* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f5f6f8; color: #333; max-width: 640px; margin: 0 auto; min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* ---------- 顶部搜索 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: #fff; padding: 10px 12px 4px;
  display: flex; align-items: center; gap: 8px;
}
.search {
  flex: 1; display: flex; align-items: center; gap: 6px;
  border: 1.5px solid #8b7ff5; border-radius: 20px; padding: 7px 12px; background: #fff;
}
.search svg { flex: none; }
.search input { border: 0; outline: 0; flex: 1; font-size: 14px; background: transparent; color: #333; }
.search input::placeholder { color: #b0b3c0; }
.user-chip { flex: none; display: flex; align-items: center; gap: 5px; font-size: 12px; color: #666; max-width: 90px; }
.user-chip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.user-chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 排序 / 板块 Tab ---------- */
.tabbar {
  position: sticky; top: 47px; z-index: 49;
  background: #fff; padding: 8px 12px; display: flex; gap: 18px;
  border-bottom: 1px solid #f0f0f0;
}
.tab { position: relative; font-size: 15px; color: #555; display: flex; align-items: center; gap: 3px; padding: 2px 0; }
.tab.active { color: #e8223a; font-weight: 600; }
.tab .caret { font-size: 10px; color: #999; transform: scaleY(.8); }
.tab.active .caret { color: #e8223a; }
.menu {
  display: none; position: absolute; top: 30px; left: -8px; min-width: 130px;
  background: #fff; border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.13);
  padding: 5px 0; z-index: 60;
}
.menu.open { display: block; }
.menu a { display: block; padding: 9px 14px; font-size: 14px; color: #444; white-space: nowrap; }
.menu a:hover, .menu a.on { color: #e8223a; background: #fff5f5; }
.menu .right { left: auto; right: -8px; }

/* ---------- 公告 ---------- */
.announce {
  margin: 8px 12px 0; background: #fff7ec; color: #b26a00; border-radius: 8px;
  font-size: 12.5px; padding: 8px 10px; line-height: 1.5; display: none;
}
.announce.show { display: block; }

/* ---------- 视频卡片列表 ---------- */
.list { padding: 4px 0 30px; }
.card {
  background: #fff; margin: 8px 12px 0; border-radius: 10px; padding: 10px;
  display: flex; gap: 10px; cursor: pointer;
}
.card:active { background: #fafafa; }
.thumb {
  position: relative; flex: none; width: 148px; height: 93px;
  border-radius: 8px; overflow: hidden; background: #22293a;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .label {
  position: absolute; top: 0; left: 0; right: 0; padding: 3px 6px;
  font-size: 11px; color: #fff; font-weight: 600;
  background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,0));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left;
}
.thumb .views {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, #ff6a3c, #e8223a);
  color: #fff; font-size: 10.5px; padding: 2px 6px;
}
.card .info { flex: 1; min-width: 0; display: flex; flex-direction: column; padding-top: 2px; }
.card .t {
  font-size: 15px; font-weight: 600; line-height: 1.4; color: #222;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .sub { margin-top: auto; font-size: 12px; color: #999; display: flex; justify-content: space-between; align-items: center; }
.empty { text-align: center; color: #999; font-size: 13px; padding: 60px 0; }

/* ---------- 播放页 ---------- */
.pheader {
  position: sticky; top: 0; z-index: 50; background: #fff;
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
}
.pheader .back { font-size: 22px; line-height: 1; color: #333; padding: 0 4px; }
.pheader .pt { font-size: 15px; font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-box { position: relative; background: #000; max-height: 56vw; }
.player-box video { width: 100%; display: block; max-height: 56vw; background: #000; }
.gate {
  position: absolute; inset: 0; z-index: 5;
  background: linear-gradient(180deg, rgba(10,12,24,.55), rgba(10,12,24,.88));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: #fff; padding: 20px; text-align: center;
}
.gate .lock { font-size: 34px; }
.gate .tip { font-size: 14px; line-height: 1.6; opacity: .92; }
.btn {
  border: 0; outline: 0; cursor: pointer;
  background: linear-gradient(90deg, #ff6a3c, #e8223a); color: #fff;
  font-size: 15px; font-weight: 600; border-radius: 22px; padding: 11px 34px;
}
.btn:active { opacity: .85; }
.btn.green { background: linear-gradient(90deg, #2bc47a, #16a05f); }
.btn.gray { background: #c9ccd4; }
.code-row { display: flex; gap: 8px; }
.code-row input {
  width: 200px; border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.14);
  border-radius: 20px; padding: 10px 14px; color: #fff; font-size: 14px; text-align: center;
  outline: none; letter-spacing: 1px;
}
.code-row input::placeholder { color: rgba(255,255,255,.6); letter-spacing: 0; }
.gate .err { color: #ffb3a6; font-size: 12.5px; min-height: 18px; }
.vmeta-box { background: #fff; padding: 14px; margin-top: 2px; }
.vmeta-box h1 { font-size: 17px; line-height: 1.45; }
.vmeta-box .vm { display: flex; gap: 12px; margin-top: 8px; font-size: 12.5px; color: #e8223a; align-items: center; }
.vmeta-box .vm .sec { color: #888; }
.vmeta-box .desc { margin-top: 10px; font-size: 13.5px; color: #666; line-height: 1.7; white-space: pre-wrap; }
.toast {
  position: fixed; left: 50%; top: 45%; transform: translateX(-50%);
  background: rgba(0,0,0,.78); color: #fff; font-size: 13.5px;
  padding: 10px 18px; border-radius: 8px; z-index: 99; display: none; max-width: 80%;
}
