/* ==========================================================================
   RIFTGUARD Storefront — 主样式表
   设计基调：战术工业风 / 深色底 / 安全橙强调色 / 高对比度
   ========================================================================== */

:root {
  --bg: #0a0c0f;
  --bg-elev: #101318;
  --surface: #14181e;
  --surface-2: #1a1f27;
  --surface-3: #222832;
  --border: #262d37;
  --border-strong: #364050;

  --text: #eef2f7;
  --text-dim: #a3aebd;
  --text-faint: #6b7787;

  --accent: #ff6a1a;
  --accent-2: #ffa02e;
  --accent-soft: rgba(255, 106, 26, 0.12);
  --accent-line: rgba(255, 106, 26, 0.35);

  --ok: #35d07f;
  --warn: #ffc53d;
  --danger: #ff5a52;
  --info: #4aa8ff;

  --radius: 4px;
  --radius-lg: 8px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --wrap: 1280px;
  --header-h: 68px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }

h1, h2, h3, h4 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---------- 通用元件 ---------- */
.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.section { padding: 72px 0; }
.section--tight { padding: 48px 0; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: clamp(24px, 3.4vw, 36px); text-transform: uppercase; }
.section-head p { margin: 8px 0 0; color: var(--text-dim); max-width: 620px; }

.link-arrow {
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.link-arrow:hover { color: var(--accent-2); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.btn--primary { background: var(--accent); color: #14080014; color: #fff; }
.btn--primary:hover { background: var(--accent-2); }
.btn--ghost { border-color: var(--border-strong); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--light { background: #fff; color: #0a0c0f; }
.btn--light:hover { background: #e6e9ee; }
.btn--block { width: 100%; }
.btn--sm { padding: 8px 14px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- 顶部公告条 ---------- */
.announce {
  background: linear-gradient(90deg, #ff6a1a, #ff8f2e);
  color: #170b02;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 8px 16px;
}

/* ---------- 页头 ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(10, 12, 15, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header__bar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 28px;
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo__mark {
  width: 30px; height: 30px;
  color: var(--accent);
  flex-shrink: 0;
}
.logo__text {
  font-weight: 900;
  font-size: 19px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.logo__text span { color: var(--accent); }

.nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav a {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  border-radius: var(--radius);
  transition: color 0.15s;
}
.nav a:hover, .nav a.is-active { color: var(--text); }

.header__actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  position: relative;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  transition: all 0.15s;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn svg { width: 19px; height: 19px; }
.cart-count {
  position: absolute;
  top: 3px; right: 2px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid; place-items: center;
  line-height: 1;
}

.menu-toggle { display: none; }

/* 搜索条 */
.searchbar {
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
  display: none;
}
.searchbar.is-open { display: block; }
.searchbar form {
  display: flex;
  gap: 10px;
  padding: 14px 0;
}
.searchbar input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 12px 14px;
  outline: none;
}
.searchbar input:focus { border-color: var(--accent); }

/* ---------- 轮播图 ---------- */
.hero {
  position: relative;
  background: #000;
  border-bottom: 1px solid var(--border);
}
.hero__viewport { position: relative; height: clamp(430px, 62vh, 660px); overflow: hidden; }
.hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
}
.hero__slide.is-active { opacity: 1; pointer-events: auto; }
.hero__bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
  transition: transform 7s linear;
}
.hero__slide.is-active .hero__bg { transform: scale(1.12); }

/* 未上传轮播图时的兜底底纹 */
.hero__bg--fallback {
  background:
    radial-gradient(900px 520px at 78% 28%, rgba(255, 106, 26, 0.20), transparent 62%),
    linear-gradient(135deg, #12161c 0%, #0a0c10 55%, #161119 100%);
}
.hero__bg--fallback::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(65deg, rgba(255, 255, 255, 0.02) 0 1px, transparent 1px 44px);
  mask-image: radial-gradient(700px 460px at 72% 34%, #000 0%, transparent 78%);
}
.hero__bg--fallback[data-theme='amber'] {
  background:
    radial-gradient(900px 520px at 76% 30%, rgba(255, 160, 46, 0.24), transparent 62%),
    linear-gradient(135deg, #1a1409 0%, #0c0a07 58%, #1a1208 100%);
}
.hero__bg--fallback[data-theme='steel'] {
  background:
    radial-gradient(900px 520px at 78% 26%, rgba(74, 168, 255, 0.16), transparent 62%),
    linear-gradient(135deg, #0e141b 0%, #090c11 56%, #101820 100%);
}
.hero__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(6, 8, 11, 0.95) 0%, rgba(6, 8, 11, 0.72) 46%, rgba(6, 8, 11, 0.25) 100%),
    linear-gradient(0deg, rgba(6, 8, 11, 0.85), transparent 55%);
}
.hero__body {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 620px;
}
.hero__title {
  font-size: clamp(32px, 5.6vw, 62px);
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin: 14px 0 16px;
}
.hero__title em { font-style: normal; color: var(--accent); }
.hero__sub {
  color: #c7d0dc;
  font-size: clamp(15px, 1.6vw, 18px);
  max-width: 520px;
  margin-bottom: 30px;
}
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }

.hero__dots {
  position: absolute;
  bottom: 22px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 5;
}
.hero__dot {
  width: 34px; height: 3px;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.3);
  transition: background 0.2s;
}
.hero__dot.is-active { background: var(--accent); }

.hero__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  background: rgba(12, 15, 19, 0.6);
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--text);
  transition: all 0.15s;
}
.hero__arrow:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.hero__arrow--prev { left: 18px; }
.hero__arrow--next { right: 18px; }
.hero__arrow svg { width: 18px; height: 18px; }

/* 信任条 */
.trustbar {
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
}
.trustbar__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
}
.trustbar__item {
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-right: 1px solid var(--border);
}
.trustbar__item:last-child { border-right: 0; }
.trustbar__item svg { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; }
.trustbar__item b { display: block; font-size: 13px; font-weight: 700; }
.trustbar__item span { font-size: 12px; color: var(--text-faint); }

/* ---------- 分类网格 ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.cat-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  min-height: 232px;
  display: flex;
  align-items: flex-end;
  transition: transform 0.22s ease, border-color 0.22s ease;
}
.cat-card:hover { transform: translateY(-4px); border-color: var(--accent-line); }
.cat-card__img {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease;
}
.cat-card:hover .cat-card__img { transform: scale(1.06); }

/* 分类 / 促销卡片未上传图片时的兜底底纹（比灰色块更有设计感） */
.media-grad {
  background:
    radial-gradient(520px 320px at 78% 22%, rgba(255, 106, 26, 0.22), transparent 65%),
    linear-gradient(140deg, #141920 0%, #0b0e13 60%, #171119 100%);
}
.media-grad::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(118deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 24px);
  mask-image: radial-gradient(420px 300px at 74% 26%, #000 0%, transparent 80%);
}
.media-grad[data-v='1'] { background: radial-gradient(520px 320px at 20% 78%, rgba(255, 160, 46, 0.2), transparent 65%), linear-gradient(140deg, #1a1409 0%, #0b0a08 60%, #161009 100%); }
.media-grad[data-v='2'] { background: radial-gradient(520px 320px at 82% 26%, rgba(74, 168, 255, 0.18), transparent 65%), linear-gradient(140deg, #0e141b 0%, #090c11 60%, #0d141c 100%); }
.media-grad[data-v='3'] { background: radial-gradient(520px 320px at 16% 24%, rgba(53, 208, 127, 0.16), transparent 65%), linear-gradient(140deg, #0d1712 0%, #090c0b 60%, #0c1410 100%); }
.media-grad[data-v='4'] { background: radial-gradient(520px 320px at 78% 74%, rgba(160, 108, 255, 0.16), transparent 65%), linear-gradient(140deg, #12101c 0%, #0a0a0f 60%, #130f1c 100%); }
.media-grad[data-v='5'] { background: radial-gradient(520px 320px at 82% 30%, rgba(255, 90, 82, 0.16), transparent 65%), linear-gradient(140deg, #1a1112 0%, #0c0a0a 60%, #170f10 100%); }
.cat-card__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(8, 10, 13, 0.96) 8%, rgba(8, 10, 13, 0.5) 52%, rgba(8, 10, 13, 0.12) 100%);
}
.cat-card__body { position: relative; padding: 24px; width: 100%; }
.cat-card__body h3 { font-size: 19px; text-transform: uppercase; margin-bottom: 6px; }
.cat-card__body p { margin: 0 0 12px; font-size: 13px; color: var(--text-dim); }
.cat-card__meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-faint);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
}
.cat-card__meta b { color: var(--accent); font-weight: 700; }

/* ---------- 商品卡 ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.product-grid--3 { grid-template-columns: repeat(3, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}
.card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: linear-gradient(160deg, #191e26, #0e1116);
  overflow: hidden;
}
.card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.card:hover .card__media img { transform: scale(1.05); }
.card__badges {
  position: absolute;
  top: 12px; left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 2px;
  background: var(--accent);
  color: #fff;
}
.badge--new { background: #2b6cff; }
.badge--out { background: #4a5462; }

.card__quick {
  position: absolute;
  left: 12px; right: 12px; bottom: 12px;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.2s ease;
}
.card:hover .card__quick { opacity: 1; transform: translateY(0); }

.card__body { padding: 16px 16px 18px; display: flex; flex-direction: column; flex: 1; }
.card__cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 7px;
}
.card__title {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 39px;
}
.card:hover .card__title { color: var(--accent); }
.card__rating {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-faint);
  margin-bottom: 12px;
}
.stars { color: var(--accent-2); letter-spacing: 1px; font-size: 12px; }
.card__foot {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.price { font-size: 18px; font-weight: 800; }
.price--was { font-size: 13px; color: var(--text-faint); text-decoration: line-through; font-weight: 500; }
.price__off { font-size: 11px; font-weight: 800; color: var(--ok); letter-spacing: 0.06em; }

/* ---------- 促销区 ---------- */
.promo-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.promo-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform 0.22s ease, border-color 0.22s ease;
}
.promo-card:hover { transform: translateY(-4px); border-color: var(--accent-line); }
.promo-card__bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0.5;
  transition: opacity 0.3s, transform 0.5s;
}
.promo-card:hover .promo-card__bg { opacity: 0.65; transform: scale(1.05); }
.promo-card__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(8,10,13,0.97) 14%, rgba(8,10,13,0.62) 60%, rgba(8,10,13,0.3));
}
.promo-card__body { position: relative; padding: 26px; }
.promo-card__tag {
  display: inline-block;
  font-size: 10px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--accent); color: #fff;
  padding: 4px 9px; border-radius: 2px; margin-bottom: 12px;
}
.promo-card__body h3 { font-size: 22px; text-transform: uppercase; margin-bottom: 8px; }
.promo-card__body p { margin: 0 0 16px; font-size: 13.5px; color: var(--text-dim); }
.promo-code {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px dashed var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px; font-weight: 700; letter-spacing: 0.1em;
  padding: 7px 12px; border-radius: var(--radius);
  cursor: pointer;
  margin-bottom: 14px;
}
.promo-code:hover { background: rgba(255,106,26,0.2); }

/* 大促横幅 */
.promo-banner {
  margin-top: 18px;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  min-height: 190px;
  display: flex;
  align-items: center;
}
.promo-banner__bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.promo-banner__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(8,10,13,0.94) 20%, rgba(8,10,13,0.55) 65%, rgba(8,10,13,0.15));
}
.promo-banner__body { position: relative; padding: 34px 40px; max-width: 640px; }
.promo-banner__body h3 { font-size: clamp(22px, 3vw, 32px); text-transform: uppercase; margin-bottom: 10px; }
.promo-banner__body p { color: var(--text-dim); margin: 0 0 20px; }

/* ---------- 分类侧栏 + 商品列表页 ---------- */
.shop-layout { display: grid; grid-template-columns: 250px 1fr; gap: 34px; align-items: start; }
.filters {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 22px;
}
.filters h4 {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 14px;
}
.filters + .filters { margin-top: 16px; }
.filter-list { list-style: none; margin: 0; padding: 0; }
.filter-list a {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius);
  font-size: 13.5px; color: var(--text-dim);
}
.filter-list a:hover { background: var(--surface-2); color: var(--text); }
.filter-list a.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.filter-list span { color: var(--text-faint); font-size: 12px; }

