/* 黄果短剧官网 —— 剧集站版（数据来自 data/，图片在 media/） */
:root {
  --bg: #0b0a0d;
  --bg-2: #141217;
  --card: #1a171d;
  --line: rgba(255, 255, 255, 0.08);
  --text: #ede8e0;
  --text-2: rgba(237, 232, 224, 0.62);
  --text-3: rgba(237, 232, 224, 0.4);
  --gold: #d7a676;
  --gold-2: #a86e4a;
  --grad: linear-gradient(135deg, #d9a77a, #a86e4a);
  --radius: 12px;
  --wrap: 1280px;
  --gutter: 16px;
  --header-h: 60px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
img { display: block; max-width: 100%; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: 999px;
  font-size: 15px; font-weight: 600; white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 20px rgba(168, 110, 74, .35); }
.btn-primary:hover { box-shadow: 0 8px 28px rgba(168, 110, 74, .55); }
.btn-ghost { background: rgba(255, 255, 255, .1); color: var(--text); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn-ghost:hover { background: rgba(255, 255, 255, .16); }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn-block { display: flex; width: 100%; height: 50px; font-size: 16px; }

/* ---------- 顶栏 ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(11, 10, 13, .82);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header .wrap { height: 100%; display: flex; align-items: center; gap: 24px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; letter-spacing: 1px; color: var(--text); white-space: nowrap; }
.logo img { width: 32px; height: 32px; border-radius: 8px; }
.nav { display: flex; gap: 22px; font-size: 15px; color: var(--text-2); }
.nav a:hover, .nav a.on { color: var(--text); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.search {
  display: flex; align-items: center; gap: 8px;
  height: 36px; width: 240px; padding: 0 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); color: var(--text-3);
}
.search svg { width: 16px; height: 16px; flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 14px; }
.search input::placeholder { color: var(--text-3); }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: none; align-items: center; justify-content: center; background: rgba(255,255,255,.07); }
.icon-btn svg { width: 18px; height: 18px; }

/* ---------- 首页大图轮播 ---------- */
.hero { position: relative; margin-top: 16px; }
.hero-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  border-radius: 16px;
}
.hero-track::-webkit-scrollbar { display: none; }
.slide {
  position: relative; flex: 0 0 100%; scroll-snap-align: start;
  aspect-ratio: 21 / 9; overflow: hidden; background: var(--bg-2);
}
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(11,10,13,.88) 0%, rgba(11,10,13,.45) 45%, rgba(11,10,13,0) 70%),
              linear-gradient(0deg, rgba(11,10,13,.7) 0%, rgba(11,10,13,0) 40%);
}
.slide-info { position: absolute; z-index: 1; left: 48px; bottom: 48px; max-width: 520px; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 6px; background: rgba(215,166,118,.18); color: var(--gold); font-size: 13px; font-weight: 600; }
.slide-title { margin: 12px 0 8px; font-size: 40px; line-height: 1.2; font-weight: 800; letter-spacing: .5px; }
.slide-tagline { margin: 0 0 22px; color: var(--text-2); font-size: 17px; }
.slide-actions { display: flex; gap: 12px; }
.hero-dots { position: absolute; right: 24px; bottom: 20px; display: flex; gap: 6px; z-index: 2; }
.hero-dots button { width: 8px; height: 8px; border-radius: 99px; background: rgba(255,255,255,.35); transition: width .25s, background .25s; }
.hero-dots button.on { width: 22px; background: var(--gold); }

