:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --border: rgba(15, 23, 42, 0.06);
  --text: #1e293b;
  --text-soft: #64748b;
  --primary: #3b82f6;
  --primary-2: #06b6d4;
  --accent-grad: linear-gradient(135deg, #3b82f6, #06b6d4);
  --success: #10b981;
  --danger: #ef4444;
  --chip: #eef2ff;
  --shadow: 0 6px 20px -10px rgba(15, 23, 42, 0.25);
  --shadow-lg: 0 12px 30px -12px rgba(15, 23, 42, 0.35);
  --radius: 16px;
  --radius-sm: 12px;
}
[data-theme="dark"] {
  --bg: #070b16;
  --surface: #111827;
  --surface-2: #0d1424;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e8edf7;
  --text-soft: #94a3b8;
  --chip: #1c2540;
  --shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 16px 40px -10px rgba(0, 0, 0, 0.9);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text);
  transition: background-color .3s, color .3s;
  -webkit-font-smoothing: antialiased;
}
.app-shell { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; flex: 0 0 auto; }
.search-ic { display: flex; align-items: center; color: var(--text-soft); }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; padding: 12px 16px 10px; background: var(--surface); border-bottom: 1px solid var(--border); }
.topbar .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.brand .logo { width: 26px; height: 26px; border-radius: 8px; background: var(--accent-grad); display: grid; place-items: center; color: #fff; font-size: 14px; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; font-size: 17px; border: 1px solid var(--border); }

.search { margin-top: 10px; display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 10px 14px; }
.search input { border: none; background: none; outline: none; flex: 1; font-size: 15px; color: var(--text); }

/* ---------- content ---------- */
.view { flex: 1; overflow-y: auto; padding-bottom: 90px; position: relative; }
.view.no-scroll { overflow: hidden; padding-bottom: 0; }
.view.no-scroll .products-page { position: absolute; inset: 0; height: auto; }
.section-title { font-size: 16px; font-weight: 700; margin: 22px 16px 12px; display: flex; align-items: center; justify-content: space-between; }
.section-title .more { font-size: 12px; color: var(--text-soft); font-weight: 500; }

/* hero / banner */
.hero { margin: 16px 16px 12px; border-radius: var(--radius); padding: 26px 22px; background: var(--accent-grad); color: #fff; box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -20px; top: -20px; width: 140px; height: 140px; background: rgba(255,255,255,0.12); border-radius: 50%; }
.hero h1 { margin: 0 0 8px; font-size: 22px; position: relative; z-index: 1; }
.hero p { margin: 0; opacity: .92; font-size: 13px; line-height: 1.5; position: relative; z-index: 1; }

/* category grid - mini app style 5 columns */
.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; padding: 0 16px; }
.cat-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: transform .15s; }
.cat-item:active { transform: scale(.95); }
.cat-ico { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; color: #fff; }
.cat-ico .ic { width: 28px; height: 28px; color: #fff; }
.cat-ico .ic svg { width: 100%; height: 100%; }
.cat-item > span { font-size: 12px; color: var(--text-soft); }
.cat-more .cat-ico { background: linear-gradient(135deg, #94a3b8, #64748b) !important; }

/* categories total page */
.categories-page { padding: 0 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.cat-section { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.cat-section:active { transform: scale(.98); }
.cat-section-head { display: flex; align-items: center; gap: 12px; }
.cat-section-info { flex: 1; min-width: 0; }
.cat-section-name { font-weight: 600; font-size: 15px; color: var(--text); }
.cat-section-meta { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.cat-section-arrow { width: 18px; height: 18px; color: var(--text-soft); }
.cat-children { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.cat-child {
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap;
  background: var(--chip); border: 1px solid color-mix(in srgb, var(--cat-color, var(--primary)) 30%, var(--border));
  box-shadow: 0 2px 6px -3px color-mix(in srgb, var(--cat-color, var(--primary)) 25%, transparent);
  text-decoration: none; transition: all .18s cubic-bezier(.16,1,.3,1);
}
.cat-child:hover { background: color-mix(in srgb, var(--cat-color, var(--primary)) 10%, var(--chip)); border-color: color-mix(in srgb, var(--cat-color, var(--primary)) 50%, var(--border)); transform: translateY(-1px); }
.cat-child:active { background: var(--cat-color, var(--primary)); color: #fff; border-color: var(--cat-color, var(--primary)); transform: translateY(0); box-shadow: none; }

/* banner cards */
.banner-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 0 16px; }
.banner-card {
  min-height: 132px; border-radius: var(--radius); position: relative; overflow: hidden;
  display: flex; align-items: flex-end; padding: 14px; color: #fff;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  box-shadow: 0 10px 24px -10px rgba(59, 130, 246, .45);
  transition: transform .28s cubic-bezier(.16,1,.3,1), box-shadow .28s ease;
}
.banner-card.brand { background: linear-gradient(135deg, #8b5cf6, #ec4899); box-shadow: 0 10px 24px -10px rgba(139, 92, 246, .45); }
.banner-card:active { transform: scale(.97); }
.banner-card:hover { transform: translateY(-4px); box-shadow: 0 16px 34px -10px rgba(59, 130, 246, .55); }
.banner-card.brand:hover { box-shadow: 0 16px 34px -10px rgba(139, 92, 246, .55); }
.banner-glow {
  position: absolute; right: -40px; top: -40px; width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle at center, rgba(255,255,255,.35), rgba(255,255,255,0) 70%); filter: blur(10px); pointer-events: none;
}
.banner-deco { position: absolute; right: 0; top: 0; width: 120px; height: 120px; pointer-events: none; opacity: .9; }
.banner-body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 5px; }
.banner-tag { align-self: flex-start; padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.22); backdrop-filter: blur(4px); font-size: 10px; font-weight: 700; letter-spacing: .5px; }
.banner-title { font-weight: 800; font-size: 15px; line-height: 1.3; text-shadow: 0 1px 2px rgba(0,0,0,.12); }
.banner-desc { font-size: 11px; opacity: .86; line-height: 1.3; }
.banner-more { display: inline-flex; align-items: center; gap: 3px; margin-top: 3px; font-size: 11px; font-weight: 700; opacity: .95; }
.banner-more .ic { font-size: 12px; }

/* product card - large image */
.prod-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 16px; }
.prod-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; position: relative; transition: transform .15s, box-shadow .2s; box-shadow: var(--shadow); }
.prod-card:active { transform: translateY(1px); }
.prod-cover { width: 100%; aspect-ratio: 1/1; border-radius: var(--radius-sm); display: grid; place-items: center; margin-bottom: 10px; overflow: hidden; position: relative; /*background: #f1f4f9;*/background: #ffffff;  }
.prod-cover .cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: scale-down; border-radius: inherit; }
.prod-cover .cover-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.prod-cover .cover-fallback svg { width: 48%; height: 48%; }
.prod-name { font-size: 14px; font-weight: 600; line-height: 1.35; height: 38px; overflow: hidden; }
.prod-meta { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; margin-top: 8px; }
.prod-price { color: var(--success); font-weight: 800; font-size: 14px; white-space: nowrap; line-height: 1.25; }
.fav-btn { position: absolute; top: 16px; right: 14px; font-size: 18px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.2)); display: grid; place-items: center; }
.brand-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-soft); background: var(--chip); padding: 3px 9px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; max-width: 42%; overflow: hidden; text-overflow: ellipsis; border: 1px solid var(--border); }

/* product list row (left thumb right text) */
.prod-list { padding: 0 16px; }
.prod-row { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px; margin-bottom: 10px; transition: transform .18s cubic-bezier(.16,1,.3,1), box-shadow .2s ease, border-color .2s ease; box-shadow: var(--shadow); }
.prod-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--primary) 22%, var(--border)); }
.prod-row:active { transform: translateY(0); }
.prod-row .thumb { width: 92px; height: 92px; border-radius: var(--radius-sm); overflow: hidden; position: relative; flex-shrink: 0; background: #ffffff; border: 1px solid var(--border); }
.prod-row .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: scale-down; }
.prod-row .thumb .fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.prod-row .thumb .fallback svg { width: 50%; height: 50%; }
.prod-row .info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; min-height: 92px; }
.prod-row .info .upper { display: flex; flex-direction: column; gap: 6px; }
.prod-row .info .name { font-size: 15px; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod-row .info .desc { font-size: 12px; color: var(--text-soft); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; }
.prod-row .info .price-row { display: flex; align-items: center; }
.prod-row .info .brand-row { display: flex; justify-content: flex-end; margin-top: 4px; }

/* brand wall */
.brand-wall { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 0 16px; }
.brand-chip { background: #fff; border: 1px solid var(--border); border-radius: 14px; aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 6px; transition: transform .15s, box-shadow .15s; box-shadow: 0 2px 8px rgba(0,0,0,.04); overflow: hidden; }
.brand-chip:active { transform: scale(.96); }
.brand-logo { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; }
.brand-logo-img { width: 100%; height: 100%; object-fit: contain; }
.brand-logo-txt { width: 100%; height: 100%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 28px; border-radius: 12px; }

/* brand page header */
.brand-page-header { margin: 14px 16px 10px; padding: 22px 20px; border-radius: 22px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.brand-page-header::before { content: ''; position: absolute; left: 0; top: 0; width: 5px; height: 100%; background: var(--accent-grad); }
.brand-page-header::after { content: ''; position: absolute; right: -28px; top: -28px; width: 110px; height: 110px; background: var(--accent-grad); opacity: .12; border-radius: 50%; filter: blur(22px); }
.brand-page-title { font-size: 26px; font-weight: 900; letter-spacing: -0.6px; background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; position: relative; z-index: 1; }
.brand-page-sub { font-size: 13px; color: var(--text-soft); margin-top: 6px; display: flex; align-items: center; gap: 7px; position: relative; z-index: 1; }
.brand-page-sub::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* brand grouped section */
.brand-cat-title { margin: 26px 16px 14px; display: flex; align-items: center; justify-content: space-between; }
.brand-cat-title:first-of-type { margin-top: 18px; }
.brand-cat-title .cat-name { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; color: var(--text); }
.brand-cat-title .cat-name::before { content: ''; width: 4px; height: 18px; border-radius: 4px; background: var(--accent-grad); flex-shrink: 0; }
.brand-cat-title .cat-count { font-size: 12px; font-weight: 600; color: var(--primary); background: var(--primary-soft); padding: 5px 11px; border-radius: 999px; }
.brand-logo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 0 16px; }
.brand-logo-grid .brand-chip { width: auto; }

/* products page: left L1 tree + top L2 chips + right list */
.products-page { display: flex; height: 100%; overflow: hidden; }
.cat-tree { width: 96px; flex-shrink: 0; background: var(--surface-2); border-right: 1px solid var(--border); overflow-y: auto; }
.cat-tree .tree-item { padding: 14px 9px; font-size: 13px; color: var(--text-soft); text-align: center; border-left: 3px solid transparent; line-height: 1.35; min-height: 52px; display: flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.cat-tree .tree-item.active { background: var(--surface); color: var(--primary); border-left-color: var(--primary); font-weight: 700; box-shadow: inset 0 0 0 1px var(--border); }
.cat-tree .tree-item:not(.active):active { background: rgba(59,130,246,.08); }
.product-col { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.prod-search-bar { display: flex; align-items: center; gap: 8px; margin: 12px; padding: 10px 15px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow); flex-shrink: 0; z-index: 11; transition: border-color .2s ease, box-shadow .2s ease; }
.prod-search-bar:focus-within { border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--primary) 35%, transparent); }
.prod-search-bar .search-icon { color: var(--text-soft); font-size: 18px; display: grid; place-items: center; }
.prod-search-bar .search-icon .ic { width: 18px; height: 18px; }
.prod-search-bar .search-input { flex: 1; border: none; background: transparent; outline: none; font-size: 14px; color: var(--text); min-width: 0; }
.prod-search-bar .search-input::placeholder { color: var(--text-soft); opacity: .65; }
.prod-search-bar .search-clear { width: 20px; height: 20px; border-radius: 50%; border: none; background: var(--surface-2); color: var(--text-soft); display: none; align-items: center; justify-content: center; cursor: pointer; font-size: 11px; padding: 0; transition: background .15s; }
.prod-search-bar .search-clear:active { background: var(--border); }
.prod-search-bar .search-clear .ic { width: 12px; height: 12px; }
.subcat-bar { display: none; gap: 8px; padding: 10px 12px; background: var(--bg); border-bottom: 1px solid var(--border); overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; flex-shrink: 0; z-index: 10; }
.subcat-bar::-webkit-scrollbar { display: none; }
.subcat-chip { flex-shrink: 0; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--text-soft); background: var(--surface); border: 1px solid var(--border); cursor: pointer; transition: all .18s; }
.subcat-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.subcat-chip:not(.active):active { background: var(--primary-soft); color: var(--primary); border-color: var(--primary-soft); }
.prod-list-wrap { flex: 1; overflow-y: auto; padding: 12px; }
.product-col .cat-name { font-size: 15px; font-weight: 700; padding: 8px 16px; }

