:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --success: #10b981;
  --success-soft: #ecfdf5;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --navy: #0b1220;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.14);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--navy);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.navbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.3px;
  cursor: pointer;
}
.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-link {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #cbd5e1;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  background: transparent;
  white-space: nowrap;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.08); }
.nav-link.active { color: #fff; background: rgba(37, 99, 235, 0.35); }

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

/* Announcement */
.announcement-bar {
  background: linear-gradient(90deg, #eff6ff, #f0f9ff);
  border-bottom: 1px solid #dbeafe;
  color: #1e40af;
  font-size: 13px;
  padding: 9px 20px;
}
.announcement-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Main container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-outline { background: #fff; color: var(--text); border-color: var(--border); }
.btn-outline:hover:not(:disabled) { background: var(--surface-2); border-color: #cbd5e1; }
.btn-dark-outline { background: rgba(255,255,255,0.08); color: #fff; border-color: rgba(255,255,255,0.18); }
.btn-dark-outline:hover:not(:disabled) { background: rgba(255,255,255,0.16); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #059669; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-xs { padding: 4px 9px; font-size: 12px; border-radius: 6px; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-body { padding: 20px; }

/* Hero / Toolbar */
.hero-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #fff;
  border-radius: 16px;
  padding: 24px 28px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.hero-banner h1 { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
.hero-banner p { margin: 0; color: #bfdbfe; font-size: 14px; }
.hero-stats {
  display: flex;
  gap: 20px;
}
.hero-stat {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  padding: 10px 16px;
  text-align: center;
  min-width: 110px;
}
.hero-stat .num { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.hero-stat .lbl { font-size: 12px; color: #cbd5e1; }

/* Platform Tabs */
.platform-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.platform-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s;
}
.platform-tab img { width: 18px; height: 18px; object-fit: contain; }
.platform-tab:hover { border-color: var(--primary); color: var(--primary); }
.platform-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.platform-tab .cnt {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 99px;
  background: rgba(15,23,42,0.07);
}
.platform-tab.active .cnt { background: rgba(255,255,255,0.22); color: #fff; }

/* Subcategory pills */
.subcat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.subcat-pill {
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: #475569;
  cursor: pointer;
}
.subcat-pill:hover { border-color: var(--primary); color: var(--primary); }
.subcat-pill.active { background: var(--primary-soft); color: var(--primary); border-color: #93c5fd; font-weight: 600; }

/* Filter Bar */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.search-box {
  flex: 1;
  min-width: 240px;
  display: flex;
  gap: 8px;
}
.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: #334155;
  cursor: pointer;
  user-select: none;
}

/* Product List (BuyFBAcc style dense scannable rows) */
.product-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.product-row {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  align-items: center;
  gap: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.product-row:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
}
.product-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.product-icon img { width: 26px; height: 26px; object-fit: contain; }
.product-info { min-width: 0; }
.product-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  word-break: break-word;
}
.product-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.product-desc {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}
.badge-green { background: var(--success-soft); color: #047857; }
.badge-gray { background: #f1f5f9; color: #64748b; }
.badge-blue { background: var(--primary-soft); color: #1d4ed8; }
.badge-amber { background: var(--warning-soft); color: #b45309; }
.badge-red { background: var(--danger-soft); color: #b91c1c; }

.product-price-col {
  text-align: right;
  min-width: 110px;
}
.price-cny {
  font-size: 20px;
  font-weight: 800;
  color: #dc2626;
  font-variant-numeric: tabular-nums;
}
.price-cny small { font-size: 13px; font-weight: 700; margin-right: 1px; }

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

/* 2FA Tool */
.tfa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.otp-display {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #fff;
  border-radius: 14px;
  padding: 24px;
  text-align: center;
}
.otp-code {
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 8px;
  font-variant-numeric: tabular-nums;
  margin: 10px 0;
  color: #38bdf8;
  cursor: pointer;
}
.otp-progress {
  height: 6px;
  border-radius: 99px;
  background: rgba(255,255,255,0.15);
  overflow: hidden;
  margin-top: 12px;
}
.otp-progress-bar {
  height: 100%;
  background: #38bdf8;
  transition: width 0.3s linear;
}

/* Tutorials */
.tutorial-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
}
.tutorial-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.tutorial-item:last-child { border-bottom: none; }
.tutorial-item:hover { background: var(--surface-2); }
.tutorial-item.active { background: var(--primary-soft); border-left: 3px solid var(--primary); }
.tutorial-content h3 { margin: 18px 0 8px; font-size: 16px; color: var(--text); }
.tutorial-content p { margin: 8px 0; color: #334155; }
.tutorial-content ul, .tutorial-content ol { padding-left: 20px; color: #334155; }
.tutorial-content code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: #0f172a;
}

/* Tables */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data-table th {
  text-align: left;
  padding: 11px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  color: #475569;
  font-weight: 600;
  white-space: nowrap;
}
table.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data-table tr:hover td { background: #fafcff; }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9999;
}
.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-lg { max-width: 720px; }
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { margin: 0; font-size: 17px; }
.modal-close {
  border: none;
  background: transparent;
  font-size: 22px;
  color: #64748b;
  cursor: pointer;
  line-height: 1;
}
.modal-body { padding: 20px 22px; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: #334155; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Floating Customer Service Button */
.cs-fab {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 60;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  border-radius: 99px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.38);
  transition: transform 0.15s;
}
.cs-fab:hover { transform: translateY(-2px); }

/* Toast */
.toast-container {
  position: fixed;
  top: 76px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: #0f172a;
  color: #fff;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  max-width: 340px;
}
.toast.success { background: #065f46; }
.toast.error { background: #991b1b; }

/* Code / Credentials box */
.cred-box {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 260px;
  overflow-y: auto;
}

.pay-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pay-option {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.15s;
}
.pay-option.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.hidden { display: none !important; }

.footer {
  margin-top: 48px;
  padding: 24px 20px;
  border-top: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 860px) {
  .product-row {
    grid-template-columns: 38px 1fr;
    gap: 10px;
  }
  .product-price-col {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }
  .tfa-grid, .tutorial-layout { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .mobile-nav { display: flex !important; }
}
.mobile-nav {
  display: none;
  background: #111c33;
  padding: 8px 12px;
  gap: 6px;
  overflow-x: auto;
}