.shop-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 22px; flex-wrap: wrap;
}
.shop-toolbar .count { font-size: 13.5px; color: var(--text-faint); }
select.input, input.input, textarea.input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s;
}
select.input:focus, input.input:focus, textarea.input:focus { border-color: var(--accent); }
select.input { width: auto; padding-right: 32px; cursor: pointer; }

.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.pagination button {
  min-width: 40px; height: 40px; padding: 0 12px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text-dim); border-radius: var(--radius);
  font-weight: 700; font-size: 13px;
}
.pagination button:hover { border-color: var(--border-strong); color: var(--text); }
.pagination button.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- 商品详情 ---------- */
.pdp { display: grid; grid-template-columns: 1.05fr 1fr; gap: 52px; align-items: start; }
.pdp__gallery { position: sticky; top: calc(var(--header-h) + 24px); }
.pdp__main {
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(160deg, #191e26, #0e1116);
}
.pdp__main img { width: 100%; height: 100%; object-fit: cover; }
.pdp__thumbs { display: flex; gap: 10px; margin-top: 12px; }
.pdp__thumb {
  width: 76px; height: 76px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; padding: 0; background: var(--surface);
  transition: border-color 0.15s;
}
.pdp__thumb img { width: 100%; height: 100%; object-fit: cover; }
.pdp__thumb.is-active { border-color: var(--accent); }

.pdp__title { font-size: clamp(24px, 3.2vw, 34px); margin-bottom: 12px; }
.pdp__sub { color: var(--text-dim); font-size: 16px; margin-bottom: 18px; }
.pdp__price { display: flex; align-items: baseline; gap: 12px; margin: 22px 0 6px; flex-wrap: wrap; }
.pdp__price .price { font-size: 32px; }
.pdp__meta {
  display: flex; gap: 20px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-faint);
  padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin: 20px 0;
}
.pdp__meta b { color: var(--text); }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.qty button { width: 42px; height: 46px; background: var(--surface-2); border: 0; color: var(--text); font-size: 17px; }
.qty button:hover { background: var(--surface-3); }
.qty input {
  width: 58px; height: 46px; text-align: center;
  background: var(--surface); border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  color: var(--text); font-weight: 700;
}
.pdp__buy { display: flex; gap: 12px; margin: 22px 0; flex-wrap: wrap; }
.pdp__buy .btn { flex: 1; min-width: 170px; padding: 15px 22px; }

