/* ===== Theme tokens ===== */
:root {
  --bg: #ffffff;
  --text: #0b0c0f;
  --muted: #585c65;
  --card: #f7f8fa;
  --brand: #0b0c0f;
  --border: rgba(0, 0, 0, 0.1);

  --btn: #0b0c0f;
  --btn-text: #fff;

  --maxw: 1120px;
  --radius: 16px;
  --hero-overlay-strength: 78%;

  --on-hero: #fff;
  --on-hero-muted: rgba(255, 255, 255, 0.86);
  --on-hero-border: rgba(255, 255, 255, 0.45);

  --footer-gap: 20px;
  --header-h: 64px;

  /* 字体栈：标题更“高定”，正文清晰 */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial,
    Helvetica, sans-serif;
  --font-display: ui-serif, "Iowan Old Style", "Baskerville", "Times New Roman",
    "Source Serif Pro", "Noto Serif", "Times", serif;
}

html[data-theme="dark"] {
  --bg: #0b0c0f;
  --text: #e9e9ea;
  --muted: #a7acb4;
  --card: #111318;
  --brand: #e9e9ea;
  --border: rgba(255, 255, 255, 0.12);

  --btn: #e9e9ea;
  --btn-text: #0b0c0f;
  --hero-overlay-strength: 64%;
}

/* ===== Global ===== */
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font-sans);
  height: 100%;
  overflow-x: hidden; /* 防整页横向溢出 */
  overscroll-behavior: none; /* 禁止滚动串扰 + 下拉刷新 */
}
a {
  color: inherit;
  text-decoration: none;
}

/* 英文小字用小型大写（更干净） */
:lang(en) .tagline,
:lang(en) .brand-sub {
  font-variant-caps: all-small-caps;
  letter-spacing: 0.08em;
}

/* ===== Layout: header stick + content flex + footer gap ===== */
body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
main,
.site-main,
.page-main,
.content {
  flex: 1;
}
/* 让 main 成为唯一垂直滚动容器（支持 iOS 惯性） */
.site-main {
  flex: 1;
  height: 100dvh; /* 固定可视高度，内部滚动 */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.site-footer,
footer.site-footer,
footer.footer,
footer {
  margin-top: 32px;
  padding: 16px 0 calc(20px + env(safe-area-inset-bottom));
  margin-bottom: var(--footer-gap);
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--header-h);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0));
  backdrop-filter: saturate(120%) blur(8px);
  transition: background 0.3s, border-color 0.3s, transform 0.3s, padding 0.3s;
  border-bottom: 1px solid transparent;
}
.site-header[data-compact="true"] {
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  border-bottom-color: var(--border);
}
.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  gap: 12px;
}

/* Brand badge */
.brand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  flex: 0 0 44px;        /* ✅ 固定为 44px，不参与收缩 */
  min-width: 44px;       /* ✅ 双保险：最小宽高不低于 44 */
  min-height: 44px;
  flex-shrink: 0;        /* ✅ 禁止 flex 收缩，防止被文字挤瘪 */
}
.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  padding: 6px;
  object-fit: contain;
}
.brand-logo--light { display: block; }
.brand-logo--dark { display: none; }
html[data-theme="dark"] .brand-logo--light { display: none; }
html[data-theme="dark"] .brand-logo--dark { display: block; }

/* 将 Nav 与 语言切换放在右侧一组，避免三列分布 */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;          /* ✅ 允许右侧内容自身收缩而不是挤压徽章 */
}

/* Nav */
.nav {
  display: flex;
  gap: 22px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.nav a { opacity: 0.88; }
.nav a:hover { opacity: 1; }

/* 首屏未收紧：导航反色可见（解决“白天看不见”） */
.site-header[data-compact="false"] .nav a {
  color: var(--on-hero);
  opacity: 0.98;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.site-header[data-compact="false"] .brand-badge {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--on-hero-border);
}
.site-header[data-compact="false"] .brand-logo--light { display: none !important; }
.site-header[data-compact="false"] .brand-logo--dark { display: block !important; }

/* ===== 语言切换（与 wx.css 一致的轻量风格） ===== */
.brand-actions { display: flex; align-items: center; }
.lang-switcher { position: relative; }
.lang-btn {
  height: 34px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--card); font-weight: 700; letter-spacing: .2px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
}
.lang-caret { font-size: 12px; opacity: .8; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px; max-height: 320px; overflow: auto;
  padding: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--card);
  box-shadow: 0 10px 28px rgba(0,0,0,.08); display: none; z-index: 2000;
}
.lang-menu button {
  width: 100%; text-align: left; height: 34px; line-height: 34px; padding: 0 10px; border: 0; background: transparent; border-radius: 8px; cursor: pointer;
}
.lang-menu button:hover { background: color-mix(in oklab, var(--bg) 80%, transparent); }
.lang-switcher.open .lang-menu { display: block; }

