:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --sub: #64748b;
  --accent: #2563eb;
  --accent-h: #1d4ed8;
  --accent-light: #eff6ff;
  --border: #e2e8f0;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.02);
  --shadow-md: 0 4px 20px rgba(0,0,0,.06);
  --shadow-lg: 0 12px 48px rgba(0,0,0,.08);
  --ease: cubic-bezier(.25,.1,.25,1);
  --nav-bg: #0f172a;
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Announcement Bar ── */
.announce-bar {
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  padding: 7px 0;
  overflow: hidden;
  white-space: nowrap;
  position: sticky;
  top: 52px;
  z-index: 99;
}
.announce-bar .track {
  display: inline-block;
  animation: marquee 30s linear infinite;
  white-space: nowrap;
}
.announce-bar .item {
  display: inline-block;
  margin-right: 80px;
  letter-spacing: .3px;
}
@keyframes marquee { 100% { transform: translateX(-50%); } }

/* ── Nav ── */
nav {
  background: #fff;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
nav .logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  letter-spacing: -.01em;
  user-select: none;
}
nav .nav-links { display:flex; gap:4px; align-items:center; }
nav .nav-links > a {
  text-decoration: none;
  color: var(--sub);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 6px;
  transition: all .2s var(--ease);
  font-weight: 500;
  letter-spacing: -.01em;
}
nav .nav-links > a:hover { color: var(--text); background: #f1f5f9; }
nav .nav-links > a.active { color: var(--accent); background: var(--accent-light); }

/* ── Avatar Trigger ── */
.avatar-trigger {
  height: 34px; border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0 14px;
  transition: all .2s var(--ease);
  background: #f1f5f9;
  border: none;
  font-size: 13px; font-weight: 600; color: var(--text);
  font-family: inherit;
  white-space: nowrap;
}
.avatar-trigger:hover { background: #e2e8f0; }
.avatar-trigger svg { width: 16px; height: 16px; display: block; }

/* ── User Dropdown ── */
nav .user-dropdown { position: relative; margin-left: 18px; }
nav .user-dropdown .menu {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: -8px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.1), 0 2px 8px rgba(0,0,0,.04);
  min-width: 170px;
  overflow: hidden;
  z-index: 150;
  padding: 6px;
}
nav .user-dropdown.open .menu { display: block; animation: menuIn .18s var(--ease); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
nav .user-dropdown .menu a, nav .user-dropdown .menu button {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  transition: background .15s var(--ease);
  font-family: inherit;
  font-weight: 500;
}
nav .user-dropdown .menu a i, nav .user-dropdown .menu button i { font-size: 17px; color: var(--sub); }
nav .user-dropdown .menu a:hover, nav .user-dropdown .menu button:hover { background: #f1f5f9; }
nav .user-dropdown .menu button.logout { color: var(--red); }
nav .user-dropdown .menu button.logout i { color: var(--red); }

/* ── Page container ── */
.page { display:none; }
.page.active { display:block; }

.page-w { max-width: 960px; margin: 0 auto; padding: 0 24px 80px; }

/* ── Cards ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 20px;
}
.card h2 { font-size: 20px; font-weight: 700; margin-bottom: 8px; letter-spacing: -.01em; }
.card .card-sub { color: var(--sub); font-size: 14px; margin-bottom: 20px; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all .2s var(--ease);
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
  letter-spacing: -.01em;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-h); transform: scale(1.02); }
.btn-outline { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn-outline:hover { background: var(--accent-light); }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 16px; }
.btn-xs { padding: 4px 10px; font-size: 11px; border-radius: 12px; }
input[type="file"] { font-size: 12px; padding: 6px 10px; border: 1.5px dashed var(--border); border-radius: 8px; background: var(--bg); cursor: pointer; transition: border-color .2s; width: 100%; box-sizing: border-box; }
input[type="file"]:hover { border-color: var(--accent); }
input[type="file"]::file-selector-button { padding: 5px 14px; border-radius: 6px; border: none; background: var(--accent); color: #fff; cursor: pointer; font-size: 12px; margin-right: 10px; transition: opacity .2s; }
input[type="file"]::file-selector-button:hover { opacity: .85; }
.daily-btn { background: transparent; color: var(--sub); border: 1px solid var(--border); cursor: pointer; transition: all .2s; }
.daily-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.daily-btn:hover:not(.active) { background: var(--bg); color: var(--text); }
.btn-success { background: var(--green); color: #fff; }
.btn-warn { background: var(--amber); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #e0352b; }
.btn-block { width:100%; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-group label { display:block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  transition: border-color .2s var(--ease), background .2s var(--ease);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--card);
}
.form-group textarea { resize: vertical; min-height: 60px; }

/* ── User Picker ── */
.user-picker {
  display: flex; align-items: center; gap: 8px;
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1.5px solid #cbd5e1; border-radius: 10px;
  font-size: 14px; background: #fff; color: #1e293b;
  box-sizing: border-box; font-family: inherit; line-height: 1.4;
}
.user-picker span { flex: 1; color: #334155; }
.user-search-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 5px 12px; border: 1px solid #cbd5e1; border-radius: 6px;
  background: #f1f5f9; color: #475569; cursor: pointer;
  font-size: 12px; font-weight: 500; font-family: inherit;
  transition: background .1s, color .1s;
  flex-shrink: 0; white-space: nowrap;
}
.user-search-btn:hover { background: #e2e8f0; color: #1e293b; }

/* ── User Dialog ── */
.user-dialog-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 999;
}
.user-dialog-box {
  background: var(--card); border-radius: 14px;
  width: 380px; max-height: 420px; display: flex; flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,.18);
  overflow: hidden;
}
.ud-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.ud-header h4 { font-size: 15px; font-weight: 700; margin: 0; }
.ud-close {
  background: none; border: none; font-size: 20px; color: var(--sub);
  cursor: pointer; padding: 0 4px; line-height: 1;
}
.ud-close:hover { color: var(--text); }
.ud-search { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.ud-search input {
  width: 100%; padding: 8px 10px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 13px; background: var(--bg); color: var(--text);
  font-family: inherit; box-sizing: border-box;
}
.ud-search input:focus { outline: none; border-color: var(--accent); }
.ud-list { flex: 1; overflow-y: auto; max-height: 280px; }
.ud-item {
  padding: 10px 18px; cursor: pointer; font-size: 13px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  transition: background .1s;
}
.ud-item:last-child { border-bottom: none; }
.ud-item:hover { background: var(--bg); }
.ud-item span { color: var(--sub); font-size: 11px; }
.ud-item.muted { color: var(--sub); cursor: default; justify-content: center; }

/* ── Badges ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-awaiting { background: #dbeafe; color: #1e40af; }
.badge-delivered { background: #d1fae5; color: #065f46; }
.badge-terminated { background: #fee2e2; color: #991b1b; }
.badge-expired { background: #f1f5f9; color: #64748b; }

/* ── Code Display ── */
.code-box {
  background: var(--accent-light);
  border: 2px dashed var(--accent);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin: 16px 0;
}
.code-box .code {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--accent);
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
}
.code-box .hint { font-size: 12px; color: var(--sub); margin-top: 6px; }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { font-weight: 600; color: var(--sub); font-size: 11px; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
tr:hover { background: #f8fafc; }
td .cell-actions { display: flex; gap: 4px; flex-wrap: wrap; }

/* ── Stats ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: center;
  transition: .15s;
  box-shadow: var(--shadow);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card .stat-num { font-size: 26px; font-weight: 800; color: var(--accent); }
.stat-card .stat-label { font-size: 12px; color: var(--sub); margin-top: 2px; }

/* ── Dashboard Layout ── */
.dash-grid   { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dash-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.dash-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

@media (max-width: 1000px) { .dash-grid-4 { grid-template-columns: 1fr 1fr; } .dash-grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 800px)  { .dash-grid, .dash-grid-3, .dash-grid-4 { grid-template-columns: 1fr; } }

/* KPI card */
.kpi-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px 18px;
  position: relative;
  overflow: hidden;
  transition: .15s;
  box-shadow: var(--shadow);
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-card .kpi-label { font-size: 11px; color: var(--sub); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; font-weight: 600; }
.kpi-card .kpi-value { font-size: 32px; font-weight: 800; color: var(--text); line-height: 1; }
.kpi-card .kpi-sub { font-size: 11px; color: var(--sub); margin-top: 4px; }
.kpi-card .kpi-accent { position: absolute; right: 14px; top: 16px; width: 48px; height: 48px; border-radius: 50%; opacity: .1; }
.kpi-card .kpi-spark { margin-top: 8px; height: 32px; }

/* Scroller for overflow */
.scroll-y { max-height: 320px; overflow-y: auto; }
.scroll-y::-webkit-scrollbar { width: 4px; }
.scroll-y::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* Ring chart legend */
.ring-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.ring-legend .rl-item { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.ring-legend .rl-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Mini bar */
.mini-bar-row { margin-bottom: 8px; }
.mini-bar-row .mb-head { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 3px; }
.mini-bar-row .mb-track { background: #f3f4f6; border-radius: 6px; height: 6px; overflow: hidden; }
.mini-bar-row .mb-fill { height: 100%; border-radius: 6px; transition: width .5s ease; }

/* Text truncation */
.text-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; display: block; }

/* Ring hover */
.ring-seg { stroke-width: 12; transition: stroke-width 0.2s, opacity 0.2s; cursor: pointer; }
.ring-seg:hover { stroke-width: 17; opacity: 0.8; }

/* ── Toast ── */
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(29,29,31,.92); color: #fff;
  padding: 10px 24px; border-radius: 20px;
  font-size: 13px; font-weight: 500;
  z-index: 999;
  animation: toastIn .25s var(--ease);
  pointer-events: none;
}
@keyframes toastIn { from { opacity:0; transform:translateX(-50%) translateY(-6px); } }

/* ── Modal ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.3); z-index: 200;
  align-items: center; justify-content: center;
  }
.modal-overlay.show { display: flex; }
.modal {
  background: var(--card);
  border-radius: 20px;
  padding: 32px;
  max-width: 480px;
  width: 92%;
  box-shadow: 0 20px 60px rgba(0,0,0,.12);
  max-height: 85vh;
  overflow-y: auto;
  animation: modalIn .25s var(--ease);
  position: relative;
}
@keyframes modalIn { from { opacity:0; transform:scale(.96) translateY(8px); } }
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; letter-spacing: -.01em; }
.modal-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  font-size: 22px;
  color: #94a3b8;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  line-height: 1;
  padding: 0;
}
.modal-close:hover {
  background: #f1f5f9;
  color: #475569;
}

/* ── Login ── */
.login-overlay {
  position: fixed; inset: 0;
  background: #f5f5f7;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
}
.login-card {
  background: var(--card);
  border-radius: 20px;
  padding: 44px 36px;
  width: 380px;
  max-width: 92%;
  box-shadow: 0 8px 40px rgba(0,0,0,.06), 0 2px 10px rgba(0,0,0,.03);
  border: 1px solid rgba(0,0,0,.06);
  text-align: center;
}
.login-card h2 { font-size: 24px; font-weight: 800; margin-bottom: 6px; letter-spacing: -.02em; }
.login-card .login-sub { color: var(--sub); font-size: 14px; margin-bottom: 28px; }
.login-card input {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 12px;
  text-align: left;
  background: var(--bg);
  font-family: inherit;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.login-card input:focus { outline: none; border-color: var(--accent); background: var(--card); }
.login-card .login-hint { font-size: 12px; color: var(--sub); margin-top: 16px; line-height: 1.6; }

/* ═══════════════════════════════════════════
   Cosmic Hero — 首页全屏粒子 · 蓝白色系
   ═══════════════════════════════════════════ */
.cosmic-hero {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background: #050b1f;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cosmic-hero canvas {
  position: absolute;
  inset: 0;
  display: block;
}
.cosmic-overlay {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
  pointer-events: none;
}
.cosmic-overlay > * { pointer-events: auto; }

.cosmic-badge {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  padding: 5px 18px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.08em; margin-bottom: 32px;
}

.cosmic-title {
  font-size: clamp(40px, 7vw, 68px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: #fff;
  margin: 0 auto 20px;
  max-width: 800px;
  background: linear-gradient(180deg, #ffffff 0%, #93c5fd 50%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 20px rgba(59,130,246,0.25));
}

.cosmic-sub {
  font-size: clamp(18px, 2.5vw, 24px);
  color: rgba(255,255,255,0.65);
  margin: 0 0 12px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.cosmic-tagline {
  font-size: 15px;
  color: rgba(255,255,255,0.35);
  margin: 0 0 48px;
  letter-spacing: 0.04em;
}

.cosmic-cta {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 44px; border-radius: 32px; border: none;
  cursor: pointer; font-size: 16px; font-weight: 600;
  font-family: inherit; letter-spacing: 0.02em; color: #fff;
  background: #2563eb;
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.cosmic-cta:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(37,99,235,0.35);
}
.cosmic-cta:active { transform: scale(0.97); }

.cosmic-arrow {
  display: inline-flex;
  transition: transform 0.3s ease;
}
.cosmic-cta:hover .cosmic-arrow { transform: translateX(4px); }

/* ═══════════════════════════════════════════
   Products Page — 纯白背景 · 精致卡片
   ═══════════════════════════════════════════ */
#page-products.active {
  background: #ffffff;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════
   Featured Product Card — 主打产品
   ═══════════════════════════════════════════ */
.featured-card {
  background: #fff;
  border: 2px solid #2563eb;
  border-radius: 20px;
  margin-bottom: 40px;
  padding: 48px 48px 40px;
  position: relative;
  transition: all .3s var(--ease);
  box-shadow: 0 4px 24px rgba(37,99,235,.1);
}
.featured-card:hover {
  box-shadow: 0 12px 48px rgba(37,99,235,.18);
  transform: translateY(-2px);
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 20px;
  border-radius: 16px;
  letter-spacing: .03em;
  margin-bottom: 28px;
}
.featured-badge i { font-size: 15px; }

.featured-name {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -.025em;
  color: #0f172a;
  line-height: 1.25;
  margin-bottom: 28px;
  max-width: 640px;
}

.featured-highlights {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 36px;
}
.fh-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  color: #334155;
  font-weight: 500;
  line-height: 1.6;
}
.fh-item i {
  color: #2563eb;
  font-size: 17px;
  flex-shrink: 0;
  margin-top: 1px;
}

.featured-bottom {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  border-top: 1px solid #f1f5f9;
  padding-top: 28px;
}

.featured-price {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.featured-price .fp-original {
  font-size: 20px;
  color: #94a3b8;
  text-decoration: line-through;
  font-weight: 500;
}
.featured-price .fp-promo {
  font-size: 40px;
  font-weight: 900;
  color: #ef4444;
  letter-spacing: -.03em;
  line-height: 1;
}

.featured-cta {
  padding: 16px 40px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  border-radius: 32px !important;
  margin-left: auto;
}
.featured-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37,99,235,.35);
}

.fp-urgency {
  font-size: 12px;
  color: #f59e0b;
  font-weight: 600;
  margin-left: 12px;
}

/* ── Category Tabs ── */
.cat-tabs {
  display: flex; gap: 10px; margin-bottom: 32px; flex-wrap: wrap;
  justify-content: center;
}
.cat-tab {
  padding: 10px 22px; border-radius: 24px;
  border: 1.5px solid #e2e8f0; background: #fff;
  cursor: pointer; font-size: 13px; font-weight: 600;
  transition: all .2s var(--ease); display: flex; align-items: center; gap: 6px;
  font-family: inherit; color: #64748b;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.cat-tab:hover { border-color: #2563eb; color: #2563eb; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,99,235,.08); }
.cat-tab.active { background: #2563eb; color: #fff; border-color: #2563eb; box-shadow: 0 4px 16px rgba(37,99,235,.2); }
.cat-tab .cat-icon { font-size: 15px; }

.cat-tab .cat-count {
  background: rgba(0,0,0,.06); border-radius: 10px;
  padding: 0 7px; font-size: 11px; line-height: 20px;
  margin-left: 2px;
}
.cat-tab.active .cat-count { background: rgba(255,255,255,.2); }

/* ── Category Section ── */
.cat-section { display: none; }
.cat-section.active { display: block; }

/* ═══════════════════════════════════════════
   Product Card — 精致白色卡片设计
   ═══════════════════════════════════════════ */
.product-card-new {
  background: #fff;
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  transition: all .25s var(--ease);
  border: 1px solid #e8ecf1;
  position: relative;
  overflow: hidden;
}
/* 左侧分类色条 */
.product-card-new::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: #e2e8f0;
  transition: all .25s var(--ease);
}
.product-card-new:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,.08);
  transform: translateY(-2px);
  border-color: #cbd5e1;
}
.product-card-new:hover::before {
  top: 8px;
  bottom: 8px;
}

/* 不同分类的色条颜色 */
.product-card-new.cat-pre::before  { background: #2563eb; }
.product-card-new.cat-mid::before  { background: #f59e0b; }
.product-card-new.cat-tutorial::before { background: #10b981; }
.product-card-new.cat-custom::before { background: #ec4899; }

.product-card-new .pcn-info { flex: 1; min-width: 0; padding-left: 8px; }
.product-card-new .pcn-name {
  font-size: 16px; font-weight: 700; margin-bottom: 4px;
  letter-spacing: -.01em; color: #0f172a;
}
.product-card-new .pcn-desc {
  font-size: 13px; color: #64748b; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.product-card-new .pcn-right { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.product-card-new .pcn-price {
  font-size: 18px; font-weight: 800; white-space: nowrap;
  color: #0f172a;
}
.product-card-new .pcn-price .price-original {
  text-decoration: line-through;
  color: #94a3b8;
  font-size: 12px;
  font-weight: 500;
  margin-right: 6px;
}
.product-card-new .pcn-price .price-promo {
  color: #ef4444;
  font-weight: 700;
}

/* ── Empty State ── */
.products-empty {
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}
.products-empty .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}
.products-empty p {
  font-size: 14px;
}

/* ── Products Page Wrapper ── */
.products-body {
  background: #ffffff;
  padding-bottom: 60px;
}

/* ── Admin Layout ── */
.admin-layout { display: flex; height: calc(100vh - 52px); overflow: hidden; }
.admin-sidebar {
  width: 200px;
  background: rgba(255,255,255,.6);
  border-right: 1px solid rgba(0,0,0,.06);
  padding: 16px 0;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.admin-sidebar .as-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 20px;
  font-size: 13px;
  color: var(--sub);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  transition: all .15s var(--ease);
  font-family: inherit;
  border-left: 3px solid transparent;
  font-weight: 500;
  margin: 0 8px;
  border-radius: 0 8px 8px 0;
  width: calc(100% - 8px);
}
.admin-sidebar .as-item:hover { background: rgba(0,0,0,.03); color: var(--text); }
.admin-sidebar .as-item.active {
  background: rgba(37,99,235,.08);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}
.admin-sidebar .as-label {
  font-size: 11px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 16px 20px 6px;
  font-weight: 600;
}
/* 管理员账户信息 — 侧边栏底部 */
.admin-user-info {
  margin-top: auto;
  padding: 16px 14px 8px;
  border-top: 1px solid var(--border);
}
.admin-user-info .aui-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #2563eb; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.admin-main { flex: 1; padding: 24px; overflow-y: auto; overflow-x: auto; }
.admin-section { display: none; }
.admin-section.active { display: block; }

/* ── Popup ── */
.popup-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.3); z-index: 250;
  align-items: center; justify-content: center;
  }
.popup-overlay.show { display: flex; }
.popup-box {
  background: var(--card);
  border-radius: 20px;
  padding: 40px 36px;
  max-width: 50vw;
  width: 50vw;
  min-width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,.12);
  position: relative;
  animation: modalIn .25s var(--ease);
  max-height: 70vh;
  overflow-y: auto;
}
.popup-box .popup-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--sub);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .15s var(--ease);
}
.popup-box .popup-close:hover { background: rgba(0,0,0,.04); }

/* ── Confirm Prompt ── */
.confirm-prompt {
  background: #fffbeb;
  border: 1.5px solid #fcd34d;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  margin-top: 16px;
}
.confirm-prompt .cp-title { font-weight: 700; font-size: 15px; color: #92400e; margin-bottom: 8px; }
.confirm-prompt .cp-text { font-size: 13px; color: #a16207; line-height: 1.6; }

/* ── Product Detail Popup ── */
.product-detail-popup { text-align: left; }
.product-detail-popup .pdp-cat {
  display: inline-block;
  background: var(--accent-light); color: var(--accent);
  padding: 3px 12px; border-radius: 12px;
  font-size: 12px; font-weight: 600; margin-bottom: 12px;
}
.product-detail-popup h3 { font-size: 20px; font-weight: 700; margin-bottom: 16px; letter-spacing: -.01em; }
.product-detail-popup .pdp-desc {
  font-size: 14px; color: var(--sub); line-height: 1.9;
  max-height: 50vh; overflow-y: auto;
}
.product-detail-popup .pdp-desc::-webkit-scrollbar { width: 4px; }
.product-detail-popup .pdp-desc::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

/* ── Section Title ── */
.section-title { text-align: center; margin-bottom: 40px; }
.section-title h2 { font-size: 32px; font-weight: 800; margin-bottom: 10px; letter-spacing: -.02em; }
.section-title p { color: var(--sub); font-size: 15px; max-width: 480px; margin: 0 auto; line-height: 1.6; }

/* ── Order Dropdown Menu ── */
.order-drop-menu.show { display: block !important; }
.dd-item {
  display: block; width: 100%; text-align: left;
  padding: 7px 12px; font-size: 12px; color: var(--text);
  background: none; border: none; cursor: pointer;
  border-radius: 6px; font-family: inherit; font-weight: 500;
  transition: background .15s;
}
.dd-item:hover { background: #f1f5f9; }

/* ── Admin Category Sidebar ── */
.admin-cat-item:hover { background: #f1f5f9; }
.admin-cat-item.active { background: var(--accent-light); color: var(--accent); }

/* ── Product Drag & Drop ── */
.product-drag-card { transition: all .15s; }
.product-drag-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.product-drag-card:active { cursor: grabbing !important; }
.drag-handle:hover { color: var(--accent) !important; }

/* ── Avatar Profile ── */
.avatar-preview {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--sub);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-preview svg { width: 48px; height: 48px; }
.avatar-option {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s var(--ease);
  background: var(--bg);
  color: var(--sub);
}
.avatar-option:hover { transform: scale(1.08); }
.avatar-option.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.2); }
.avatar-upload-btn {
  border: 2px dashed #cbd5e1 !important;
  color: #94a3b8;
}
.avatar-upload-btn:hover { border-color: var(--accent) !important; color: var(--accent); }

/* ═══════════════════════════════════════════
   Footer — 深蓝 · 白色文字
   ═══════════════════════════════════════════ */
:root {
  --footer-bg: #0c1929;
  --footer-text: rgba(255,255,255,0.75);
  --footer-text-hover: #fff;
  --footer-heading: #fff;
  --footer-divider: rgba(255,255,255,0.2);
  --footer-qr-bg: rgba(255,255,255,0.15);
  --footer-bottom-text: rgba(255,255,255,0.65);
}

.site-footer {
  background: var(--footer-bg);
  margin-top: auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  position: relative;
}

.footer-main {
  max-width: 1200px; margin: 0 auto; padding: 56px 24px 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

.footer-col-title {
  font-size: 14px; font-weight: 700;
  color: var(--footer-heading);
  letter-spacing: .2px;
  margin: 0 0 20px;
  position: relative;
  padding-bottom: 10px;
}
.footer-col-title::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0;
  width: 24px; height: 2px;
  background: rgba(255,255,255,0.4);
  border-radius: 1px;
}

.footer-links {
  list-style: none; padding: 0; margin: 0;
}
.footer-links li {
  margin-bottom: 10px;
  font-size: 13px; color: var(--footer-text);
  line-height: 1.5;
}
.footer-links a {
  font-size: 13px; color: var(--footer-text); text-decoration: none;
  transition: color .2s;
  display: inline-block;
}
.footer-links a:hover { color: var(--footer-text-hover); }

.footer-col-qr {
  grid-column: span 2;
}
.qr-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.qr-cell {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.qr-cell span {
  font-size: 11px; color: var(--footer-text); white-space: nowrap;
}
.qr-img {
  width: 80px; height: 80px;
  object-fit: contain;
  border-radius: 10px;
  transition: transform .25s, box-shadow .25s;
}
.qr-img:hover { transform: scale(1.05); box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.qr-placeholder {
  width: 80px; height: 80px;
  background: var(--footer-qr-bg);
  border-radius: 10px;
  transition: transform .25s, box-shadow .25s;
}
.qr-placeholder:hover { transform: scale(1.05); box-shadow: 0 4px 16px rgba(0,0,0,.3); }

.footer-bottom {
  border-top: 1px solid var(--footer-divider);
  padding: 18px 20px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  flex-wrap: wrap;
  max-width: 1200px; margin: 0 auto;
  font-size: 12px; color: var(--footer-bottom-text);
}
.fb-sep { color: var(--footer-divider); }
.fb-icp { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }

/* ── Back to Top Button ── */
.back-top-btn {
  position: fixed; bottom: 28px; right: 28px;
  width: 50px; height: 50px; border-radius: 50%;
  background: #1e3a5f; border: none;
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
  transition: all .25s;
  z-index: 200;
  opacity: 0; visibility: hidden;
  transform: translateY(8px);
}
.back-top-btn.visible {
  opacity: 1; visibility: visible;
  transform: translateY(0);
}
.back-top-btn:hover {
  background: #264b77;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; }
  .footer-col-qr { grid-column: span 2; }
  .qr-row { grid-template-columns: repeat(4, 1fr); gap: 12px; }
}
@media (max-width: 700px) {
  nav { padding: 0 12px; }
  nav .logo { font-size: 15px; }
  .hero { padding: 36px 16px 28px; }
  .hero h1 { font-size: 24px; }
  .product-row { flex-direction: column; text-align: center; }
  .product-row .pr-price { font-size: 20px; }
  .admin-layout { flex-direction: column; height: auto; overflow: visible; }
  .admin-sidebar { width: 100%; flex-direction: row; overflow-x: auto; padding: 8px; gap: 4px; border-right: none; border-bottom: 1px solid var(--border); flex-shrink: 0; }
  .admin-sidebar .as-item { border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; padding: 8px 14px; font-size: 12px; width: auto; margin: 0; border-radius: 6px; }
  .admin-sidebar .as-item.active { border-left: none; border-bottom-color: var(--accent); }
  .admin-sidebar .as-label { display: none; }
  .admin-user-info { display: none; }
  .admin-main { padding: 16px; overflow-y: visible; }
  .login-card { padding: 28px 20px; }
  .cosmic-title { font-size: 32px; }
  .cosmic-sub { font-size: 16px; }
  .cosmic-tagline { font-size: 13px; }
  .cosmic-cta { padding: 14px 32px; font-size: 14px; }
  .product-card-new { flex-direction: column; align-items: flex-start; }
  .product-card-new .pcn-right { width: 100%; justify-content: space-between; }
  .featured-card { padding: 28px 24px 24px; }
  .featured-name { font-size: 22px; }
  .featured-bottom { flex-direction: column; align-items: flex-start; gap: 16px; }
  .featured-cta { margin-left: 0; width: 100%; justify-content: center; }
  .featured-price .fp-promo { font-size: 32px; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-col-qr { grid-column: span 1; }
  .footer-main { padding: 36px 20px 28px; }
  .footer-bottom { flex-direction: column; gap: 8px; }
  .footer-links li { white-space: normal; }
  .qr-row { grid-template-columns: repeat(2, 1fr); gap: 14px; justify-items: center; }
  .qr-placeholder, .qr-img { width: 72px; height: 72px; }
  .back-top-btn { width: 42px; height: 42px; bottom: 20px; right: 16px; font-size: 18px; }
}

/* 三端切换按钮 */
.switch-bar{margin-top:20px;padding-top:18px;border-top:1px solid #e2e8f0}
.switch-bar .switch-label{font-size:11px;color:#94a3b8;margin-bottom:10px}
.switch-btns{display:flex;gap:8px;justify-content:center}
.switch-btn{flex:1;padding:8px 0;border-radius:10px;font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;transition:all .2s}
.switch-btn.active{background:#2563eb;color:#fff;border:1.5px solid #2563eb}
.switch-btn:not(.active){background:#fff;color:#64748b;border:1.5px solid #e2e8f0}
.switch-btn:not(.active):hover{background:#f1f5f9}