.feature-list { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.feature-list li { display: flex; gap: 11px; font-size: 14px; color: var(--text-dim); }
.feature-list svg { width: 17px; height: 17px; color: var(--accent); flex-shrink: 0; margin-top: 3px; }

.notice {
  border: 1px solid var(--border);
  border-left: 3px solid var(--warn);
  background: rgba(255, 197, 61, 0.06);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-dim);
  margin: 18px 0;
}
.notice b { color: var(--warn); }
.notice--danger { border-left-color: var(--danger); background: rgba(255, 90, 82, 0.07); }
.notice--danger b { color: var(--danger); }
.notice--info { border-left-color: var(--info); background: rgba(74, 168, 255, 0.07); }
.notice--info b { color: var(--info); }

/* 详情标签页 */
.tabs { border-bottom: 1px solid var(--border); display: flex; gap: 4px; margin-bottom: 26px; flex-wrap: wrap; }
.tabs button {
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  color: var(--text-faint); padding: 12px 18px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.tabs button.is-active { color: var(--accent); border-bottom-color: var(--accent); }

.spec-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.spec-table tr { border-bottom: 1px solid var(--border); }
.spec-table td { padding: 13px 0; vertical-align: top; }
.spec-table td:first-child { color: var(--text-faint); width: 240px; }
.spec-table td:last-child { font-weight: 600; }

.prose { font-size: 15px; color: var(--text-dim); line-height: 1.85; }
.prose p { margin: 0 0 18px; }

/* ---------- 购物车 ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 380px; gap: 34px; align-items: start; }
.cart-line {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.cart-line__img {
  width: 96px; height: 96px;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.cart-line__img img { width: 100%; height: 100%; object-fit: cover; }
.cart-line h4 { font-size: 15px; margin-bottom: 6px; }
.cart-line .sku { font-size: 12px; color: var(--text-faint); font-family: var(--mono); }
.cart-line__right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.remove-btn { background: none; border: 0; color: var(--text-faint); font-size: 12px; text-decoration: underline; }
.remove-btn:hover { color: var(--danger); }

.summary {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 24px;
  position: sticky;
  top: calc(var(--header-h) + 24px);
}
.summary h3 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 20px; }
.summary__row { display: flex; justify-content: space-between; padding: 9px 0; font-size: 14px; color: var(--text-dim); }
.summary__row b { color: var(--text); }
.summary__row--total {
  border-top: 1px solid var(--border);
  margin-top: 12px; padding-top: 16px;
  font-size: 17px; color: var(--text);
}
.summary__row--total b { font-size: 22px; }
.summary__free { font-size: 12px; color: var(--ok); }
.progressbar { height: 5px; background: var(--surface-3); border-radius: 3px; overflow: hidden; margin: 8px 0 4px; }
.progressbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.empty-state { text-align: center; padding: 80px 20px; }
.empty-state svg { width: 54px; height: 54px; color: var(--text-faint); margin-bottom: 18px; }
.empty-state h3 { font-size: 20px; margin-bottom: 10px; }
.empty-state p { color: var(--text-faint); margin-bottom: 24px; }

/* ---------- 表单 / 认证页 ---------- */
.auth-layout { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - var(--header-h)); }
.auth-art {
  position: relative;
  background: linear-gradient(160deg, #151a21, #08090c);
  display: flex; align-items: flex-end;
  padding: 56px;
  overflow: hidden;
}
.auth-art__bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.35; }
.auth-art__scrim { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8,10,13,0.95), rgba(8,10,13,0.35)); }
.auth-art__body { position: relative; max-width: 440px; }
.auth-art__body h2 { font-size: clamp(26px, 3.4vw, 40px); text-transform: uppercase; margin-bottom: 14px; }
.auth-art__body p { color: var(--text-dim); }
.auth-art__list { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; }
.auth-art__list li { display: flex; gap: 11px; font-size: 14px; color: var(--text-dim); }
.auth-art__list svg { width: 17px; height: 17px; color: var(--accent); flex-shrink: 0; margin-top: 3px; }

