/* ============ 电影站样式 ============ */
:root {
  --bg: #0b0d14;
  --bg-soft: #141824;
  --card: #141824;
  --card-hover: #1a2030;
  --line: #222838;
  --text: #eef2ff;
  --text-dim: #8e97b3;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --gold: #f5b50a;
  --radius: 14px;
  --shadow: 0 14px 40px rgba(0, 0, 0, .5);
  --wrap: 1280px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }

/* 必须放在最前面：.modal 设了 display:flex，会盖掉 HTML 的 hidden 属性，
   导致页面一加载就露出空白弹层 */
[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 18px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(11, 13, 20, .86);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }

.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  font-size: 11px; font-weight: 900; letter-spacing: 2px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  padding: 5px 9px; border-radius: 7px;
}
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: .5px; }

.search { display: flex; align-items: center; gap: 8px; flex: 0 1 420px; }
.search input {
  flex: 1; padding: 10px 14px; border-radius: 10px; outline: none;
  border: 1px solid var(--line); background: var(--bg-soft); color: var(--text); font-size: 14px;
}
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 92, 255, .18); }
.search button {
  padding: 10px 18px; border-radius: 10px; cursor: pointer; border: 0; color: #fff; font-size: 14px;
  background: linear-gradient(135deg, var(--accent), #5b7cfa);
}
.search button:hover { filter: brightness(1.1); }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(900px 300px at 15% -40%, rgba(124, 92, 255, .35), transparent 70%),
    radial-gradient(700px 260px at 85% -30%, rgba(34, 211, 238, .22), transparent 70%);
  border-bottom: 1px solid var(--line);
  padding: 34px 0 28px;
}
.hero-title { margin: 0 0 6px; font-size: 30px; font-weight: 900; letter-spacing: 1px; }
.hero-sub { margin: 0; color: var(--text-dim); font-size: 14.5px; }

/* ---------- Tabs ---------- */
.tabbar { position: sticky; top: 64px; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.tabbar-inner { display: flex; gap: 8px; overflow-x: auto; padding: 11px 18px; scrollbar-width: none; }
.tabbar-inner::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; padding: 8px 18px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line); background: transparent; color: var(--text-dim); font-size: 14px; transition: .18s;
}
.tab:hover { color: var(--text); border-color: var(--accent); }
.tab.active {
  color: #fff; border-color: transparent; font-weight: 600;
  background: linear-gradient(135deg, var(--accent), #5b7cfa);
}

/* ---------- 提示 ---------- */
.notice {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 16px; padding: 13px 16px; border-radius: 12px; font-size: 13.5px;
  border: 1px solid rgba(245, 181, 10, .35); background: rgba(245, 181, 10, .1); color: #f0d68a;
}
.notice code { background: rgba(0, 0, 0, .3); padding: 1px 6px; border-radius: 5px; }

/* ---------- 状态条 ---------- */
.statusbar { display: flex; align-items: center; gap: 14px; padding: 16px 0 4px; color: var(--text-dim); font-size: 13.5px; }
.link-btn { background: none; border: 0; color: var(--accent-2); cursor: pointer; font-size: 13.5px; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* ---------- 影片网格 ---------- */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(172px, 1fr)); padding-top: 12px; }

.card {
  position: relative; cursor: pointer; border-radius: var(--radius); overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
  transition: transform .22s, box-shadow .22s, border-color .22s;
  animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--accent); }

.poster { position: relative; aspect-ratio: 2/3; background: linear-gradient(160deg, #1b2130, #262f45); overflow: hidden; }
.poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card:hover .poster img { transform: scale(1.07); }
.poster.no-img::after {
  content: attr(data-title); position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px;
  color: rgba(255, 255, 255, .8); font-weight: 700; font-size: 15px;
}
.poster::before {
  content: ""; position: absolute; inset: auto 0 0 0; height: 62%; z-index: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, .88), transparent);
}
.rating {
  position: absolute; right: 8px; top: 8px; z-index: 2;
  padding: 3px 8px; border-radius: 7px; font-size: 12.5px; font-weight: 700;
  background: rgba(0, 0, 0, .68); color: var(--gold); backdrop-filter: blur(4px);
}
.year { position: absolute; left: 8px; top: 8px; z-index: 2; padding: 3px 8px; border-radius: 7px; font-size: 12px; background: rgba(0, 0, 0, .6); color: #dfe5ff; }
/* 底部文字区：更新状态 + 片名 纵向排列，避免两者绝对定位重叠 */
.poster-caption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 10px 11px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
}
.poster-title {
  width: 100%;                 /* flex 子项需显式宽度才能正确换行与截断 */
  font-size: 14px; font-weight: 700; line-height: 1.35; color: #fff;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.remarks {
  align-self: flex-start;      /* 只占文字宽度，不撑满整行 */
  max-width: 100%;
  padding: 2px 8px; border-radius: 7px; font-size: 11.5px; line-height: 1.45;
  background: rgba(34, 211, 238, .22); color: #9deffb; border: 1px solid rgba(34, 211, 238, .35);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.7); z-index: 3;
  width: 50px; height: 50px; border-radius: 50%; opacity: 0; transition: .25s;
  background: rgba(255, 255, 255, .92); display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #111;
}
.card:hover .card-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* 骨架屏 */
.skeleton { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--card); }
.skeleton .sk-poster { aspect-ratio: 2/3; background: linear-gradient(100deg, var(--bg-soft) 30%, var(--card-hover) 50%, var(--bg-soft) 70%); background-size: 200% 100%; animation: shine 1.3s infinite; }
@keyframes shine { to { background-position: -200% 0; } }

