
:root {
  color-scheme: light;
  --bg: #f8fafc;
  --panel: #ffffff;
  --panel-hover: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --line: rgba(0, 0, 0, 0.08);
  --brand: #ff2a2a;
  --brand-light: rgba(255, 42, 42, 0.08);
  --brand-hover: #dc2626;
  --accent: #10b981;
  --accent-light: rgba(16, 185, 129, 0.08);
  --danger: #ef4444;
  --danger-light: rgba(239, 68, 68, 0.08);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.08);
  --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.06);
  --font: 'Roboto', 'Segoe UI', Arial, ui-sans-serif, system-ui, sans-serif;
  --borderline: rgba(0, 0, 0, 0.06);
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -2;
  opacity: 0.12;
  pointer-events: none;
}
.glow-1 {
  top: -10%;
  right: -5%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(255, 42, 42, 0.3) 0%, rgba(0, 0, 0, 0) 70%);
}
.glow-2 {
  bottom: -20%;
  left: -10%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, rgba(0, 0, 0, 0) 70%);
}

.app {
  width: min(1360px, calc(100% - 24px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

/* Header Topbar chinh tren cung */
.topbar {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: var(--shadow-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}
.logo-area h1 a {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--brand);
  text-decoration: none;
}
.logo-area p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Sidebar ben trai rong 280px */
.glass-sidebar {
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  border-radius: 16px;
  padding: 16px;
}
.main-layout {
  display: block;
  width: 100%;
}
.content-shell {
  width: 100%;
  max-width: 1180px;
  margin-left: 0;
  margin-right: auto;
}
.sidebar-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 900;
  margin-bottom: 12px;
  padding-left: 6px;
}
.categories-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cat {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 650;
  font-size: 14px;
  text-align: left;
}
.cat:hover {
  background: var(--panel-hover);
}
.cat.active {
  background: var(--brand-light);
  color: var(--brand);
  border-color: #fca5a5;
}
.cat .count {
  font-size: 11.5px;
  font-weight: 800;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--text-muted);
}
.cat.active .count {
  background: #fca5a5;
  color: var(--brand);
}

/* Category header giong bm999 / taikhoanxin */
.category-group {
  margin-bottom: 32px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  border: 1px solid var(--line);
}
.category-header {
  display: flex;
  align-items: center;
  padding: 0;
  background: linear-gradient(90deg, #1e293b 0%, #3b82f6 100%);
  border-bottom: 1px solid var(--line);
}
.category-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 22px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.category-header-title {
  padding: 0 18px;
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 20px;
  padding: 20px;
  background: #ffffff;
}
@media (min-width: 640px) {
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1280px) {
  .cards-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Product Card Design */
.product-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 172px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.product-card:hover {
  transform: translateY(-2px);
  border-color: #3b82f6;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.05);
}
.card-top {
  margin-bottom: 12px;
}
.card-title {
  font-size: 14.5px;
  font-weight: 800;
  line-height: 1.4;
  color: #1e293b;
  margin-bottom: 10px;
  height: 44px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.card-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.badge-stock {
  font-size: 10.5px;
  font-weight: 800;
  padding: 4px 8px;
  background: #e0f2fe; /* soft blue */
  color: #0369a1;
  border-radius: 6px;
}
.badge-sold {
  font-size: 10.5px;
  font-weight: 800;
  padding: 4px 8px;
  background: #ecfdf5; /* soft teal */
  color: #0d9668;
  border-radius: 6px;
}
.card-price {
  font-size: 17px;
  font-weight: 900;
  color: #ff2a2a;
  margin-bottom: 4px;
}
.card-excerpt {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* Card actions */
.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.btn-detail {
  width: 100%;
  padding: 8px;
  background: #e2e8f0;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
}
.btn-detail:hover {
  background: #cbd5e1;
  color: #0f172a;
}
.btn-buy-now {
  width: 100%;
  padding: 8px;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #fff;
  border-radius: 8px;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.2);
}
.btn-buy-now:hover {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

/* Dialog Inputs & Labels */
.dialog label {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 6px;
}
.dialog input[type="text"],
.dialog input[type="password"],
.dialog input[type="email"],
.dialog input[type="number"],
.dialog select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: #ffffff;
  color: #0f172a;
  transition: all 0.2s;
}
.dialog input:focus, .dialog select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Purchase details popup 2 columns (bm999) */
.purchase-dialog {
  width: min(780px, calc(100% - 24px)) !important;
}
.purchase-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
}
.purchase-desc-col {
  border-right: 1px solid var(--line);
  padding-right: 20px;
}
.purchase-desc-col h3 {
  font-size: 13.5px;
  margin-bottom: 8px;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.product-desc-content {
  font-size: 13px;
  color: #334155;
  line-height: 1.6;
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
  background: #f8fafc;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
}
.pricing-summary {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 13.5px;
}
.summary-row:last-child {
  margin-bottom: 0;
}
.user-balance-val {
  font-weight: 850;
  color: var(--warning);
}
.product-price-val {
  font-weight: 850;
  color: var(--accent);
}
.form-label {
  font-size: 13.5px;
  font-weight: 700;
  display: block;
  margin-bottom: 10px;
  color: #374151;
}
.form-label input, .form-label select {
  margin-top: 6px;
}
.total-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14.5px;
  font-weight: 800;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}
.total-price-val {
  color: var(--brand);
  font-size: 19px;
  font-weight: 900;
}
.warning-box {
  background: var(--warning-light);
  border: 1px solid #fde68a;
  color: #92400e;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  margin-top: 14px;
  line-height: 1.45;
}
.purchase-result-box {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  font-size: 12.5px;
  margin-top: 12px;
  white-space: pre-wrap;
  max-height: 180px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
}
.purchase-result-box.success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
.purchase-result-box.error {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

/* Filters & Search */
.filters-container {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  border-radius: 16px;
  margin-bottom: 18px;
}

/* Topbar Header chinh */
.glass-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--borderline);
}

/* Buttons */
button {
  font-family: var(--font);
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-hover) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 42, 42, 0.2);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 42, 42, 0.3);
}
.btn-secondary {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
}
.btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #cbd5e1;
}
.btn-topup {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25) !important;
  border: 0 !important;
}
.btn-topup:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(5, 150, 105, 0.35) !important;
}
.btn-admin {
  background: var(--warning);
  color: #fff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}
.btn-admin:hover {
  background: #d97706;
}
.btn-logout {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 18px;
  border: 1px solid #fca5a5;
}
.btn-logout:hover {
  background: #fca5a5;
}

.username-display {
  font-weight: 700;
  font-size: 13.5px;
  padding: 8px 14px;
  background: #f1f5f9;
  color: #334155;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}
.balance-display {
  font-weight: 950;
  font-size: 14.5px;
  color: #0d9668;
  padding: 8px 14px;
  background: var(--accent-light);
  border-radius: 12px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  font-size: 13.5px;
  font-weight: 750;
  color: #475569;
  background: #f8fafc;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
}
.checkbox-label input {
  width: auto;
  margin-right: 6px;
  cursor: pointer;
}
.status-badge {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-muted);
}

/* Recent lists */
.recent-transactions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}
.recent-box {
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
}
.recent-title {
  padding: 12px 16px;
  font-weight: 800;
  font-size: 13.5px;
  color: #fff;
}
.title-orders {
  background: var(--brand);
}
.title-topups {
  background: var(--accent);
}
.recent-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  background: #ffffff;
}
.loading-recent {
  color: var(--text-muted);
  text-align: center;
  font-size: 13px;
  padding: 10px 0;
}

