/* ===== 御马产品 · 小程序风格 H5 ===== */

:root {
  --gold: #c9a063;
  --gold-soft: #e4c88a;
  --dark: #141414;
  --dark-soft: #1e1e1e;
  --navbar-bg: #2a2a2a;
  --page-bg: #ffffff;
  --tabbar-bg: #ffffff;
  --phone-radius: 30px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* hidden 属性必须压得住后面的 display 规则 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: #1b1b1b;
  background: #0c0c0e;
  background-image: radial-gradient(120% 90% at 50% 0%, #232326 0%, #0c0c0e 62%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow: hidden;
}

/* ---------- 设备外框 ---------- */

.stage { position: relative; }

.phone {
  width: min(460px, 100vw - 32px);
  height: min(880px, 100vh - 48px);
  background: var(--page-bg);
  border-radius: var(--phone-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 40px 80px -20px rgba(0, 0, 0, .8),
    0 0 0 1px rgba(255, 255, 255, .07),
    0 0 0 10px #191919,
    0 0 0 11px rgba(255, 255, 255, .05);
}

/* ---------- 顶部导航（仿小程序导航栏 + 胶囊） ---------- */

.navbar {
  flex: 0 0 auto;
  height: 50px;
  background: var(--navbar-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  position: relative;
  z-index: 20;
}

.nav-back {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  margin-right: 8px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  padding: 0 0 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .16s;
}
.nav-back:hover { background: rgba(255, 255, 255, .2); }
.nav-back:active { transform: scale(.92); }

.nav-pill {
  background: #fff;
  color: #1b1b1b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  padding: 8px 14px;
  border-radius: 999px;
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: auto;
}

.capsule {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .16);
}

.capsule .dot3 { display: flex; gap: 3px; }
.capsule .dot3 i { width: 4px; height: 4px; border-radius: 50%; background: #fff; opacity: .9; }
.capsule .divider { width: 1px; height: 16px; background: rgba(255, 255, 255, .25); }
.capsule .target {
  width: 15px; height: 15px; border-radius: 50%;
  border: 1.5px solid #fff; display: flex; align-items: center; justify-content: center;
}
.capsule .target i { width: 5px; height: 5px; border-radius: 50%; background: #fff; }

/* ---------- 内容区 ---------- */

.viewport {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--page-bg);
  transition: background-color .2s ease;
  position: relative;
  scroll-behavior: smooth;
}
.viewport::-webkit-scrollbar { width: 0; }

/* 车型详情页 · 顶部分类 Tab 条 */
.subtabs {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  padding: 10px 14px 12px;
  background: var(--navbar-bg);
  overflow-x: auto;
  scrollbar-width: none;
  z-index: 15;
}
.subtabs::-webkit-scrollbar { display: none; }

.subtab {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 7px 17px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  background: rgba(255, 255, 255, .13);
  color: #eaeaea;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background .16s, color .16s;
}
.subtab:active { transform: scale(.96); }
.subtab.active { background: #d9c6a4; color: #241f16; font-weight: 700; }

/* 车型 Tab 条最左侧的产品线名称（静态，不可点） */
.subtab-line {
  flex: 0 0 auto;
  align-self: center;
  font-size: 12px;
  color: rgba(255, 255, 255, .5);
  letter-spacing: .06em;
  padding-right: 2px;
  white-space: nowrap;
}

/* 详情页分区 */
.section { position: relative; }
.section + .section { border-top: 1px solid rgba(0, 0, 0, .06); }

.page-enter { animation: fade-up .26s ease both; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* 图片区块 */
.blk { margin: 0; display: block; position: relative; }
.blk img { display: block; width: 100%; height: auto; }

/* 图片角标（前排 / 后排 …）
   位置跟源设计一致：贴在**图片右上角**，右边和上边贴边、左下是圆角 */
.blk-badge {
  position: absolute;
  right: 0;
  top: 0;
  background: #fff;
  color: #141414;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  padding: 13px 22px 13px 20px;
  border-radius: 0 0 0 14px;
  letter-spacing: .04em;
  pointer-events: none;
}

/* ---------- 首页轮播 ---------- */
.blk-carousel {
  position: relative;
  overflow: hidden;
  background: #111;
  touch-action: pan-y;
}
.blk-carousel .track {
  display: flex;
  will-change: transform;
  transition: transform .42s cubic-bezier(.32, .72, 0, 1);
}
.blk-carousel .slide {
  flex: 0 0 100%;
  width: 100%;
}
.blk-carousel .slide img {
  display: block;
  width: 100%;
  height: auto;
}
.blk-carousel .dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.blk-carousel .dots i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .45);
  transition: width .25s, background .25s;
}
.blk-carousel .dots i.on {
  width: 16px;
  background: #fff;
}

/* 大标题条（实拍展示） */
.blk-heading {
  background: #d6d6d6;
  color: #101010;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 20px 16px;
  line-height: 1.2;
}

/* 视频区块 */
.blk-video { background: #000; }
.blk-video video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 78vh;
  background: #000;
  object-fit: contain;
}
.blk-video .video-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 46%;
  text-align: center;
  color: #fff;
  font-size: 14px;
  letter-spacing: .05em;
  line-height: 1.5;
  padding: 0 24px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .75);
  pointer-events: none;
}

.blk-label {
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  padding: 13px 16px;
  letter-spacing: .04em;
}
.on-light .blk-label { color: #4a4a4a; }
.on-dark  .blk-label { color: #e8e8e8; }

.notice {
  text-align: center;
  font-size: 13px;
  padding: 16px 20px 10px;
}
.on-dark .notice { color: #cfcfcf; }
.on-light .notice { color: #6b6b6b; }

/* 车型大全 · Logo 网格 */
.brand-head {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .08em;
  color: #f0e2c6;
  padding: 20px 16px 14px;
  position: relative;
}
.brand-head::before,
.brand-head::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 46px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 160, 99, .8));
}
.brand-head::before { left: 22px; }
.brand-head::after { right: 22px; transform: scaleX(-1); }

.brand-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 6px;
  padding: 0 14px 26px;
}

.brand-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.brand-item .tile {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .22);
  transition: transform .18s cubic-bezier(.34, 1.4, .64, 1), box-shadow .18s;
}
.brand-item .tile img { width: 100%; height: 100%; object-fit: contain; }

