/* DigitShop 用户端 — humkt 风格 */

:root {
  --brand: #006fff;
  --brand-hover: #0056cc;
  --header-bg: #ffffff;
  --header-bg-secondary: #f8fafc;
  --header-border: #e5e7eb;
  --header-text: #1e293b;
  --header-muted: #64748b;
  --page-bg: #f2f5fa;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --muted: #64748b;
  --success: #28a745;
  --success-hover: #218838;
  --danger: #dc3545;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--page-bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.site-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.site-container--wide {
  max-width: 1320px;
}

.page-main { padding: 20px 16px 40px; }

.price, .products-count-num, .price-value, .balance, .stock-text, [class*="price"] {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ========== Header V2 ========== */
.header-v2 {
  background: var(--header-bg);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid var(--header-border);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.header-v2__main { padding: 12px 0; }

.header-v2__container {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-v2__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), #56ccf2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.logo-name {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--header-text);
  letter-spacing: -0.02em;
}

.header-v2__search {
  flex: 1;
  max-width: 520px;
}

.header-v2__search-form {
  display: flex;
  align-items: center;
  background: var(--header-bg-secondary);
  border: 1px solid var(--header-border);
  border-radius: 999px;
  transition: all 0.2s;
}

.header-v2__search-form:focus-within {
  background: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 111, 255, 0.12);
}

.header-v2__search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 16px;
  font-size: 0.92rem;
  outline: none;
  color: var(--header-text);
}

.header-v2__search-input::placeholder { color: var(--header-muted); }

.header-v2__search-btn {
  background: var(--brand);
  border: none;
  color: #fff;
  padding: 10px 18px;
  cursor: pointer;
  border-radius: 0 999px 999px 0;
  margin: -1px -1px -1px 0;
  transition: background 0.2s;
}

.header-v2__search-btn:hover { background: var(--brand-hover); }
.header-v2__search-btn i { font-size: 1.05rem; }

.header-v2__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.header-v2__auth { display: flex; gap: 8px; }

.header-v2__auth-btn {
  border: 1px solid var(--header-border);
  background: #fff;
  color: var(--header-text);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.header-v2__auth-btn:hover { background: var(--header-bg-secondary); }

.header-v2__auth-btn--primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.header-v2__auth-btn--primary:hover { background: var(--brand-hover); }

.header-v2__user-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-v2__balance {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  padding: 6px 12px;
  border-radius: 999px;
  color: #059669;
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
}

.header-v2__user { position: relative; }

.header-v2__user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--header-bg-secondary);
  border: 1px solid var(--header-border);
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  color: var(--header-text);
  font-weight: 500;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s;
}

.header-v2__user-btn:hover { background: #f1f5f9; }

.header-v2__user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
}

.header-v2__user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--header-border);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s;
  z-index: 1050;
}

.header-v2__user:hover .header-v2__user-menu,
.header-v2__user-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header-v2__user-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: #334155;
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
}

.header-v2__user-item:hover {
  background: #f1f5f9;
  color: var(--brand);
}

.header-v2__user-item i { width: 18px; text-align: center; }

.header-v2__user-divider {
  height: 1px;
  background: var(--header-border);
  margin: 4px 0;
}

/* Nav bar */
.header-v2__nav {
  background: var(--header-bg-secondary);
  border-top: 1px solid var(--header-border);
}

.header-v2__nav-container { display: flex; align-items: center; }

.header-v2__nav-links { display: flex; width: 100%; }

.header-v2__nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--header-muted);
  font-weight: 500;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.header-v2__nav-link:hover,
.header-v2__nav-link.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ========== 分类卡片 ========== */
.cat-subcard {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.cat-subcard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #f1f5f9;
}

.cat-subcard-label {
  font-size: 12px;
  color: #94a3b8;
  margin-right: 8px;
}

