/* ============ 全局 / 重置 ============ */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: #f5f1ea;
  color: #2b2b2b;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

:root {
  --brand: #9b2c2c;
  --brand-dark: #6e1f1f;
  --bg: #f5f1ea;
  --card: #ffffff;
  --text: #2b2b2b;
  --text-light: #888;
  --warn: #c05621;
  --danger: #c53030;
}

/* ============ 顶部导航 ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 12px;
  background: var(--brand);
  color: #fff;
}
.topbar-back, .topbar-cart {
  color: #fff;
  text-decoration: none;
  font-size: 26px;
  width: 36px;
  text-align: center;
  line-height: 1;
}
.topbar-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  margin: 0;
}

/* ============ 合规提示 ============ */
.compliance {
  background: #fff5e6;
  color: var(--warn);
  border-left: 4px solid var(--warn);
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.5;
}
.compliance-top { border-left: none; border-bottom: 1px solid #f0d9b5; text-align: center; }
.compliance-mid { margin: 16px 12px; border-radius: 4px; }

/* ============ 容器 ============ */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 88px; /* 给底部操作栏留位 */
}
.loading {
  text-align: center;
  padding: 60px 12px;
  color: var(--text-light);
}

/* ============ 视频模块 ============ */
.video-wrap {
  position: relative;
  background: #000;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.video-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  touch-action: none; /* 阻止默认滚动，便于手势缩放 */
}
.video-el {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  transition: transform 0.1s ease-out;
  object-fit: contain;
  background: #000;
}

.video-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0));
  color: #fff;
  z-index: 5;
}
.vc-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 4px;
  min-width: 32px;
}
.vc-btn:active { background: rgba(255,255,255,0.2); }
.vc-progress {
  flex: 1;
  height: 4px;
  accent-color: var(--brand);
  cursor: pointer;
}
.vc-time { font-size: 12px; font-variant-numeric: tabular-nums; min-width: 92px; }
.vc-volume { width: 70px; accent-color: var(--brand); }

.zoom-tip {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: rgba(255,255,255,0.85);
  background: rgba(0,0,0,0.45);
  padding: 3px 10px;
  border-radius: 12px;
  pointer-events: none;
  z-index: 4;
  transition: opacity 0.4s;
}

/* ============ 基础信息 ============ */
.info {
  background: var(--card);
  padding: 16px 12px;
  margin-bottom: 8px;
}
.info-name {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.info-price {
  color: var(--brand);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}
.info-price::before { content: '¥'; font-size: 14px; margin-right: 2px; }
.info-meta {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}
.info-meta li { font-size: 13px; color: var(--text-light); }
.info-meta li b { color: var(--text); margin-left: 6px; font-weight: 600; }
.info-intro {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  border-top: 1px dashed #eee;
  padding-top: 12px;
}

/* ============ 通用区块标题 ============ */
.section-title {
  margin: 0;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  background: var(--card);
  border-bottom: 1px solid #f0ebe2;
}

/* ============ 图文轮播 ============ */
.gallery {
  margin-bottom: 8px;
  background: var(--card);
}
.carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
}
.carousel-track {
  display: flex;
  transition: transform 0.32s ease;
  will-change: transform;
}
.carousel-track > div {
  flex: 0 0 100%;
  text-align: center;
  padding: 8px 0;
}
.carousel-track img {
  width: auto;
  max-height: 360px;
  margin: 0 auto;
  cursor: zoom-in;
}
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 22px;
  line-height: 32px;
}
.carousel-arrow.prev { left: 10px; }
.carousel-arrow.next { right: 10px; }
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
}
.carousel-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ccc;
  transition: background 0.2s;
}
.carousel-dots span.active { background: var(--brand); }
.gallery-desc {
  margin: 0;
  padding: 8px 12px 16px;
  font-size: 13px;
  color: var(--text-light);
}

/* ============ 详情图文 ============ */
.desc { background: var(--card); margin-bottom: 8px; }
.desc-content {
  padding: 12px;
  font-size: 14px;
  color: var(--text);
  white-space: pre-wrap;
}

/* ============ 底部购买栏 ============ */
.actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: var(--card);
  box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
}
.compliance-bar {
  border-left: none;
  border-bottom: 1px solid #f0d9b5;
  text-align: center;
  font-size: 12px;
  padding: 5px 12px;
}
.action-row {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  max-width: 720px;
  margin: 0 auto;
}
.action-btn {
  flex: 1;
  height: 44px;
  border: 1px solid var(--brand);
  border-radius: 22px;
  font-size: 15px;
  font-weight: 600;
}
.action-btn.cart {
  background: #fff;
  color: var(--brand);
}
.action-btn.buy {
  background: var(--brand);
  color: #fff;
}
.action-btn:active { opacity: 0.85; }

/* ============ 图片放大查看 ============ */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.viewer[hidden] { display: none; }
.viewer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 24px;
  text-align: center;
  line-height: 36px;
}
.viewer-img { max-width: 95%; max-height: 90vh; }

/* ============ Toast ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  z-index: 90;
  max-width: 80%;
  text-align: center;
}
.toast[hidden] { display: none; }

/* ============ 年龄确认弹层 ============ */
.age-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.age-modal[hidden] { display: none; }
.age-modal-box {
  background: #fff;
  border-radius: 12px;
  padding: 24px 20px;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.age-modal-box h3 { margin: 0 0 12px; color: var(--brand); font-size: 18px; }
.age-modal-box p { margin: 0 0 10px; font-size: 14px; color: var(--text); }
.age-modal-warn { color: var(--danger); font-weight: 600; }
.age-modal-btns {
  display: flex;
  gap: 12px;
  margin: 18px 0;
}
.age-btn {
  flex: 1;
  height: 42px;
  border: none;
  border-radius: 21px;
  font-size: 15px;
  font-weight: 600;
}
.age-btn.ok { background: var(--brand); color: #fff; }
.age-btn.no { background: #eee; color: var(--text); }
.age-modal-tip {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.5;
}

/* ============ 响应式 ============ */
@media (max-width: 480px) {
  .info-meta { grid-template-columns: 1fr; }
  .carousel-track img { max-height: 280px; }
  .vc-volume { display: none; }
  .vc-time { min-width: 80px; font-size: 11px; }
}

/* 桌面端居中布局后，给视频区上下加边框 */
@media (min-width: 721px) {
  .container { padding-bottom: 100px; }
  .video-wrap { aspect-ratio: 16 / 9; max-height: 70vh; }
}
