/* ============================================================
   用户端全局样式：首页 + 播放页
   采用红色/粉色为主的小红书风，重点适配苹果手机竖屏
   ============================================================ */

/* 全局基础设置：清边距、统一盒模型、隐藏横向滚动 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent; /* 去掉点击高亮 */
}

html, body {
  width: 100%;
  height: 100%;
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: #f5f5f5;
  color: #222;
  /* 隐藏滚动条，保持页面干净高端 */
  scrollbar-width: none;
}
::-webkit-scrollbar, body::-webkit-scrollbar {
  display: none; /* 苹果浏览器隐藏滚动条 */
}

/* ---------- 顶部信息栏：固定不滚动 ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.topbar-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
}
.topbar-left {
  position: absolute;
  left: 12px;
  display: flex;
  align-items: center;
}
/* 大厂风格返回按钮：圆形半透明背景 + 左箭头，无文字，点击有反馈 */
.back-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: #333;
  cursor: pointer;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.back-btn:active {
  background: rgba(0, 0, 0, 0.14);
}
.topbar-right {
  position: absolute;
  right: 12px;
}
.topbar-admin {
  font-size: 13px;
  color: #999;
  cursor: pointer;
}

/* ---------- 主体内容：独立滚动，给顶栏留出空间 ---------- */
.content {
  position: fixed;
  top: 50px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow-y: auto; /* 内容区独立滚动 */
  -webkit-overflow-scrolling: touch; /* 苹果流畅滚动 */
}
/* 隐藏内容区滚动条 */
.content::-webkit-scrollbar {
  display: none;
}

/* ---------- 轮播图 ---------- */
.banner-wrap {
  padding: 10px 10px 0;
}
.banner {
  position: relative;
  width: 100%;
  height: 200px; /* 轮播框高度调高，更美观 */
  border-radius: 12px;
  overflow: hidden;
  background: #eee;
}
.banner-track {
  display: flex;
  height: 100%;
  transition: transform 0.4s ease; /* 轮播切换动画 */
}
.banner-slide {
  flex: 0 0 100%;
  height: 100%;
}
/* 让包裹图片的链接填满轮播框 */
.banner-slide a {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #ffffff;
}
.banner-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover; /* 图片填满整个框，允许裁剪变形 */
}
.banner-dots {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.banner-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  transition: all 0.3s;
}
.banner-dots span.active {
  width: 16px;
  border-radius: 3px;
  background: #fff; /* 当前页高亮 */
}

/* ---------- 瀑布流标题 ---------- */
.feed-title {
  padding: 14px 12px 6px;
  font-size: 16px;
  font-weight: 700;
}

/* ---------- 双列瀑布流：左右两列往下排 ---------- */
.waterfall {
  display: flex;
  gap: 8px;
  padding: 8px 10px 20px;
  align-items: flex-start; /* 两列各自高度独立 */
}
.col {
  flex: 1; /* 每列占一半 */
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

/* ---------- 视频卡片 ---------- */
.card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.card-cover {
  position: relative;
  width: 100%;
  background: #eee;
}
/* 无封面图时的占位色块 */
.cover-placeholder {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(135deg, #ff9aa8, #ff5d78); /* 渐变占位背景 */
}
.card-cover img {
  display: block;
  width: 100%;
  object-fit: cover; /* 高度靠图片比例撑开，形成高低差 */
}
/* 封面右下角播放量角标 */
.card-stat {
  position: absolute;
  bottom: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: #fff;
  background: rgba(0,0,0,0.5);
  padding: 2px 6px;
  border-radius: 8px;
}
.card-body {
  padding: 8px 9px 10px;
}
.card-title {
  font-size: 14px;
  line-height: 1.3;
  /* 标题最多显示 2 行，超出隐藏 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-cat {
  margin-top: 6px;
  font-size: 11px;
  color: #ff2442;
}
.card-link {
  display: block; /* 让卡片可点击进入播放页 */
  color: inherit;
  text-decoration: none;
}

/* ---------- 加载更多 ---------- */
.load-more {
  text-align: center;
  padding: 14px;
  font-size: 13px;
  color: #aaa;
}

/* ---------- 下拉刷新红色转圈（小红书风） ---------- */
.pull-hint {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  color: #ff2442;
  font-size: 13px;
  z-index: 5;
  background: #f5f5f5;
}
.pull-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #ffb2bd;
  border-top-color: #ff2442;
  border-radius: 50%;
  animation: rotate 0.8s linear infinite;
}
@keyframes rotate {
  to { transform: rotate(360deg); }
}

/* ---------- 播放页 ---------- */
.player-wrap {
  position: relative;
  background: #000;
  width: 100%;
}
.player {
  width: 100%;
  max-height: 60vh;
  background: #000;
  display: block;
}
/* 自定义播放器控制条 */
.custom-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  opacity: 1; /* 默认可见 */
  transition: opacity 0.3s ease;
  z-index: 4;
}
/* 播放且无操作时淡出控制条 */
.player-wrap.hide-controls .custom-controls {
  opacity: 0;
}
.ctrl-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.ctrl-btn:active {
  opacity: 0.6;
}
.ctrl-time {
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ctrl-progress {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.3);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
}
.ctrl-progress-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255,255,255,0.4);
  border-radius: 2px;
  width: 0;
}
.ctrl-progress-played {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: #ff2442;
  border-radius: 2px;
  width: 0;
}
.ctrl-progress-thumb {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  left: 0;
  opacity: 0;
  transition: opacity 0.2s;
}
.ctrl-progress:hover .ctrl-progress-thumb {
  opacity: 1;
}
/* "开启声音"按钮：覆盖在播放器中央，默认隐藏 */
.unmute-btn {
  display: none;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 20px;
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
  z-index: 5;
  user-select: none;
}
/* 播放开始时显示该按钮 */
.unmute-btn.show {
  display: block;
}
.video-info {
  background: #fff;
  padding: 12px;
}
.video-title {
  font-size: 18px;
  line-height: 1.4;
}
.video-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 13px;
  color: #888;
}
.tag {
  background: #fff0f1;
  color: #ff2442;
  padding: 2px 8px;
  border-radius: 6px;
}
.play-line b {
  color: #ff2442;
}
.video-desc {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: #555;
  /* 简介过长设最大高度，超出隐藏 */
  max-height: 60px;
  overflow: hidden;
}