.recent-item {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 8px 20px rgba(15,23,42,.04);
}
.recent-item-main { min-width: 0; color: #475569; font-size: 13px; line-height: 1.5; }
.recent-user { color: #16a34a; font-weight: 900; }
.recent-qty { color: #ef4444; font-weight: 900; }
.recent-money { color: #1d4ed8; font-weight: 950; white-space: nowrap; }
.recent-product { color: #334155; font-weight: 800; }
.recent-bank { color: #ef4444; font-weight: 900; }
.recent-time { flex: 0 0 auto; background: #2563eb; color: #fff; border-radius: 7px; padding: 4px 7px; font-size: 10.5px; font-weight: 900; white-space: nowrap; }
@media (max-width: 768px) { .recent-transactions { grid-template-columns: 1fr; } .recent-item { align-items: flex-start; } .recent-time { margin-top: 2px; } }
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 960px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
}
@media (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .top-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .filters-container {
    grid-template-columns: 1fr;
  }
  .filter-actions {
    justify-content: space-between;
  }
  .purchase-grid, .topup-grid, .recent-transactions, .settings-form, .form-row {
    grid-template-columns: 1fr !important;
  }
  .purchase-desc-col {
    border-right: 0;
    padding-right: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 16px;
    margin-bottom: 10px;
  }
}

/* Compact catalog toolbar */
.catalog-toolbar {
  grid-template-columns: minmax(220px, 1fr) minmax(360px, 1.8fr) auto;
  gap: 18px;
  margin-bottom: 18px;
}
.catalog-heading {
  min-width: 0;
}
.catalog-heading h2 {
  color: #1e293b;
  font-size: clamp(20px, 2.1vw, 30px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
  white-space: nowrap;
}
.catalog-heading p {
  color: #64748b;
  font-size: 13px;
  line-height: 1.3;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.catalog-toolbar .filter-actions {
  justify-content: flex-end;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .catalog-toolbar {
    grid-template-columns: 1fr;
  }
  .catalog-heading h2,
  .catalog-heading p {
    white-space: normal;
  }
}

/* Center and polish dialogs */
dialog.dialog {
  position: fixed;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(520px, calc(100vw - 32px));
  max-height: min(88vh, 760px);
  overflow: auto;
  border: 1px solid #dbe3ef;
  border-radius: 18px;
  padding: 0;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.26);
}
dialog.dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
}
dialog.dialog form,
dialog.dialog > div {
  padding: 18px;
}
.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.dialog-head h2 {
  font-size: 20px;
  font-weight: 900;
  color: #111827;
  line-height: 1.2;
}
.dialog-head p {
  color: #64748b;
  font-size: 13px;
  margin-top: 4px;
}
.close-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  background: #f1f5f9;
  color: #334155;
  font-size: 22px;
  line-height: 1;
  flex: 0 0 auto;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}
.purchase-dialog {
  width: min(820px, calc(100vw - 32px)) !important;
}
.purchase-dialog form {
  padding: 18px !important;
}
@media (max-width: 768px) {
  dialog.dialog {
    width: min(96vw, 520px);
    max-height: 90vh;
  }
  .purchase-dialog {
    width: min(96vw, 820px) !important;
  }
}

/* Sidebar polish and clearer actions */
.glass-sidebar {
  border-radius: 0 18px 18px 0;
  padding: 18px 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}
.sidebar-brand {
  padding: 18px 18px 14px;
  margin-bottom: 8px;
}
.sidebar-brand h1 {
  font-size: 20px;
  font-weight: 950;
  color: #1e293b;
  letter-spacing: -0.03em;
}
.brand-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #ff2a2a;
  box-shadow: 0 0 18px rgba(255, 42, 42, 0.75);
}
.sidebar-account-top {
  margin: 0 10px 18px;
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}
.sidebar-account-top .btn-primary,
.sidebar-account-top .btn-secondary,
.sidebar-account-top .btn-topup,
.sidebar-account-top .btn-admin {
  min-height: 42px;
  border-radius: 12px;
}
.sidebar-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.sidebar-user-name {
  font-size: 13px;
  font-weight: 850;
  color: #334155;
}
.sidebar-logout {
  padding: 6px 9px;
  border-radius: 9px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 12px;
}
.balance-display-box {
  padding: 10px 12px;
  border-radius: 12px;
  background: #ecfdf5;
  color: #047857;
  font-weight: 900;
  text-align: center;
  border: 1px solid #bbf7d0;
}
.glass-sidebar nav {
  padding: 0 10px 24px !important;
}
.glass-sidebar nav > div {
  margin-bottom: 18px;
}
.nav-group-title {
  padding: 0 12px;
  margin: 0 0 8px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  padding: 9px 12px !important;
  border-radius: 12px;
  color: #1e293b;
  font-weight: 750;
  text-decoration: none;
  transition: all .18s ease;
}
.nav-link:hover,
.nav-link.active {
  background: #eff6ff;
  color: #0f172a;
  box-shadow: inset 0 0 0 1px #bfdbfe;
}
.nav-num {
  min-width: 28px;
  color: #475569;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}
.card-actions {
  grid-template-columns: 1fr;
}
.btn-buy-now {
  min-height: 42px;
  border-radius: 10px;
  font-size: 13.5px;
  letter-spacing: .01em;
}
.dialog-actions .btn-primary,
.dialog-actions .btn-secondary {
  min-width: 132px;
  min-height: 42px;
  border-radius: 12px;
  font-size: 14px;
}
.dialog-actions .btn-primary {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(2, 132, 199, 0.28);
}
.dialog-actions .btn-secondary {
  background: #e2e8f0;
  color: #1e293b;
  border: 1px solid #cbd5e1;
}
.dialog-actions .btn-primary:hover,
.dialog-actions .btn-secondary:hover {
  transform: translateY(-1px);
}
@media (max-width: 1023px) {
  .sidebar-brand {
    display: none !important;
  }
  .sidebar-account-top {
    margin-top: 12px;
  }
}

/* Restore readable category title bar */
.category-header {
  min-height: 28px;
  padding: 5px 12px !important;
  color: #ffffff !important;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.2;
  gap: 8px;
}
.category-header * {
  color: inherit !important;
}

/* Purchase popup auth/action buttons */
.purchase-actions {
  flex-wrap: wrap;
  align-items: center;
}
.purchase-actions button {
  opacity: 1 !important;
  visibility: visible !important;
  font-weight: 900;
}
.purchase-actions button[hidden] {
  display: none !important;
}
.purchase-actions .btn-secondary {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border: 1px solid #94a3b8 !important;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.10);
}
.btn-confirm-purchase,
.btn-login-purchase,
.btn-register-popup {
  color: #ffffff !important;
  border: 0 !important;
  text-shadow: 0 1px 0 rgba(0,0,0,.12);
}
.btn-confirm-purchase {
  background: linear-gradient(135deg, #0ea5e9 0%, #0369a1 100%) !important;
  box-shadow: 0 10px 22px rgba(3, 105, 161, 0.30) !important;
}
.btn-login-purchase {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
  box-shadow: 0 10px 22px rgba(220, 38, 38, 0.30) !important;
}
.btn-register-popup {
  min-width: 118px;
  min-height: 42px;
  border-radius: 12px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  box-shadow: 0 10px 22px rgba(5, 150, 105, 0.28) !important;
}
@media (max-width: 520px) {
  .purchase-actions button {
    width: 100%;
  }
}

/* My orders table style */
.my-orders-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.my-orders-table th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 800;
  padding: 14px 16px;
  font-size: 13.5px;
  border-bottom: 2px solid #e2e8f0;
}
.my-orders-table td {
  padding: 14px 16px;
  font-size: 13.5px;
  vertical-align: middle;
}
#my-orders-portal .table-responsive {
  width: 100%;
  overflow-x: auto;
  position: relative;
  scrollbar-gutter: stable;
}
.my-orders-table th:last-child,
.my-orders-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: #f8fafc;
  box-shadow: -12px 0 20px rgba(15, 23, 42, .12);
}
.my-orders-table th:last-child {
  z-index: 3;
  background: #f1f5f9;
}

/* Topup QR center styling */
.topup-grid {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  gap: 20px;
  width: 100%;
}
.topup-grid .qr-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.topup-grid .qr-col img {
  max-width: 260px;
  width: 100%;
  margin: 0 auto;
  display: block;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  padding: 8px;
  background: #ffffff;
}
.topup-grid .qr-sub {
  font-size: 10.5px;
  color: #64748b;
  margin-top: 6px;
  display: block;
}
.topup-grid .info-col {
  width: 100%;
  max-width: 420px;
  text-align: left;
  background: #f8fafc;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
}
.topup-grid .info-row {
  margin-bottom: 8px;
  font-size: 13.5px;
}
.topup-grid .memo-box {
  margin-top: 14px;
  background: #fef2f2;
  border: 1px solid #fee2e2;
}
.topup-grid .memo-code {
  display: block;
  text-align: center;
  font-size: 18px;
  font-weight: 900;
  padding: 8px;
  border-radius: 8px;
  background: #1e293b;
  color: #10b981;
  letter-spacing: 0.05em;
  margin-top: 6px;
}

/* My topups table style */
.my-topups-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.my-topups-table th {
  background: #f1f5f9;
  color: #475569;
  font-weight: 800;
  padding: 14px 16px;
  font-size: 13.5px;
  border-bottom: 2px solid #e2e8f0;
}
.my-topups-table td {
  padding: 14px 16px;
  font-size: 13.5px;
  vertical-align: middle;
}

/* Sale tag and old price style */
.badge-sale-label {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  padding: 4px 8px;
  border-radius: 6px;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.25);
  z-index: 10;
}
.price-old {
  text-decoration: line-through;
  color: #94a3b8;
  font-size: 13px;
  margin-left: 8px;
  font-weight: normal;
}
.price-current {
  color: #ff2a2a;
  font-weight: 900;
}

/* Rounded borders for sidebar menu items */
.glass-sidebar .nav-link {
  border: 1px solid #e2e8f0 !important;
  background: #ffffff !important;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.03);
  margin-bottom: 8px;
  border-radius: 12px !important;
  font-weight: 800 !important;
  color: #334155 !important;
}
.glass-sidebar .nav-link:hover,
.glass-sidebar .nav-link.active {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border-color: #bfdbfe !important;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.08) !important;
}

/* Custom Admin Style updates */
.admin-tab {
  border-bottom: 3px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #64748b !important;
  padding: 10px 16px !important;
  font-weight: 700 !important;
}
.admin-tab:hover {
  color: #1e293b !important;
}
.admin-tab.active {
  color: var(--brand) !important;
  border-color: var(--brand) !important;
}


/* Mobile Menu Toggle & Sidebar Slide Effect */
#mobile-overlay {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
body.menu-open #mobile-overlay {
  display: block;
  opacity: 1;
}

@media (max-width: 1023px) {
  .glass-sidebar {
    position: fixed !important;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(15, 23, 42, 0.15) !important;
    border-radius: 18px 0 0 18px !important;
  }
  
  body.menu-open {
    overflow: hidden;
  }
  
  body.menu-open .glass-sidebar {
    transform: translateX(0);
  }
}


/* Blog Post Horizontal List Item Style (Wordpress-like) */
.blog-post-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid #f1f5f9;
  transition: all 0.2s ease;
}
.blog-post-item:hover {
  background: rgba(15, 23, 42, 0.01);
}
.blog-post-item:last-child {
  border-bottom: 0;
}
.blog-post-thumb-wrapper {
  width: 130px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
}
.blog-post-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.blog-post-info-col {
  flex: 1;
  min-width: 0;
}
.blog-post-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 10.5px;
  color: #64748b;
  margin-bottom: 6px;
  font-weight: 700;
}
.blog-post-meta-row .featured-badge {
  background: #fef2f2;
  color: #ef4444;
  padding: 1px 6px;
  border-radius: 4px;
}
.blog-post-item-title {
  font-size: 16px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.35;
  margin-bottom: 6px;
  display: block;
  text-decoration: none;
  word-break: break-word;
}
.blog-post-item-title:hover {
  color: #ff2a2a;
}
.blog-post-item-excerpt {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.blog-post-action-col {
  flex-shrink: 0;
}
.btn-blog-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  color: #ffffff !important;
  font-weight: 850;
  font-size: 12px;
  padding: 6px 18px;
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.15s ease;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.15);
}
.btn-blog-view:hover {
  background: #ff2a2a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 42, 42, 0.25);
}