/* ---------- product detail page ---------- */
.pd-page { padding-bottom: 24px; }

/* 沉浸式图库 */
.detail-gallery { position: relative; /*background: var(--surface-2);*/ background: #fff; }
.detail-gallery.empty { min-height: 260px; }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide { flex: 0 0 100%; scroll-snap-align: center; position: relative; overflow: hidden; aspect-ratio: 4/3; max-height: 420px; }
.gallery-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: scale-down; }
.gallery-slide .cover-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-soft); }
.gallery-slide .cover-fallback svg { width: 22%; height: 22%; opacity: .5; }
.gallery-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 2; }
.gd-inner { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(0,0,0,.28); backdrop-filter: blur(8px); }
.g-dot { width: 7px; height: 7px; padding: 0; border: none; border-radius: 50%; background: rgba(255,255,255,.55); cursor: pointer; transition: width .25s, border-radius .25s, background .25s; }
.g-dot.active { width: 18px; border-radius: 4px; background: #fff; }
.detail-cover { width: 100%; aspect-ratio: 4/3; max-height: 420px; display: grid; place-items: center; overflow: hidden; position: relative; background: var(--surface-2); }
.detail-cover .cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.detail-cover .cover-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-soft); }
.detail-cover .cover-fallback svg { width: 22%; height: 22%; opacity: .5; }