/* ---------- 加载中遮罩：简洁，只显示转圈，无文字 ---------- */
.loading-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(255,255,255,0.4);
  border-top-color: #ff2442;
  border-radius: 50%;
  animation: rotate 0.8s linear infinite;
}

/* ---------- 苹果 Safari 引导弹窗（强制跳转，居中显示） ---------- */
.safari-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75); /* 加深遮罩，强制感更强 */
  z-index: 2000;
  display: flex;
  align-items: center; /* 居中显示 */
  justify-content: center;
  padding: 20px;
}
.safari-sheet {
  width: 100%;
  max-width: 320px;
  background: #fff;
  border-radius: 18px;
  padding: 26px 20px 22px;
  transform: scale(0.8); /* 初始缩小 */
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  text-align: center;
}
.safari-mask.show .safari-sheet {
  transform: scale(1); /* 弹出动画 */
  opacity: 1;
}
.safari-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  background: linear-gradient(135deg,#1b8bff,#4fa8ff);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
}
.safari-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
}
.safari-desc {
  font-size: 13px;
  color: #888;
  margin-bottom: 18px;
}
.btn {
  display: inline-block;
  width: 100%;
  padding: 12px 0;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
}
.btn-primary {
  background: #ff2442;
  color: #fff;
}

/* 复制链接按钮 */
.btn-copy {
  background: #f2f3f5;
  color: #333;
  width: 100%;
  margin-top: 4px;
}
.btn-copy.copied {
  background: #34c759;
  color: #fff;
}

/* ---------- Safari 引导：分步操作指引 ---------- */
.safari-guide {
  margin: 8px 0 14px;
}
/* 模拟手机浏览器顶栏 */
.guide-phone {
  background: #f2f3f5;
  border-radius: 12px;
  padding: 14px 14px 18px;
  margin-bottom: 16px;
}
.guide-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
/* 地址栏文本 */
.guide-url {
  font-size: 12px;
  color: #999;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  max-width: 65%;
}
/* 右上角更多按钮（三个点样式，类似浏览器菜单） */
.guide-share-btn {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  background: #e8e8ed;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
/* 三个点图标 */
.guide-share-btn::before {
  content: '';
  width: 14px;
  height: 4px;
  background-image: radial-gradient(circle, #666 1.5px, transparent 1.5px);
  background-size: 4px 4px;
  background-repeat: repeat-x;
  background-position: center;
}
/* 红色箭头：指向右上角更多按钮 */
.guide-arrow {
  position: absolute;
  right: -8px;
  top: -30px;
  width: 44px;
  height: 44px;
  transform: rotate(20deg);
}
/* 引导步骤行 */
.guide-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 10px;
  color: #333;
}
.guide-step:last-child {
  margin-bottom: 0;
}
.guide-step b {
  color: #ff2442;
}
/* 步骤序号圆点 */
.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ff2442;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---------- 桌面端限宽：居中显示手机宽度，提升 PC 观感 ---------- */
@media (min-width: 768px) {
  /* 页面背景加深，形成"手机卡"效果 */
  body {
    background: #e6e6e6;
  }
  /* 顶部信息栏与内容区都限制为手机宽度并居中 */
  .topbar,
  .content {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
  }
  body .content {
    position: fixed;
    left: 0;
    right: 0;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.12); /* 给内容加轻微阴影 */
  }
}