@media (max-width: 640px) {
  .blog-post-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 0;
  }
  .blog-post-thumb-wrapper {
    width: 100%;
    height: 160px;
    border-radius: 12px;
  }
  .blog-post-action-col {
    width: 100%;
    display: flex;
    justify-content: flex-end;
  }
}

/* Blog list style aligned with ncunlock.vn */
body,
button,
input,
select,
textarea,
body :where(h1, h2, h3, h4, h5, h6, p, a, span, strong, em, li, button, input, select, textarea, label) {
  font-family: var(--font) !important;
}

#blogPostsListContainer .category-group {
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: none;
}

#blogPostsListContainer .category-header {
  height: auto;
  padding: 15px 18px;
  border-radius: 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff !important;
  color: #111827 !important;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
}

#blogPostsListContainer .category-group > div:last-child {
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
}

#blogPostsListContainer .blog-post-item {
  display: grid !important;
  grid-template-columns: 108px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  background: #ffffff;
  transition: background .18s ease;
}

#blogPostsListContainer .blog-post-item:hover {
  background: #f8fafc;
}

#blogPostsListContainer .blog-post-thumb-wrapper {
  display: block;
  width: 108px !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #f3f4f6;
  flex: none;
}

#blogPostsListContainer .blog-post-thumb-wrapper img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
}

