:root {
  --green: #07c160;
  --green-dark: #06ad56;
  --green-light: #e8f8ef;
  --green-glow: rgba(7, 193, 96, 0.25);
  --bg: #f5f7f6;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --danger: #ef4444;
  --warning: #f59e0b;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.1);
  --radius: 16px;
  --radius-sm: 10px;
  --header-h: auto;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

svg { display: block; max-width: 100%; height: auto; }
.brand-icon svg,
.cart-btn svg { width: 100%; height: 100%; max-width: none; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: #fff;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: var(--green-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: min(1140px, calc(100% - 40px));
  margin: 0 auto;
}

.narrow { max-width: 680px; }

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
  padding-top: env(safe-area-inset-top, 0);
}

.header-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 56px;
  padding: 8px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover { text-decoration: none; }

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--green);
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
}

.brand-icon svg { width: 20px; height: 20px; }

.brand-name {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
  color: var(--text);
  background: var(--bg);
  text-decoration: none;
}

.nav-link.active {
  color: var(--green-dark);
  background: var(--green-light);
  text-decoration: none;
  font-weight: 600;
}

.cart-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
}

.nav-link-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--green-light);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.user-chip:hover { text-decoration: none; opacity: 0.9; }

.admin-tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--green);
  color: #fff;
  font-size: 10px;
  line-height: 1.4;
}

.cart-btn:hover { background: var(--bg); }
.cart-btn svg { width: 22px; height: 22px; }

.cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.cart-count:empty,
.cart-count[data-zero="true"] { display: none; }

/* ===== Main ===== */
.site-main {
  background: #fff;
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0));
}

.page-title {
  text-align: center;
  margin: 0 0 24px;
  font-size: 22px;
  font-weight: 700;
}

/* ===== Section titles (shared) ===== */
.section-head {
  text-align: center;
  margin-bottom: 28px;
}

.section-head h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
}

.section-head p {
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 14px;
  max-width: 480px;
}

/* ===== Products ===== */
.products-section {
  padding: 28px 0 20px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 320px;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--green);
}

.product-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.product-code {
  font-size: 13px;
  color: var(--green-dark);
  font-weight: 600;
  margin-bottom: 4px;
}

.product-name {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 700;
}

.product-desc {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
}

.product-price {
  margin-bottom: 16px;
  color: var(--green-dark);
}

.product-price .currency { font-size: 16px; font-weight: 600; vertical-align: top; }
.product-price .amount { font-size: 32px; font-weight: 700; line-height: 1; }

.qty-control {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 140px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.qty-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg);
  font-size: 18px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s;
}

.qty-btn:hover { background: var(--green-light); }

.qty-input {
  flex: 1;
  border: none;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  min-width: 0;
  -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
}

.btn:hover { text-decoration: none; }