.empty { text-align: center; color: var(--text-dim); padding: 80px 0; }

/* 更多 */
.more { display: flex; justify-content: center; padding: 28px 0 0; }
.more-btn {
  padding: 12px 40px; border-radius: 999px; cursor: pointer; font-size: 14px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
}
.more-btn:hover { border-color: var(--accent); color: var(--accent); }

.foot-space { height: 44px; }
.footer { border-top: 1px solid var(--line); margin-top: 20px; }
.footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 22px 18px; color: var(--text-dim); font-size: 12.5px; }

/* ---------- 详情弹层 ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-mask { position: absolute; inset: 0; background: rgba(4, 6, 12, .78); backdrop-filter: blur(4px); }
.modal-box {
  position: relative; z-index: 1; width: 100%; max-width: 900px; max-height: 88vh; overflow-y: auto;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  animation: pop .25s ease both;
}
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-close {
  position: absolute; right: 12px; top: 12px; z-index: 3; width: 36px; height: 36px; border-radius: 50%;
  border: 0; cursor: pointer; font-size: 20px; line-height: 1;
  background: rgba(0, 0, 0, .6); color: #fff;
}
.modal-close:hover { background: rgba(0, 0, 0, .85); }

.modal-hero { position: relative; aspect-ratio: 16/7; background: linear-gradient(160deg, #1b2130, #2a3350); overflow: hidden; }
.modal-hero .hero-blur {
  position: absolute; inset: -30px; background-size: cover; background-position: center;
  filter: blur(26px) saturate(1.3); transform: scale(1.15); opacity: .5;
}
.modal-hero img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: contain; }
.modal-hero::after { content: ""; position: absolute; inset: 0; z-index: 2; background: linear-gradient(to top, var(--bg-soft) 4%, transparent 70%); }

.modal-body { padding: 4px 26px 28px; margin-top: -60px; position: relative; z-index: 2; }
.m-head { display: flex; gap: 20px; }
.m-poster { flex: 0 0 150px; width: 150px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #1b2130; box-shadow: var(--shadow); }
.m-poster img { width: 100%; aspect-ratio: 2/3; object-fit: cover; }
.m-info { flex: 1; min-width: 0; padding-top: 62px; }
.m-title { margin: 0 0 4px; font-size: 23px; font-weight: 800; }
.m-orig { margin: 0 0 10px; color: var(--text-dim); font-size: 13.5px; }
.m-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.m-tag { padding: 4px 11px; border-radius: 999px; font-size: 12.5px; background: rgba(124, 92, 255, .16); color: #b9a7ff; border: 1px solid rgba(124, 92, 255, .3); }
.m-score { color: var(--gold); font-weight: 700; }
.m-meta { color: var(--text-dim); font-size: 13.5px; margin-bottom: 12px; }
.m-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 10px 20px; border-radius: 10px;
  font-size: 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { border-color: transparent; color: #fff; background: linear-gradient(135deg, var(--accent), #5b7cfa); }
.btn-primary:hover { filter: brightness(1.1); color: #fff; }
.btn-gold { border-color: transparent; color: #201a00; background: linear-gradient(135deg, var(--gold), #ffd76a); font-weight: 700; }
.btn-gold:hover { filter: brightness(1.06); color: #201a00; }

.m-section { margin-top: 22px; }
.m-section h4 { margin: 0 0 8px; font-size: 15px; color: var(--accent-2); }
.m-overview { color: #cdd4ea; font-size: 14.5px; line-height: 1.8; white-space: pre-line; }
.m-cast { display: flex; flex-wrap: wrap; gap: 8px; }
.m-cast span { padding: 5px 12px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); font-size: 13px; color: var(--text-dim); }
.m-loading { padding: 60px; text-align: center; color: var(--text-dim); }

/* 回到顶部 */
.to-top {
  position: fixed; right: 22px; bottom: 26px; z-index: 80; width: 44px; height: 44px; border-radius: 50%;
  cursor: pointer; font-size: 18px; border: 1px solid var(--line); background: var(--card); color: var(--text); box-shadow: var(--shadow);
}
.to-top:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 720px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
  .hero-title { font-size: 23px; }
  .brand-name { font-size: 16px; }
  .topbar-inner { height: auto; padding: 10px 0; flex-wrap: wrap; }
  .search { flex: 1 1 100%; }
  .tabbar { top: 0; }
  .m-head { flex-direction: column; }
  .m-poster { width: 120px; }
  .m-info { padding-top: 0; }
  .modal-body { margin-top: -30px; padding: 4px 16px 22px; }
}
