/* ==========================================================================
   广告播放栏 · 独立样式表
   --------------------------------------------------------------------------
   为什么单独一个文件：`styles.css` 属 V1.0 起不可动清单（SHA256 锁定），
   V1.02 全程未改。本栏目的样式全部自包含在此，不污染也不依赖既有样式。

   设计口径：
   · 电视框质感 —— 深色金属边框 + 内阴影 + 屏幕反光，避免"贴了个video"的廉价感
   · 静止态显示广告内产品图截图（已压缩 webp），画面上永远带"广告"标识
   · 点击播放 / 再次点击暂停；同一时刻只允许一路画面+声音
   ========================================================================== */

/* ---------- 区块外壳 ---------- */
.adbar {
  --adbar-radius: 14px;
  --adbar-frame: #14161a;
  --adbar-frame-hi: #3a3f47;
  --adbar-ink: #f2f3f5;

  position: relative;
  padding: clamp(28px, 4.2vw, 56px) clamp(16px, 3vw, 40px);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(178, 141, 84, 0.09) 0%, rgba(178, 141, 84, 0) 62%),
    linear-gradient(180deg, #0c0d10 0%, #101216 100%);
  color: var(--adbar-ink);
}

.adbar-inner {
  width: min(1240px, 100%);
  margin: 0 auto;
}

/* ---------- 标题 ---------- */
.adbar-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: clamp(16px, 2vw, 26px);
}

.adbar-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #b29d70;
}

.adbar-title {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

.adbar-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: #9aa0a8;
  max-width: 46ch;
}

/* ---------- 电视框 ---------- */
.adbar-tv {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(14px, 1.8vw, 22px);
  padding: clamp(12px, 1.5vw, 18px);
  border-radius: var(--adbar-radius);
  background: linear-gradient(160deg, #23262c 0%, var(--adbar-frame) 42%, #0d0e11 100%);
  box-shadow:
    inset 0 1px 0 var(--adbar-frame-hi),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 24px 60px -28px rgba(0, 0, 0, 0.9);
}

/* 桌面：左列两台电视上下叠放，右列一支手机。
   为什么这么排：竖版 9:16 与横版 16:9 等宽并排必然留出大片空洞
   （实测横版 217px 高 vs 竖版 687px 高，落差 470px）。
   改成「两横 + 一竖」后，列宽比按几何反推：
   左列高 ≈ 左宽 × 0.5625 × 2（两台）＝ 1.125 × 左宽
   右列高 ≈ 右宽 × 1.778（手机全高）
   要两者相当 => 右宽 : 左宽 ≈ 0.633 : 1，取 0.64 后两列高度基本齐平。 */
@media (min-width: 900px) {
  .adbar-tv {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr);
    align-items: center;
  }
}

.adbar-stack {
  display: grid;
  gap: clamp(14px, 1.8vw, 22px);
  min-width: 0;
}

/* ---------- 单台电视 ---------- */
.adbar-set {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

/* 屏幕外壳 */
.adbar-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  /* 屏幕内阴影，模拟屏幕边缘 */
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    inset 0 0 34px rgba(0, 0, 0, 0.72);
}

/* 竖版那条（品牌短片 9:16）用手机机身，不用电视框。
   理由有两层：一是几何上 9:16塞进 16:9 电视框必然左右或上下留黑边，
   二是内容性质不同 —— 前两条是拿到广告审查批文的电视样片，
   这一条是竖屏拍摄的祝福短片，用手机形态在语义上更贴切。 */
.adbar-set[data-orientation="portrait"] {
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}

.adbar-set[data-orientation="portrait"] .adbar-screen {
  aspect-ratio: 9 / 16;
  border-radius: 26px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.09),
    inset 0 0 30px rgba(0, 0, 0, 0.6);
}

/* 手机机身：金属中框 + 上下留出边框厚度 */
.adbar-phone {
  position: relative;
  padding: 9px;
  border-radius: 34px;
  background: linear-gradient(155deg, #4a5058 0%, #1b1e23 26%, #0c0d10 62%, #31363d 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    0 20px 44px -22px rgba(0, 0, 0, 0.92);
}

/* 灵动岛 */
.adbar-phone::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 50%;
  width: 74px;
  height: 20px;
  border-radius: 12px;
  background: #000;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
}

/* 底部 Home 指示条 */
.adbar-phone::after {
  content: "";
  position: absolute;
  bottom: 18px;
  left: 50%;
  width: 96px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.34);
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
}

.adbar-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 0;
  background: #000;
}

.adbar-set[data-orientation="portrait"] .adbar-media {
  object-fit: contain;
}

/* 屏幕反光层：非交互，不拦截点击 */
.adbar-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(196deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0) 42%);
}

/* 手机屏内反光减淡：顶部要让灵动岛压得住 */
.adbar-set[data-orientation="portrait"] .adbar-screen::after {
  background: linear-gradient(196deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 30%);
}

