/* ============================================================
   CineVault 扩展页面视觉层（邀请 / 签到 / VIP）
   严格遵循流媒体暗黑体系：#141414 / #181818 / #262626 + #fff + #e50914
   ============================================================ */

/* ------------------------------------------------------------ 导航扩展（VIP 入口 + 头像下拉） */
.nav-vip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 11px;
  border-radius: 3px;
  background: var(--red);
  color: #fff;
  font-size: 12px; font-weight: 800; letter-spacing: .04em;
  white-space: nowrap;
  transition: background-color .2s, transform .15s;
}
.nav-vip:hover { background: var(--red-soft); transform: translateY(-1px); }

.profile { position: relative; outline: none; }
.avatar { position: relative; flex: 0 0 auto; }
.avatar.is-vip {
  box-shadow: 0 0 0 1.5px var(--red);
}
.avatar.is-vip::after {
  content: "VIP";
  position: absolute; right: -4px; bottom: -4px;
  padding: 1px 4px; border-radius: 2px;
  background: var(--red);
  color: #fff; font-size: 8px; font-weight: 900; line-height: 1.1;
}

.profile-menu {
  position: absolute; top: calc(100% + 14px); right: 0;
  width: 220px; padding: 8px 0;
  background: rgba(0, 0, 0, .94);
  border: 1px solid rgba(255, 255, 255, .15);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .75);
  opacity: 0; visibility: hidden; transform: translateY(-4px);
  transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
  z-index: 95;
}
.profile-menu::before {
  content: ""; position: absolute; inset: -18px 0 auto 0; height: 18px;
}
.profile-menu::after {
  content: ""; position: absolute; top: -12px; right: 16px;
  border: 6px solid transparent; border-bottom-color: rgba(255, 255, 255, .9);
}
.profile:hover .profile-menu,
.profile:focus-within .profile-menu,
.profile.open .profile-menu {
  opacity: 1; visibility: visible; transform: none;
}
.profile-menu a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; font-size: 13px; color: #e5e5e5;
  transition: background-color .15s, color .15s;
}
.profile-menu a:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: underline; }
.profile-menu a.cur { font-weight: 700; color: #fff; }
.profile-menu a.center { justify-content: center; color: var(--text-dim); }
.profile-menu hr { border: 0; border-top: 1px solid rgba(255, 255, 255, .15); margin: 6px 0; }
.pm-ico {
  width: 20px; height: 20px; border-radius: 3px;
  background: rgba(255, 255, 255, .12);
  display: inline-grid; place-items: center;
  font-style: normal; font-size: 11px; font-weight: 900; color: #fff;
  flex: 0 0 auto;
}
.pm-ico.red { background: var(--red); color: #fff; }

/* ------------------------------------------------------------ 子页公共头图与主容器 */
.page-hero {
  position: relative;
  min-height: clamp(410px, 48vh, 520px);
  max-width: 100%;
  display: flex; align-items: flex-end;
  padding: calc(var(--nav-h) + 38px) var(--gutter) clamp(68px, 7vw, 96px);
  isolation: isolate; overflow: hidden;
  background: #000;
}
.page-hero .hero-bg .hero-img { opacity: 1; }
.page-hero .hero-scrim {
  background:
    linear-gradient(77deg, rgba(0, 0, 0, .86) 0%, rgba(0, 0, 0, .5) 48%, rgba(0, 0, 0, .18) 100%);
}
.page-hero-content {
  position: relative;
  width: 100%; min-width: 0;
  max-width: 780px; z-index: 2;
}
.page-hero-content h1 {
  font-size: clamp(30px, 3.6vw, 56px);
  font-weight: 900; line-height: 1.08; letter-spacing: -.02em;
  margin: 0 0 12px;
  text-shadow: 2px 4px 26px rgba(0, 0, 0, .55);
}
.page-sub {
  font-size: clamp(14px, 1.2vw, 18px);
  line-height: 1.55; color: #e5e5e5;
  margin: 0 0 22px; max-width: 580px;
  text-shadow: 1px 2px 10px rgba(0, 0, 0, .6);
}
.page-wrap {
  padding: 0 var(--gutter) 64px;
  margin-top: -4vw;
  position: relative; z-index: 3;
}
.sec-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 36px 0 16px;
  font-size: clamp(18px, 1.55vw, 24px); font-weight: 700; color: #e5e5e5;
}
.sec-title small { font-size: 13px; font-weight: 400; color: var(--text-dim); }
.panel {
  background: var(--bg-elev);
  border-radius: 6px;
  padding: 24px;
}

.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-soft); }
.btn-sm { font-size: 14px; padding: 8px 18px; line-height: 1.4; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ------------------------------------------------------------ 通用状态徽章 / 栅格 */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 3px;
  font-size: 12px; font-weight: 700;
  background: rgba(255, 255, 255, .1); color: #e5e5e5;
}
.pill.red { background: rgba(229, 9, 20, .22); color: #ff5c64; }
.pill.red-solid { background: var(--red); color: #fff; }
.pill.white { background: #fff; color: #141414; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

/* ------------------------------------------------------------ 邀请页 (invite.html) */
.rule-card {
  display: flex; align-items: center; gap: 18px;
  background: var(--bg-elev);
  border-radius: 6px; padding: 22px 24px;
  border-left: 4px solid #4d4d4d;
}
.rule-card.top { border-left-color: var(--red); }
.rule-num {
  flex: 0 0 auto;
  width: 60px; height: 60px; border-radius: 6px;
  background: rgba(255, 255, 255, .08); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 900; line-height: 1.1;
}
.rule-card.top .rule-num { background: var(--red); color: #fff; }
.rule-num b { font-size: 24px; }
.rule-num small { font-size: 11px; font-weight: 700; color: var(--text-dim); }
.rule-card.top .rule-num small { color: rgba(255, 255, 255, .9); }
.rule-info h3 { margin: 0 0 4px; font-size: 18px; font-weight: 700; color: #fff; }
.rule-info p { margin: 0; font-size: 13.5px; color: var(--text-dim); line-height: 1.5; }

.inv-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 24px;
}
.inv-head h3 { margin: 0; font-size: 18px; font-weight: 700; }
.inv-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.milestones {
  position: relative;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px; padding: 14px 0 6px;
}
.ms-track {
  position: absolute; left: 16.6%; right: 16.6%; top: 40px; height: 4px;
  background: #2f2f2f; border-radius: 2px; z-index: 0;
}
.ms-fill {
  height: 100%; width: 0; border-radius: 2px;
  background: var(--red);
  transition: width .45s var(--ease);
}
.ms-node {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.ms-circle {
  width: 54px; height: 54px; border-radius: 50%;
  background: #242424; border: 2px dashed #555;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 900; color: #777;
  margin-bottom: 10px;
  transition: all .3s var(--ease);
}
.ms-node.done .ms-circle {
  border-style: solid; border-color: var(--red);
  background: var(--red); color: #fff;
}
.ms-node.prize.done .ms-circle {
  box-shadow: 0 0 0 4px rgba(229, 9, 20, .25);
}
.ms-label { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 3px; }
.ms-reward { font-size: 12px; color: var(--text-dim); }
.ms-node.done .ms-reward { color: #ff5c64; font-weight: 700; }

.code-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: 4px;
  background: #242424; margin: 14px 0 12px;
}
.code-val {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 22px; font-weight: 900; letter-spacing: .12em; color: #fff;
}
.link-box {
  padding: 10px 14px; border-radius: 4px;
  background: #101010; border: 1px solid #2f2f2f;
  font-size: 13px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 16px;
}
.share-row { display: flex; gap: 10px; flex-wrap: wrap; }

.friend-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.friend-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 4px; background: #222;
}
.f-av {
  width: 36px; height: 36px; border-radius: 4px;
  background: #333; display: grid; place-items: center;
  color: #e5e5e5; flex: 0 0 auto;
}
.f-av svg { width: 18px; height: 18px; }
.f-meta { flex: 1; min-width: 0; }
.f-name { font-size: 14px; font-weight: 700; color: #fff; }
.f-time { font-size: 12px; color: var(--text-mute); margin-top: 2px; }

.empty-box {
  padding: 28px 16px; text-align: center;
  color: var(--text-mute); font-size: 13.5px; line-height: 1.7;
  background: #141414; border-radius: 4px; margin-top: 14px;
}

/* 常见问题手风琴 */
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item { background: #262626; border-radius: 4px; overflow: hidden; }
.faq-q {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 22px; font-size: 16px; font-weight: 700; text-align: left; color: #fff;
  transition: background-color .2s;
}
.faq-q:hover { background: #323232; }
.faq-q::after { content: "+"; font-size: 24px; font-weight: 400; line-height: 1; transition: transform .2s; }
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a {
  display: none; padding: 0 22px 18px;
  font-size: 14px; line-height: 1.65; color: #d2d2d2;
  border-top: 1px solid #353535; padding-top: 14px;
}
.faq-item.open .faq-a { display: block; }

/* ------------------------------------------------------------ 签到页 (checkin.html) */
.stat-card {
  background: var(--bg-elev); border-radius: 6px; padding: 20px 24px;
  display: flex; flex-direction: column; gap: 6px;
}
.stat-card label { font-size: 13px; color: var(--text-dim); }
.stat-card b { font-size: 32px; font-weight: 900; color: #fff; line-height: 1.1; }
.stat-card b span { font-size: 14px; font-weight: 700; color: var(--text-dim); margin-left: 4px; }
.stat-card small { font-size: 12px; color: var(--text-mute); }

.streak-grid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px;
}
.day-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 18px 10px; border-radius: 6px;
  background: #1f1f1f; text-align: center;
  border: 1px solid rgba(255, 255, 255, .08);
  transition: transform .2s, border-color .2s, background-color .2s;
}
.day-card .dc-day { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }
.day-card .dc-ico {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  color: #808080; margin-bottom: 8px;
}
.day-card .dc-ico svg { width: 24px; height: 24px; }
.day-card .dc-val { font-size: 13px; font-weight: 700; color: #b3b3b3; }
.day-card.checked { background: #262626; border-color: rgba(255, 255, 255, .22); }
.day-card.checked .dc-ico { color: var(--red); }
.day-card.checked .dc-val { color: #fff; }
.day-card.today { border-color: var(--red); background: rgba(229, 9, 20, .12); }
.day-card.today .dc-ico { color: #fff; }
.day-card.today .dc-val { color: #fff; }

.cal-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
}
.cal-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; text-align: center; }
.cal-wd { font-size: 12px; color: var(--text-mute); padding: 4px 0 8px; }
.cal-cell {
  aspect-ratio: 1; max-height: 44px; border-radius: 4px;
  display: grid; place-items: center; font-size: 13px; color: var(--text-dim);
  background: #202020; position: relative;
}
.cal-cell.empty { background: transparent; }
.cal-cell.checked { background: var(--red); color: #fff; font-weight: 700; }
.cal-cell.today:not(.checked) { box-shadow: inset 0 0 0 1.5px #fff; color: #fff; font-weight: 700; }

.rec-list { display: flex; flex-direction: column; gap: 10px; }
.rec-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px; border-radius: 4px; background: #222; font-size: 13.5px;
}
.rec-row small { display: block; color: var(--text-mute); font-size: 12px; margin-top: 2px; }
.rec-plus { color: #ff5c64; font-weight: 800; white-space: nowrap; }
.rec-minus { color: var(--text-dim); font-weight: 700; white-space: nowrap; }

.unlock-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px;
}
.u-card {
  background: var(--bg-elev); border-radius: 6px; overflow: hidden;
  display: flex; flex-direction: column;
}
.u-thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.u-thumb img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.06); }
.u-thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(24,24,24,1) 0%, transparent 60%);
}
.u-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.u-title { font-size: 15px; font-weight: 700; color: #fff; }
.u-meta { font-size: 12px; color: var(--text-dim); }
.u-body .btn { margin-top: auto; width: 100%; }

/* ------------------------------------------------------------ VIP 中心 (vip.html) */
.vip-status {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px;
  background: var(--bg-elev);
  border: 1px solid rgba(255, 255, 255, .12);
  border-left: 4px solid var(--red);
  border-radius: 6px; padding: 24px 28px;
}
.vip-user { display: flex; align-items: center; gap: 16px; }
.vip-user .avatar { width: 52px; height: 52px; font-size: 18px; border-radius: 6px; flex: 0 0 auto; }
.vip-user h3 { margin: 0 0 4px; font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.vip-user p { margin: 0; font-size: 13.5px; color: var(--text-dim); }
.vip-status-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.perk-grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px;
}
.perk-card {
  background: var(--bg-elev); border-radius: 6px; padding: 20px 18px;
  display: flex; flex-direction: column; gap: 10px;
  border: 1px solid rgba(255, 255, 255, .07);
  transition: transform .2s var(--ease), border-color .2s;
}
.perk-card:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .3); }
.perk-ico {
  width: 38px; height: 38px; border-radius: 6px;
  background: rgba(229, 9, 20, .14); color: var(--red);
  display: grid; place-items: center;
}
.perk-ico svg { width: 20px; height: 20px; }
.perk-card h4 { margin: 0; font-size: 15px; font-weight: 700; color: #fff; }
.perk-card p { margin: 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }

.plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.plan-card {
  position: relative;
  background: var(--bg-elev); border-radius: 6px; padding: 26px 22px;
  border: 1px solid rgba(255, 255, 255, .1);
  display: flex; flex-direction: column;
  transition: transform .2s var(--ease), border-color .2s;
}
.plan-card:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, .32); }
.plan-card.rec {
  border: 2px solid var(--red);
  background: linear-gradient(180deg, rgba(229, 9, 20, .14) 0%, #181818 52%);
}
.plan-card.family {
  border: 1px solid rgba(255, 255, 255, .3);
  background: linear-gradient(180deg, rgba(255, 255, 255, .06) 0%, #181818 52%);
}
.plan-badge {
  position: absolute; top: -11px; right: 18px;
  padding: 3px 10px; border-radius: 3px;
  background: var(--red);
  color: #fff; font-size: 11px; font-weight: 900;
}
.plan-badge.dark {
  background: #fff; color: #141414;
}
.plan-name { font-size: 18px; font-weight: 800; margin: 0 0 6px; }
.plan-sub { font-size: 13px; color: var(--text-dim); margin: 0 0 18px; }
.plan-price { display: flex; align-items: baseline; gap: 4px; margin-bottom: 18px; }
.plan-price b { font-size: 36px; font-weight: 900; color: #fff; letter-spacing: -.02em; }
.plan-price span { font-size: 14px; color: var(--text-dim); }
.plan-list {
  list-style: none; padding: 0; margin: 0 0 22px;
  display: flex; flex-direction: column; gap: 9px; font-size: 13px; color: #d8d8d8;
}
.plan-list li::before { content: "✓ "; color: var(--red); font-weight: 900; margin-right: 4px; }
.plan-card .btn { margin-top: auto; width: 100%; }

.cmp-wrap { overflow-x: auto; }
.cmp-table { width: 100%; min-width: 540px; border-collapse: collapse; font-size: 14px; }
.cmp-table th, .cmp-table td {
  padding: 14px 16px; text-align: left;
  border-bottom: 1px solid #2b2b2b;
}
.cmp-table th { color: var(--text-dim); font-weight: 700; font-size: 13px; }
.cmp-table th.vip-col { color: #fff; }
.cmp-table th.vip-col::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); margin-right: 6px; vertical-align: middle;
}
.cmp-table td:first-child { color: #e5e5e5; font-weight: 600; }
.cmp-table td:nth-child(2) { color: var(--text-mute); }
.cmp-table td.vip-col { color: #fff; font-weight: 700; }

/* ------------------------------------------------------------ 弹窗 & Toast */
.cv-toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 200;
  transform: translate(-50%, 16px);
  padding: 11px 22px; border-radius: 4px;
  background: #2f2f2f; color: #fff; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .75);
  border: 1px solid rgba(255, 255, 255, .14);
  opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s var(--ease);
}
.cv-toast.show { opacity: 1; transform: translate(-50%, 0); }

.cv-modal-back {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(0, 0, 0, .72);
  display: grid; place-items: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.cv-modal-back.open { opacity: 1; pointer-events: auto; }
.cv-modal {
  position: relative; width: min(480px, 100%);
  background: var(--bg-elev); border-radius: 6px;
  padding: 26px 26px 24px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, .85);
  border: 1px solid rgba(255, 255, 255, .1);
  transform: scale(.94); transition: transform .22s var(--ease);
}
.cv-modal-back.open .cv-modal { transform: scale(1); }
.cv-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: #2b2b2b; color: #fff; display: grid; place-items: center;
}
.cv-modal-close svg { width: 16px; height: 16px; }
.cv-modal h3 { margin: 0 0 8px; font-size: 22px; font-weight: 800; }
.cv-modal p { margin: 0 0 18px; font-size: 14px; color: var(--text-dim); line-height: 1.6; }

.pay-methods { display: flex; gap: 10px; margin-bottom: 18px; }
.pay-chip {
  flex: 1; padding: 10px; border-radius: 4px;
  background: #242424; border: 1px solid #3a3a3a;
  font-size: 13px; font-weight: 700; color: #d8d8d8; text-align: center;
}
.pay-chip.on { border-color: var(--red); color: #fff; background: rgba(229, 9, 20, .18); }

.poster-card {
  position: relative; border-radius: 6px; overflow: hidden;
  background: #101010; margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, .12);
}
.poster-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.poster-cap { padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ------------------------------------------------------------ 响应式 */
@media (max-width: 1180px) {
  .perk-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .unlock-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .page-hero { min-height: 340px; padding: calc(var(--nav-h) + 28px) 20px 56px; }
  .page-hero .hero-kicker, .page-hero .hero-actions { justify-content: flex-start; }
  .page-wrap { margin-top: -24px; padding: 0 20px 48px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .perk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .streak-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .milestones { grid-template-columns: 1fr; gap: 18px; }
  .ms-track { display: none; }
  .ms-node { flex-direction: row; text-align: left; gap: 14px; }
  .ms-circle { margin-bottom: 0; width: 46px; height: 46px; font-size: 17px; }
  .nav-vip { padding: 3px 8px; font-size: 11px; }
  .cmp-table th, .cmp-table td { padding: 11px 10px; font-size: 12.5px; }
}
@media (max-width: 640px) {
  .sec-title { flex-direction: column; align-items: flex-start; gap: 6px; }
  .plan-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .perk-grid, .unlock-grid { grid-template-columns: 1fr; }
  .streak-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