.auth-form-wrap { display: flex; align-items: center; justify-content: center; padding: 56px 24px; }
.auth-form { width: 100%; max-width: 420px; }
.auth-form h1 { font-size: 30px; text-transform: uppercase; margin-bottom: 8px; }
.auth-form > p { color: var(--text-dim); margin: 0 0 30px; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 7px;
}
.field .hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; }
.field .err { font-size: 12px; color: var(--danger); margin-top: 6px; display: none; }
.field.has-error .err { display: block; }
.field.has-error .input { border-color: var(--danger); }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--text-dim); cursor: pointer; }
.checkbox input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ---------- 提示 / toast ---------- */
.toast-host {
  position: fixed;
  right: 20px; bottom: 20px;
  z-index: 9000;
  display: flex; flex-direction: column; gap: 10px;
  max-width: 360px;
}
.toast {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13.5px;
  box-shadow: var(--shadow);
  animation: toastIn 0.22s ease;
}
.toast--ok { border-left-color: var(--ok); }
.toast--err { border-left-color: var(--danger); }
.toast b { display: block; margin-bottom: 3px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-elev); margin-top: 80px; }
.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 40px;
  padding: 56px 0 40px;
}
.footer h5 {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-faint); margin: 0 0 16px; font-weight: 800;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer a { font-size: 13.5px; color: var(--text-dim); }
.footer a:hover { color: var(--accent); }
.footer__about p { font-size: 13.5px; color: var(--text-dim); margin: 16px 0 20px; max-width: 320px; }