#blogPostsListContainer .blog-post-meta-row {
  gap: 7px;
  margin-bottom: 5px;
  color: #6b7280;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.35;
}

#blogPostsListContainer .blog-post-meta-row .featured-badge {
  padding: 0;
  background: transparent;
  color: #6b7280;
}

#blogPostsListContainer .blog-post-item-title {
  margin: 0 0 4px;
  color: #111827;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.32;
}

#blogPostsListContainer .blog-post-item-title:hover {
  color: #e11d48;
}

#blogPostsListContainer .blog-post-item-excerpt {
  color: #4b5563;
  font-size: 13px;
  line-height: 1.5;
}

#blogPostsListContainer .btn-blog-view {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 999px;
  background: #18181b;
  color: #ffffff !important;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  box-shadow: none;
}

#blogPostsListContainer .btn-blog-view:hover {
  background: #e11d48;
  transform: none;
  box-shadow: none;
}

@media (max-width: 640px) {
  #blogPostsListContainer .blog-post-item {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 14px;
  }

  #blogPostsListContainer .blog-post-thumb-wrapper {
    width: 88px !important;
  }

  #blogPostsListContainer .blog-post-action-col {
    grid-column: 2;
    justify-content: flex-start;
    width: auto;
  }

  #blogPostsListContainer .category-header {
    font-size: 19px;
  }
}