/* 主信息卡片：叠加在图库下方 */
.pd-info-card { margin: 20px 16px 16px; position: relative; z-index: 2; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 18px; box-shadow: var(--shadow-lg); }
.pd-price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.pd-price { font-size: 28px; font-weight: 900; color: var(--success); letter-spacing: -.5px; }
.pd-price.negotiable { font-size: 22px; font-weight: 800; color: var(--text-soft); }
.pd-price-label { font-size: 12px; color: var(--text-soft); background: var(--surface-2); padding: 3px 8px; border-radius: 999px; }
.pd-title { font-size: 22px; font-weight: 800; line-height: 1.35; margin: 0 0 12px; color: var(--text); }
.pd-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.pd-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-soft); background: var(--surface-2); }
.pd-tag .ic { width: 13px; height: 13px; }
.pd-tag.brand { color: var(--primary); background: rgba(59,130,246,.08); border-color: rgba(59,130,246,.15); }

/* 通用详情卡片 */
.pd-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 12px 16px; }
.pd-section-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; margin-bottom: 12px; color: var(--text); }
.pd-section-title .ic { width: 18px; height: 18px; color: var(--primary); }
.empty-detail { margin: 0; color: var(--text-soft); font-size: 14px; line-height: 1.7; }

/* 旧 block 兼容（万一其他页面仍用） */
.block { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 14px 16px; }
.block h3 { margin: 0 0 10px; font-size: 15px; }
.block p { margin: 0; color: var(--text-soft); line-height: 1.7; font-size: 14px; white-space: pre-wrap; }