.btn-primary {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.btn-primary:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: #fff;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-outline {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }

/* ===== Help links ===== */
.help-links-section {
  padding: 16px 0 0;
  background: #fff;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.help-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  color: inherit;
  transition: all 0.2s;
  text-decoration: none;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 140px;
}

.help-card:hover {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
  text-decoration: none;
  transform: translateY(-2px);
}

.help-num {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  background: var(--green-light);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.help-card h4 { margin: 0 0 6px; font-size: 17px; }
.help-card p { margin: 0; font-size: 13px; color: var(--text-muted); }

/* ===== Features strip ===== */
.features-section {
  padding: 28px 0 36px;
  background: linear-gradient(180deg, #fff 0%, var(--green-light) 100%);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.feature-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 22px 14px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(7, 193, 96, 0.15);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(7, 193, 96, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(7, 193, 96, 0.12);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: var(--green-light);
  color: var(--green-dark);
}

.feature-icon svg {
  width: 26px;
  height: 26px;
}

.feature-item h4 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.feature-item p {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ===== Help pages ===== */
.page-hero {
  padding: 36px 0 28px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.page-hero-inner {
  position: relative;
}

.page-hero h1 {
  margin: 8px 0 0;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 700;
}

.page-hero-desc {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.back-link {
  display: inline-block;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 4px;
}

.back-link:hover { color: var(--green-dark); }

.help-content { padding: 32px 0 48px; }

/* Download tutorial card */
.download-card {
  background: linear-gradient(145deg, var(--green-light) 0%, #fff 55%);
  border: 1px solid rgba(7, 193, 96, 0.22);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}

.download-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.download-card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
}

.download-card-icon svg {
  width: 22px;
  height: 22px;
}

.download-card-label {
  margin: 0 0 2px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.download-card-tip {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.download-url-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 12px 14px;
  background: #fff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.download-url {
  flex: 1;
  min-width: 180px;
  word-break: break-all;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 14px;
  color: var(--green-dark);
}

.btn-outline {
  background: #fff;
  color: var(--green-dark);
  border: 1px solid var(--green);
}

.btn-outline:hover {
  background: var(--green-light);
}

.help-block {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  text-align: center;
}

.help-block.highlight {
  border-color: var(--green);
  background: var(--green-light);
}

.help-block label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.link-block {
  display: block;
  word-break: break-all;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
}

.step-list {
  margin: 0 0 24px;
  padding-left: 0;
  list-style: none;
  counter-reset: step;
}

.step-list li {
  counter-increment: step;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 24px 20px 56px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  position: relative;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.step-list li:hover {
  border-color: rgba(7, 193, 96, 0.35);
  box-shadow: 0 4px 16px rgba(7, 193, 96, 0.08);
}

.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.step-list strong { display: block; margin-bottom: 6px; font-size: 16px; }
.step-list p { margin: 0; color: var(--text-muted); font-size: 14px; }

.warning-box,
.info-box,
.alert-box {
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}

.warning-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
}

.warning-box h3 { margin: 0 0 12px; font-size: 16px; color: #991b1b; text-align: center; }
.warning-box ul { margin: 0; padding-left: 20px; color: #7f1d1d; font-size: 14px; line-height: 1.7; }
.warning-box li + li { margin-top: 4px; }

.info-box {
  background: var(--green-light);
  border: 1px solid #bbf7d0;
  font-size: 14px;
  text-align: center;
}

.alert-box {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  text-align: center;
  font-weight: 600;
  color: #9a3412;
}

.plain-list {
  padding-left: 20px;
  font-size: 15px;
}

.plain-list li { margin-bottom: 10px; }

.faq-item {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  text-align: center;
}

.faq-item h3 { margin: 0 0 10px; font-size: 17px; }
.faq-item p { margin: 0; color: var(--text-muted); }

.price-table {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.price-table h3 { margin: 0 0 16px; text-align: center; }

.price-table table {
  width: 100%;
  border-collapse: collapse;
}

.price-table th,
.price-table td {
  padding: 12px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.price-table th { color: var(--text-muted); font-weight: 600; font-size: 13px; }

.table-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ===== Cart drawer ===== */
body.scroll-lock {
  overflow: hidden;
  touch-action: none;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 100vw);
  height: 100vh;
  height: 100dvh;
  background: var(--surface);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -8px 0 32px rgba(0,0,0,0.1);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.cart-drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.drawer-header h2 {
  margin: 0 auto 0 0;
  font-size: 20px;
  flex: 1;
  text-align: center;
  padding-right: 36px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg);
  border-radius: 8px;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  color: var(--text-muted);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.empty-cart {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.cart-item-info { flex: 1; min-width: 0; text-align: left; }
.cart-item-info strong { display: block; font-size: 15px; }
.cart-item-info small { color: var(--text-muted); font-size: 13px; }

.cart-item-price {
  font-weight: 700;
  color: var(--green-dark);
  white-space: nowrap;
}

.cart-item-remove {
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px;
}

.drawer-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 16px;
}

.cart-total strong { font-size: 24px; color: var(--green-dark); }

.checkout-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-overlay[hidden] { display: none; }

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 32px 28px;
  width: min(440px, 100%);
  position: relative;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

.modal h3 {
  margin: 0 0 20px;
  font-size: 20px;
  text-align: center;
}

.checkout-summary {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
  font-size: 14px;
  text-align: left;
}

.checkout-line {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
}

.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.modal-hint {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: calc(32px + env(safe-area-inset-bottom, 0));
  left: 50%;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  background: rgba(26, 26, 26, 0.9);
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  z-index: 400;
  pointer-events: none;
  animation: toastIn 0.3s ease;
}

.toast[hidden] { display: none; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== Footer ===== */
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 10px 0 calc(12px + env(safe-area-inset-bottom, 0));
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.footer-note {
  max-width: 640px;
  margin: 0 auto 4px;
  line-height: 1.5;
}

.footer-copy { margin: 6px 0 0; opacity: 0.7; }

/* ===== Auth ===== */
.auth-section {
  padding: 40px 0 60px;
}

.auth-wrap {
  max-width: 420px;
}

.auth-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}

.auth-title {
  margin: 0 0 8px;
  font-size: 24px;
  text-align: center;
}

.auth-desc {
  margin: 0 0 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.auth-form .form-group { margin-bottom: 16px; }

.captcha-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.captcha-input {
  flex: 1;
  min-width: 0;
  letter-spacing: 0.15em;
  text-align: center;
  font-weight: 600;
}

.captcha-img {
  flex-shrink: 0;
  width: 108px;
  height: 40px;
  border-radius: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
  background: #f9fafb;
}

.auth-hint {
  margin: 16px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.flash-list { margin-bottom: 16px; }

.flash {
  margin: 0 0 8px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}

.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.flash-success { background: var(--green-light); color: var(--green-dark); border: 1px solid #bbf7d0; }

/* ===== Profile ===== */
.profile-section {
  padding: 28px 0 80px;
}

.profile-info-bar {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  margin-bottom: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.profile-buy-btn {
  justify-self: end;
  padding: 8px 16px;
  font-size: 13px;
  white-space: nowrap;
}

.profile-recharge {
  margin-bottom: 28px;
}

.recharge-card {
  padding: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.recharge-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.recharge-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.6;
  border-bottom: 1px solid var(--border);
}

.recharge-steps li:last-child {
  border-bottom: none;
}

.recharge-step-no {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  margin-top: 1px;
}

.recharge-steps em {
  font-style: normal;
  font-weight: 600;
  color: var(--green-dark);
}

.recharge-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 18px;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.recharge-tip {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.recharge-qq-link {
  padding: 0;
  border: none;
  background: none;
  color: var(--green-dark);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.recharge-qq-link:hover {
  color: var(--green);
}

.profile-info-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 14px;
}

.profile-info-item .label {
  color: var(--text-muted);
}

.profile-info-item .value {
  font-weight: 600;
}

.profile-info-item .profile-balance {
  color: var(--green-dark);
  font-size: 18px;
}

.profile-records-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.profile-records-head h2 {
  margin: 0;
  font-size: 18px;
}

.profile-records-count {
  font-size: 13px;
  color: var(--text-muted);
}

.profile-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}

.profile-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.profile-table th,
.profile-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.profile-table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 13px;
}

.profile-table tbody tr:last-child td {
  border-bottom: none;
}

.profile-table .col-time {
  white-space: nowrap;
  color: var(--text-muted);
}

.profile-table .col-key code {
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
}

.profile-table .col-action {
  width: 80px;
  text-align: right;
  white-space: nowrap;
}

.profile-table .copy-btn {
  display: inline-block;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--green-dark);
  font-size: 12px;
  cursor: pointer;
}

.profile-table .copy-btn:hover {
  background: var(--green-light);
  border-color: var(--green);
}

.profile-empty {
  margin: 0;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 13px;
}

.pagination-size {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pagination-size-label {
  color: var(--text-muted);
  margin-right: 2px;
}

.pagination-size-btn {
  display: inline-block;
  min-width: 32px;
  padding: 4px 8px;
  border-radius: 6px;
  text-align: center;
  color: var(--text);
  text-decoration: none;
}

.pagination-size-btn:hover {
  background: var(--green-light);
  text-decoration: none;
}

.pagination-size-btn.active {
  background: var(--green);
  color: #fff;
}

.pagination-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination-btn {
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

.pagination-btn:hover:not(.disabled) {
  color: var(--green-dark);
  text-decoration: none;
}

.pagination-btn.disabled {
  color: var(--text-muted);
  opacity: 0.5;
  cursor: default;
}

.pagination-info {
  color: var(--text-muted);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .pagination-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .pagination-nav {
    justify-content: center;
  }
}

/* ===== CMS content ===== */
.cms-content .help-block,
.cms-content .step-list,
.cms-content .warning-box,
.cms-content .info-box,
.cms-content .alert-box,
.cms-content .faq-item { margin-bottom: 16px; }

/* ===== Admin ===== */
.admin-section { padding: 28px 0 80px; }

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.admin-head .page-title { margin: 0; }

.admin-menu {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.admin-menu-card {
  display: block;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s;
}

.admin-menu-card:hover {
  border-color: var(--green);
  text-decoration: none;
}

.admin-menu-card h3 { margin: 0 0 8px; }
.admin-menu-card p { margin: 0; color: var(--text-muted); font-size: 14px; }

.admin-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  background: #fff;
}

.admin-card h3 { margin: 0 0 16px; }

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.admin-list { display: flex; flex-direction: column; gap: 10px; }

.admin-list-item {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.admin-list-item:hover { border-color: var(--green); text-decoration: none; }
.admin-list-item span { color: var(--text-muted); font-size: 14px; }
.admin-list-item em { font-style: normal; font-size: 12px; color: var(--green-dark); }

.admin-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.admin-search .input {
  width: min(240px, 100%);
}

.admin-table-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.tag-ok {
  background: var(--green-light);
  color: var(--green-dark);
}

.tag-danger {
  background: #fef2f2;
  color: #991b1b;
}

.log-desc {
  font-weight: 600;
  font-size: 13px;
}

.log-desc-ok {
  color: var(--green-dark);
}

.log-desc-fail {
  color: #991b1b;
}

.admin-actions {
  white-space: nowrap;
}

.inline-form {
  display: inline;
  margin: 0;
}

.action-link {
  color: var(--green-dark);
  font-size: 13px;
  text-decoration: none;
  margin-right: 10px;
}

.action-link:hover {
  text-decoration: underline;
}

.action-link-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  margin-right: 0;
}

.action-link-btn:hover {
  color: var(--green);
}

.action-link-danger {
  color: #b91c1c;
}

.action-link-danger:hover {
  color: #991b1b;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
  border: none;
}

.btn-danger:hover {
  background: #dc2626;
}

.admin-danger-zone {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  margin: 8px 0 12px;
}

.textarea {
  min-height: 280px;
  resize: vertical;
  font-family: Consolas, 'Courier New', monospace;
  font-size: 13px;
}

.form-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 8px 0 16px;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .help-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .container { width: calc(100% - 32px); }

  .header-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand actions"
      "nav nav";
    gap: 6px 8px;
    align-items: center;
    padding: 8px 0 6px;
  }

  .brand {
    grid-area: brand;
    min-width: 0;
  }

  .brand-name {
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 46vw;
  }

  .header-actions {
    grid-area: actions;
    margin-left: 0;
    gap: 4px;
    flex-wrap: nowrap;
  }

  .header-nav {
    grid-area: nav;
    width: 100%;
    flex: unset;
    justify-content: flex-start;
    gap: 3px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0;
  }

  .header-nav::-webkit-scrollbar { display: none; }

  .nav-link {
    flex: 0 0 auto;
    padding: 4px 7px;
    font-size: 11px;
    min-height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-link-sm {
    padding: 4px 7px;
    font-size: 11px;
    min-height: 28px;
  }

  .user-chip {
    max-width: 88px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 8px 10px;
    min-height: 44px;
  }

  .cart-btn {
    width: 36px;
    height: 36px;
    -webkit-tap-highlight-color: transparent;
  }

  .btn,
  .qty-btn,
  .copy-btn,
  .icon-btn {
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
  }

  .qty-btn {
    min-width: 44px;
  }

  .qty-input {
    font-size: 16px;
  }

  .input,
  .auth-form .input {
    font-size: 16px;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-width: none;
    margin: 0;
  }

  .products-section {
    padding: 10px 0 16px;
  }

  .products-section-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
  }

  .products-section .page-title {
    font-size: 17px;
    margin: 0;
    padding-top: 2px;
    flex: 1;
    min-width: 0;
  }

  .product-card {
    min-height: 0;
    padding: 10px 8px 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  }

  .product-card:hover {
    transform: none;
  }

  .product-badge {
    top: 6px;
    right: 6px;
    font-size: 9px;
    padding: 2px 6px;
  }

  .product-code {
    font-size: 10px;
    margin-bottom: 2px;
  }

  .product-name {
    font-size: 14px;
    margin-bottom: 2px;
  }

  .product-desc {
    display: none;
  }

  .product-price {
    margin-bottom: 6px;
  }

  .product-price .currency {
    font-size: 11px;
  }

  .product-price .amount {
    font-size: 20px;
  }

  .qty-control {
    max-width: 100%;
    margin-bottom: 6px;
    border-radius: 6px;
  }

  .qty-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    font-size: 14px;
  }

  .qty-input {
    font-size: 13px;
  }

  .product-card .btn {
    padding: 6px 4px;
    font-size: 11px;
    min-height: 30px;
    border-radius: 6px;
  }

  .help-grid {
    grid-template-columns: 1fr;
    max-width: none;
    margin: 0;
  }

  .help-card {
    min-height: 0;
    padding: 24px 18px;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .feature-item {
    padding: 16px 10px;
  }

  .feature-item h4 { font-size: 14px; }
  .feature-item p { font-size: 11px; }

  .page-hero {
    padding: 28px 0 22px;
  }

  .page-hero h1 {
    font-size: 22px;
    line-height: 1.3;
  }

  .help-content {
    padding: 24px 0 40px;
  }

  .download-card {
    padding: 18px 16px;
  }

  .download-url-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .download-url {
    min-width: 0;
    font-size: 13px;
    text-align: center;
  }

  .download-url-row .btn {
    width: 100%;
  }

  .modal-overlay {
    padding: 16px;
    align-items: flex-end;
  }

  .modal {
    width: 100%;
    max-height: calc(100dvh - 32px - env(safe-area-inset-bottom, 0));
    overflow-y: auto;
    padding: 28px 20px calc(24px + env(safe-area-inset-bottom, 0));
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .auth-section {
    padding: 28px 0 48px;
  }

  .auth-card {
    padding: 24px 18px;
  }

  .profile-section {
    padding: 24px 0 calc(72px + env(safe-area-inset-bottom, 0));
  }

  .profile-info-bar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .profile-buy-btn {
    grid-column: auto;
    justify-self: stretch;
    text-align: center;
    width: 100%;
  }

  .profile-table .copy-btn {
    min-height: 36px;
    padding: 8px 12px;
  }

  .recharge-steps li {
    align-items: flex-start;
  }

  .admin-menu,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .admin-list-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .footer-note {
    font-size: 12px;
    padding: 0 8px;
  }
}

@media (max-width: 640px) {
  .container { width: calc(100% - 24px); }

  .pagination-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .pagination-nav {
    justify-content: center;
  }

  .features-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 360px) {
  .nav-link {
    padding: 4px 6px;
    font-size: 10px;
  }

  .header-actions .nav-link-sm:not(.cart-btn) {
    padding: 4px 6px;
    font-size: 10px;
  }
}

/* ===== 假订单滚动面板（首页宣传展示） ===== */
.products-section-top {
  position: relative;
}

.fake-order-panel {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: relative;
  top: auto;
  right: auto;
  width: min(148px, 46vw);
  z-index: 2;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(7, 193, 96, 0.14);
  border-radius: 8px;
  box-shadow: none;
  overflow: hidden;
}

.fake-order-panel-head {
  display: none;
}

.fake-order-panel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(7, 193, 96, 0.2);
  animation: fakeOrderPulse 1.6s ease-in-out infinite;
}

@keyframes fakeOrderPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.92); }
}

.fake-order-viewport {
  flex-shrink: 0;
  height: 84px;
  overflow: hidden;
  padding: 0;
}

.fake-order-track {
  will-change: transform;
}

.fake-order-row {
  display: flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 7px;
  font-size: 9px;
  line-height: 1.3;
  color: rgba(55, 65, 81, 0.85);
  border-bottom: 1px dashed rgba(229, 231, 235, 0.45);
}

.fake-order-row:last-child {
  border-bottom: none;
}

.fake-order-row-icon {
  display: none;
}

.fake-order-row-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fake-order-row-text strong {
  color: var(--green-dark);
  font-weight: 700;
}

.fake-order-row-text em {
  font-style: normal;
  font-weight: 600;
  color: var(--text);
}

@media (min-width: 1200px) {
  .products-section-top {
    display: block;
  }

  .products-section-top .page-title {
    margin-bottom: 16px;
  }

  .fake-order-panel {
    position: fixed;
    top: 132px;
    right: max(12px, calc((100vw - 1140px) / 2 - 272px));
    width: 248px;
    max-width: none;
    margin: 0;
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(7, 193, 96, 0.28);
    border-radius: var(--radius);
    box-shadow: 0 10px 36px rgba(7, 193, 96, 0.12);
  }

  .fake-order-panel-head {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 8px;
    padding: 14px 16px 12px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, var(--green-light) 0%, #fff 100%);
  }

  .fake-order-viewport {
    height: 520px;
  }

  .fake-order-row {
    align-items: flex-start;
    gap: 10px;
    min-height: 52px;
    padding: 10px 14px;
    font-size: 12px;
    line-height: 1.45;
    border-bottom: 1px dashed rgba(229, 231, 235, 0.9);
  }

  .fake-order-row-icon {
    display: grid;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--green-light);
    color: var(--green-dark);
    place-items: center;
    font-size: 14px;
  }

  .fake-order-row-text {
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }
}