.newsletter { display: flex; gap: 8px; max-width: 340px; }
.newsletter input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text); padding: 11px 13px; outline: none;
}
.newsletter input:focus { border-color: var(--accent); }

.footer__bottom {
  border-top: 1px solid var(--border);
  padding: 22px 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--text-faint);
}
.footer__legal { display: flex; gap: 18px; flex-wrap: wrap; }

/* ---------- 年龄门槛弹窗 ---------- */
.agate {
  position: fixed; inset: 0; z-index: 9500;
  background: rgba(5, 7, 9, 0.94);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
  overflow-y: auto;
}
.agate.is-open { display: flex; }
.agate__box {
  max-width: 480px; width: 100%; min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 34px;
  text-align: center;
}
.agate__box > * { min-width: 0; max-width: 100%; }
.agate__box h3 { font-size: 22px; text-transform: uppercase; margin-bottom: 12px; }
.agate__box p { color: var(--text-dim); font-size: 14px; margin: 0 0 22px; }
.agate__actions { display: grid; gap: 10px; }

/* ---------- 面包屑 / 页面头 ---------- */
.pagehead { border-bottom: 1px solid var(--border); background: var(--bg-elev); padding: 36px 0; }
.crumbs { font-size: 12.5px; color: var(--text-faint); margin-bottom: 12px; }
.crumbs a:hover { color: var(--accent); }
.pagehead h1 { font-size: clamp(26px, 4vw, 40px); text-transform: uppercase; }
.pagehead p { color: var(--text-dim); margin: 10px 0 0; max-width: 680px; }

