* { box-sizing: border-box; }
:root {
  --bg: #0a0c11;
  --bg-soft: #11141c;
  --card: #161a24;
  --line: rgba(255,255,255,.08);
  --txt: #e8ecf3;
  --txt-2: #9aa4b5;
  --accent: #ff3b5c;
  --accent-2: #ff8a3d;
  --radius: 12px;
}
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
img, video { max-width: 100%; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, rgba(255,59,92,.14), transparent 60%),
              radial-gradient(900px 500px at 0% 0%, rgba(60,120,255,.12), transparent 55%), var(--bg);
  color: var(--txt);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input { font-family: inherit; }

/* 头部 */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10,12,17,.78);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1360px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 20px;
}
.logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; letter-spacing: .5px; flex: none; }
.logo-mark { color: var(--accent); font-size: 22px; text-shadow: 0 0 18px rgba(255,59,92,.8); }
.logo-text { background: linear-gradient(120deg, #fff, #ffb1c0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { display: flex; gap: 6px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 7px 14px; border-radius: 999px; font-size: 14px; color: var(--txt-2);
  white-space: nowrap; transition: .18s;
}
.nav a:hover { color: var(--txt); background: rgba(255,255,255,.06); }
.nav a.active { color: #fff; background: linear-gradient(120deg, var(--accent), var(--accent-2)); box-shadow: 0 6px 20px rgba(255,59,92,.3); }
.search-box { display: flex; align-items: center; flex: none; background: rgba(255,255,255,.06); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; min-width: 0; }
.search-box input { background: transparent; border: 0; outline: none; color: var(--txt); padding: 9px 14px; width: 210px; font-size: 14px; }
.search-box input::placeholder { color: #6d768a; }
.search-box button { background: transparent; border: 0; color: var(--accent); padding: 9px 14px; cursor: pointer; font-size: 14px; font-weight: 600; white-space: nowrap; flex: none; }
.mobile-menu { display: none; background: rgba(255,255,255,.06); border: 1px solid var(--line); color: var(--txt); border-radius: 10px; padding: 6px 11px; cursor: pointer; }

/* 布局 */
.view { flex: 1; max-width: 1360px; width: 100%; margin: 0 auto; padding: 24px 20px 60px; }
.loading, .empty { color: var(--txt-2); text-align: center; padding: 60px 0; }
.section { margin-bottom: 34px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section-head h2 { font-size: 19px; margin: 0; display: flex; align-items: center; gap: 10px; }
.section-head h2::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.section-head a.more { font-size: 13px; color: var(--txt-2); }
.section-head a.more:hover { color: var(--accent); }

/* 轮播 */
.hero { position: relative; border-radius: 18px; overflow: hidden; margin-bottom: 30px; border: 1px solid var(--line); }
.hero-slides { position: relative; height: 340px; }
.hero-slide {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; opacity: 0; transition: opacity .8s; display: flex;
  background-size: cover; background-position: center 20%;
}
.hero-slide.on { opacity: 1; }
.hero-slide::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(90deg, rgba(8,10,14,.94) 15%, rgba(8,10,14,.55) 55%, rgba(8,10,14,.2)); }
.hero-info { position: relative; z-index: 2; padding: 46px 40px; display: flex; flex-direction: column; justify-content: center; gap: 12px; max-width: 620px; }
.hero-info h1 { font-size: 32px; margin: 0; line-height: 1.2; }
.hero-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.1); color: #dfe5ef; }
.tag.hot { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 600; }
.hero-desc { color: var(--txt-2); font-size: 14px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-actions { display: flex; gap: 12px; margin-top: 6px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 22px; border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff; font-weight: 600; font-size: 14px;
  border: 0; cursor: pointer; box-shadow: 0 10px 26px rgba(255,59,92,.28); transition: .18s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn.ghost { background: rgba(255,255,255,.08); box-shadow: none; border: 1px solid var(--line); }
.hero-dots { position: absolute; bottom: 16px; right: 24px; z-index: 3; display: flex; gap: 7px; }
.hero-dots i { width: 22px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.28); cursor: pointer; transition: .2s; }
.hero-dots i.on { background: var(--accent); width: 34px; }

/* 卡片 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }
.grid.row-scroll { display: flex; overflow-x: auto; gap: 16px; padding-bottom: 8px; scrollbar-width: thin; }
.grid.row-scroll .card { flex: 0 0 160px; }
.card { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--card); border: 1px solid var(--line); transition: .2s; }
.card:hover { transform: translateY(-4px); border-color: rgba(255,59,92,.45); box-shadow: 0 16px 32px rgba(0,0,0,.45); }
.card .poster { position: relative; background: #0f1219; overflow: hidden; }
.card .poster::before { content: ""; display: block; padding-top: 138%; }
.card .poster img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: .35s; }
.card:hover .poster img { transform: scale(1.06); }
.card .remarks {
  position: absolute; left: 8px; right: 8px; bottom: 8px; font-size: 12px; padding: 3px 8px; border-radius: 6px;
  background: rgba(0,0,0,.62); backdrop-filter: blur(6px); color: #fff; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card .play-icon {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: grid; place-items: center; opacity: 0; transition: .22s;
  background: rgba(8,10,14,.35);
}
.card:hover .play-icon { opacity: 1; }
.play-icon span {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff; font-size: 17px;
  box-shadow: 0 8px 22px rgba(255,59,92,.45);
}
.card .meta { padding: 10px 11px 12px; }
.card .meta .title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .meta .sub { font-size: 12px; color: var(--txt-2); margin-top: 5px; display: flex; justify-content: space-between; gap: 6px; }
.score-pill { color: #ffb020; font-weight: 700; }

/* 筛选栏 */
.filter-bar { display: flex; flex-direction: column; gap: 8px; background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; }
.filter-row { display: flex; gap: 10px; align-items: center; font-size: 13px; flex-wrap: wrap; }
.filter-row .label { color: #6d768a; flex: none; width: 42px; }
.filter-row a { padding: 4px 12px; border-radius: 999px; color: var(--txt-2); }
.filter-row a:hover { color: #fff; background: rgba(255,255,255,.06); }
.filter-row a.on { color: #fff; background: rgba(255,59,92,.22); border: 1px solid rgba(255,59,92,.45); }

/* 分页 */
.pager { display: flex; gap: 8px; justify-content: center; margin: 28px 0 0; flex-wrap: wrap; }
.pager a, .pager span { padding: 8px 15px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--line); font-size: 14px; color: var(--txt-2); }
.pager a:hover { color: #fff; border-color: rgba(255,59,92,.45); }
.pager .cur { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; font-weight: 600; }

/* 详情页 */
.detail-top { display: grid; grid-template-columns: 260px 1fr; gap: 28px; margin-bottom: 28px; }
.detail-poster { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: #0f1219; }
.detail-poster::before { content: ""; display: block; padding-top: 138%; }
.detail-poster img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.detail-main h1 { margin: 0 0 12px; font-size: 27px; }
.detail-sub { color: var(--txt-2); font-size: 14px; margin-bottom: 14px; }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.detail-desc { color: #c3cbd8; font-size: 14px; line-height: 1.9; border-left: 3px solid rgba(255,59,92,.5); padding-left: 14px; margin-bottom: 20px; white-space: pre-wrap; }
.crumb { font-size: 13px; color: var(--txt-2); margin-bottom: 16px; }
.crumb a:hover { color: var(--accent); }
.lines { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.lines button { background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--txt-2); padding: 7px 18px; border-radius: 999px; cursor: pointer; font-size: 13px; }
.lines button.on { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff; border-color: transparent; font-weight: 600; }
.episodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; max-height: 340px; overflow-y: auto; padding-right: 4px; }
.episodes a {
  padding: 10px 8px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid var(--line);
  text-align: center; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: .16s;
}
.episodes a:hover, .episodes a.on { background: rgba(255,59,92,.18); border-color: rgba(255,59,92,.5); color: #fff; }

/* 播放页 */
.player-wrap { position: relative; background: #000; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.player-frame { position: relative; padding-top: 56.25%; background: #000; }
.player-frame video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: #000; display: block; }
.player-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: rgba(255,255,255,.03); border-top: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.player-bar .now { color: var(--txt-2); }
.player-bar .now b { color: #fff; }
.play-nav { display: flex; gap: 8px; }
.play-nav button { background: rgba(255,255,255,.07); border: 1px solid var(--line); color: var(--txt); padding: 7px 16px; border-radius: 999px; cursor: pointer; font-size: 13px; }
.play-nav button:hover:not(:disabled) { border-color: rgba(255,59,92,.5); }
.play-nav button:disabled { opacity: .4; cursor: not-allowed; }

/* 全站弹窗 */
.popup-mask {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 200;
  background: rgba(4,6,10,.72); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: popupFade .22s ease;
}
.popup-mask.corner { align-items: flex-end; justify-content: flex-end; }
.popup-card {
  position: relative; width: 100%; max-width: 420px; max-height: 88vh; overflow-y: auto;
  background: linear-gradient(180deg, #171b26, #11141c);
  border: 1px solid rgba(255,255,255,.12); border-radius: 16px;
  box-shadow: 0 30px 70px rgba(0,0,0,.62); animation: popupIn .3s cubic-bezier(.2,.8,.3,1);
}
.popup-card .popup-img { width: 100%; display: block; }
.popup-body { padding: 22px 22px 20px; }
.popup-body h3 { margin: 0 0 10px; font-size: 19px; line-height: 1.4; }
.popup-text { color: #c3cbd8; font-size: 14px; line-height: 1.9; white-space: pre-wrap; word-break: break-word; }
.popup-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.popup-actions .btn { flex: 1; justify-content: center; min-width: 120px; }
.popup-close {
  position: absolute; top: 10px; right: 12px; width: 30px; height: 30px; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.5); color: #fff; font-size: 17px; line-height: 1; cursor: pointer;
}
.popup-close:hover { background: rgba(255,59,92,.85); }
@keyframes popupFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes popupIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }

/* 页脚 */
.site-footer {
  border-top: 1px solid var(--line); text-align: center; color: #6d768a;
  font-size: 13px; line-height: 1.9;
  padding: 22px 20px calc(30px + env(safe-area-inset-bottom, 0px));
}
.site-footer a { color: var(--txt-2); }
.site-footer a:hover { color: var(--accent); }

/* ==================== 平板 ==================== */
@media (max-width: 900px) {
  .header-inner { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .logo { font-size: 17px; }
  .logo-mark { font-size: 19px; }
  .nav {
    order: 4; flex: 1 0 100%; width: 100%;
    display: none; gap: 4px; padding-bottom: 2px;
  }
  .nav.open { display: flex; }
  .search-box { margin-left: auto; flex: 1; min-width: 0; }
  .search-box input { width: 100%; min-width: 0; padding: 8px 12px; }
  .search-box button { padding: 8px 12px; font-size: 13.5px; }
  .mobile-menu { display: block; }
  .view { padding: 16px 14px 48px; }

  .hero-slides { height: 240px; }
  .hero-info { padding: 22px 20px; gap: 9px; max-width: 100%; }
  .hero-info h1 { font-size: 21px; }
  .hero-desc { font-size: 13px; -webkit-line-clamp: 2; }
  .hero-actions .btn { padding: 9px 18px; font-size: 13.5px; }
  .hero-dots { bottom: 10px; right: 14px; }
  .hero-dots i { width: 16px; height: 3px; }
  .hero-dots i.on { width: 26px; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 11px; }
  .grid.row-scroll { gap: 11px; }
  .grid.row-scroll .card { flex: 0 0 118px; }
  .card .meta { padding: 8px 9px 10px; }
  .card .meta .title { font-size: 13px; }
  .card .meta .sub { font-size: 11.5px; }
  .card .remarks { left: 6px; right: 6px; bottom: 6px; font-size: 11px; padding: 2px 6px; }

  .detail-top { grid-template-columns: 118px 1fr; gap: 14px; }
  .detail-main h1 { font-size: 19px; }
  .detail-sub { font-size: 12.5px; }
  .detail-desc { font-size: 13px; line-height: 1.8; }
  .episodes { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; max-height: none; }
  .episodes a { padding: 9px 6px; font-size: 12.5px; }

  .filter-bar { padding: 10px 12px; gap: 6px; }
  .filter-row { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .filter-row::-webkit-scrollbar { display: none; }
  .filter-row .label { position: sticky; left: 0; background: #101319; padding-right: 6px; width: auto; }
  .filter-row a { white-space: nowrap; }

  .player-bar { padding: 10px 12px; font-size: 13px; }
  .play-nav { width: 100%; }
  .play-nav button, .play-nav .btn { flex: 1; justify-content: center; }

  .pager a, .pager span { padding: 10px 15px; font-size: 13.5px; }
  .section { margin-bottom: 24px; }
  .section-head h2 { font-size: 16px; }
}

/* ==================== 手机 ==================== */
@media (max-width: 600px) {
  .hero { border-radius: 14px; margin-bottom: 20px; }
  .hero-slides { height: 210px; }
  .hero-info { padding: 16px 16px; justify-content: flex-end; }
  .hero-info h1 { font-size: 18px; }
  .hero-desc { display: none; }
  .hero-tags .tag { font-size: 11px; padding: 2px 8px; }
  .hero-actions .btn { padding: 8px 15px; font-size: 13px; }

  /* 播放页：视频满宽贴边，观感更好 */
  .player-wrap { margin: 0 -14px; border-radius: 0; border-left: 0; border-right: 0; }
  .player-bar { padding: 10px 14px; }
  .play-nav { flex-wrap: wrap; }

  .detail-top { grid-template-columns: 100px 1fr; gap: 12px; }
  .detail-main h1 { font-size: 17px; }
  .detail-tags .tag { font-size: 11px; padding: 2px 8px; }
  .detail-desc { border-left-width: 2px; padding-left: 10px; }

  .episodes { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 7px; }
  .episodes a { font-size: 12px; padding: 8px 4px; }

  .popup-mask { padding: 14px; }
  .popup-mask.corner { align-items: flex-end; justify-content: center; }
  .popup-card { max-width: 100%; }
  .popup-body { padding: 18px 16px 16px; }
  .popup-body h3 { font-size: 17px; }
  .popup-actions .btn { min-width: 0; }

  .site-footer { padding: 18px 14px 26px; font-size: 12px; }
}

/* 超窄屏 */
@media (max-width: 380px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 9px; }
  .detail-top { grid-template-columns: 88px 1fr; }
  .card .meta .sub span:first-child { display: none; }
}

/* 触摸设备：没有 hover，卡片直接给出可点提示 */
@media (hover: none) {
  .card .play-icon { opacity: .85; }
  .card:hover .poster img { transform: none; }
  .card:hover { transform: none; }
  .episodes a:hover { background: rgba(255,255,255,.05); border-color: var(--line); color: inherit; }
  .episodes a:active { background: rgba(255,59,92,.22); border-color: rgba(255,59,92,.5); }
}