/* 富文本详情渲染 */
.rte-content { color: var(--text-soft); line-height: 1.75; font-size: 14px; word-break: break-word; }
/* 纯文本详情（如 Excel 导入的规格）：保留原始换行格式 */
.rte-plain { color: var(--text-soft); line-height: 1.75; font-size: 14px; word-break: break-word; white-space: pre-wrap; }
.rte-content > :first-child { margin-top: 0; }
.rte-content > :last-child { margin-bottom: 0; }
.rte-content p { margin: 0 0 10px; }
.rte-content h1, .rte-content h2, .rte-content h3, .rte-content h4 { margin: 14px 0 8px; line-height: 1.4; color: var(--text); }
.rte-content h1 { font-size: 19px; } .rte-content h2 { font-size: 17px; } .rte-content h3 { font-size: 15px; } .rte-content h4 { font-size: 14px; }
.rte-content ul, .rte-content ol { margin: 0 0 10px; padding-left: 22px; }
.rte-content li { margin: 4px 0; }
.rte-content a { color: var(--brand, #2f6bff); text-decoration: underline; }
.rte-content img { max-width: 100%; border-radius: 10px; margin: 6px 0; display: block; }
.rte-content table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 13px; }
.rte-content th, .rte-content td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; }
.rte-content blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--brand, #2f6bff); background: var(--chip); color: var(--text-soft); }
.rte-content code { background: var(--chip); padding: 1px 5px; border-radius: 5px; font-size: 13px; }