/* 首屏未收紧时，语言按钮做轻微反色，保证在大图上也清晰 */
.site-header[data-compact="false"] .lang-btn {
  background: rgba(255,255,255,0.06);
  border-color: var(--on-hero-border);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    color-mix(in oklab, var(--bg) var(--hero-overlay-strength%), transparent) 0%,
    rgba(0, 0, 0, 0) 38%,
    rgba(0, 0, 0, 0.12) 100%
  );
  pointer-events: none;
}
.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 20px;
  max-width: 780px;
}
.hero h1 {
  margin: 0 0 10px;
  font-weight: 900;
  letter-spacing: 0.5px;
  font-size: clamp(32px, 5vw, 56px);
  font-family: var(--font-display);
}
.hero p {
  margin: 0 auto 20px;
  color: var(--muted);
  font-size: clamp(15px, 2.2vw, 18px);
  max-width: 640px;
}
.hero .hero-content h1 {
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.hero .hero-content p {
  color: var(--on-hero-muted);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn,
button.btn,
a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 22px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-weight: 800;
  letter-spacing: 0.3px;
  transition: transform 0.06s, opacity 0.2s, background 0.2s;
  font-size: 16px;
  line-height: 1;
}
.btn.primary {
  background: var(--btn);
  color: var(--btn-text);
  border-color: transparent;
}
.btn.primary:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--text); }
.btn.link { background: transparent; border-color: transparent; text-decoration: underline; }

/* 首屏按钮反色 */
.hero .btn.ghost {
  color: #fff;
  border-color: var(--on-hero-border);
  background: rgba(255, 255, 255, 0.02);
}
.hero .btn.ghost:hover { background: rgba(255, 255, 255, 0.06); }

/* 小屏略收一档 */
@media (max-width: 420px) {
  .btn, button.btn, a.btn { font-size: 15px; }
}

/* ===== 三列卖点 ===== */
.pillars {
  --seal-size: 48px;
  --seal-radius: 14px;
  --seal-inset: 10px;
  max-width: var(--maxw);
  margin: 56px auto 14px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.pillar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px 20px;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.pillar:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08); }
.pillar .dot {
  width: var(--seal-size);
  height: var(--seal-size);
  margin: 6px auto 12px;
  border-radius: var(--seal-radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.75));
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55), 0 1px 2px rgba(0, 0, 0, 0.05);
  position: relative;
}
html[data-theme="dark"] .pillar .dot {
  background: linear-gradient(180deg, #171922, #12141a);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.35);
}
.pillar .dot::after {
  content: "";
  position: absolute;
  inset: var(--seal-inset);
  border-radius: 6px;
  transform: rotate(45deg);
  border: 2px solid currentColor;
  opacity: 0.75;
}
.pillar h3 {
  font-size: 18px;
  letter-spacing: 0.6px;
  font-weight: 800;
  margin: 4px 0 8px;
  font-family: var(--font-display);
}
.pillar p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }

/* ===== 横向视觉带 ===== */
.gallery {
  margin: 28px auto;
  padding: 0;
  width: min(100%, var(--maxw));
  overflow: visible;
}
.gallery .track {
  display: flex;
  gap: 8px;
  padding: 0 24px 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: none;
  touch-action: pan-x;
  scrollbar-width: none;
}
.gallery .track::-webkit-scrollbar { display: none; }
.gallery img {
  display: block;
  flex: 0 0 auto;
  width: calc((var(--maxw) - 48px) / 3);
  height: 280px;
  object-fit: cover;
  border-radius: 14px;
  scroll-snap-align: center;
  background: #e9ecef;
}
@media (max-width: 900px) {
  .gallery { width: 100%; }
  .gallery img {
    width: min(88vw, 560px);
    height: min(62vw, 360px);
  }
}

/* ===== 售后卡片 ===== */
.card {
  width: min(var(--maxw), calc(100% - 48px));
  margin: 32px auto;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  padding-left: max(24px, env(safe-area-inset-left));
  padding-right: max(24px, env(safe-area-inset-right));
}
.care h2 {
  margin: 0 0 10px;
  font-size: 22px;
  font-family: var(--font-display);
}
.tips { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
.tips li { margin: 6px 0; }
.care-cta {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.toast.show { opacity: 1; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .pillars { grid-template-columns: 1fr; }
  .hero-content { padding: 0 18px; }
  .header-inner { padding: 0 18px; }
}

/* 小优化：支持器材好一点时提升玻璃态质量 */
@supports (backdrop-filter: blur(6px)) {
  .site-header { backdrop-filter: saturate(120%) blur(8px); }
}

/* 视觉隐藏：#wxId 等 */
.sr-only,
#wxId.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important; /* 旧语法 */
  clip-path: inset(50%) !important; /* 新语法 */
  white-space: nowrap !important;
  border: 0 !important;
}
[hidden] { display: none !important; }