/* ---------- 下载条 ---------- */
.dl-strip {
  margin-top: 20px; padding: 20px 24px;
  display: flex; align-items: center; gap: 24px;
  border-radius: 16px; background: linear-gradient(120deg, rgba(215,166,118,.14), rgba(215,166,118,.04));
  border: 1px solid rgba(215,166,118,.18);
}
.dl-strip-text h1 { margin: 0 0 4px; font-size: 20px; }
.dl-strip-text p { margin: 0; color: var(--text-2); font-size: 14px; }
.dl-platforms { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.plat-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px;
  background: rgba(255,255,255,.07); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600;
  transition: background .2s, border-color .2s;
}
.plat-btn:hover { background: rgba(255,255,255,.12); }
.plat-btn svg { width: 18px; height: 18px; }
.plat-btn small { font-weight: 400; color: var(--text-3); font-size: 12px; }
.plat-btn.is-me { background: var(--grad); border-color: transparent; color: #fff; }
.plat-btn.is-me small { color: rgba(255,255,255,.75); }
.dl-qr { flex: none; padding: 6px; border-radius: 10px; background: #fff; }
.dl-qr canvas, .dl-qr img { width: 84px !important; height: 84px !important; }

/* ---------- 标签 ---------- */
.chips { display: flex; gap: 10px; margin-top: 24px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center;
  flex: none; height: 34px; padding: 0 16px; border-radius: 999px;
  background: rgba(255,255,255,.06); color: var(--text-2); font-size: 14px;
  border: 1px solid transparent; transition: all .2s;
}
.chip:hover { color: var(--text); }
.chip.on { color: var(--gold); border-color: rgba(215,166,118,.5); background: rgba(215,166,118,.1); }

/* ---------- 标签页 / 分类总览 ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 6px; color: var(--text-3); font-size: 14px; }
.crumbs a:hover { color: var(--text); }
.page-title { margin: 8px 0 10px; font-size: 26px; line-height: 1.3; }
.page-intro { margin: 0 0 24px; max-width: 860px; color: var(--text-2); line-height: 1.8; }
.chips-wrap { flex-wrap: wrap; overflow: visible; margin-top: 0; }
.tag-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.tag-tile { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--line); transition: border-color .2s; }
.tag-tile:hover { border-color: rgba(215,166,118,.5); }
.tag-tile span { color: var(--text-3); font-size: 13px; }

/* ---------- 分区 + 卡片 ---------- */
.section { margin-top: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section-head h2 { margin: 0; font-size: 20px; font-weight: 700; }
.section-head .count { color: var(--text-3); font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 16px 14px; }
.card { display: block; min-width: 0; }
.card-cover { position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: var(--card); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-cover img { transform: scale(1.05); }
.card-cover .eps {
  position: absolute; right: 6px; bottom: 6px; padding: 2px 8px; border-radius: 6px;
  background: rgba(0,0,0,.6); font-size: 12px; color: #fff;
}
.card-cover .hot {
  position: absolute; left: 6px; top: 6px; padding: 2px 7px; border-radius: 6px;
  background: rgba(215,166,118,.92); font-size: 11px; font-weight: 700; color: #1a120c;
}
.card-cover .play {
  position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; border-radius: 50%;
  background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s;
}
.card:hover .play { opacity: 1; }
.card-cover .play svg { width: 18px; height: 18px; margin-left: 3px; }
.card-title {
  margin: 8px 0 2px; font-size: 14px; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-tags { color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 48px 0; text-align: center; color: var(--text-3); }

/* ---------- 分享有礼 ---------- */
.share {
  margin-top: 48px; padding: 28px; border-radius: 16px;
  display: flex; align-items: center; gap: 20px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(215,166,118,.22), rgba(215,166,118,.04) 60%), var(--bg-2);
  border: 1px solid rgba(215,166,118,.2);
}
.share-icon { font-size: 40px; line-height: 1; }
.share h2 { margin: 0 0 4px; font-size: 20px; }
.share p { margin: 0; color: var(--text-2); }
.share-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.card-cover .hot.fresh { background: #2fd67f; color: #06301a; }
.link-btn { color: var(--text-3); font-size: 13px; }
.link-btn:hover { color: var(--text); }
.toast {
  position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); z-index: 1300; transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: rgba(20, 18, 24, .95);
  color: var(--text); font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4), inset 0 0 0 1px var(--line);
  animation: pop .2s ease;
}

/* ---------- 页脚 ---------- */
.footer { margin-top: 56px; padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); color: var(--text-3); font-size: 13px; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; }
.footer .logo { font-size: 16px; opacity: .85; }
.footer .logo img { width: 26px; height: 26px; }
.footer-links { display: flex; gap: 20px; }
.footer-links a:hover { color: var(--text); }
.footer-copy { margin-left: auto; }

/* ---------- 播放页 ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; margin: 16px 0 12px; color: var(--text-2); font-size: 14px; }
.back svg { width: 16px; height: 16px; }
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-poster { position: absolute; inset: 0; cursor: pointer; }
.player-poster img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.7); }
.player-poster .big-play {
  position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; border-radius: 50%;
  background: var(--grad); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 40px rgba(168,110,74,.6);
}
.player-poster .big-play svg { width: 30px; height: 30px; margin-left: 5px; }
.player-poster .free-tag { position: absolute; left: 16px; top: 16px; }
.player-end {
  position: absolute; inset: 0; z-index: 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding: 24px; text-align: center; background: rgba(8,7,10,.86); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.player-end h3 { margin: 0; font-size: 22px; }
.player-end p { margin: 0 0 8px; color: var(--text-2); }
.player-end .row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.player-err { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-2); }
.unlock-bar {
  margin-top: 12px; padding: 12px 16px; border-radius: 12px;
  display: flex; align-items: center; gap: 12px;
  background: rgba(215,166,118,.1); border: 1px solid rgba(215,166,118,.2);
}
.unlock-bar p { margin: 0; font-size: 14px; color: var(--text-2); }
.unlock-bar b { color: var(--gold); }
.unlock-bar .btn { margin-left: auto; }
.info h1 { margin: 18px 0 8px; font-size: 24px; line-height: 1.35; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--text-2); font-size: 14px; }
.meta .hot-num { color: var(--gold); font-weight: 600; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.tag-row a:hover { color: var(--gold); }
.tag-row span, .tag-row a { padding: 3px 10px; border-radius: 6px; background: rgba(255,255,255,.07); font-size: 13px; color: var(--text-2); }
.desc { color: var(--text-2); line-height: 1.75; margin: 0; }
.actors { margin-top: 10px; color: var(--text-3); font-size: 14px; }
.actors a { color: var(--text-2); border-bottom: 1px dashed var(--text-3); }
.actors a:hover { color: var(--gold); }
.side h2, .block-title { margin: 0 0 12px; font-size: 17px; }
.eps-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.ep {
  position: relative; height: 44px; border-radius: 10px; background: rgba(255,255,255,.07);
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600;
}
.ep.on { background: rgba(215,166,118,.16); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(215,166,118,.5); }
.ep .lock { position: absolute; right: 4px; top: 3px; width: 11px; height: 11px; opacity: .55; }
.ep .free { position: absolute; right: -4px; top: -6px; padding: 0 5px; border-radius: 6px; background: var(--grad); font-size: 10px; line-height: 16px; color: #fff; }
.side-card { padding: 18px; border-radius: 14px; background: var(--bg-2); border: 1px solid var(--line); }
.side-card + .side-card { margin-top: 16px; }
.side-dl p { margin: 0 0 12px; color: var(--text-2); font-size: 14px; }

/* ---------- 常见问题 ---------- */
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { padding: 14px 0; cursor: pointer; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--text-3); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 14px; color: var(--text-2); line-height: 1.75; }

/* ---------- 下载面板（底部抽屉 / 弹窗） ---------- */
.sheet { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.sheet-card {
  position: relative; width: 100%; max-width: 420px; padding: 26px 22px 22px; border-radius: 20px;
  background: #19161c; box-shadow: 0 20px 60px rgba(0,0,0,.5), inset 0 0 0 1px rgba(215,166,118,.2);
  animation: pop .22s ease;
}
@keyframes pop { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-close { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; font-size: 26px; line-height: 1; color: var(--text-3); }
.sheet h3 { margin: 0 0 4px; font-size: 20px; text-align: center; }
.sheet .sub { margin: 0 0 18px; text-align: center; color: var(--text-2); font-size: 14px; }
.sheet-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.05); margin-bottom: 18px; }
.sheet-tabs button { height: 54px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; color: var(--text-2); }
.sheet-tabs button svg { width: 18px; height: 18px; }
.sheet-tabs button.on { background: var(--grad); color: #fff; }
.sheet-body { text-align: center; }
.sheet-qr { display: inline-block; padding: 8px; margin-bottom: 14px; border-radius: 12px; background: #fff; }
.sheet-qr canvas, .sheet-qr img { width: 132px !important; height: 132px !important; }
.sheet-notice {
  display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; padding: 14px 16px; border-radius: 12px;
  background: rgba(215,166,118,.12); border: 1px solid rgba(215,166,118,.3); text-align: center;
}
.sheet-notice b { color: var(--gold); font-size: 16px; }
.sheet-notice span { color: var(--text-2); font-size: 14px; }
#auto-sec { color: var(--gold); }
.sheet-note { margin: 12px 0 0; color: var(--text-3); font-size: 13px; line-height: 1.6; }
.sheet-note b { color: var(--gold); font-weight: 600; }
.sheet .btn + .btn { margin-top: 10px; }

/* ---------- 年龄确认 ---------- */
.age { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5,4,6,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.age-card { width: 100%; max-width: 400px; padding: 30px 24px 24px; border-radius: 20px; background: #19161c; text-align: center; box-shadow: inset 0 0 0 1px var(--line); }
.age-logo { justify-content: center; margin-bottom: 16px; font-size: 20px; }
.age-logo img { width: 40px; height: 40px; }
.age-card h3 { margin: 0 0 8px; font-size: 20px; }
.age-card p { margin: 0 0 20px; color: var(--text-2); font-size: 14px; line-height: 1.7; }
.age-card .btn + .btn { margin-top: 10px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .grid.row > :nth-child(n+7) { display: none; }
}
@media (max-width: 1024px) {
  .watch { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .slide-title { font-size: 32px; }
}
@media (max-width: 760px) {
  :root { --header-h: 54px; }
  .nav, .search { display: none; }
  .search.open { display: flex; position: absolute; left: var(--gutter); right: var(--gutter); top: 9px; width: auto; background: #221e26; z-index: 2; }
  .icon-btn { display: inline-flex; }
  .logo { font-size: 16px; }
  .logo img { width: 28px; height: 28px; }
  .hero { margin: 0 calc(var(--gutter) * -1); }
  .hero-track { border-radius: 0; }
  .slide { aspect-ratio: 4 / 3; }
  .slide::after { background: linear-gradient(0deg, rgba(11,10,13,.95) 0%, rgba(11,10,13,.3) 55%, rgba(11,10,13,0) 75%); }
  .slide-info { left: 16px; right: 16px; bottom: 34px; }
  .slide-title { font-size: 24px; margin: 8px 0 4px; }
  .slide-tagline { font-size: 14px; margin-bottom: 14px; }
  .slide-actions .btn { height: 40px; padding: 0 18px; font-size: 14px; }
  .hero-dots { left: 0; right: 0; bottom: 12px; justify-content: center; }
  .dl-strip { flex-direction: column; align-items: stretch; gap: 14px; padding: 18px 16px; }
  .dl-strip-text { text-align: center; }
  .dl-platforms { margin: 0; display: grid; grid-template-columns: 1fr 1fr; }
  .plat-btn { justify-content: center; padding: 0 10px; }
  .plat-btn small { display: none; }
  .plat-btn.is-me { grid-column: 1 / -1; height: 50px; font-size: 16px; }
  .plat-btn.is-me small { display: inline; font-size: 13px; }
  .dl-qr { display: none; }
  .section { margin-top: 28px; }
  .section-head h2 { font-size: 17px; }
  /* 手机端分区横滑，露出下一张提示可滑动 */
  .grid.row {
    display: flex; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
    margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); gap: 10px;
  }
  .grid.row::-webkit-scrollbar { display: none; }
  .grid.row > .card { flex: 0 0 31%; scroll-snap-align: start; }
  .grid.row > :nth-child(n+7) { display: block; }
  .grid:not(.row) { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }
  .card-title { font-size: 13px; }
  .share { flex-direction: column; text-align: center; padding: 22px 18px; }
  .share-actions { margin: 4px 0 0; width: 100%; flex-direction: column; }
  .share-actions .btn { width: 100%; }
  .footer .wrap { flex-direction: column; text-align: center; gap: 12px; }
  /* 给右下角客服按钮留位置，避免遮住页脚 */
  .footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .footer-copy { margin: 0; }
  .player { margin: 0 calc(var(--gutter) * -1); border-radius: 0; }
  .info h1 { font-size: 20px; }
  .unlock-bar { flex-direction: column; text-align: center; }
  .unlock-bar .btn { margin: 0; width: 100%; }
  .sheet { align-items: flex-end; padding: 0; }
  .sheet-card { max-width: none; border-radius: 20px 20px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); animation-name: slide-up; }
  .sheet-qr { display: none; }
}
@keyframes slide-up { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