/* membership gate */
.gate-card { padding-bottom: 8px; }
.gate { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); min-height: 170px; background: var(--surface-2); }
.gate .blur { filter: blur(7px); opacity: .45; padding: 16px; color: var(--text-soft); line-height: 1.7; font-size: 14px; user-select: none; }
.gate .mask { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 22px; background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.55)); }
[data-theme="dark"] .gate .mask { background: linear-gradient(180deg, rgba(10,15,30,.4), rgba(10,15,30,.85)); }
.gate .lock { width: 52px; height: 52px; border-radius: 50%; background: rgba(15,23,42,.08); display: grid; place-items: center; font-size: 24px; color: var(--text); margin-bottom: 10px; }
.gate .mask p { margin: 0 0 14px; font-size: 13px; color: var(--text-soft); line-height: 1.5; }
.gate .mask .btn { max-width: 180px; box-shadow: var(--shadow); }

/* contact card */
.contact-section { padding-bottom: 8px; }
.contact-card { display: flex; align-items: center; gap: 12px; padding: 4px 2px; }
.contact-ava { width: 50px; height: 50px; border-radius: 50%; background: var(--accent-grad); display: grid; place-items: center; color: #fff; font-size: 22px; flex-shrink: 0; box-shadow: var(--shadow); }
.contact-info { flex: 1; min-width: 0; }
.contact-info .nm { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.contact-info .nm .title { font-size: 12px; font-weight: 600; color: var(--text-soft); background: var(--surface-2); padding: 2px 7px; border-radius: 999px; }
.contact-info .sub { font-size: 13px; color: var(--text-soft); margin-top: 4px; }
.contact-tip { font-size: 11px; color: var(--primary); margin-top: 6px; }
.contact-actions { display: flex; gap: 8px; }
.contact-actions .act { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; color: #fff; border: none; transition: transform .12s; }
.contact-actions .act:active { transform: scale(.92); }
.contact-actions .act.phone { background: linear-gradient(135deg, #10b981, #34d399); }
.contact-actions .act.wechat { background: linear-gradient(135deg, #22c55e, #4ade80); }

/* sticky action bar */
#action-slot { display: contents; }
.action-bar { position: fixed; bottom: calc(58px + env(safe-area-inset-bottom) + 8px); left: 50%; transform: translateX(-50%); width: calc(100% - 32px); max-width: 448px; display: flex; gap: 10px; padding: 10px; background: rgba(255,255,255,.82); border: 1px solid rgba(15,23,42,.06); border-radius: 18px; box-shadow: 0 -8px 28px rgba(2,6,23,.1); backdrop-filter: blur(16px) saturate(180%); z-index: 30; }
[data-theme="dark"] .action-bar { background: rgba(17,24,39,.78); border-color: rgba(255,255,255,.08); }
.app-shell.no-tabbar .action-bar { bottom: calc(env(safe-area-inset-bottom) + 8px); }
.btn { flex: 1; padding: 13px; border-radius: 14px; font-weight: 700; font-size: 15px; text-align: center; transition: transform .12s; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:active { transform: scale(.97); }
.btn .ic { width: 17px; height: 17px; }
.btn-primary { background: var(--accent-grad); color: #fff; box-shadow: 0 4px 14px -4px rgba(59,130,246,.45); }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--border); }
.btn-fav { flex: 0 0 48px; height: 48px; background: var(--surface-2); border: 1px solid var(--border); font-size: 20px; display: grid; place-items: center; border-radius: 14px; transition: transform .12s, color .2s, background .2s; }
.btn-fav:active { transform: scale(.92); }
.btn-fav.is-fav { color: #ef4444; border-color: rgba(239,68,68,.3); background: rgba(239,68,68,.08); }
.btn-consult { flex: 2.2; }

/* share panel */
.share-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(4px); display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .28s; z-index: 60; }
.share-mask.show { opacity: 1; pointer-events: auto; }
.share-sheet { width: 100%; max-width: 480px; background: var(--surface); border-radius: 24px 24px 0 0; padding: 18px 20px calc(18px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .32s cubic-bezier(.16,1,.3,1); box-shadow: 0 -12px 40px -12px rgba(0,0,0,.25); }
.share-mask.show .share-sheet { transform: translateY(0); }
.share-sheet-handle { width: 44px; height: 5px; border-radius: 5px; background: rgba(15,23,42,.12); margin: 0 auto 18px; }
.share-sheet-title { text-align: center; font-size: 16px; font-weight: 800; color: var(--text); margin-bottom: 26px; letter-spacing: 1px; }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 0 6px; }
.share-item { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0; border: none; background: none; cursor: pointer; transition: transform .12s; }
.share-item:active { transform: scale(.95); }
.share-ic { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; transition: transform .2s cubic-bezier(.16,1,.3,1); background: #07C160; color: #fff; box-shadow: 0 8px 22px -8px rgba(7,193,96,.55); }
.share-item.friend .share-ic { background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 8px 22px -8px rgba(34,197,94,.55); }
.share-item.group .share-ic { background: linear-gradient(135deg, #3b82f6, #2563eb); box-shadow: 0 8px 22px -8px rgba(59,130,246,.55); }
.share-item.moments .share-ic { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 8px 22px -8px rgba(245,158,11,.55); }
.share-item.link .share-ic { background: linear-gradient(135deg, #8b5cf6, #7c3aed); box-shadow: 0 8px 22px -8px rgba(139,92,246,.55); }
.share-item:active .share-ic { transform: scale(.9); }
.share-ic svg { width: 32px; height: 32px; display: block; }
.share-name { font-size: 13px; font-weight: 500; color: var(--text); }
.share-cancel { width: 100%; margin-top: 26px; padding: 15px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 700; font-size: 15px; color: var(--text); cursor: pointer; transition: transform .12s, background .15s; }
.share-cancel:active { transform: scale(.98); background: #e2e8f0; }

/* wechat guide overlay */
.wx-guide { position: fixed; inset: 0; background: rgba(0,0,0,.78); display: none; z-index: 70; }
.wx-guide.show { display: block; }
.wx-guide-arrow { position: absolute; top: 8px; right: 18px; width: 70px; height: 70px; border-top: 5px solid #fff; border-right: 5px solid #fff; border-radius: 0 18px 0 0; transform: rotate(-45deg); }
.wx-guide-tip { position: absolute; top: 86px; right: 20px; max-width: 220px; text-align: right; color: #fff; font-size: 15px; line-height: 1.5; }

/* bottom tab */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; display: flex; background: var(--surface); border-top: 1px solid var(--border); z-index: 25; padding-bottom: env(safe-area-inset-bottom); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 0; font-size: 11px; color: var(--text-soft); }
.tab.active { color: var(--primary); font-weight: 700; }
.tab .ic { font-size: 22px; }

/* mine - member center */
.mine-page { padding: 16px 16px 28px; }

.mine-header { margin-bottom: 18px; border-radius: 24px; padding: 28px 20px 24px; color: #fff; display: flex; align-items: center; gap: 16px; position: relative; overflow: hidden; box-shadow: 0 8px 32px -12px rgba(59,130,246,.45); }
.mine-header-bg { position: absolute; inset: 0; background: var(--accent-grad); z-index: 0; }
.mine-header-glow { position: absolute; right: -30px; top: -40px; width: 170px; height: 170px; background: rgba(255,255,255,.18); border-radius: 50%; filter: blur(18px); z-index: 0; }
.mine-header::before { content: ''; position: absolute; left: -20px; bottom: -50px; width: 140px; height: 140px; background: rgba(255,255,255,.1); border-radius: 50%; z-index: 0; }
.mine-ava { width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.22); color: #fff; display: grid; place-items: center; position: relative; z-index: 1; flex-shrink: 0; border: 2px solid rgba(255,255,255,.35); box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.mine-ava svg { width: 32px; height: 32px; }
.mine-ava.guest { background: rgba(255,255,255,.18); color: rgba(255,255,255,.85); }
.mine-info { flex: 1; position: relative; z-index: 1; min-width: 0; }
.mine-name { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mine-level { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.22); color: #fff; font-size: 11px; font-weight: 700; backdrop-filter: blur(4px); }
.mine-meta { font-size: 13px; opacity: .92; margin-top: 5px; display: flex; align-items: center; gap: 5px; }
.mine-meta .ic { width: 13px; height: 13px; }
.mine-qr { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.18); color: #fff; display: grid; place-items: center; position: relative; z-index: 1; flex-shrink: 0; border: 1px solid rgba(255,255,255,.25); backdrop-filter: blur(6px); transition: transform .12s, background .2s; }
.mine-qr:active { transform: scale(.92); }
.mine-qr .ic { font-size: 22px; }

.mine-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 16px 18px; box-shadow: 0 6px 24px -10px var(--shadow); margin-bottom: 18px; }
.mine-card-title { font-size: 15px; font-weight: 800; margin-bottom: 16px; color: var(--text); }

.tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tool-item { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: var(--text); padding: 16px 6px 14px; border-radius: 16px; transition: transform .12s, background .2s; background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; }
.tool-item:active { transform: scale(.96); }
.tool-item .tool-icon { width: 40px; height: 40px; }
.tool-item .tool-name { font-size: 13px; font-weight: 600; }

.btn-logout { width: 100%; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--danger); font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 7px; box-shadow: 0 6px 24px -10px var(--shadow); transition: transform .12s, background .2s; }
.btn-logout:active { transform: scale(.98); }
.btn-logout .ic { width: 17px; height: 17px; }

/* member card / 名片页 */
.card-page { padding: 22px 16px 100px; }
.card-visual { background: var(--accent-grad); border-radius: 26px; padding: 34px 24px 30px; text-align: center; color: #fff; box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.card-visual::before { content: ''; position: absolute; right: -50px; top: -50px; width: 200px; height: 200px; background: rgba(255,255,255,.14); border-radius: 50%; filter: blur(22px); }
.card-visual::after { content: ''; position: absolute; left: -40px; bottom: -60px; width: 160px; height: 160px; background: rgba(255,255,255,.1); border-radius: 50%; }
.card-avatar { width: 86px; height: 86px; border-radius: 50%; background: rgba(255,255,255,.22); border: 3px solid rgba(255,255,255,.35); display: grid; place-items: center; margin: 0 auto 16px; position: relative; z-index: 1; box-shadow: 0 10px 28px rgba(0,0,0,.14); }
.card-avatar .ic { font-size: 40px; }
.card-name { font-size: 23px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.card-real { font-size: 13px; font-weight: 600; opacity: .85; }
.card-level { display: inline-flex; align-items: center; margin-top: 10px; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.22); color: #fff; font-size: 12px; font-weight: 700; backdrop-filter: blur(4px); position: relative; z-index: 1; }
.card-meta-wrap { margin-top: 22px; display: flex; flex-direction: column; gap: 8px; align-items: center; position: relative; z-index: 1; }
.card-meta { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; opacity: .92; }
.card-meta .ic { width: 14px; height: 14px; }

/* 旧类名兼容 */
.level-tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.25); color: #fff; font-size: 11px; font-weight: 600; vertical-align: middle; }
.profile .level-tag { background: var(--accent-grad); }

.profile { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin: 16px; }
.profile .ava { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-grad); display: grid; place-items: center; font-size: 28px; color: #fff; }
.profile-logo { width: 64px; height: 64px; border-radius: 16px; object-fit: contain; background: var(--surface-2); border: 1px solid var(--border); padding: 6px; }
.profile .nm { font-weight: 800; font-size: 18px; }
.profile .ph { font-size: 13px; color: var(--text-soft); }

/* brand hero header */
.brand-hero { margin: 16px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.bh-main { display: flex; align-items: center; gap: 14px; }
.bh-logo { width: 64px; height: 64px; border-radius: 16px; object-fit: contain; background: #FFFFFF; border: 1px solid var(--border); padding: 6px; flex-shrink: 0; }
.bh-logo-fallback { width: 64px; height: 64px; border-radius: 16px; background: var(--accent-grad); display: grid; place-items: center; font-size: 28px; color: #fff; font-weight: 700; flex-shrink: 0; }
.bh-info { flex: 1; min-width: 0; }
.bh-name { font-size: 20px; font-weight: 800; color: var(--text); }
.bh-count { font-size: 13px; color: var(--text-soft); margin-top: 6px; }
.bh-desc { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-soft); line-height: 1.7; white-space: pre-wrap; }

/* auth modal */
.mask { position: fixed; inset: 0; background: rgba(2,6,23,.5); backdrop-filter: blur(4px); display: none; place-items: center; z-index: 60; padding: 20px; }
.mask.open { display: grid; }
.sheet { width: 100%; max-width: 360px; max-height: calc(100vh - 40px); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; background: var(--surface); border-radius: 22px; padding: 22px; }
.sheet h3 { margin: 0 0 12px; font-size: 18px; text-align: center; }
.seg { display: flex; background: var(--surface-2); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.seg button { flex: 1; padding: 9px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--text-soft); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.field { position: relative; margin-bottom: 10px; }
.field.required::before { content: '*'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--danger); font-size: 16px; font-weight: 700; pointer-events: none; z-index: 2; }
.field.required input,
.field.required select,
.field.required textarea { padding-left: 22px; }
.field input,
.field select,
.field textarea { width: 100%; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 15px; outline: none; transition: border-color .2s; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
[data-theme="dark"] .field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); }
.field textarea { resize: vertical; min-height: 64px; line-height: 1.5; }
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--primary); }
.link-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-soft); margin-top: 4px; }
.forgot-link { color: var(--primary); font-weight: 600; cursor: pointer; }
.forgot-link:active { opacity: 0.6; }
/* 忘记密码：人工协助引导卡 */
.reset-desc { font-size: 13px; color: var(--text-soft); line-height: 1.7; margin: 2px 0 16px; }
.kf-card { background: var(--surface-2); border-radius: 14px; padding: 4px 6px; margin-bottom: 14px; }
.kf-row { display: flex; align-items: center; padding: 14px 10px; cursor: pointer; }
.kf-row + .kf-row { border-top: 1px solid var(--border); }
.kf-label { width: 64px; flex-shrink: 0; font-size: 13px; color: var(--text-soft); }
.kf-value { flex: 1; font-size: 14px; color: var(--text); font-weight: 600; word-break: break-all; }
.kf-act { flex-shrink: 0; padding-left: 14px; font-size: 13px; color: var(--primary); font-weight: 600; }
.kf-act:active { opacity: .6; }
/* 二维码扫码区 —— 独立卡片，带标题+操作提示 */
.kf-qr-wrap { margin: 12px 8px 4px; background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%); border: 1.5px solid #bbf7d0; border-radius: 14px; padding: 18px 14px 16px; display: flex; flex-direction: column; align-items: center; }
.kf-qr-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.kf-qr-icon { display: inline-flex; align-items: center; vertical-align: -3px; line-height: 0; }
.kf-qr-title { font-size: 14px; font-weight: 700; color: #166534; }
.kf-qr { width: 160px; height: 160px; border-radius: 12px; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.kf-qr-tip { font-size: 12px; color: var(--text-soft); margin: 8px 0 0; text-align: center; line-height: 1.5; }
.reset-tip { font-size: 12px; color: var(--text-soft); text-align: center; margin: 0 0 14px; }

.empty { text-align: center; color: var(--text-soft); padding: 50px 20px; font-size: 14px; }
.toast { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%) translateY(10px); background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 12px; font-size: 13px; font-weight: 600; opacity: 0; transition: all .25s; z-index: 100; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.hidden { display: none !important; }
.spinner { text-align: center; color: var(--text-soft); padding: 40px; font-size: 14px; }

/* make injected inline SVGs fill their icon box */
.ic svg { width: 100%; height: 100%; display: block; }
.cover-fallback svg, .fallback svg { display: block; }
.fav-btn.is-fav { color: var(--danger); }
.fav-btn.is-fav .ic { transform: scale(1.05); }

/* section spacing helpers */
.section { margin-top: 4px; }
.search.hidden { display: none !important; }

/* ===== premium micro-interactions: magnetic + hover lift + reveal ===== */
/* magnetic targets + cards share a smooth transform transition; JS sets inline transform on the former */
.btn-primary, .btn-ghost, .fav-btn, .btn-fav, .tool-item, .banner-card, .brand-chip, .cat-item, .prod-card {
  transition: transform .28s cubic-bezier(.16,1,.3,1), box-shadow .28s ease, border-color .28s ease;
  will-change: transform;
}
.prod-card:hover, .brand-chip:hover, .cat-item:hover, .tool-item:hover, .banner-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 34px -10px rgba(59,130,246,.38);
  border-color: color-mix(in srgb, var(--accent, #3b82f6) 42%, var(--border));
}
.cover-img { transition: transform .6s cubic-bezier(.16,1,.3,1); }
.prod-card:hover .cover-img { transform: scale(1.07); }
/* inner accent ring on hover for a premium glow */
.prod-card::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 0 transparent; transition: box-shadow .35s ease;
}
.prod-card:hover::after { box-shadow: inset 0 0 0 1.5px rgba(59,130,246,.55); }

/* hero parallax glow */
.hero-glow {
  position: absolute; left: -50px; bottom: -70px; width: 210px; height: 210px; border-radius: 50%;
  background: radial-gradient(circle at center, rgba(255,255,255,.55), rgba(255,255,255,0) 70%);
  filter: blur(8px); pointer-events: none; z-index: 0;
}
.hero-content { position: relative; z-index: 1; }

/* scroll-entrance reveal */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .prod-card:hover, .brand-chip:hover, .cat-item:hover, .tool-item:hover, .banner-card:hover { transform: none; box-shadow: var(--shadow-lg); }
  .prod-card:hover .cover-img { transform: none; }
}