.cat-subcard-title {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.cat-subcard-count {
  font-size: 13px;
  color: var(--muted);
}

.cat-subcard-body { padding: 12px 18px 16px; }

.cat-subcard-scroll {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.cat-pill img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.cat-pill:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.cat-pill.active {
  background: #eff6ff;
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 500;
}

.cat-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cbd5e1;
  flex-shrink: 0;
}

.cat-pill.active .cat-pill-dot { background: var(--brand); }

/* ========== 分类公告条 ========== */
.cat-notice-bar {
  position: relative;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
  padding: 12px 16px 12px 48px;
  margin-bottom: 16px;
  overflow: hidden;
}

.cat-notice-bar .bar-side {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, #f97316, #fb923c);
}

.cat-notice-bar .bar-content {
  font-size: 0.92rem;
  line-height: 1.55;
  color: #78350f;
  word-break: break-word;
}

.cat-notice-bar .bar-content a {
  color: var(--brand);
  text-decoration: underline;
}

/* ========== 排序栏 ========== */
.sort-filter-wrapper { margin-bottom: 16px; }

.sort-filter-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.sort-filter-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.sort-tabs {
  display: inline-flex;
  background: #f0f1f3;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.sort-tab {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.sort-tab:hover { color: #374151; }

.sort-tab.active {
  background: #fff;
  color: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 500;
}

.products-count {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.products-count-num {
  font-size: 1.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.products-count-label {
  color: #9ca3af;
  font-size: 0.8rem;
  font-weight: 500;
}

.sort-filter-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stock-seg {
  display: inline-flex;
  background: #f0f1f3;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.stock-seg-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: #6b7280;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.stock-seg-btn:hover { color: #374151; }

.stock-seg-btn.active {
  background: #fff;
  color: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-weight: 500;
}

.view-switch {
  display: inline-flex;
  background: #f0f1f3;
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.view-switch__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border: none;
  background: transparent;
  color: #9ca3af;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.view-switch__btn i { font-size: 1.05rem; }
.view-switch__btn:hover { color: #374151; }

.view-switch__btn.active {
  background: #fff;
  color: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.ref-banner {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.88rem;
}

/* ========== 商品列表 ========== */
.boxA {
  display: flex;
  flex-direction: column;
  gap: 0;
}

html.products-view-grid .boxA {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 14px;
}

.product-card-list { display: flex; }
.product-card-grid { display: none; }

html.products-view-grid .product-card-list { display: none !important; }
html.products-view-grid .product-card-grid { display: flex !important; }

.catalog-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  border: 1px solid #e8edf3;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  transition: all 0.22s ease;
  gap: 14px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

html.products-view-grid .catalog-item { margin-bottom: 0; }

.catalog-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(180deg, var(--brand), #56ccf2);
  opacity: 0.2;
  transition: width 0.18s ease;
}

.catalog-item:hover {
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
  transform: translateY(-2px);
  border-color: rgba(0, 111, 255, 0.22);
}

.catalog-item:hover::before { width: 4px; }

.catalog-item__thumb {
  flex: 0 0 132px;
  width: 132px;
  height: 132px;
  position: relative;
  background: #f8fafc;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid #eef2f7;
}

.thumb-wrap {
  position: absolute;
  inset: 0;
}

.thumb-wrap .catalog-item__placeholder {
  position: absolute;
  inset: 0;
}

.thumb-wrap .catalog-item__image,
.thumb-wrap img {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.catalog-item__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.catalog-item__image--contain {
  object-fit: contain;
  padding: 12px;
  background: #fff;
}

.catalog-item:hover .catalog-item__image { transform: scale(1.04); }

.catalog-item__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  background: linear-gradient(145deg, #3b82f6, #6366f1);
}

.catalog-item__placeholder--g { background: linear-gradient(145deg, #ef4444, #f97316); }
.catalog-item__placeholder--i { background: linear-gradient(145deg, #ec4899, #a855f7); }
.catalog-item__placeholder--t { background: linear-gradient(145deg, #0ea5e9, #0284c7); }

.catalog-item__content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 0;
}

.catalog-item__top-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.catalog-item__title {
  font-weight: 650;
  font-size: 1.14rem;
  margin: 0;
  line-height: 1.45;
  letter-spacing: -0.018em;
}

.catalog-item__link {
  color: #0f172a;
  text-decoration: none;
  transition: color 0.2s;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.catalog-item:hover .catalog-item__link { color: var(--brand); }

.catalog-item__desc {
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.seller-return-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.seller-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 0.72rem;
  font-weight: 600;
}

.seller-chip i { font-size: 0.7rem; color: #fb923c; }

.meta-inline {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 0.72rem;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.meta-item i { font-size: 11px; color: #94a3b8; }

.catalog-item__details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.catalog-item__meta-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.catalog-item__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.price-value {
  color: var(--danger) !important;
  font-size: 1.28rem;
  font-weight: 800;
}

.stock-text {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 500;
}

.stock-text--ok { color: #28a745; }

.delivery-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.delivery-badge--auto {
  background: #ecfdf5;
  color: #059669;
}

.format-line { display: none; }

.btn-buy {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 18px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  transition: background 0.2s, transform 0.15s;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-buy:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
}

.btn-buy:disabled,
.btn-buy.is-disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

.btn-buy--block { width: 100%; margin-top: 8px; justify-content: center; }

/* ========== 网格商品卡片 ========== */
.product-card-grid {
  flex-direction: column;
  background: #fff;
  border: 1px solid #e8edf3;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  transition: box-shadow 0.22s, transform 0.22s, border-color 0.22s;
  height: 100%;
}

.product-card-grid:hover {
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
  transform: translateY(-3px);
  border-color: rgba(0, 111, 255, 0.2);
}

.pcg-thumb {
  display: block;
  position: relative;
  height: 108px;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
  border-bottom: 1px solid #f1f5f9;
  overflow: hidden;
}

.pcg-thumb .thumb-wrap {
  position: absolute;
  inset: 0;
}

.pcg-thumb .thumb-wrap .catalog-item__placeholder {
  font-size: 1.5rem;
}

.pcg-thumb img,
.pcg-thumb .catalog-item__placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 72%;
  max-height: 72%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.pcg-thumb img.pcg-cover-photo {
  inset: 0;
  top: 0;
  left: 0;
  transform: none;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  border-radius: 0;
}

.pcg-thumb .catalog-item__placeholder {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  font-size: 1.5rem;
  transform: translate(-50%, -50%);
}

.pcg-body {
  padding: 12px 12px 14px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pcg-title {
  font-size: 0.98rem;
  font-weight: 650;
  line-height: 1.45;
  letter-spacing: -0.015em;
  color: #0f172a;
  margin: 0 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.85em;
  word-break: break-word;
}

.product-card-grid:hover .pcg-title { color: var(--brand); }

.pcg-seller-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.pcg-meta {
  margin-top: auto;
  padding-top: 8px;
}

.pcg-price {
  color: var(--danger);
  font-size: 1.22rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.pcg-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pcg-stock {
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 500;
}

.pcg-stock--ok { color: #16a34a; }

.pcg-stock__num { font-weight: 700; }

.pcg-delivery {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #bbf7d0;
}

.pcg-actions {
  margin-top: 10px;
}

.pcg-actions .btn-buy {
  width: 100%;
  justify-content: center;
  padding: 10px 12px;
}

.product-card-grid .seller-return-row {
  margin-bottom: 6px;
}

.product-card-grid .meta-inline {
  font-size: 0.68rem;
}

.product-card-grid .seller-chip {
  font-size: 0.68rem;
  padding: 1px 7px;
}

.pcg-actions .qty-input {
  display: none;
}

.btn-ghost {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.88rem;
}

.btn-ghost:hover { background: #f8fafc; }

.qty-input {
  width: 52px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.82rem;
  text-align: center;
}

/* ========== 其他页面 ========== */
.page-head {
  margin-bottom: 18px;
}

.page-head h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.page-head p {
  color: var(--muted);
  font-size: 0.88rem;
}

.sub-head {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 18px 0 10px;
  color: #334155;
}

.content-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.content-card input[type="number"],
.content-card input[type="text"],
.content-card input[type="email"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}

.form-hint {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

.pay-method-label {
  margin: 14px 0 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.pay-method-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.pay-method-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.pay-method-item i {
  font-size: 1.1rem;
}

.pay-method-item:hover {
  border-color: var(--brand);
}

.pay-method-item.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.order-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.order-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 0.92rem;
}

.tag {
  background: #dcfce7;
  color: #16a34a;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
}

.order-body .total {
  margin-top: 8px;
  font-weight: 600;
  color: var(--danger);
}

.delivery-box {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 8px;
  margin-top: 10px;
  overflow-x: auto;
}

.delivery-box pre {
  white-space: pre-wrap;
  word-break: break-all;
  font-family: Consolas, monospace;
  font-size: 0.82rem;
  margin: 4px 0;
}

.delivery-box.small { font-size: 0.78rem; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  background: var(--header-bg-secondary);
  padding: 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.stat span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat strong { font-size: 1.05rem; }

.ref-link label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.88rem;
}

.copy-row {
  display: flex;
  gap: 8px;
}

.copy-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
}

.comm-row, .log-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.log-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 20px;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

/* ========== Modal ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal {
  background: var(--card);
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.modal--wide { max-width: 560px; }

.modal--purchase {
  max-width: 780px;
  width: min(780px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
}

.purchase-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}

.purchase-modal__body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  padding-bottom: 8px;
}

.purchase-modal__head h2 {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 600;
}

.purchase-modal__close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0 4px;
}

.purchase-modal__close:hover { color: #475569; }

.purchase-modal__product {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 18px 28px 0;
  padding: 16px 18px;
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
  border: 1px solid #dbeafe;
  border-radius: 10px;
}

.purchase-modal__thumb {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: #f8fafc;
  border: 1px solid #eef2f7;
  position: relative;
}

/* 与商品列表共用 thumb 结构，保证图标一致 */
.purchase-modal__thumb .thumb-wrap {
  position: absolute;
  inset: 0;
}

.purchase-modal__thumb .thumb-wrap .catalog-item__image,
.purchase-modal__thumb .thumb-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 10px;
  background: #fff;
  z-index: 1;
}

.purchase-modal__thumb .thumb-wrap .catalog-item__image--contain {
  object-fit: contain;
  padding: 10px;
  background: #fff;
}

.purchase-modal__thumb .thumb-wrap .catalog-item__image:not(.catalog-item__image--contain) {
  object-fit: cover;
  padding: 0;
}

.purchase-modal__thumb .catalog-item__placeholder {
  position: absolute;
  inset: 0;
  font-size: 1.6rem;
  z-index: 0;
}

.purchase-modal__product-text {
  min-width: 0;
  flex: 1;
}

.purchase-modal__label {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 4px;
}

.purchase-modal__product-text strong {
  display: block;
  font-size: 1rem;
  font-weight: 650;
  color: var(--brand);
  line-height: 1.4;
  word-break: break-word;
}

.purchase-modal__stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 18px 28px 0;
}

.purchase-stat {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
}

.purchase-stat__label {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 6px;
}

.purchase-stat__value {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.purchase-stat__sub {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: #94a3b8;
}

.purchase-stat--total .purchase-stat__value {
  color: var(--danger);
  font-size: 1.12rem;
}

.purchase-modal__policy {
  margin: 16px 28px 0;
  padding: 10px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  font-size: 0.82rem;
  color: #92400e;
  text-align: center;
}

.purchase-modal__policy a {
  color: var(--brand);
  text-decoration: underline;
}

.purchase-modal__form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 24px;
  padding: 18px 28px 0;
  align-items: end;
}

.purchase-field {
  display: grid;
  grid-template-rows: auto auto;
  gap: 8px;
  min-width: 0;
}

.purchase-field label {
  font-size: 0.82rem;
  font-weight: 500;
  color: #334155;
  line-height: 1.4;
  min-height: 2.8em;
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
}

.purchase-qty-hint {
  font-weight: 400;
  color: #94a3b8;
  font-size: 0.75rem;
  margin-left: 4px;
}

.purchase-pay-method {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  font-size: 0.88rem;
  color: #334155;
  box-sizing: border-box;
}

.purchase-pay-method i {
  color: var(--brand);
  font-size: 1.1rem;
}

.purchase-balance {
  margin-left: auto;
  font-size: 0.78rem;
  color: #059669;
  font-weight: 600;
}

.purchase-pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.purchase-pay-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-size: 0.88rem;
  color: #334155;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.purchase-pay-option i {
  font-size: 1.2rem;
  color: var(--brand);
}

.purchase-pay-option.is-active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.12);
  background: #eff6ff;
}

.purchase-pay-option small {
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 500;
}

.qty-stepper {
  display: flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-sizing: border-box;
}

.qty-stepper__btn {
  width: 44px;
  height: 44px;
  border: none;
  background: #f8fafc;
  color: #334155;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qty-stepper__btn:hover:not(:disabled) { background: #eef2f7; }
.qty-stepper__btn:disabled { opacity: 0.45; cursor: not-allowed; }

.qty-stepper input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0;
  margin: 0;
  background: #fff;
  line-height: 44px;
  box-sizing: border-box;
  -moz-appearance: textfield;
}

.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.purchase-modal__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 20px auto 24px;
  padding: 12px 32px;
  min-width: 200px;
  max-width: 280px;
  width: auto;
  font-size: 0.95rem;
  border-radius: 8px;
  flex: 0 0 auto;
}

.purchase-modal__submit:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 520px) {
  .modal-overlay { padding: 12px; }
  .modal--purchase {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    border-radius: 14px;
  }

  .purchase-modal__head { padding: 14px 14px 10px; }

  .purchase-modal__product {
    margin: 12px 14px 0;
    padding: 12px 12px;
    gap: 12px;
  }

  .purchase-modal__thumb { width: 64px; height: 64px; }

  .purchase-modal__form { grid-template-columns: 1fr; }
  .purchase-modal__stats { grid-template-columns: 1fr; }

  .purchase-modal__stats { padding: 12px 14px 0; gap: 10px; }
  .purchase-stat { padding: 10px 10px; }

  .purchase-modal__policy { margin: 12px 14px 0; font-size: 0.8rem; }
  .purchase-modal__form { padding: 12px 14px 0; gap: 10px; }

  /* 底部按钮固定，避免被浏览器底栏遮挡 */
  .purchase-modal__submit {
    width: calc(100% - 16px);
    max-width: none;
    min-width: 0;
    margin: 12px auto 12px;
    padding: 12px 16px;
    border-radius: 12px;
    position: sticky;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 2;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  }

  .purchase-modal__body {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
}

.modal h2 {
  margin-bottom: 16px;
  font-size: 1.15rem;
}

.modal input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 0.9rem;
}

.modal--purchase .qty-stepper input {
  width: auto;
  flex: 1;
  height: 44px;
  padding: 0;
  margin: 0;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-radius: 0;
  text-align: center;
  line-height: 44px;
  font-size: 0.95rem;
  font-weight: 600;
  box-sizing: border-box;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: var(--header-bg-secondary);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
}

.auth-tab.active {
  background: var(--brand);
  color: #fff;
}

.register-hint {
  margin: -6px 0 10px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #64748b;
}

.captcha-row {
  margin-bottom: 10px;
}

.captcha-row label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.88rem;
  color: #334155;
}

.captcha-row__inputs {
  display: flex;
  gap: 8px;
  align-items: center;
}

.captcha-image {
  width: 132px;
  height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  background: #f8fafc;
  object-fit: cover;
}

.captcha-row__inputs input {
  flex: 1;
  margin-bottom: 0;
}

.captcha-row__inputs .btn-ghost {
  flex-shrink: 0;
  padding: 0 12px;
  white-space: nowrap;
}

/* ========== Toast & Footer ========== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1e293b;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  opacity: 0;
  transition: all 0.3s;
  z-index: 3000;
  font-size: 0.88rem;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: #16a34a; }
.toast.error { background: var(--danger); }
.toast.warn { background: #d97706; }

.site-footer {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  color: #cbd5e1;
  padding: 32px 16px 24px;
  margin-top: 24px;
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.site-footer__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-footer__logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  background: #fff;
}

.site-footer__logo-mark {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
}

.site-footer__brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
}

.site-footer__brand-text strong {
  color: #f8fafc;
  font-size: 1rem;
}

.site-footer__brand-text span {
  font-size: 0.78rem;
  color: #94a3b8;
}

.site-footer__nav,
.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
}

.site-footer__nav a,
.site-footer__legal a {
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.88rem;
  transition: color 0.15s;
}

.site-footer__nav a:hover,
.site-footer__legal a:hover {
  color: #60a5fa;
}

.site-footer__legal a {
  font-size: 0.8rem;
  color: #94a3b8;
}

.site-footer__copy {
  margin: 0;
  font-size: 0.75rem;
  color: #64748b;
}

.page-head--tutorial {
  margin-bottom: 8px;
}

.tutorial-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin-bottom: 14px;
  padding-bottom: 4px;
}

.tutorial-tab {
  flex-shrink: 0;
  padding: 10px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
}

.tutorial-tab.active {
  border-color: #ef4444;
  background: #fff;
  color: #dc2626;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.15);
}

.tutorial-risk-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-left: 4px solid #f59e0b;
  color: #92400e;
  font-size: 0.88rem;
  line-height: 1.5;
}

.tutorial-post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

.tutorial-post-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  min-height: 0;
}

.tutorial-post-card__cover {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 160px;
  margin-bottom: 0;
  border-radius: 0;
  background: linear-gradient(145deg, #dbeafe, #bfdbfe);
  overflow: hidden;
}

.tutorial-post-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tutorial-post-card__date {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 16px 0;
  font-size: 0.78rem;
  color: #94a3b8;
}

.tutorial-post-card--faq .tutorial-post-card__cover {
  background: linear-gradient(145deg, #dcfce7, #bbf7d0);
}

.tutorial-post-card--aftersales .tutorial-post-card__cover {
  background: linear-gradient(145deg, #ede9fe, #ddd6fe);
}

.tutorial-post-card--risk .tutorial-post-card__cover {
  background: linear-gradient(145deg, #fee2e2, #fecaca);
}

.tutorial-privacy-wrap {
  display: block;
}

.tutorial-privacy-panel {
  min-height: 180px;
}

.tutorial-post-card__letter {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.tutorial-post-card__title {
  margin: 10px 16px 8px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
  color: #0f172a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 0;
}

.tutorial-post-card__excerpt {
  flex: 1;
  margin: 0 16px 12px;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #64748b;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tutorial-post-card__btn {
  width: auto;
  margin: 0 16px 16px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--brand);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tutorial-post-card__btn:hover {
  background: transparent;
  color: #1d4ed8;
}

.tutorial-empty {
  grid-column: 1 / -1;
  padding: 48px 20px;
  text-align: center;
  color: #64748b;
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
}

.tutorial-empty i {
  font-size: 2rem;
  color: #94a3b8;
  margin-bottom: 8px;
}

.tutorial-empty p {
  margin: 0 0 4px;
  font-weight: 600;
  color: #334155;
}

.tutorial-empty span {
  font-size: 0.82rem;
}

.tutorial-post-modal__cover {
  margin: 0 0 16px;
  border-radius: 14px;
  overflow: hidden;
  max-height: 280px;
}

.tutorial-post-modal__cover img {
  width: 100%;
  height: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
}

.tutorial-post-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.tutorial-post-modal__head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.tutorial-post-modal__close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
}

.tutorial-post-modal__body {
  max-height: 50vh;
  overflow-y: auto;
  margin-bottom: 12px;
}

.page-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border: none;
  background: #f1f5f9;
  border-radius: 8px;
  color: #334155;
  cursor: pointer;
  font-size: 0.88rem;
}

.product-detail__hero {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  margin-bottom: 16px;
  align-items: start;
}

.product-detail__thumb {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.product-detail__thumb .thumb-wrap {
  position: absolute;
  inset: 0;
}

.product-detail__thumb .thumb-wrap .catalog-item__placeholder {
  position: absolute;
  inset: 0;
  font-size: 2rem;
}

.product-detail__thumb img,
.product-detail__thumb .catalog-item__placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 78%;
  max-height: 78%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.product-detail__thumb img.pcg-cover-photo,
.product-detail__thumb img.catalog-item__image:not(.catalog-item__image--contain) {
  inset: 0;
  top: 0;
  left: 0;
  transform: none;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  border-radius: 0;
}

.product-detail__thumb .catalog-item__image--contain {
  inset: 0;
  top: 0;
  left: 0;
  transform: none;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  padding: 10px;
  background: #fff;
}

.product-detail__summary {
  min-width: 0;
}

.product-detail__name {
  margin: 0 0 8px;
  font-size: 1.25rem;
  line-height: 1.35;
}

.product-detail__price-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.product-detail__price {
  font-size: 1.5rem;
  color: #dc2626;
}

.product-detail__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  font-size: 0.78rem;
}

.product-detail__stats {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.product-detail__stat {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.82rem;
  color: #64748b;
}

.product-detail__stat strong {
  display: block;
  margin-top: 4px;
  color: #0f172a;
  font-size: 1rem;
}

.product-detail__limit {
  margin: 0;
  font-size: 0.82rem;
  color: #64748b;
}

.detail-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 12px;
  padding-bottom: 4px;
}

.detail-tab {
  flex-shrink: 0;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  font-size: 0.85rem;
}

.detail-tab.active {
  border-color: var(--brand);
  background: #eff6ff;
  color: var(--brand);
  font-weight: 600;
}

.product-detail__panel {
  min-height: 120px;
}

.product-detail__buy {
  width: 100%;
  margin-top: 16px;
  justify-content: center;
}

.rich-list {
  margin: 8px 0 12px;
  padding-left: 20px;
}

.rich-list li {
  margin-bottom: 6px;
  line-height: 1.6;
}

.rich-qa {
  margin: 8px 0;
  line-height: 1.6;
}

.delivery-format {
  white-space: pre-wrap;
  word-break: break-all;
  padding: 12px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.88rem;
}

.register-label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.88rem;
  color: #334155;
}

.register-label .required {
  color: #dc2626;
}

#register-form select {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.92rem;
  background: #fff;
}

@media (max-width: 640px) {
  .tutorial-post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .tutorial-post-card {
    min-height: 180px;
    padding: 12px 10px 10px;
  }

  .site-footer__nav {
    gap: 6px 14px;
  }

  .product-detail__hero {
    grid-template-columns: 88px 1fr;
    gap: 12px;
  }

  .product-detail__thumb {
    width: 88px;
    height: 88px;
  }
}

/* ========== Responsive ========== */
/* 手机/平板：两行头部 + 隐藏顶栏（底部导航已覆盖） */
@media (max-width: 899px) {
  .header-v2__nav { display: none; }

  .header-v2__main { padding: 8px 0; }

  .header-v2__container {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 8px 10px;
  }

  .header-v2__logo {
    grid-column: 1;
    grid-row: 1;
    gap: 8px;
    min-width: 0;
  }

  .logo-img {
    height: 34px;
    width: auto;
    max-width: 34px;
    border-radius: 8px;
    object-fit: cover;
  }

  .logo-name {
    display: block;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 42vw;
  }

  .header-v2__actions {
    grid-column: 2;
    grid-row: 1;
    margin-left: 0;
    flex-shrink: 0;
  }

  .header-v2__search {
    grid-column: 1 / -1;
    grid-row: 2;
    flex: none;
    min-width: 0;
    max-width: none;
  }

  .header-v2__search-input {
    padding: 8px 12px;
    font-size: 0.88rem;
  }

  .header-v2__search-btn {
    padding: 8px 14px;
  }

  .header-v2__balance { display: none; }

  .header-v2__auth { gap: 6px; }

  .header-v2__auth-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .header-v2__user-btn {
    padding: 2px;
    border-radius: 50%;
    border: none;
    background: transparent;
  }

  .header-v2__user-btn #user-name,
  .header-v2__user-btn .la-angle-down { display: none; }

  .header-v2__user-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }

  .page-main { padding-top: 10px; }

  .home-hero {
    min-height: 0;
    height: auto;
  }
  .home-hero__content {
    display: block;
    grid-template-columns: none;
    padding: 14px 12px 10px;
    gap: 0;
  }
  .home-hero__stats { display: none; }
}

@media (max-width: 768px) {
  .sort-filter-inner { flex-direction: column; align-items: stretch; }
  .sort-filter-right { justify-content: space-between; }
  html.products-view-grid .boxA {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }
  .catalog-item__thumb {
    flex: 0 0 100px;
    width: 100px;
    height: 100px;
  }
  .catalog-item__title { font-size: 1rem; }
  .pcg-title { font-size: 0.9rem; min-height: 2.6em; }
  .btn-buy { padding: 8px 14px; font-size: 0.8rem; }
}

@media (max-width: 576px) {
  .catalog-item {
    align-items: flex-start;
    padding: 10px;
  }
  .catalog-item__details {
    flex-direction: column;
    align-items: stretch;
  }
  .catalog-item__meta-left { gap: 8px; }
  .btn-buy { width: 100%; text-align: center; }
}

/* ========== 首页 / 底部导航 / 个人中心菜单 ========== */
body { padding-bottom: 72px; }

.logo-img {
  height: 40px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
}

.page-main { padding-bottom: 16px; }

.home-page { display: flex; flex-direction: column; gap: 20px; }

/* Hero */
.home-hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  min-height: 380px;
  background-color: #0f172a;
  background-image: url('/images/big.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.home-hero--has-bg { background-color: #0f172a; }

.home-hero__overlay {
  display: none;
}

.home-hero--has-bg .home-hero__overlay {
  display: none;
}

.home-hero__decor {
  display: none;
}

.home-hero__content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: center;
  padding: 40px 36px;
}

.home-hero__inner { color: #fff; max-width: 560px; }

.home-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 0.78rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.home-hero__title {
  margin: 0 0 12px;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.home-hero__subtitle {
  margin: 0 0 26px;
  opacity: 0.92;
  line-height: 1.7;
  font-size: 0.98rem;
  max-width: 520px;
}

.home-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.home-hero__btn {
  min-width: 148px;
  justify-content: center;
  padding: 11px 22px;
  font-size: 0.92rem;
  border-radius: 10px;
}

.home-hero__btn--primary {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.home-hero__btn--primary:hover {
  background: #f8fafc;
  color: var(--brand-hover);
}

.home-hero__btn--ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.home-hero__btn--ghost:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.home-hero__stats {
  display: grid;
  gap: 12px;
}

.home-stat-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  color: #fff;
}

.home-stat-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.home-stat-card strong {
  font-size: 1rem;
  font-weight: 700;
}

.home-stat-card span {
  font-size: 0.78rem;
  opacity: 0.85;
}

/* Features strip */
.home-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.home-feature {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  min-height: 108px;
}

.home-feature:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

.home-feature__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.home-feature__icon i {
  font-size: 1.45rem;
  line-height: 1;
}

.home-feature--blue .home-feature__icon { background: linear-gradient(135deg, #dbeafe, #eff6ff); color: #2563eb; }
.home-feature--green .home-feature__icon { background: linear-gradient(135deg, #bbf7d0, #ecfdf5); color: #059669; }
.home-feature--purple .home-feature__icon { background: linear-gradient(135deg, #ddd6fe, #f5f3ff); color: #7c3aed; }
.home-feature--orange .home-feature__icon { background: linear-gradient(135deg, #fed7aa, #fff7ed); color: #ea580c; }

.home-feature__body {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.home-feature__title {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
  line-height: 1.3;
}

.home-feature__desc {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.55;
}

/* Panels */
.home-panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 22px 24px;
  box-shadow: var(--shadow);
}

.home-section { margin-bottom: 0; }

.home-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.home-section__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 4px;
}

.home-section__label--light { color: #93c5fd; }

.home-section__head h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.home-section__head--light h2 { color: #fff; }

.home-link-btn {
  border: none;
  background: #eff6ff;
  color: var(--brand);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s;
}

.home-link-btn:hover { background: #dbeafe; }

.link-btn {
  border: none;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  font-size: 0.88rem;
}

/* Categories */
.home-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.home-cat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  border-radius: 14px;
  padding: 16px;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  text-align: left;
}

.home-cat-card:hover {
  transform: translateY(-2px);
  border-color: #93c5fd;
  box-shadow: 0 12px 28px rgba(59, 130, 246, 0.12);
}

.home-cat-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #eef2f7;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.home-cat-card__icon img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }

.home-cat-card__letter {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--brand);
}

.home-cat-card__info { flex: 1; min-width: 0; }

.home-cat-card__name {
  font-size: 0.95rem;
  font-weight: 650;
  color: #0f172a;
}

.home-cat-card__meta {
  margin-top: 4px;
  font-size: 0.76rem;
  color: var(--muted);
}

.home-cat-card__arrow {
  color: #cbd5e1;
  font-size: 1.1rem;
  transition: color 0.2s, transform 0.2s;
}

.home-cat-card:hover .home-cat-card__arrow {
  color: var(--brand);
  transform: translateX(2px);
}

/* Featured products */
.home-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.home-product-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s, transform 0.2s;
}

.home-product-card:hover {
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.home-product-card__thumb {
  position: relative;
  height: 150px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.home-product-card__thumb .thumb-wrap {
  position: absolute;
  inset: 0;
}

.home-product-card__thumb .thumb-wrap,
.home-product-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-product-card__body { padding: 14px; }

.home-product-card__cat {
  font-size: 0.72rem;
  color: var(--brand);
  font-weight: 600;
  margin-bottom: 6px;
}

.home-product-card__title {
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.45;
  min-height: 2.8em;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-product-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.home-product-card__price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--brand);
}

.home-product-card__stock {
  font-size: 0.76rem;
  color: var(--muted);
}

.home-product-card__buy {
  width: 100%;
  justify-content: center;
}

/* Flow */
.home-flow {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 0;
  background-color: #0b1220;
  background-image: url('/images/small.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.home-flow__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.25) 0%, rgba(15, 23, 42, 0.45) 100%);
}

.home-flow__inner {
  position: relative;
  z-index: 1;
  padding: 28px 24px 30px;
}

.home-flow__steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.home-flow__step {
  position: relative;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 18px 16px;
  color: #fff;
  min-height: 132px;
}

.home-flow__step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.home-flow__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
}

.home-flow__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.home-flow__text {
  display: block;
  line-height: 1.55;
  font-size: 0.88rem;
  font-weight: 500;
}

.home-flow__arrow {
  display: none;
}

/* Contact */
.home-contact {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 55%, #f8fafc 100%);
  background-size: cover;
  background-position: center;
  border: 1px solid #dbeafe;
}

.home-contact__overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.72);
  pointer-events: none;
}

.home-contact__inner {
  position: relative;
  z-index: 1;
  padding: 28px 24px 30px;
}

.home-contact__head { margin-bottom: 18px; }

.home-contact__head h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.home-contact__head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.contact-cards--inline { margin-top: 10px; }

.contact-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s;
}

.contact-card:hover {
  transform: translateY(-1px);
  border-color: #93c5fd;
}

.contact-card i {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #eff6ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--brand);
  flex-shrink: 0;
}

.contact-card strong { display: block; font-size: 0.78rem; color: #64748b; margin-bottom: 2px; }

.contact-card span { font-size: 0.92rem; word-break: break-all; color: #0f172a; font-weight: 500; }

.contact-card--compact { padding: 10px 12px; }

.contact-empty {
  text-align: center;
  padding: 36px 20px;
  border: 1px dashed #cbd5e1;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
}

.contact-empty__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: #eff6ff;
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.contact-empty p {
  margin: 0 0 6px;
  font-weight: 600;
  color: #334155;
}

.contact-empty small {
  color: var(--muted);
  font-size: 0.82rem;
}

.contact-note {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  color: #64748b;
  font-size: 0.85rem;
  text-align: center;
}

.home-rich-text { line-height: 1.7; color: #334155; }

@media (min-width: 900px) {
  .home-hero { min-height: 320px; }
}

@media (max-width: 992px) {
  .home-hero__content { grid-template-columns: 1fr; }
  .home-hero__stats { grid-template-columns: repeat(3, 1fr); }
  .home-features { grid-template-columns: repeat(2, 1fr); }
  .home-flow__steps { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .home-hero { border-radius: 12px; box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1); }
  .home-hero__decor { display: none; }
  .home-hero__content { padding: 10px 12px 8px; }
  .home-hero__badge { display: none; }
  .home-hero__title {
    font-size: 1rem;
    margin-bottom: 4px;
    line-height: 1.25;
  }
  .home-hero__subtitle {
    font-size: 0.75rem;
    margin-bottom: 8px;
    line-height: 1.4;
  }
  .home-hero__actions { gap: 6px; margin-bottom: 0; }
  .home-hero__btn {
    min-width: 0;
    flex: 1;
    padding: 7px 8px;
    font-size: 0.78rem;
    border-radius: 8px;
  }
  .home-page { gap: 10px; }
  .home-features { display: none; }
  .home-panel { padding: 16px 14px; border-radius: 14px; }
  .home-cat-grid { grid-template-columns: 1fr; }
  .home-product-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  .home-flow { border-radius: 12px; box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12); }
  .home-flow__inner { padding: 12px 12px 14px; }
  .home-flow .home-section__head { margin-bottom: 8px; align-items: center; }
  .home-flow .home-section__label { font-size: 0.62rem; margin-bottom: 2px; }
  .home-flow .home-section__head h2 { font-size: 0.95rem; }
  .home-flow__steps {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .home-flow__step {
    min-height: 0;
    padding: 10px 8px;
    border-radius: 10px;
  }
  .home-flow__step-top { margin-bottom: 6px; }
  .home-flow__num {
    width: 22px;
    height: 22px;
    font-size: 0.72rem;
  }
  .home-flow__icon {
    width: 26px;
    height: 26px;
    font-size: 0.85rem;
    border-radius: 8px;
  }
  .home-flow__text {
    font-size: 0.74rem;
    line-height: 1.35;
  }
}

.profile-menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.profile-menu__item {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 14px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-size: 0.85rem;
}

.profile-menu__item i { font-size: 1.3rem; color: var(--brand); }

.after-sales-card { margin-top: 16px; }

.after-sales-box {
  margin-top: 16px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
}

.order-detail-btn { margin-top: 10px; }

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.modal-actions .btn-buy,
.modal-actions .btn-ghost { flex: 1; justify-content: center; }

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1500;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.06);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav__item {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 4px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #64748b;
  font-size: 0.72rem;
  cursor: pointer;
}

.bottom-nav__item i { font-size: 1.25rem; }

.bottom-nav__item.active { color: var(--brand); font-weight: 600; }

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
}
