/* ==========================================================================
   简约影院模板 · 白底卡片 + 粉红主色
   ========================================================================== */
:root {
  --c: #ec2d7a;
  --c-hover: #d41f68;
  --c-soft: #fdeef4;
  --bg: #edeff0;
  --panel: #fff;
  --line: #edeff0;
  --line-2: #dfe1e2;
  --text: #333;
  --text-2: #666;
  --text-3: #999;
  --star: #ffb400;
  --tag: #ff8a00;
  --w: 1200px;

  /* 兼容旧页面内联变量 */
  --accent-gold: var(--c);
  --accent-crimson: var(--c);
  --accent-emerald: #5cb85c;
  --primary: var(--c);
  --text-primary: var(--text);
  --text-secondary: var(--text-2);
  --text-muted: var(--text-3);
  --bg-surface: #f7f8f9;
  --border-subtle: var(--line);
  --border-light: var(--line-2);
  --border-accent: var(--c);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text); background: var(--bg);
  min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--c); }
img { display: block; max-width: 100%; border: 0; }
ul, ol, dl { list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; border: 0; outline: 0; background: none; }
button { cursor: pointer; }
h1, h2, h3, h4 { font-weight: normal; }

.container { width: 100%; max-width: var(--w); margin: 0 auto; padding: 0 15px; }
.main { flex: 1 0 auto; padding: 20px 0 10px; }