/* ---------- 点击层（同时是按钮）---------- */
.adbar-hit {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  /* 抑制移动端双击缩放，但**不**阻断原生 click 的用户手势
     （曾用 touchend + preventDefault + 手动 click() 代替，真机点不动） */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* 手机那条：播放键下移到画面下缘，避开上部人脸主体 */
.adbar-set[data-orientation="portrait"] .adbar-hit {
  align-items: end;
  padding-bottom: 13%;
}

.adbar-set[data-orientation="portrait"] .adbar-play {
  width: 54px;
  height: 54px;
}

/* 静止态：铺一层暗色，让中间的播放三角更醒目 */
.adbar-hit::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(6, 7, 9, 0.34);
  transition: background 0.22s ease, opacity 0.22s ease;
}

.adbar-hit:hover::before,
.adbar-hit:focus-visible::before {
  background: rgba(6, 7, 9, 0.2);
}

/* 手机那条：整体压暗更轻，避免人脸肤色发灰 */
.adbar-set[data-orientation="portrait"] .adbar-hit::before {
  background: rgba(6, 7, 9, 0.18);
}

.adbar-set[data-orientation="portrait"] .adbar-hit:hover::before,
.adbar-set[data-orientation="portrait"] .adbar-hit:focus-visible::before {
  background: rgba(6, 7, 9, 0.1);
}

/* 播放三角 */
.adbar-play {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(10, 11, 13, 0.5);
  border: 1.5px solid rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(3px);
  transition: transform 0.22s ease, background 0.22s ease, opacity 0.18s ease;
}

.adbar-hit:hover .adbar-play,
.adbar-hit:focus-visible .adbar-play {
  transform: scale(1.07);
  background: rgba(10, 11, 13, 0.66);
}

.adbar-play svg {
  width: 22px;
  height: 22px;
  margin-left: 3px; /* 视觉居中：三角形几何偏右 */
  fill: #fff;
}

/* 播放中：隐藏播放三角，露出暂停条 */
.adbar-hit[data-state="playing"] .adbar-play {
  opacity: 0;
  pointer-events: none;
}

.adbar-hit::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* 播放中：暗色层退去，露出画面 */
.adbar-hit[data-state="playing"]::before {
  background: rgba(6, 7, 9, 0);
  opacity: 0;
}

/* ---------- 播放/暂停图标切换 ---------- */
.adbar-icon-pause {
  display: none;
}

.adbar-hit[data-state="playing"] .adbar-icon-play {
  display: none;
}

.adbar-hit[data-state="playing"] .adbar-icon-pause {
  display: block;
}

/* 播放中浮出的暂停按钮 */
.adbar-pause-float {
  position: absolute;
  z-index: 4;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(10, 11, 13, 0.62);
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.adbar-hit[data-state="playing"]:hover .adbar-pause-float,
.adbar-hit[data-state="playing"]:focus-visible .adbar-pause-float {
  opacity: 1;
}

.adbar-pause-float svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

/* ---------- 静止态角标 ---------- */
.adbar-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 3px 9px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-size: 11px;
  letter-spacing: 0.14em;
  line-height: 1.5;
  color: #e8e9eb;
  pointer-events: none;
}

.adbar-badge[hidden] {
  display: none;
}

/* ---------- 机位下方铭牌 ---------- */
.adbar-plaque {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.adbar-plaque-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #eceded;
  letter-spacing: 0.02em;
}

.adbar-plaque-dur {
  margin: 0;
  font-size: 12px;
  color: #8d939b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.adbar-set[data-playing="true"] .adbar-plaque {
  border-color: rgba(178, 141, 84, 0.5);
}

/* 播放中在铭牌左侧点亮一个小圆点 */
.adbar-lamp {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4a4f57;
  flex: none;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.adbar-set[data-playing="true"] .adbar-lamp {
  background: #d3b271;
  box-shadow: 0 0 8px rgba(211, 178, 113, 0.8);
}

/* ---------- 区块下方合规说明 ---------- */
.adbar-legal {
  margin: clamp(16px, 2vw, 24px) 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12.5px;
  line-height: 1.85;
  color: #8a9098;
}

.adbar-legal strong {
  color: #b6bcc4;
  font-weight: 600;
}

.adbar-legal .keep {
  white-space: nowrap;
}

/* ---------- 减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  .adbar-play,
  .adbar-pause-float,
  .adbar-hit::before,
  .adbar-lamp {
    transition: none;
  }

  .adbar-hit:hover .adbar-play,
  .adbar-hit:focus-visible .adbar-play {
    transform: none;
  }
}

/* ---------- 键盘可达性 ---------- */
.adbar-hit:focus-visible {
  outline: 2px solid #d3b271;
  outline-offset: -2px;
}

/* ---------- 窄屏 ---------- */
@media (max-width: 560px) {
  .adbar-plaque {
    padding: 8px 10px;
  }

  .adbar-play {
    width: 52px;
    height: 52px;
  }
}