/* ---------- 骨架屏 ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- 后台管理 ---------- */
.admin-body { background: #0b0e12; }
.admin-shell { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.admin-side {
  background: var(--bg-elev);
  border-right: 1px solid var(--border);
  padding: 22px 0;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-side__brand { padding: 0 22px 22px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.admin-side__nav { display: flex; flex-direction: column; gap: 2px; padding: 0 12px; }
.admin-side__nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 600; color: var(--text-dim);
}
.admin-side__nav a:hover { background: var(--surface-2); color: var(--text); }
.admin-side__nav a.is-active { background: var(--accent-soft); color: var(--accent); }
.admin-side__nav svg { width: 17px; height: 17px; }
.admin-side__foot { margin-top: auto; padding: 18px 22px 0; border-top: 1px solid var(--border); }
/* 后台窄屏专属操作区（桌面端隐藏，操作在左下角 foot 里） */
.admin-side__mobile { display: none; }

/* 后台语言切换（中文 / EN）—— 侧栏底部与窄屏操作区各一份 */
.lang-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.lang-switch button {
  appearance: none; border: 0; background: transparent; color: var(--text-faint);
  font: inherit; font-size: 12px; line-height: 1; letter-spacing: .04em;
  padding: 7px 11px; cursor: pointer; transition: background .15s, color .15s;
}
.lang-switch button + button { border-left: 1px solid var(--border); }
.lang-switch button:hover { color: var(--text); background: var(--surface-2); }
.lang-switch button.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.lang-switch--sm button { padding: 6px 8px; font-size: 11px; }

.admin-main { padding: 30px 34px 60px; min-width: 0; }
.admin-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; margin-bottom: 26px; flex-wrap: wrap;
}
.admin-head h1 { font-size: 25px; text-transform: uppercase; }
.admin-head p { color: var(--text-faint); font-size: 13.5px; margin: 6px 0 0; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 20px;
}
.stat__label {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 10px; font-weight: 700;
}
.stat__value { font-size: 28px; font-weight: 800; line-height: 1.1; }
.stat__hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 22px;
}
.panel__head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap;
}
.panel__head h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; }
.panel__body { padding: 20px; }

.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; padding: 12px 14px;
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-faint); border-bottom: 1px solid var(--border); font-weight: 800;
  white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:hover td { background: var(--surface-2); }
.table__thumb {
  width: 44px; height: 44px; border-radius: var(--radius);
  object-fit: cover; border: 1px solid var(--border); background: var(--surface-2);
}
.table__name { font-weight: 700; }
.table__sub { font-size: 12px; color: var(--text-faint); font-family: var(--mono); }

.pill {
  display: inline-block;
  font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 20px;
  background: var(--surface-3); color: var(--text-dim);
}
.pill--ok { background: rgba(53, 208, 127, 0.14); color: var(--ok); }
.pill--warn { background: rgba(255, 197, 61, 0.14); color: var(--warn); }
.pill--off { background: rgba(107, 119, 135, 0.18); color: var(--text-faint); }
.pill--accent { background: var(--accent-soft); color: var(--accent); }

.row-actions { display: flex; gap: 6px; }
.btn-icon {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface-2);
  border-radius: var(--radius); color: var(--text-dim);
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }
.btn-icon--danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-icon svg { width: 15px; height: 15px; }