/* ---------- 页头 ---------- */
.header { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.04); position: relative; z-index: 50; }
.header .container { height: 72px; display: flex; align-items: center; gap: 30px; }
.logo { flex-shrink: 0; }
.logo a { display: flex; align-items: center; gap: 8px; color: var(--c); }
.logo-text { font-size: 28px; font-weight: 900; letter-spacing: 2px; line-height: 1; font-family: "STXingkai", "Xingkai SC", "PingFang SC", "Microsoft YaHei", sans-serif; }
.nav { flex: 1; display: flex; justify-content: center; min-width: 0; }
.nav ul { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.nav ul::-webkit-scrollbar { display: none; }
.nav li a { position: relative; display: block; padding: 0 12px; line-height: 72px; font-size: 17px; color: #555; white-space: nowrap; }
.nav li a:hover, .nav li.on a { color: var(--c); }
.nav li.on a::after { content: ""; position: absolute; left: 50%; bottom: 16px; width: 18px; height: 2px; margin-left: -9px; background: var(--c); }
.searchform { display: flex; width: 275px; height: 34px; flex-shrink: 0; }
.sinput { flex: 1; min-width: 0; padding: 0 10px; border: 1px solid #e4e7e9; border-right: 0; font-size: 13px; background: #fff; }
.sinput:focus { border-color: var(--c); }
.sbtn { width: 36px; background: var(--c); color: #fff; display: flex; align-items: center; justify-content: center; }
.sbtn:hover { background: var(--c-hover); }
.sbtn svg { width: 15px; height: 15px; }
.search-toggle { display: none; width: 36px; height: 36px; align-items: center; justify-content: center; color: #555; }
.search-toggle svg { width: 20px; height: 20px; }

/* ---------- 面板 ---------- */
.panel { background: var(--panel); border-radius: 4px; padding: 0 20px 20px; margin-bottom: 15px; }
.panel-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 54px; border-bottom: 1px solid var(--line); margin-bottom: 15px; }
.panel-hd h3, .panel-hd h1, .panel-hd h2 { font-size: 18px; color: var(--c); white-space: nowrap; }
.panel-tabs { display: flex; align-items: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.panel-tabs::-webkit-scrollbar { display: none; }
.panel-tabs > * { display: block; padding: 0 10px; line-height: 26px; font-size: 13px; color: #555; white-space: nowrap; cursor: pointer; border-radius: 2px; }
.panel-tabs > *:hover { color: var(--c); }
.panel-tabs > .on { background: var(--c); color: #fff; font-weight: bold; }
.panel-more { font-size: 13px; color: var(--text-3); white-space: nowrap; }

/* 两栏 */
.row { display: flex; gap: 15px; align-items: flex-start; }
.row > .col-main { flex: 1; min-width: 0; }
.row > .col-side { width: 300px; flex-shrink: 0; }
.row-rev { flex-direction: row-reverse; }

/* ---------- 影片网格 ---------- */
.vlist { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px 12px; }
.vlist-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.vlist-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.v-item { min-width: 0; text-align: center; }
.v-thumb { position: relative; display: block; aspect-ratio: 7 / 10; overflow: hidden; background: #f1f1f1; }
.v-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.v-thumb:hover img { transform: scale(1.05); }
.v-note {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px;
  font-size: 12px; color: #fff; text-align: center;
  background: linear-gradient(0deg, rgba(0,0,0,.65), rgba(0,0,0,0));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.v-tag { display: none; position: absolute; top: 0; right: 0; padding: 0 6px; line-height: 20px; font-size: 12px; color: #fff; background: var(--tag); white-space: nowrap; }
.v-tag i { font-style: normal; margin-left: 6px; }
.show-tag .v-tag { display: block; }
.v-title { margin-top: 8px; font-size: 14px; line-height: 20px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-rate { display: flex; align-items: center; justify-content: center; gap: 4px; height: 18px; margin-top: 2px; font-size: 12px; color: var(--tag); }
.stars { position: relative; display: inline-block; width: 55px; height: 11px; background: linear-gradient(90deg, #ddd 0 100%); -webkit-mask: var(--star-svg) repeat-x 0 0 / 11px 11px; mask: var(--star-svg) repeat-x 0 0 / 11px 11px; }
.stars i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--star); }
:root { --star-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87L18.18 22 12 18.56 5.82 22 7 14.14l-5-4.87 6.91-1.01z'/%3E%3C/svg%3E"); }

.tab-pane { display: none; }
.tab-pane.on { display: block; }

/* ---------- 排行榜 ---------- */
.rank li { display: flex; align-items: center; gap: 10px; height: 38px; }
.rank .rn { width: 22px; height: 18px; line-height: 18px; text-align: center; font-size: 13px; color: var(--text-3); flex-shrink: 0; border-radius: 2px; }
.rank li:nth-child(1) .rn { background: #ff351a; color: #fff; }
.rank li:nth-child(2) .rn { background: #ff7a1a; color: #fff; }
.rank li:nth-child(3) .rn { background: #ffb400; color: #fff; }
.rank .rt { flex: 1; min-width: 0; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank .rt:hover { color: var(--c); }
.rank .rd { font-size: 11px; color: #bbb; flex-shrink: 0; }

/* ---------- 筛选 ---------- */
.filter dl { display: flex; align-items: flex-start; padding: 5px 0; }
.filter dt { width: 46px; flex-shrink: 0; line-height: 26px; color: var(--text-3); }
.filter dd { flex: 1; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.filter dd a { padding: 0 8px; line-height: 26px; font-size: 14px; color: #555; border-radius: 2px; }
.filter dd a:hover { color: var(--c); }
.filter dd a.on { background: #bbb; color: #fff; }
.sorts { display: flex; gap: 2px; margin: 18px 0 15px; border-bottom: 1px solid var(--line); }
.sorts a { padding: 0 14px; line-height: 32px; font-size: 14px; color: #555; }
.sorts a.on { background: var(--c); color: #fff; font-weight: bold; }
.result-tip { margin-left: auto; line-height: 32px; font-size: 12px; color: var(--text-3); }
.result-tip b { color: var(--c); }

/* ---------- 分页 ---------- */
.pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 25px 0 5px; }
.pages a, .pages span { min-width: 34px; height: 32px; padding: 0 10px; line-height: 30px; text-align: center; border: 1px solid var(--line-2); font-size: 13px; color: #555; background: #fff; border-radius: 2px; }
.pages a:hover { border-color: var(--c); color: var(--c); }
.pages .on { background: var(--c); border-color: var(--c); color: #fff; }
.pages .dis { color: #ccc; pointer-events: none; }

/* ---------- 详情 ---------- */
.detail { display: flex; gap: 35px; padding: 30px 10px 25px; border-bottom: 1px solid var(--line); }
.detail-pic { width: 220px; flex-shrink: 0; }
.detail-pic .v-thumb { box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.detail-info { flex: 1; min-width: 0; }
.detail-info h1 { font-size: 20px; font-weight: bold; color: #555; margin-bottom: 12px; line-height: 1.4; }
.detail-info h1 small { font-size: 15px; color: #888; margin-left: 4px; }
.detail-info p { font-size: 14px; line-height: 1.7; color: #555; margin-bottom: 9px; }
.detail-info p > span:first-child { color: var(--text-3); }
.detail-info p a { color: var(--c); margin-right: 6px; }
.detail-info .desc { color: #666; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.detail-info .v-rate { justify-content: flex-start; margin: 0 0 12px; font-size: 16px; font-weight: bold; }
.detail-info .stars { width: 80px; height: 16px; -webkit-mask-size: 16px 16px; mask-size: 16px 16px; }
.detail-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn, .btn-primary, .btn-glass {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 22px; font-size: 14px; border-radius: 2px; white-space: nowrap;
}
.btn-primary, .btn.btn-primary { background: var(--c); color: #fff; }
.btn-primary:hover { background: var(--c-hover); color: #fff; }
.btn-glass, .btn.btn-glass { background: #fff; color: #555; border: 1px solid var(--line-2); }
.btn-glass:hover { border-color: var(--c); color: var(--c); }
.btn-sm { height: 32px; padding: 0 16px; font-size: 13px; }
.btn svg { width: 14px; height: 14px; }

/* 播放线路 */
.playbox { padding: 20px 10px 0; }
.play-src-hd { font-size: 14px; color: var(--c); margin-bottom: 6px; }
.play-src { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 20px; }
.play-src a { padding: 0 14px; line-height: 32px; font-size: 14px; color: #fff; background: #555; border: 1px solid #555; cursor: pointer; }
.play-src a.on { background: var(--c); border-color: var(--c); }
.play-ep-hd { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.play-ep-hd span { display: inline-block; padding: 0 12px; line-height: 30px; background: #555; color: #fff; font-weight: bold; font-size: 14px; }
.play-ep-hd button { font-size: 13px; color: var(--text-3); }
.play-ep-hd button:hover { color: var(--c); }
.eps { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 10px; max-height: 420px; overflow-y: auto; padding: 2px; }
.eps a { display: block; height: 30px; line-height: 28px; padding: 0 6px; text-align: center; font-size: 13px; color: #555; border: 1px solid var(--line-2); border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eps a:hover { border-color: var(--c); color: var(--c); }
.eps a.on { background: var(--c); border-color: var(--c); color: #fff; }

/* 播放器 */
.player-wrap { padding-top: 20px; }
.player { position: relative; aspect-ratio: 16 / 9; background: #333; overflow: hidden; }
.player .MacPlayer, .player iframe, .player video { width: 100% !important; height: 100% !important; border: 0; }
.player-tip { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: #eee; text-align: center; padding: 20px; }
.player-bar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 12px 0 0; }
.player-bar h1 { font-size: 18px; font-weight: bold; color: #555; }
.player-bar h1 small { font-size: 14px; color: var(--c); font-weight: normal; margin-left: 6px; }
.player-bar .ops { display: flex; gap: 8px; flex-wrap: wrap; }
.player-bar .ops a, .player-bar .ops button { padding: 0 12px; line-height: 28px; font-size: 13px; color: #555; border: 1px solid var(--line-2); border-radius: 2px; background: #fff; }
.player-bar .ops a:hover, .player-bar .ops button:hover { color: var(--c); border-color: var(--c); }
.player-bar .ops .next { background: var(--c); color: #fff; border-color: var(--c); }
.player-bar .ops .next:hover { color: #fff; background: var(--c-hover); }
body.lights-off::before { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.9); z-index: 90; }
body.lights-off .player { z-index: 95; }

/* ---------- 搜索 ---------- */
.s-item { display: flex; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.s-item:last-child { border-bottom: 0; }
.s-item .v-thumb { width: 130px; flex-shrink: 0; }
.s-info { flex: 1; min-width: 0; }
.s-info h3 { font-size: 18px; font-weight: bold; margin-bottom: 8px; }
.s-info h3 small { font-size: 13px; color: var(--text-3); font-weight: normal; margin-left: 6px; }
.s-info p { font-size: 13px; color: #666; line-height: 1.8; }
.s-info p span { color: var(--text-3); }
.s-info .desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.s-info .detail-btns { margin-top: 10px; }
.s-kw { color: var(--c); }

/* ---------- 通用 / 兼容旧页面 ---------- */
.glass-panel { background: #fff; border-radius: 4px; padding: 22px; }
.form-control { width: 100%; padding: 9px 12px; border: 1px solid #e4e7e9; border-radius: 2px; font-size: 14px; background: #fff; }
.form-control:focus { border-color: var(--c); }
.comment-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment-item:last-child { border-bottom: 0; }
.comment-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.comment-author { color: var(--c); }
.comment-time { color: var(--text-3); font-size: 12px; }
.comment-text { color: #555; }
.empty { padding: 50px 0; text-align: center; color: var(--text-3); }
.page-banner { display: none; }
.main-wrap, .main-wrap--hero { flex: 1 0 auto; padding: 20px 0 10px; }
.page-title { font-size: 18px; color: var(--c); }
.page-subtitle { font-size: 13px; color: var(--text-3); }
.empty-state { background: #fff; padding: 50px 20px; text-align: center; color: var(--text-3); border-radius: 4px; }
.empty-state h3 { font-size: 16px; color: #555; margin-bottom: 6px; }

/* ---------- 页脚 ---------- */
.footer { margin-top: 10px; padding: 26px 0 30px; text-align: center; font-size: 12px; line-height: 2; color: var(--text-3); }
.footer a { color: var(--text-2); margin: 0 6px; }
.footer a:hover { color: var(--c); }
.gotop { position: fixed; right: 20px; bottom: 30px; z-index: 60; width: 40px; height: 40px; border-radius: 2px; background: rgba(0,0,0,.35); color: #fff; display: none; align-items: center; justify-content: center; }
.gotop.show { display: flex; }
.gotop:hover { background: var(--c); color: #fff; }
.toast { position: fixed; left: 50%; top: 40%; transform: translateX(-50%); z-index: 999; padding: 10px 20px; background: rgba(0,0,0,.75); color: #fff; border-radius: 4px; font-size: 14px; display: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
  .vlist-6 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .row > .col-side { width: 260px; }
}
@media (max-width: 900px) {
  .row, .row-rev { flex-direction: column; }
  .row > .col-side { width: 100%; }
  .vlist-6, .vlist-5 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .main, .main-wrap, .main-wrap--hero { padding-top: 8px; }
  .container { padding: 0 8px; }
  .header .container { height: auto; flex-wrap: wrap; justify-content: center; gap: 0; padding-top: 10px; position: relative; }
  .logo-text { font-size: 24px; }
  .nav { order: 3; width: 100%; flex: none; }
  .nav li a { line-height: 40px; font-size: 16px; padding: 0 8px; }
  .nav li.on a::after { bottom: 4px; }
  .search-toggle { display: flex; position: absolute; right: 8px; top: 8px; }
  .searchform { display: none; order: 4; width: 100%; margin-bottom: 10px; }
  body.search-open .searchform { display: flex; }
  .panel { padding: 0 10px 12px; margin-bottom: 8px; border-radius: 0; }
  .panel-hd { min-height: 46px; margin-bottom: 10px; }
  .panel-hd h3, .panel-hd h1, .panel-hd h2 { font-size: 16px; }
  .vlist, .vlist-6, .vlist-5 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 6px; }
  .v-title { font-size: 12px; margin-top: 5px; }
  .v-note { font-size: 11px; }
  .v-tag { font-size: 10px; line-height: 16px; padding: 0 4px; }
  .v-tag i { display: none; }
  .stars { width: 45px; height: 9px; -webkit-mask-size: 9px 9px; mask-size: 9px 9px; }
  .detail { flex-direction: row; gap: 14px; padding: 16px 0; }
  .detail-pic { width: 110px; }
  .detail-info h1 { font-size: 16px; }
  .detail-info p { font-size: 13px; margin-bottom: 4px; }
  .detail-info .desc { -webkit-line-clamp: 3; }
  .playbox { padding: 14px 0 0; }
  .eps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .filter dd { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .filter dd::-webkit-scrollbar { display: none; }
  .filter dd a { white-space: nowrap; }
  .s-item .v-thumb { width: 96px; }
  .s-info h3 { font-size: 16px; }
  .player-wrap { padding-top: 10px; }
}
@media (max-width: 380px) {
  .vlist, .vlist-6, .vlist-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* 专题页兼容 */
.vod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 15px 12px; list-style: none; }
.vod-poster { position: relative; aspect-ratio: 7/10; overflow: hidden; background: #f1f1f1; }
.vod-poster img { width: 100%; height: 100%; object-fit: cover; }
.vod-card-title { margin-top: 8px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vod-card-sub { font-size: 12px; color: var(--text-3); text-align: center; }
/* 移动端修正 */
@media (max-width: 900px) {
  .row, .row-rev { align-items: stretch; gap: 0; }
  .row > .col-main { order: -1; }
}
@media (max-width: 768px) {
  .vlist-5 .v-item:nth-child(n+9) { display: none; }
  .header .container { padding-left: 44px; padding-right: 44px; }
  .nav { margin: 0 -44px; width: calc(100% + 88px); }
  .nav ul { padding: 0 8px; }
}
@media (max-width: 768px) { .detail-pic { width: 100px !important; } }
