:root {
  --red: #ff4d6d;
  --red-dark: #e02murky;
  --red-deep: #d92b4d;
  --green: #2dc55c;
  --green-deep: #1e9e47;
  --yellow: #ffb020;
  --bg: #f6f6f8;
  --card: #ffffff;
  --text: #1c1c21;
  --text-2: #5c5c66;
  --text-3: #9393a0;
  --line: #e8e8ee;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 2px 12px rgba(20, 20, 40, .06);
  --shadow-hover: 0 8px 28px rgba(20, 20, 40, .12);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "HarmonyOS Sans SC", sans-serif;
  background: var(--bg); color: var(--text);
  font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 12px; }

/* ============ Header ============ */
.hd {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.hd-in { display: flex; align-items: center; gap: 12px; height: 56px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; color: var(--red-deep); flex-shrink: 0; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--red), #ff7a4d);
  color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: 0 3px 10px rgba(255, 77, 109, .35);
}
.logo-sub { font-size: 11px; color: var(--text-3); font-weight: 400; letter-spacing: .5px; }

.search { flex: 1; position: relative; max-width: 460px; }
.search input {
  width: 100%; height: 38px; padding: 0 14px 0 38px;
  border: 1px solid var(--line); border-radius: 999px;
  background: #f2f2f5; outline: none; transition: .2s;
  font-size: 14px;
}
.search input:focus { background: #fff; border-color: var(--red); box-shadow: 0 0 0 3px rgba(255, 77, 109, .12); }
.search::before {
  content: ''; position: absolute; left: 14px; top: 11px;
  width: 13px; height: 13px; border: 2px solid var(--text-3); border-radius: 50%;
  border-bottom-color: transparent; border-right-color: transparent; transform: rotate(45deg);
}

.hd-links { display: flex; gap: 6px; flex-shrink: 0; }
.hd-btn {
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--line); background: #fff; cursor: pointer; transition: .18s; white-space: nowrap;
}
.hd-btn:hover { border-color: var(--red); color: var(--red); }
.hd-btn.primary { background: var(--red); color: #fff; border-color: var(--red); }
.hd-btn.primary:hover { background: var(--red-deep); color: #fff; }

/* ============ Zone tabs ============ */
.tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 12px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 8px 16px; border-radius: 999px; font-size: 14px; white-space: nowrap;
  background: #fff; border: 1px solid var(--line); cursor: pointer; transition: .18s; color: var(--text-2);
}
.tab:hover { color: var(--red); border-color: #ffd0d8; }
.tab.on { background: var(--red); color: #fff; border-color: var(--red); font-weight: 500; box-shadow: 0 3px 10px rgba(255, 77, 109, .28); }

/* ============ Section ============ */
.sec { padding: 14px 0 4px; }
.sec-hd { display: flex; align-items: baseline; justify-content: space-between; padding: 0 12px; margin-bottom: 10px; }
.sec-title { font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.sec-title::before { content: ''; width: 4px; height: 16px; border-radius: 3px; background: var(--red); }
.sec-more { font-size: 13px; color: var(--text-3); }

/* ============ Video grid ============ */
.grid {
  display: grid; gap: 14px; padding: 0 12px 12px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: .22s; cursor: pointer;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

.thumb { position: relative; width: 100%; aspect-ratio: 16/10; overflow: hidden; background: #2a2a35; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-ph {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: linear-gradient(135deg, #ff9a6d, #ff4d6d 45%, #a8325c);
}
.thumb-ph span { font-size: 34px; font-weight: 700; color: rgba(255, 255, 255, .5); letter-spacing: 2px; }
.badge-zone {
  position: absolute; left: 8px; top: 8px; padding: 3px 9px; border-radius: 6px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; backdrop-filter: blur(4px);
}
.badge-new {
  position: absolute; right: 8px; top: 8px; padding: 3px 9px; border-radius: 6px;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 500;
}
.dur {
  position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 5px;
  background: rgba(0, 0, 0, .65); color: #fff; font-size: 11px; font-variant-numeric: tabular-nums;
}
.play-ico {
  position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: .22s;
  background: rgba(0, 0, 0, .18);
}
.card:hover .play-ico { opacity: 1; }
.play-ico i {
  width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .92);
  display: grid; place-items: center; box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}
.play-ico i::before {
  content: ''; width: 0; height: 0; margin-left: 3px;
  border-left: 13px solid var(--red); border-top: 8px solid transparent; border-bottom: 8px solid transparent;
}

.card-body { padding: 10px 11px 12px; }
.card-title {
  font-size: 14px; font-weight: 500; line-height: 1.45; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px;
}
.card-meta { display: flex; align-items: center; gap: 10px; margin-top: 7px; font-size: 12px; color: var(--text-3); }
.card-meta span { display: flex; align-items: center; gap: 3px; }

/* ============ Ad slot ============ */
.ad-banner { padding: 0 12px; }
.ad-banner-inner {
  position: relative; border-radius: var(--radius); overflow: hidden; min-height: 84px;
  background: linear-gradient(100deg, #fff3e0, #ffe0e6 45%, #e8f6ee);
  border: 1px dashed #ffc9d2; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow); cursor: pointer; transition: .2s;
}
.ad-banner-inner:hover { border-color: var(--red); }
.ad-banner-inner img { width: 100%; display: block; }
.ad-ph { padding: 16px; text-align: center; }
.ad-ph strong { display: block; color: var(--red-deep); font-size: 15px; }
.ad-ph small { color: var(--text-2); font-size: 12px; }
.ad-tag {
  position: absolute; right: 8px; top: 8px; font-size: 10px; color: var(--text-3);
  background: rgba(255, 255, 255, .85); padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line);
}

.ad-feed {
  background: linear-gradient(100deg, #fff7ed, #fff0f3);
  border: 1px dashed #ffc9d2; border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; cursor: pointer; transition: .2s; box-shadow: var(--shadow);
}
.ad-feed:hover { border-color: var(--red); transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.ad-feed-body { padding: 14px 12px; text-align: center; flex: 1; display: flex; flex-direction: column; justify-content: center; aspect-ratio: 16/10; }
.ad-feed-body strong { color: var(--red-deep); font-size: 14px; display: block; }
.ad-feed-body small { color: var(--text-2); font-size: 12px; margin-top: 4px; }

/* ============ Watch page ============ */
.watch-wrap { display: grid; gap: 16px; padding: 12px; grid-template-columns: 1fr; }
@media (min-width: 980px) { .watch-wrap { grid-template-columns: minmax(0, 1fr) 330px; } }

.player-box {
  background: #000; border-radius: var(--radius); overflow: hidden; position: relative;
  aspect-ratio: 16/9; display: grid; place-items: center;
}
.player-box video { width: 100%; height: 100%; display: block; background: #000; }
.pause-ad {
  position: absolute; inset: 0; display: none; place-items: center; cursor: pointer;
  background: rgba(0, 0, 0, .55); backdrop-filter: blur(3px); z-index: 5;
}
.pause-ad.show { display: grid; }
.pause-ad-in {
  background: #fff; border-radius: 14px; padding: 18px 26px; text-align: center; max-width: 320px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
}
.pause-ad-in strong { color: var(--red-deep); display: block; font-size: 15px; }
.pause-ad-in small { color: var(--text-2); font-size: 12px; }
.pause-ad-in em { display: block; font-style: normal; font-size: 10px; color: var(--text-3); margin-top: 8px; }

.watch-info { padding: 14px 0 0; }
.watch-title { font-size: 19px; font-weight: 600; line-height: 1.4; }
.watch-stat { display: flex; gap: 14px; margin-top: 10px; font-size: 13px; color: var(--text-3); flex-wrap: wrap; }
.watch-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.act {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  cursor: pointer; font-size: 14px; transition: .18s; display: flex; align-items: center; gap: 6px;
}
.act:hover { border-color: var(--red); color: var(--red); }
.act.on { background: #fff0f3; border-color: #ffc9d2; color: var(--red); }
.watch-desc { margin-top: 14px; padding: 12px 14px; background: #fff; border-radius: var(--radius); font-size: 14px; color: var(--text-2); box-shadow: var(--shadow); }
.tags { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.tag { padding: 4px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 12px; color: var(--text-2); }

.side-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.side-hd { padding: 12px 14px; font-weight: 600; font-size: 15px; border-bottom: 1px solid var(--line); }
.rel-list { padding: 8px; display: grid; gap: 8px; }
.rel {
  display: grid; grid-template-columns: 116px 1fr; gap: 10px; padding: 6px; border-radius: 10px; cursor: pointer; transition: .18s;
}
.rel:hover { background: #fafafa; }
.rel img { width: 116px; aspect-ratio: 16/10; object-fit: cover; border-radius: 8px; background: #eee; }
.rel-t { font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rel-m { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* ============ Ads page ============ */
.hero {
  background: linear-gradient(135deg, #ff4d6d, #ff7a4d 55%, #ffb020);
  color: #fff; padding: 40px 12px 34px; text-align: center;
}
.hero h1 { font-size: 27px; font-weight: 700; text-shadow: 0 2px 12px rgba(0, 0, 0, .12); }
.hero p { margin: 10px 0 0; opacity: .93; font-size: 14px; }

.plans { display: grid; gap: 16px; padding: 20px 12px; grid-template-columns: 1fr; }
@media (min-width: 800px) { .plans { grid-template-columns: repeat(3, 1fr); } }
.plan {
  background: #fff; border-radius: var(--radius-lg); padding: 22px 20px; box-shadow: var(--shadow);
  border: 2px solid transparent; transition: .22s; display: flex; flex-direction: column;
}
.plan:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.plan.hl { border-color: var(--red); position: relative; }
.plan.hl::after {
  content: '热门'; position: absolute; right: 14px; top: -1px; background: var(--red); color: #fff;
  font-size: 11px; padding: 3px 10px; border-radius: 0 0 8px 8px;
}
.plan-name { font-size: 16px; font-weight: 600; }
.plan-price { font-size: 26px; font-weight: 700; color: var(--red-deep); margin: 10px 0 4px; }
.plan-slot { font-size: 12px; color: var(--text-3); }
.plan ul { margin: 16px 0 20px; display: grid; gap: 9px; }
.plan li { font-size: 13.5px; color: var(--text-2); padding-left: 20px; position: relative; line-height: 1.5; }
.plan li::before {
  content: ''; position: absolute; left: 0; top: 7px; width: 12px; height: 12px; border-radius: 50%;
  background: #e8f9ee; border: 3px solid var(--green);
}
.plan-btn {
  margin-top: auto; padding: 11px; border-radius: 999px; text-align: center; cursor: pointer;
  background: #fff; border: 1.5px solid var(--red); color: var(--red); font-weight: 500; font-size: 14px; transition: .18s;
}
.plan-btn:hover { background: var(--red); color: #fff; }
.plan.hl .plan-btn { background: var(--red); color: #fff; }
.plan.hl .plan-btn:hover { background: var(--red-deep); }

.form-box { background: #fff; border-radius: var(--radius-lg); padding: 22px; box-shadow: var(--shadow); }
.form-row { display: grid; gap: 12px; margin-bottom: 14px; }
@media (min-width: 640px) { .form-row.two { grid-template-columns: 1fr 1fr; } }
.fld label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.fld input, .fld textarea, .fld select {
  width: 100%; padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; outline: none;
  background: #fbfbfc; transition: .18s; font-size: 14px;
}
.fld input:focus, .fld textarea:focus, .fld select:focus { border-color: var(--red); background: #fff; box-shadow: 0 0 0 3px rgba(255, 77, 109, .1); }
.fld textarea { min-height: 96px; resize: vertical; }
.btn {
  padding: 11px 22px; border-radius: 999px; border: none; cursor: pointer; font-weight: 500; font-size: 14px;
  background: var(--red); color: #fff; transition: .18s;
}
.btn:hover { background: var(--red-deep); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--text-2); }
.btn.ghost:hover { border-color: var(--red); color: var(--red); background: #fff; }
.btn.block { width: 100%; }

.stat-grid { display: grid; gap: 12px; padding: 0 12px 20px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat {
  background: #fff; border-radius: var(--radius); padding: 18px; text-align: center; box-shadow: var(--shadow);
  border-left: 3px solid var(--red);
}
.stat b { display: block; font-size: 22px; color: var(--red-deep); font-weight: 700; }
.stat span { font-size: 12.5px; color: var(--text-3); }

/* ============ Bottom bar ============ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  padding-bottom: var(--safe-b);
}
.tabbar i svg { width: 100%; height: 100%; }
.tabbar a { padding: 8px 0 7px; text-align: center; font-size: 11px; color: var(--text-3); transition: .18s; }
.tabbar a.on { color: var(--red); }
.tabbar i { display: block; margin: 0 auto 2px; width: 22px; height: 22px; opacity: .8; }
.tabbar a.on i { opacity: 1; }
@media (min-width: 760px) { .tabbar { display: none; } body { padding-bottom: 0 !important; } }

body.has-tabbar { padding-bottom: 58px; }

/* ============ Misc ============ */
.empty { text-align: center; padding: 50px 20px; color: var(--text-3); }
.empty b { display: block; font-size: 17px; color: var(--text-2); margin-bottom: 6px; }
.pager { display: flex; justify-content: center; gap: 8px; padding: 18px 12px 30px; flex-wrap: wrap; }
.pg {
  min-width: 38px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-size: 14px; display: grid; place-items: center; transition: .18s;
}
.pg:hover:not(:disabled) { border-color: var(--red); color: var(--red); }
.pg.on { background: var(--red); color: #fff; border-color: var(--red); }
.pg:disabled { opacity: .45; cursor: not-allowed; }

.ft { padding: 26px 12px 24px; text-align: center; font-size: 12.5px; color: var(--text-3); border-top: 1px solid var(--line); margin-top: 20px; }
.ft a { color: var(--red); }
.notice {
  margin: 12px; padding: 11px 14px; border-radius: 10px; font-size: 13px;
  background: #fff8e6; border: 1px solid #ffe1a6; color: #8a5b00;
}
