/* 大农户 · 专家课堂「视频挂链」 v3.26.353（含开放标签 / 小程序码引导层）
 * 参考抖音「小黄车」：常驻购物车角标（自定义链接名称 + 数量）+ 展开商品架。
 * v3.26.347：图标与文字统一 40px 行高；角标贴视频右下角（控制条上沿）。
 * 兼容性：opacity:1 起步、display 直接切、reduced-motion 终态写死。
 * 动画：仅图标轻摆 / 光晕 / 背景流光；文字不缩放、不位移、不降透明度；周期 ≥3s。
 */
.ec-video-wrap, .player { position: relative; }
.ec-video-wrap > video, .player > video { position: relative; z-index: 1; }

/* 贴视频右下角：right 更贴边；bottom 落在原生 controls 上沿，既不遮挡控制条又紧贴底部 */
#vlinkDock {
  position: absolute; right: 8px; bottom: 44px; z-index: 20;
  opacity: 1; pointer-events: none;
}
#vlinkDock[hidden] { display: none; }
#vlinkDock > * { pointer-events: auto; }

.vl-dock-wrap { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
/* v3.26.349: 角标只保留购物车图标；即便旧缓存 JS 渲染出名称胶囊也不展示 */
.vl-dock-wrap .vl-dock-label { display: none !important; }

/* 自定义链接名称胶囊：慢速流光只走背景，文字恒定高对比白色 */
.vl-dock-label {
  max-width: 156px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: inline-block; box-sizing: border-box;
  height: 40px; padding: 0 12px; border-radius: 20px;
  background: rgba(12, 26, 18, .84); color: #fff;
  /* 40px 容器 - 2px 边框 = 38px 行高，文字与购物车圆钮等高同行 */
  font-size: 12px; font-weight: 600; line-height: 38px; letter-spacing: .2px;
  border: 1px solid rgba(255, 255, 255, .30);
  background-image: linear-gradient(105deg, rgba(255,255,255,0) 30%, rgba(255,199,92,.42) 50%, rgba(255,255,255,0) 70%);
  background-size: 240% 100%; background-repeat: no-repeat;
  -webkit-animation: vlShine 6s linear infinite;
  animation: vlShine 6s linear infinite;
}
@-webkit-keyframes vlShine { 0% { background-position: 180% 0; } 100% { background-position: -80% 0; } }
@keyframes vlShine { 0% { background-position: 180% 0; } 100% { background-position: -80% 0; } }

/* 小黄车圆钮：橙金渐变 + 慢速光晕呼吸；图标慢速轻摆（±7°，不缩放） */
.vl-dock-cart {
  position: relative; width: 40px; height: 40px; flex: 0 0 40px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255,255,255,.88); border-radius: 50%; padding: 0;
  background: linear-gradient(140deg, #FFC24A 0%, #FF8A1E 55%, #F2620C 100%);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  -webkit-animation: vlGlow 3.6s ease-in-out infinite;
  animation: vlGlow 3.6s ease-in-out infinite;
}
@-webkit-keyframes vlGlow {
  0%, 100% { box-shadow: 0 3px 12px rgba(242,98,12,.45), 0 0 0 0 rgba(255,180,60,.34); }
  50%      { box-shadow: 0 4px 18px rgba(242,98,12,.62), 0 0 0 7px rgba(255,180,60,0); }
}
@keyframes vlGlow {
  0%, 100% { box-shadow: 0 3px 12px rgba(242,98,12,.45), 0 0 0 0 rgba(255,180,60,.34); }
  50%      { box-shadow: 0 4px 18px rgba(242,98,12,.62), 0 0 0 7px rgba(255,180,60,0); }
}
.vl-dock-ico {
  display: block; width: 22px; height: 22px; line-height: 0;
  -webkit-animation: vlSway 4.2s ease-in-out infinite;
  animation: vlSway 4.2s ease-in-out infinite;
}
@-webkit-keyframes vlSway { 0%, 100% { -webkit-transform: rotate(-7deg); } 50% { -webkit-transform: rotate(7deg); } }
@keyframes vlSway { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
.vl-dock-ico svg { display: block; width: 22px; height: 22px; }
.vl-dock-count {
  position: absolute; top: -3px; right: -3px; min-width: 17px; height: 17px;
  border-radius: 9px; background: #E23B2B; color: #fff;
  font-size: 10px; font-weight: 700; line-height: 17px; text-align: center;
  border: 2px solid #fff; padding: 0 3px;
}
.vl-dock-cart:active { background: linear-gradient(140deg, #F5A93A 0%, #E87716 100%); }

/* ── 展开态：商品架（文档流，不遮挡播放器 controls） ── */
#vlinkPanel[hidden] { display: none; }
#vlinkPanel {
  background: #fff; color: #1c2b22;
  border-bottom: 1px solid #e7ede8;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom));
  max-height: 52vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.vl-shelf-head {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 2px 10px; margin-bottom: 8px;
  border-bottom: 1px solid #f0e2cc;
}
.vl-shelf-cart {
  width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%;
  background: linear-gradient(140deg, #FFC24A, #F2620C);
  display: flex; align-items: center; justify-content: center;
}
.vl-shelf-cart svg { width: 14px; height: 14px; }
.vl-shelf-title { font-size: 14px; font-weight: 700; color: #B9550B; flex: 1 1 auto; line-height: 20px; }
.vl-shelf-n { font-size: 12px; color: #8a958e; flex: 0 0 auto; line-height: 20px; }
.vl-shelf-close {
  flex: 0 0 auto; border: 0; background: transparent; color: #8a958e;
  font-size: 12px; cursor: pointer; padding: 4px 2px 4px 8px;
}
.vlink-list { display: block; }
.vlink-card {
  position: relative;
  display: flex; align-items: center; min-height: 72px;
  padding: 9px; margin-bottom: 8px;
  border: 1px solid #f0e6d6; border-radius: 12px;
  background: linear-gradient(180deg, #fffdf8, #fff);
  cursor: pointer;
}
.vlink-card:last-child { margin-bottom: 0; }
.vlink-card:active { background: #fff4e2; }
.vlink-thumb {
  width: 54px; height: 54px; flex: 0 0 54px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: #f5f1e8; overflow: hidden;
}
.vlink-thumb img { width: 100%; height: 100%; object-fit: contain; }
.vlink-emoji { font-size: 27px; line-height: 1; }
.vlink-txt { flex: 1 1 auto; min-width: 0; padding: 0 8px; }
.vlink-title {
  font-size: 13.5px; font-weight: 700; line-height: 1.35; color: #1c2b22;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vlink-sub {
  font-size: 11.5px; line-height: 1.4; color: #7c887f; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.vlink-price { font-size: 13px; font-weight: 700; color: #E0531B; margin-top: 2px; line-height: 1.3; }
.vlink-cta { flex: 0 0 auto; padding-left: 4px; }
.vlink-buy {
  display: inline-block; padding: 7px 11px; border-radius: 16px;
  background: linear-gradient(140deg, #FFC24A, #F2620C); color: #fff;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(242,98,12,.24);
}

/* 朋友圈深色 H5 面板：保持可读性，不覆盖播放器 */
body#vlinkShare #vlinkPanel, .wrap #vlinkPanel.vlink-dark { background: #171b18; color: #eef3ec; }
body#vlinkShare .vl-shelf-head, .wrap #vlinkPanel.vlink-dark .vl-shelf-head { border-bottom-color: #2f3a32; }
body#vlinkShare .vlink-card, .wrap #vlinkPanel.vlink-dark .vlink-card {
  background: #202722; border-color: #334037;
}
body#vlinkShare .vlink-title, .wrap #vlinkPanel.vlink-dark .vlink-title { color: #f2f6f1; }

/* 横屏自动收起为角标（JS 同步置 hidden），此处仅压缩面板高度 */
@media (orientation: landscape) and (max-height: 480px) {
  #vlinkPanel { max-height: 40vh; }
  #vlinkDock { bottom: 44px; }
  .vl-dock-label { max-width: 110px; }
}

/* 荣耀 / 省电模式 / 移除动画：动画全关，但终态写死可见，角标绝不消失 */
@media (prefers-reduced-motion: reduce) {
  #vlinkDock, #vlinkPanel, .vlink-card, .vl-dock-label, .vl-dock-cart, .vl-dock-ico {
    opacity: 1 !important; transform: none !important;
    transition: none !important;
    -webkit-animation: none !important; animation: none !important;
  }
  .vl-dock-label { background-image: none !important; }
  .vl-dock-cart { box-shadow: 0 3px 12px rgba(242,98,12,.45) !important; }
}

/* 后台弹窗预览（复用同一卡片模板，去掉点击态与动画干扰） */
#vlink-preview { position: relative; }
#vlink-preview .vlink-card { cursor: default; background: linear-gradient(180deg, #fffdf8, #fff); }
#vlink-preview .vlink-card:active { background: linear-gradient(180deg, #fffdf8, #fff); }
#vlink-preview .vl-dock-label,
#vlink-preview .vl-dock-cart,
#vlink-preview .vl-dock-ico {
  -webkit-animation: none !important; animation: none !important;
  transform: none !important; opacity: 1 !important;
}
#vlink-preview .vl-shelf-close { display: none; }


/* ── v3.26.350 微信开放标签 + 小程序码引导层（仅朋友圈 H5 /c/<cid> 使用） ──
   覆盖层用 left/top/width/height，不用 inset（老 X5 / 荣耀 WebView 不支持）。 */
.dnh-wx-tag {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  z-index: 5; display: block; opacity: 1;
}
.dnh-card-tag { z-index: 6; }
#dnhWxCodeMask {
  position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 9999;
  background: rgba(0, 0, 0, .78); display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 1;
}
#dnhWxCodeMask[hidden] { display: none; }
.dnh-wxcode-box {
  width: 100%; max-width: 320px; background: #fff; border-radius: 16px;
  padding: 20px 18px 16px; text-align: center; color: #1c2b22;
}
.dnh-wxcode-title { font-size: 15px; font-weight: 700; line-height: 1.5; margin-bottom: 14px; }
#dnhWxCodeImg {
  display: block; width: 200px; height: 200px; margin: 0 auto 10px;
  background: #f5f1e8; border-radius: 10px;
}
.dnh-wxcode-tip { font-size: 12px; line-height: 1.7; color: #7c887f; margin-bottom: 14px; }
.dnh-wxcode-btn {
  display: block; width: 100%; padding: 11px 0; border: 0; border-radius: 22px;
  background: linear-gradient(140deg, #FFC24A, #F2620C); color: #fff;
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.dnh-wxcode-link {
  display: block; margin-top: 12px; font-size: 12px; color: #1f7a4d;
  text-decoration: underline; cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
  #dnhWxCodeMask, .dnh-wxcode-box, .dnh-wx-tag {
    opacity: 1 !important; transform: none !important;
    -webkit-animation: none !important; animation: none !important;
  }
}