/* 模态框 */
.modal {
  position: fixed; inset: 0; z-index: 8000;
  background: rgba(4, 6, 9, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start; justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.modal.is-open { display: flex; }
.modal__box {
  width: 100%; max-width: 780px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  margin: auto 0;
}
.modal__head {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal__head h3 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; }
.modal__body { padding: 22px; max-height: 68vh; overflow-y: auto; }
.modal__foot {
  padding: 16px 22px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.uploader {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.uploader:hover { border-color: var(--accent); color: var(--accent); }
.uploader input { display: none; }
.upload-preview { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.upload-preview__item { position: relative; width: 76px; height: 76px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.upload-preview__item img { width: 100%; height: 100%; object-fit: cover; }
.upload-preview__item button {
  position: absolute; top: 3px; right: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.75); color: #fff; border: 0;
  font-size: 12px; line-height: 1;
}

/* 登录页（后台） */
.admin-login {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
  background: radial-gradient(1000px 500px at 50% -10%, rgba(255,106,26,0.1), transparent), var(--bg);
}
.admin-login__box {
  width: 100%; max-width: 400px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: 34px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 980px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .promo-strip { grid-template-columns: 1fr; }
  .pdp { grid-template-columns: 1fr; gap: 34px; }
  .pdp__gallery { position: static; }
  .cart-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .shop-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .auth-layout { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .admin-shell { grid-template-columns: 1fr; }
  /* 栅格子项默认 min-width:auto，窄屏会被后台导航/表格内容撑破视口 —— 显式归零 */
  .admin-shell > * { min-width: 0; }
  .admin-side { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; padding: 12px; }
  .admin-side__brand { border: 0; padding: 0 16px 0 0; margin: 0; min-width: 0; }
  .admin-side__nav { flex-direction: row; padding: 0; min-width: 0; }
  .admin-side__nav a span { display: none; }
  .admin-side__foot { display: none; }
  .admin-main { padding: 20px 16px 50px; }
}

@media (max-width: 760px) {
  :root { --header-h: 60px; }
  .wrap { padding: 0 16px; }
  .section { padding: 48px 0; }
  .nav { display: none; }
  .nav.is-open {
    display: flex; flex-direction: column;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--bg-elev); border-bottom: 1px solid var(--border);
    padding: 12px 16px 18px; gap: 2px;
  }
  .nav.is-open a { padding: 12px; font-size: 14px; }
  .menu-toggle { display: grid; }
  .trustbar__grid { grid-template-columns: 1fr; }
  .trustbar__item { border-right: 0; border-bottom: 1px solid var(--border); }
  .trustbar__item:last-child { border-bottom: 0; }
  .product-grid, .product-grid--3 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-grid { grid-template-columns: 1fr; }
  .card__body { padding: 12px; }
  .card__title { font-size: 13.5px; }
  .price { font-size: 16px; }
  .hero__viewport { height: 470px; }
  .hero__arrow { display: none; }
  .pdp__buy .btn { min-width: 0; }
  .form-row { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
  .promo-banner__body { padding: 24px; }
  .table { display: block; overflow-x: auto; white-space: nowrap; }
  .cart-line { grid-template-columns: 72px 1fr; }
  .cart-line__img { width: 72px; height: 72px; }
  .cart-line__right { grid-column: 1 / -1; align-items: flex-start; flex-direction: row; justify-content: space-between; width: 100%; }
}

/* ================================================================
   移动端加固（Mobile hardening）
   覆盖：iOS 安全区 / 触控目标 / 聚焦缩放 / 抽屉菜单 / 后台移动导航
   ================================================================ */

/* 抽屉菜单里的移动专属操作区（桌面端不显示） */
.nav__mobile { display: none; }
.nav__mobile .btn { width: 100%; justify-content: center; }

/* ---------- 平板（≤980px）---------- */
@media (max-width: 980px) {
  /* 页头：平板也改用抽屉菜单。8 个导航项在 761–980px 会把页头挤到溢出（实测 820px 时宽 980px） */
  .nav { display: none; }
  .nav.is-open {
    display: flex; flex-direction: column;
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--bg-elev); border-bottom: 1px solid var(--border);
    padding: 12px 16px 18px; gap: 2px;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .menu-toggle { display: grid; }
  .nav__mobile {
    display: flex; flex-direction: column; gap: 8px;
    margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--border);
  }

  /* 后台：侧栏改为「品牌 + 操作」一行、导航一行横向滚动，保留文字标签 */
  .admin-side {
    position: sticky; top: 0; z-index: 300;
    flex-direction: row; flex-wrap: wrap; align-items: center;
    height: auto; overflow: visible;
    padding: 10px max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
    border-right: 0; border-bottom: 1px solid var(--border);
    gap: 6px 10px;
  }
  .admin-side__brand {
    flex: 1 1 auto; display: flex; align-items: center;
    padding: 0 !important; border: 0 !important; margin: 0 !important;
  }
  .admin-side__brand > div { display: none; }        /* 隐藏 "Store admin" 小字 */
  .admin-side__brand .logo__text { font-size: 15px !important; }
  .admin-side__mobile { display: flex; flex: 0 0 auto; gap: 6px; order: 2; }
  .admin-side__nav {
    order: 3; flex: 1 1 100%; min-width: 0; flex-direction: row; gap: 4px;
    padding: 2px; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .admin-side__nav::-webkit-scrollbar { display: none; }
  .admin-side__nav a { flex: 0 0 auto; padding: 9px 12px; }
  .admin-side__nav a span { display: inline !important; }   /* 覆盖上面的图标模式 */
  .admin-side__foot { display: none; }                       /* 操作已移到右上角 */
  .admin-main { padding: 18px 16px 60px; }
  .admin-head { margin-bottom: 18px; }
  .admin-head h1 { font-size: 22px; }
  /* 首页仪表盘/设置页的两栏内联栅格在窄屏必须堆叠 */
  #dashCols { grid-template-columns: 1fr !important; }
}

/* ---------- 手机（≤760px）---------- */
@media (max-width: 760px) {
  /* 1) iOS 聚焦输入框不再自动放大（字号 <16px 会触发整页缩放） */
  input, select, textarea, .input, .field input, .field select, .field textarea {
    font-size: 16px !important;
  }
  /* 2) 触控目标 ≥44px（Apple HIG / Android 无障碍规范） */
  .icon-btn { width: 44px; height: 44px; }
  .nav.is-open a { padding: 14px 12px; font-size: 15px; }
  .qty__btn, .qty button { min-width: 40px; min-height: 40px; }
  /* 3) iOS 安全区：横屏刘海、底部 Home 指示条 */
  .wrap {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
  .header { padding-top: env(safe-area-inset-top); }
  /* 抽屉要贴在页头下沿（含刘海安全区偏移），否则会被页头压住 */
  .nav.is-open {
    top: calc(var(--header-h) + env(safe-area-inset-top));
    max-height: calc(100dvh - var(--header-h) - env(safe-area-inset-top));
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .nav__mobile { gap: 8px; }   /* 基础样式见 ≤980px 区块 */
  .footer__bottom { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  /* 4) 长按钮文案允许换行，避免把整页撑宽（原来 nowrap 会溢出到 501px） */
  .btn { white-space: normal; text-align: center; }
  .agate { padding: 16px; }
  .agate__box { padding: 26px 20px; }
  .agate__box h3 { font-size: 19px; }
  .agate__actions .btn { min-width: 0; }
  /* 5) 弹窗全屏化：手机上表单更好填 */
  .modal { padding: 0; align-items: stretch; }
  .modal__box { max-width: none; min-height: 100%; margin: 0; border-radius: 0; }
  .modal__body { max-height: none; }
  .modal__foot { flex-direction: column-reverse; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .modal__foot .btn { width: 100%; }
  /* 6) 兜底：任何写死在行内的多列栅格，在手机上强行单列
        （行内样式优先级高于媒体查询，所以这里必须 !important 才压得住） */
  [style*='grid-template-columns'] { grid-template-columns: 1fr !important; }
  /* 7) 例外：规格行 / 卖点行保留「内容 + 删除按钮」的双列结构 */
  .spec-row { grid-template-columns: 1fr !important; gap: 4px !important; }
  .spec-row > *:last-child { justify-self: start !important; }
  .feat-row { grid-template-columns: 1fr 34px !important; }
  /* 8) 首屏文案与高度自适应 */
  .hero__viewport { height: clamp(430px, 64vh, 540px); }
  .hero__title { font-size: clamp(29px, 8.6vw, 42px); }
  .hero__body { padding-bottom: 28px; }
  /* 9) 表格横向滑动更顺滑 */
  .table { -webkit-overflow-scrolling: touch; }
}

/* ---------- 小屏（≤400px，iPhone SE / 折叠屏外屏）---------- */
@media (max-width: 400px) {
  body { font-size: 14.5px; }
  .logo__text { font-size: 16px; letter-spacing: 0.1em; }
  .header__bar { gap: 10px; }
  /* 页头放不下 4 个图标：搜索收进抽屉（抽屉里有 Search products 入口） */
  #searchToggle { display: none; }
  #searchBar { display: none !important; }
  .product-grid, .product-grid--3 { gap: 10px; }
  .admin-side__nav a span { display: none !important; }   /* 极窄屏退回图标模式 */
}

/* 触屏设备：去掉 hover 残留高亮，避免点击后卡在悬停态 */
@media (hover: none) {
  .card:hover, .cat-card:hover, .promo-card:hover { transform: none; }
}