#blogPostsListContainer .category-header-link {
  color: #111827;
  font-weight: 800;
  min-width: 0;
}

#blogPostsListContainer .category-header-link:hover {
  color: #e11d48;
}

#blogPostsListContainer .category-header-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#blogPostsListContainer .category-header-more {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #e11d48;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

#blogPostsListContainer .category-header-more:hover {
  text-decoration: underline;
}

.category-header{display:flex;align-items:center;gap:8px}.category-brand-icon{width:22px;height:22px;border-radius:6px;object-fit:contain;background:#fff;box-shadow:0 1px 3px rgba(15,23,42,.12)}.product-title-with-icon{display:flex;align-items:flex-start;gap:8px}.product-title-with-icon .category-brand-icon{width:18px;height:18px;border-radius:5px;flex:0 0 18px;margin-top:2px}

.nav-link .category-brand-icon{width:16px;height:16px;border-radius:4px;flex:0 0 16px;box-shadow:none}




/* Admin Pro polish - lightweight, no framework dependency */
.admin-pro-shell{background:linear-gradient(180deg,#f8fafc 0,#eef2ff 100%)}
.admin-pro-container{max-width:1480px;width:100%}
.admin-pro-hero{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:24px;border:1px solid rgba(15,23,42,.08);border-radius:24px;background:radial-gradient(circle at top left,rgba(16,185,129,.16),transparent 32%),linear-gradient(135deg,#0f172a,#1e293b);color:#fff;box-shadow:0 20px 60px rgba(15,23,42,.16)}
.admin-pro-hero h2{margin:2px 0 6px;font-size:clamp(24px,3vw,36px);font-weight:900;letter-spacing:-.04em}.admin-pro-hero p{max-width:760px;color:#cbd5e1}.admin-pro-eyebrow{font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.18em;color:#86efac}.admin-pro-refresh{border:0;border-radius:999px;background:#fff;color:#0f172a;padding:11px 16px;font-weight:900;white-space:nowrap;box-shadow:0 12px 30px rgba(0,0,0,.18)}
.admin-pro-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:14px}.admin-pro-stat{position:relative;overflow:hidden;border:1px solid rgba(15,23,42,.08);border-radius:20px;background:#fff;padding:18px;box-shadow:0 12px 34px rgba(15,23,42,.07)}.admin-pro-stat:before{content:"";position:absolute;inset:0 0 auto;height:4px;background:#64748b}.admin-pro-stat-emerald:before{background:#10b981}.admin-pro-stat-sky:before{background:#0ea5e9}.admin-pro-stat-amber:before{background:#f59e0b}.admin-pro-stat-red:before,.admin-pro-stat-rose:before{background:#ef4444}.admin-pro-stat-label{font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.08em;color:#64748b}.admin-pro-stat-value{margin-top:8px;font-size:25px;font-weight:950;letter-spacing:-.04em;color:#0f172a}.admin-pro-stat-hint{margin-top:8px;font-size:12px;font-weight:700;color:#94a3b8}.admin-pro-loading,.admin-pro-error{grid-column:1/-1;text-align:center;padding:22px;border-radius:18px;background:#fff}.admin-pro-error{color:#ef4444;font-weight:800}
.admin-pro-health{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px}.admin-pro-health>div{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid rgba(15,23,42,.08);border-radius:16px;background:#fff;padding:13px 15px}.admin-pro-health span{color:#64748b;font-size:13px;font-weight:800}.admin-pro-health strong{color:#0f172a;font-size:13px}.admin-pro-toolbar{position:sticky;top:0;z-index:5;box-shadow:0 12px 35px rgba(15,23,42,.08)}.admin-pro-manual{box-shadow:0 20px 50px rgba(15,23,42,.18)}.data-table tbody tr{transition:background .15s ease}.data-table input,.data-table select{background:#fff}.mini-copy{display:block;margin-top:5px;border:1px solid #e2e8f0;border-radius:999px;background:#fff;color:#475569;padding:2px 7px;font-size:10px;font-weight:900}.mini-copy:hover{background:#f1f5f9;color:#0f172a}
@media (max-width:760px){.admin-pro-hero{align-items:flex-start;flex-direction:column;padding:18px}.admin-pro-refresh{width:100%}.product-table{min-width:1180px}.data-table th,.data-table td{padding:10px 12px}}


/* Mobile order/top-up history cards */
@media (max-width: 1024px) {
  #my-orders-portal .glass-panel,
  #my-topups-portal .glass-panel {
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  #my-orders-portal .table-responsive,
  #my-topups-portal .table-responsive {
    overflow: visible !important;
    width: 100% !important;
  }
  .my-orders-table,
  .my-topups-table,
  .my-orders-table tbody,
  .my-topups-table tbody,
  .my-orders-table tr,
  .my-topups-table tr,
  .my-orders-table td,
  .my-topups-table td {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  .my-orders-table,
  .my-topups-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
  }
  .my-orders-table thead,
  .my-topups-table thead {
    display: none !important;
  }
  .my-orders-table tr,
  .my-topups-table tr {
    margin: 0 0 14px !important;
    padding: 12px 14px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .06) !important;
  }
  .my-orders-table td,
  .my-topups-table td {
    padding: 9px 0 !important;
    border: 0 !important;
    text-align: right !important;
    max-width: none !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow: visible !important;
  }
  .my-orders-table td::before,
  .my-topups-table td::before {
    content: attr(data-label);
    float: left;
    max-width: 42%;
    padding-right: 12px;
    color: #64748b;
    font-weight: 900;
    text-align: left;
  }
  .my-orders-table td[data-label="Delivery"],
  .my-topups-table td[data-label="Transaction"] {
    text-align: left !important;
  }
  .my-orders-table td[data-label="Delivery"]::before,
  .my-topups-table td[data-label="Transaction"]::before {
    float: none;
    display: block;
    max-width: none;
    margin-bottom: 6px;
  }
  .my-orders-table th:last-child,
  .my-orders-table td:last-child {
    position: static !important;
    box-shadow: none !important;
  }
}



.category-update-icon{width:22px;height:22px;border-radius:6px;display:inline-flex;align-items:center;justify-content:center;background:#fff;color:#2563eb;font-size:18px;font-weight:950;line-height:1;box-shadow:0 1px 3px rgba(15,23,42,.12)}

/* Mobile bottom navigation */
.mobile-bottom-nav {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 90;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(226, 232, 240, .95);
  border-radius: 24px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 18px 45px rgba(15,23,42,.20);
  backdrop-filter: blur(18px);
}
.mobile-bottom-item {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  text-decoration: none;
  border-radius: 18px;
  padding: 7px 2px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10.5px;
  font-weight: 900;
  line-height: 1.05;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.mobile-bottom-icon {
  width: 26px;
  height: 24px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
}
.mobile-bottom-item.active {
  color: #ef2727;
  background: #fff1f2;
}
.mobile-bottom-item.active .mobile-bottom-icon {
  background: #ef2727;
  color: #fff;
  box-shadow: 0 8px 16px rgba(239,39,39,.24);
}
@media (max-width: 1023px) {
  body { padding-bottom: 96px !important; }
  .glass-header { display: none !important; }
  #mobile-overlay, #mobile-menu { display: none !important; }
  main { padding-top: 0 !important; }
  .content-shell { padding-bottom: 24px !important; }
}
@media (min-width: 1024px) {
  .mobile-bottom-nav { display: none !important; }
}.mobile-bottom-nav.is-logged-out {
  grid-template-columns: 1fr 1fr 1fr 1.7fr;
}
.mobile-bottom-nav.is-logged-out .mobile-auth-only {
  display: none !important;
}
.mobile-bottom-nav.is-logged-out #mobileBottomAuth {
  color: #fff;
  background: linear-gradient(135deg,#ef2727,#dc2626);
  box-shadow: 0 12px 24px rgba(239,39,39,.28);
  min-height: 58px;
  font-size: 13px;
  border-radius: 20px;
}
.mobile-bottom-nav.is-logged-out #mobileBottomAuth .mobile-bottom-icon {
  background: rgba(255,255,255,.18);
  color: #fff;
}.mobile-category-sheet{position:fixed;left:12px;right:12px;bottom:calc(92px + env(safe-area-inset-bottom));z-index:95;max-height:min(62vh,520px);overflow:auto;padding:12px;border:1px solid #e2e8f0;border-radius:24px;background:rgba(255,255,255,.98);box-shadow:0 24px 70px rgba(15,23,42,.28);display:grid;gap:8px}.mobile-category-sheet[hidden]{display:none!important}.mobile-category-sheet a{display:flex;align-items:center;gap:10px;padding:12px 14px;border-radius:16px;background:#f8fafc;color:#0f172a;text-decoration:none;font-size:13px;font-weight:900}.mobile-category-sheet a.active{background:#fff1f2;color:#ef2727}
/* Imported Juejin article style */
.blog-import-juejin{color:#252933;font-size:16px;line-height:1.9;background:#fff;max-width:760px;margin:0 auto}
.blog-import-juejin h1,.blog-import-juejin h2,.blog-import-juejin h3{color:#1d2129;font-weight:800;line-height:1.35;margin:30px 0 16px;border-bottom:1px solid #e5e6eb;padding-bottom:12px}
.blog-import-juejin h1{font-size:28px}.blog-import-juejin h2{font-size:24px}.blog-import-juejin h3{font-size:20px}
.blog-import-juejin p{margin:14px 0}.blog-import-juejin ul,.blog-import-juejin ol{padding-left:26px;margin:14px 0}.blog-import-juejin li{margin:8px 0}
.blog-import-juejin a{color:#1e80ff;text-decoration:none}.blog-import-juejin a:hover{text-decoration:underline}
.blog-import-juejin code{font-family:'JetBrains Mono',Consolas,monospace;color:#f53f3f;background:#fff1f0;border-radius:4px;padding:2px 5px;font-size:.92em}
.blog-import-juejin pre{background:#f7f8fa;border:1px solid #e5e6eb;border-radius:2px;padding:18px 20px;margin:18px 0;overflow:auto;color:#1f2329;line-height:1.75;box-shadow:inset 0 1px 0 rgba(255,255,255,.8)}
.blog-import-juejin pre code{background:transparent;color:inherit;padding:0;font-size:14px;white-space:pre}
.blog-import-juejin blockquote{border-left:4px solid #1e80ff;background:#f7f8fa;color:#4e5969;margin:18px 0;padding:12px 16px}
.blog-import-juejin img{max-width:100%;border-radius:6px;margin:14px auto;display:block}.blog-import-juejin table{width:100%;border-collapse:collapse;margin:18px 0}.blog-import-juejin th,.blog-import-juejin td{border:1px solid #e5e6eb;padding:10px;text-align:left}

/* Juejin-like code toolbar + highlight */
.blog-import-juejin pre{position:relative;margin:18px 0 22px;padding:52px 24px 22px 54px;background:#f8f8f8;border:1px solid #eee;border-radius:2px;color:#1f2329;font-family:'JetBrains Mono',Consolas,monospace;font-size:14px;line-height:1.75;counter-reset:line}
.blog-import-juejin pre:before{content:'▾    js';position:absolute;left:0;right:0;top:0;height:34px;background:#fafafa;border-bottom:1px solid #eee;color:#a8abb2;font-family:var(--font);font-size:13px;line-height:34px;padding-left:18px}
.blog-import-juejin pre:after{content:'代码解释   代码解读   复制代码';position:absolute;right:14px;top:0;height:34px;color:#7b61ff;font-family:var(--font);font-size:12px;line-height:34px;word-spacing:8px}
.blog-import-juejin pre code{display:block;background:transparent;color:#1f2329;padding:0;white-space:pre;tab-size:2}
.blog-import-juejin .hljs-keyword{color:#d70022;font-weight:700}.blog-import-juejin .hljs-string{color:#d70022}.blog-import-juejin .hljs-title,.blog-import-juejin .hljs-title.class_,.blog-import-juejin .hljs-title.function_{color:#111827;font-weight:700}.blog-import-juejin .hljs-attr{color:#8a5cf6}.blog-import-juejin .hljs-comment{color:#8a8f98;font-style:italic}.blog-import-juejin .hljs-number,.blog-import-juejin .hljs-literal{color:#005cc5}.blog-import-juejin .hljs-built_in{color:#0086b3}.blog-import-juejin code:not(pre code){color:#f53f3f;background:#fff1f0}


/* ponytail: home catalog compact until product count grows beyond ~50; then add pagination/virtual list. */
.category-compact { margin-bottom: 22px; }
.category-compact .cards-grid { padding: 16px; gap: 14px; align-items: start; }
@media (min-width: 1024px) { .category-compact .cards-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 260px)); } }
.category-compact .product-card { min-height: 142px; padding: 14px; }
.product-card { min-height: 150px; padding: 15px; }
.card-title { height: 38px; font-size: 13.5px; line-height: 1.35; margin-bottom: 8px; }
.card-meta { gap: 6px; margin-bottom: 8px; }
.card-price, .card-price span { font-size: 16px !important; }
.btn-buy-now { padding: 9px 10px; font-size: 12px; border-radius: 10px; }
.cards-grid { gap: 16px; padding: 16px; }
.category-group { margin-bottom: 24px; }
.category-header { min-height: 36px; }
.category-header .category-brand-icon, .category-header .category-update-icon { width: 18px; height: 18px; }
.category-header span { font-size: 13px; font-weight: 900; }
@media (max-width: 1023px) {
  body { padding-bottom: 118px !important; }
  .mobile-bottom-nav { left: 14px; right: 14px; bottom: max(8px, env(safe-area-inset-bottom)); padding: 6px; gap: 4px; border-radius: 18px; box-shadow: 0 12px 28px rgba(15,23,42,.18); }
  .mobile-bottom-item { min-height: 42px; padding: 4px 2px; font-size: 9.5px; border-radius: 14px; }
  .mobile-bottom-icon { width: 21px; height: 20px; font-size: 14px; }
  .mobile-bottom-nav.is-logged-out #mobileBottomAuth { min-height: 44px; font-size: 11px; border-radius: 15px; }
  .catalog-toolbar { margin-bottom: 12px; }
  .category-group { margin-bottom: 18px; border-radius: 10px; }
  .cards-grid { padding: 12px; gap: 12px; }
  .product-card { min-height: 138px; padding: 13px; }
  .card-title { height: auto; min-height: 34px; }
  .card-price, .card-price span { font-size: 15px !important; }
}


/* ponytail: tighter sparse categories; if many products return, replace with real carousel. */
@media (min-width: 1024px) {
  .category-compact { width: fit-content; max-width: 100%; min-width: 320px; }
  .category-compact .cards-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 260px)); }
  .category-compact .cards-grid:has(.product-card:only-child) { grid-template-columns: 260px; }
  .category-latest { width: 100%; }
  .category-latest .cards-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.category-latest .category-header { background: linear-gradient(90deg,#0f172a,#2563eb); }
.category-compact .cards-grid { min-height: 0; }


/* ponytail: keep category blocks full-width; only tune card columns for small stock. */
@media (min-width: 1024px) {
  .category-group.category-compact { width: 100%; min-width: 0; }
  .category-group.category-count-1 .cards-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .category-group.category-count-2 .cards-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .category-group.category-count-3 .cards-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .category-group.category-count-1 .cards-grid::after,
  .category-group.category-count-2 .cards-grid::after,
  .category-group.category-count-2 .cards-grid::before,
  .category-group.category-count-3 .cards-grid::after { content:''; display:block; }
}


/* ponytail: desktop category masonry-lite for small catalog; upgrade to real masonry when categories exceed 20. */
@media (min-width: 1024px) {
  #catalogGroupedList { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
  #catalogGroupedList .category-group { margin-bottom: 0; width: 100%; min-width: 0; }
  #catalogGroupedList .category-latest { grid-column: 1 / -1; }
  #catalogGroupedList .category-latest .cards-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #catalogGroupedList .category-count-1 .cards-grid { grid-template-columns: minmax(220px, 1fr); }
  #catalogGroupedList .category-count-2 .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #catalogGroupedList .category-count-3 .cards-grid,
  #catalogGroupedList .category-count-4 .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #catalogGroupedList .cards-grid::before,
  #catalogGroupedList .cards-grid::after { content: none !important; display: none !important; }
}
@media (min-width: 1440px) {
  #catalogGroupedList { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #catalogGroupedList .category-latest { grid-column: 1 / -1; }
}


/* ponytail: 4 category columns + 6 latest cards for wide desktop; switch to carousel if this grows again. */
@media (min-width: 1280px) {
  .content-shell { max-width: 1480px; }
  #catalogGroupedList { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
  #catalogGroupedList .category-latest { grid-column: 1 / -1; }
  #catalogGroupedList .category-latest .cards-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
  #catalogGroupedList .category-latest .product-card { min-height: 142px; padding: 12px; }
  #catalogGroupedList .category-latest .card-title { font-size: 12px; min-height: 34px; height: 34px; }
  #catalogGroupedList .category-latest .card-price,
  #catalogGroupedList .category-latest .card-price span { font-size: 14px !important; }
  #catalogGroupedList .category-latest .btn-buy-now { padding: 8px 6px; font-size: 11px; }
}