.brand-item .name {
  font-size: 12px;
  line-height: 1.2;
  color: #f2f2f2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (hover: hover) {
  .brand-item:hover .tile { transform: translateY(-3px) scale(1.03); box-shadow: 0 8px 16px rgba(0, 0, 0, .36); }
  .brand-item:active .tile { transform: scale(.95); }
}

/* ---------- 底部 Tab ---------- */

.tabbar {
  flex: 0 0 auto;
  height: 62px;
  background: var(--tabbar-bg);
  display: grid;
  grid-auto-flow: column;          /* Tab 数量由内容决定，不写死列数 */
  grid-auto-columns: 1fr;
  border-top: 1px solid rgba(0, 0, 0, .07);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 20;
}

.tab {
  border: 0;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  font: inherit;
  color: #9a9a9a;
  transition: color .16s ease;
  position: relative;
}

.tab svg, .tab img { width: 22px; height: 22px; display: block; }
.tab img { object-fit: contain; filter: grayscale(1) opacity(.55); transition: filter .16s ease; }
.tab .tab-txt {
  height: 22px;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: inherit;
}
.tab .label { font-size: 11px; line-height: 1; }

.tab.active { color: #0f7a52; font-weight: 600; }
.tab.active img { filter: none; }
.tab.active .tab-txt { font-weight: 800; }

/* ---------- 骨架屏 / 提示 ---------- */

.skeleton { padding: 0; }
.sk-block { background: linear-gradient(100deg, #e9e9e9 30%, #f5f5f5 50%, #e9e9e9 70%);
  background-size: 220% 100%; animation: shimmer 1.3s infinite linear; }
.sk-hero { height: 260px; }
.sk-a { height: 150px; margin-top: 10px; }
.sk-b { height: 190px; margin-top: 10px; }
@keyframes shimmer { from { background-position: 140% 0; } to { background-position: -40% 0; } }

.empty { padding: 60px 24px; text-align: center; color: #8d8d8d; font-size: 14px; line-height: 1.9; }
.on-dark .empty { color: #b9b9b9; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 42px;
  transform: translate(-50%, 20px);
  background: rgba(20, 20, 20, .92);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  z-index: 99;
  max-width: 80vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 移动端满屏 ---------- */

@media (max-width: 560px) {
  body { padding: 0; background: var(--page-bg); }
  .phone {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
