/* ============================================================
   JavDB Web UI — 暗色优先的观影界面
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* 底色 / 表面 */
  --bg: #f6f6fa;
  --bg-soft: #eeeef4;
  --panel: #ffffff;
  --panel-2: #fafafd;
  --surface: #ffffff;
  --surface-2: #f3f3f8;
  --overlay: rgba(255, 255, 255, 0.72);

  /* 文字 */
  --text: #14141a;
  --text-2: #3d3d4a;
  --muted: #6b6b7b;
  --faint: #9a9aab;

  /* 线条 */
  --border: #e4e4ee;
  --border-strong: #d4d4e2;
  --hairline: rgba(16, 16, 28, 0.07);

  /* 主色 */
  --accent: #e0245e;
  --accent-2: #ff7a3d;
  --accent-soft: rgba(224, 36, 94, 0.1);
  --accent-text: #ffffff;
  --accent-grad: linear-gradient(135deg, #ff3b6b 0%, #ff7a3d 100%);
  --glow: 0 10px 30px -12px rgba(224, 36, 94, 0.5);

  --success: #12855a;
  --warn: #b3701a;

  /* 形状 */
  --radius: 16px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --radius-pill: 999px;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(16, 16, 28, 0.06);
  --shadow: 0 12px 32px -16px rgba(16, 16, 28, 0.28);
  --shadow-lg: 0 28px 60px -24px rgba(16, 16, 28, 0.34);

  --grid-min: 200px;
  --header-h: 62px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  color-scheme: light;
}

html.dark {
  --bg: #08080b;
  --bg-soft: #101017;
  --panel: #12121a;
  --panel-2: #171720;
  --surface: #12121a;
  --surface-2: #1a1a24;
  --overlay: rgba(10, 10, 14, 0.72);

  --text: #f4f4f8;
  --text-2: #d3d3de;
  --muted: #9a9aad;
  --faint: #6e6e80;

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --hairline: rgba(255, 255, 255, 0.06);

  --accent: #ff3b6b;
  --accent-2: #ff8a4d;
  --accent-soft: rgba(255, 59, 107, 0.14);
  --accent-grad: linear-gradient(135deg, #ff3b6b 0%, #ff8a4d 100%);
  --glow: 0 14px 40px -16px rgba(255, 59, 107, 0.55);

  --success: #2fbd85;
  --warn: #e0a33c;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 34px 70px -28px rgba(0, 0, 0, 0.9);
  color-scheme: dark;
}

html[data-cover="small"] {
  --grid-min: 150px;
}

html[data-cover="large"] {
  --grid-min: 224px;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 14px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* 背景的两团柔光，避免大片死黑 */
body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 520px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(46% 60% at 22% 0%, rgba(255, 59, 107, 0.16), transparent 70%),
    radial-gradient(40% 55% at 78% 6%, rgba(120, 90, 255, 0.14), transparent 72%);
  filter: blur(6px);
  opacity: 0.9;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background: var(--accent-soft);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* 细滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--faint);
  background-clip: padding-box;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

/* ============================================================
   通用组件
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), background 0.18s var(--ease),
    transform 0.12s var(--ease), box-shadow 0.18s var(--ease);
}

.btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: scale(0.975);
}

.btn.primary {
  background: var(--accent-grad);
  border-color: transparent;
  color: var(--accent-text);
  font-weight: 650;
  box-shadow: var(--glow);
}

.btn.primary:hover {
  filter: brightness(1.05) saturate(1.05);
  color: var(--accent-text);
  box-shadow: 0 16px 34px -14px rgba(255, 59, 107, 0.7);
}

.btn.ghost {
  background: transparent;
  border-color: transparent;
}

.btn.ghost:hover {
  background: var(--surface-2);
  border-color: var(--border);
}

.btn.small {
  height: 30px;
  padding: 0 12px;
  font-size: 12.5px;
}

.btn.block {
  width: 100%;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 12.8px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease), background 0.16s var(--ease),
    transform 0.12s var(--ease);
}

.chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.chip:active {
  transform: scale(0.97);
}

.chip.active {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent);
  font-weight: 650;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.8px;
  font-weight: 500;
  border: 1px solid transparent;
}

.tag.bad {
  color: var(--accent);
  background: var(--accent-soft);
}

.tag.good {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 14%, transparent);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 30px 0 15px;
}

.section-title h2 {
  position: relative;
  margin: 0;
  padding-left: 13px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.section-title h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 17px;
  border-radius: 99px;
  background: var(--accent-grad);
  box-shadow: 0 0 12px -1px var(--accent);
}

.section-title .hint {
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.02em;
}

/* ============================================================
   顶栏
   ============================================================ */

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--overlay);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--hairline);
}

.app-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 45%, transparent), transparent);
  opacity: 0.6;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1600px;
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  letter-spacing: 0.02em;
  font-size: 16.5px;
  flex: none;
  transition: opacity 0.18s var(--ease);
}

.brand:hover {
  opacity: 0.85;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 9px;
  background: var(--accent-grad);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  box-shadow: var(--glow);
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav a {
  position: relative;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.16s var(--ease), background 0.16s var(--ease);
}

.nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.nav a.active {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 650;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  transition: background 0.16s var(--ease), color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.icon-btn:hover {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
}

/* 搜索 */

.search-bar {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-bar input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 36px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.search-bar input::placeholder {
  color: var(--faint);
}

.search-bar input:focus {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.search-bar .search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  font-size: 14px;
  pointer-events: none;
}

.search-suggest {
  position: absolute;
  top: 46px;
  left: 0;
  right: 0;
  z-index: 60;
  padding: 7px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  display: none;
  animation: pop 0.16s var(--ease);
}

.search-suggest.open {
  display: block;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.search-suggest a {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.14s var(--ease);
}

.search-suggest a:hover {
  background: var(--surface-2);
}

.search-suggest img {
  width: 36px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--surface-2);
  flex: none;
}

.search-suggest .meta {
  min-width: 0;
}

.search-suggest .meta strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-suggest .meta span {
  color: var(--faint);
  font-size: 11.8px;
}

/* ============================================================
   布局
   ============================================================ */

.page {
  max-width: 1600px;
  margin: 0 auto;
  padding: 22px 18px 90px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.toolbar .spacer {
  flex: 1;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

/* ============================================================
   影片卡片
   ============================================================ */

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--grid-min), 1fr));
  gap: 20px 16px;
}

.card {
  display: block;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 0.24s var(--ease), border-color 0.24s var(--ease), box-shadow 0.24s var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  box-shadow: var(--shadow-lg);
}

.cover-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  background: var(--surface-2);
  overflow: hidden;
}

.cover-wrap::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.55));
  opacity: 0;
  transition: opacity 0.24s var(--ease);
  pointer-events: none;
}

.card:hover .cover-wrap::after {
  opacity: 1;
}

.cover-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease), filter 0.3s var(--ease);
}

.card:hover .cover-wrap img {
  transform: scale(1.055);
}

.cover-wrap .badges {
  position: absolute;
  left: 8px;
  top: 8px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  z-index: 2;
}

.badge {
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(12, 12, 18, 0.66);
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.badge.play {
  background: var(--accent-grad);
  border-color: transparent;
  box-shadow: 0 4px 12px -4px rgba(255, 59, 107, 0.8);
}

.badge.cn {
  background: rgba(18, 133, 90, 0.9);
  border-color: transparent;
}

.badge.rank {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 2;
  min-width: 24px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  background: var(--accent-grad);
  border-color: transparent;
  box-shadow: 0 6px 16px -6px rgba(255, 59, 107, 0.9);
}

/* 悬停播放按钮 */
.card-play {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -46%) scale(0.85);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 17px;
  padding-left: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
}

.card:hover .card-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.card-body {
  padding: 9px 11px 11px;
}

.card-body .number {
  font-size: 11.5px;
  font-weight: 750;
  color: var(--accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.card-body .title {
  margin-top: 3px;
  font-size: 12.8px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 37px;
}

.card-body .sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  color: var(--faint);
  font-size: 11.3px;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   详情页
   ============================================================ */

.detail {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.detail-cover {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  align-self: start;
}

.detail-cover img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  box-shadow: var(--shadow-lg);
}

.detail-cover .actions {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.detail h1 {
  margin: 0 0 8px;
  font-size: 23px;
  font-weight: 750;
  line-height: 1.38;
  letter-spacing: -0.01em;
}

.detail .origin-title {
  color: var(--faint);
  font-size: 13px;
  margin: 0 0 18px;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 2px 20px;
  padding: 6px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.meta-grid .row {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  font-size: 13px;
  min-width: 0;
  border-bottom: 1px solid var(--hairline);
}

.meta-grid .row .k {
  color: var(--faint);
  flex: none;
  min-width: 46px;
  font-size: 12.5px;
}

.meta-grid .row .v {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-2);
  font-weight: 500;
}

.meta-grid .row a.v {
  color: var(--accent);
  font-weight: 550;
}

.meta-grid .row a.v:hover {
  text-decoration: underline;
}

.summary {
  margin: 18px 0 0;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  box-shadow: var(--shadow-sm);
}

.summary.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.tag-row a {
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.2px;
  border: 1px solid transparent;
  transition: all 0.16s var(--ease);
}

.tag-row a:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.actor-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.actor-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 14px 5px 5px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.16s var(--ease);
}

.actor-chip:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.actor-chip img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 11px;
  margin-top: 14px;
}

.gallery-item {
  position: relative;
  padding: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: zoom-in;
  transition: transform 0.24s var(--ease), box-shadow 0.24s var(--ease), border-color 0.24s var(--ease);
}

.gallery-item::after {
  content: "⤢";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(10, 10, 14, 0.6);
  color: #fff;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}

.gallery-item:hover::after {
  opacity: 1;
}

.gallery img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  width: 100%;
  transition: transform 0.4s var(--ease);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* ---------- 预览图浮窗 ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  opacity: 0;
  transition: opacity 0.16s var(--ease);
}

.lightbox.open {
  opacity: 1;
}

.lightbox.closing {
  opacity: 0;
}

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 4, 8, 0.93);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lb-body {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  gap: 14px;
  width: 100%;
  height: 100%;
  padding: 56px 64px 18px;
  box-sizing: border-box;
}

.lb-image {
  grid-row: 1;
  align-self: center;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.9);
  background: rgba(255, 255, 255, 0.03);
  transition: opacity 0.18s var(--ease), transform 0.24s var(--ease);
}

.lb-image.loading {
  opacity: 0.35;
}

.lb-close,
.lb-nav {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(20, 20, 26, 0.72);
  color: #f2f2f7;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.16s var(--ease), transform 0.16s var(--ease), border-color 0.16s var(--ease);
}

.lb-close:hover,
.lb-nav:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}

.lb-close:active,
.lb-nav:active {
  transform: scale(0.93);
}

.lb-close {
  top: 16px;
  right: 18px;
  width: 38px;
  height: 38px;
  font-size: 15px;
}

.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 30px;
  line-height: 1;
  padding-bottom: 4px;
}

.lb-nav.prev {
  left: 16px;
}

.lb-nav.next {
  right: 16px;
}

.lb-nav:hover {
  transform: translateY(-50%) scale(1.06);
}

.lb-counter {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 2;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  background: rgba(20, 20, 26, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e8e8ef;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(10px);
}

.lb-thumbs {
  grid-row: 2;
  display: flex;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: none;
}

.lb-thumbs::-webkit-scrollbar {
  display: none;
}

.lb-thumb {
  flex: none;
  width: 76px;
  height: 48px;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.16s var(--ease), border-color 0.16s var(--ease), transform 0.16s var(--ease);
}

.lb-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lb-thumb:hover {
  opacity: 0.9;
}

.lb-thumb.active {
  opacity: 1;
  border-color: var(--accent);
  transform: translateY(-2px);
}

.lightbox.single .lb-nav,
.lightbox.single .lb-thumbs {
  display: none;
}

@media (max-width: 720px) {
  .lb-body {
    padding: 52px 12px 12px;
  }

  .lb-nav {
    width: 42px;
    height: 42px;
    font-size: 24px;
  }

  .lb-nav.prev {
    left: 8px;
  }

  .lb-nav.next {
    right: 8px;
  }

  .lb-thumb {
    width: 62px;
    height: 40px;
  }
}

/* 磁力列表 */

.magnet-list {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.magnet-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 11px 14px 11px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 12.6px;
  overflow: hidden;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease), transform 0.16s var(--ease);
}

.magnet-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-grad);
  opacity: 0.55;
  transition: opacity 0.16s var(--ease);
}

.magnet-item:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.magnet-item:hover::before {
  opacity: 1;
}

.magnet-item .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--text-2);
}

.magnet-item .sub {
  color: var(--faint);
  font-size: 11.5px;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   演员
   ============================================================ */

.actor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 16px;
}

.actor-card {
  text-align: center;
  padding: 18px 12px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.actor-card:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.actor-card img {
  width: 88px;
  height: 88px;
  margin: 0 auto 10px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-2);
  border: 2px solid var(--border);
  transition: border-color 0.2s var(--ease);
}

.actor-card:hover img {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.actor-card strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}

.actor-card span {
  color: var(--faint);
  font-size: 11.8px;
}

/* ============================================================
   分页
   ============================================================ */

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.pager .page-info {
  color: var(--muted);
  font-size: 12.8px;
  min-width: 84px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   播放器
   ============================================================ */

.player-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: #000;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.18s var(--ease);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.player-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 26px;
  color: #f2f2f7;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.82), transparent);
  font-size: 13px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.player-overlay:not(.idle) .player-bar,
.player-overlay.paused .player-bar {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.player-bar .title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 550;
  letter-spacing: 0.01em;
}

.player-bar .icon-btn {
  color: #e8e8ef;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
}

.player-bar .icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.player-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
  background: #000;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}

.player-stage video {
  width: 100%;
  height: 100%;
  max-height: 100%;
  background: #000;
  object-fit: contain;
}

/* 缓冲转圈 */

.player-spinner {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s var(--ease);
}

.player-spinner.show {
  opacity: 1;
}

.player-spinner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: #fff;
  border-right-color: rgba(255, 255, 255, 0.72);
  animation: spin 0.85s linear infinite;
}

.player-spinner::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px 2px var(--accent);
  animation: pulse 1.1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.82);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* 顶部浮层提示（倍速 / 跳转 / 音量） */

.player-flash {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translate(-50%, -6px);
  z-index: 4;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  background: rgba(10, 10, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s var(--ease), transform 0.16s var(--ease);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-variant-numeric: tabular-nums;
}

.player-flash.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 中间大播放键 */

.player-bigplay {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%) scale(0.88);
  z-index: 3;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  padding-left: 4px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), background 0.18s var(--ease);
}

.player-bigplay.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.player-bigplay:hover {
  background: rgba(255, 255, 255, 0.26);
}

/* 底部控件 */

.player-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  padding: 34px 18px 12px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.78) 42%, rgba(0, 0, 0, 0.94));
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.player-controls.visible,
.player-overlay.paused .player-controls {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* 进度条 */

.pc-progress {
  position: relative;
  height: 20px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.pc-track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
  transition: height 0.14s var(--ease);
}

.pc-buffered,
.pc-played {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  border-radius: 99px;
  width: 0;
}

.pc-buffered {
  background: rgba(255, 255, 255, 0.32);
}

.pc-played {
  background: var(--accent-grad);
  box-shadow: 0 0 12px -2px var(--accent);
}

.pc-knob {
  position: absolute;
  top: 50%;
  left: 0;
  width: 13px;
  height: 13px;
  margin-left: -6.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 59, 107, 0.3), 0 2px 8px rgba(0, 0, 0, 0.5);
  transform: translateY(-50%) scale(0.55);
  transition: transform 0.14s var(--ease);
  pointer-events: none;
}

.pc-progress:hover .pc-track,
.pc-progress.dragging .pc-track {
  height: 7px;
}

.pc-progress:hover .pc-knob,
.pc-progress.dragging .pc-knob {
  transform: translateY(-50%) scale(1);
}

/* 按钮行 */

.pc-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  color: #e9e9f0;
  font-size: 12px;
}

.pc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  font-size: 12.5px;
  border-radius: 9px;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: background 0.14s var(--ease), color 0.14s var(--ease), border-color 0.14s var(--ease),
    transform 0.1s var(--ease);
}

.pc-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.pc-btn:active {
  transform: scale(0.94);
}

.pc-btn.main {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.16);
  min-width: 38px;
}

.pc-btn.main:hover {
  background: rgba(255, 255, 255, 0.26);
}

/* 快进按钮组 */

.pc-skip {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}

.pc-skip::-webkit-scrollbar {
  display: none;
}

.pc-skip .pc-btn {
  height: 30px;
  min-width: 40px;
  font-size: 11.8px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.pc-skip .pc-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.pc-time {
  font-variant-numeric: tabular-nums;
  opacity: 0.9;
  padding: 0 6px;
  white-space: nowrap;
  font-size: 12.2px;
}

.pc-grow {
  flex: 1;
}

.pc-rate {
  color: var(--accent);
  font-weight: 750;
  min-width: 32px;
  text-align: right;
  font-size: 12.5px;
}

.pc-volume {
  width: 76px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* 解析中 / 提示信息 */

.player-message {
  position: absolute;
  inset: auto 0 42% 0;
  z-index: 4;
  text-align: center;
  color: #dcdce4;
  font-size: 13.5px;
  line-height: 1.8;
  padding: 0 24px;
  pointer-events: none;
}

.player-message p {
  margin: 0 0 10px;
}

.player-message .spinner {
  display: inline-block;
  vertical-align: -4px;
  margin-right: 9px;
  width: 16px;
  height: 16px;
  border-color: rgba(255, 255, 255, 0.22);
  border-top-color: var(--accent);
}

.player-message a.btn {
  pointer-events: auto;
  margin: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.player-message a.btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.player-message button {
  pointer-events: auto;
}

.player-message .btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* 线路选择 */

.player-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px 18px;
  background: #050507;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  max-height: 34vh;
  overflow-y: auto;
}

.player-sources .chip {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #c9c9d6;
  height: 30px;
  font-size: 12.2px;
}

.player-sources .chip:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.player-sources .chip.active {
  background: var(--accent-grad);
  border-color: transparent;
  color: #fff;
  font-weight: 650;
  box-shadow: 0 8px 22px -10px rgba(255, 59, 107, 0.9);
}

@media (max-width: 720px) {
  .pc-volume {
    display: none;
  }

  .player-bigplay {
    width: 66px;
    height: 66px;
  }

  .player-controls {
    padding: 30px 12px 10px;
  }

  .player-sources {
    padding: 10px 12px 16px;
    max-height: 30vh;
  }
}

/* ============================================================
   表单 / 高级搜索 / 登录
   ============================================================ */

.panel {
  padding: 18px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px 16px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
}

.field input,
.field select {
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

.field input:focus,
.field select:focus {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.login-panel {
  max-width: 400px;
  margin: 64px auto;
}

.login-panel h2 {
  margin: 0 0 6px;
  font-size: 19px;
}

.login-panel .hint {
  color: var(--faint);
  font-size: 12.5px;
  margin-bottom: 18px;
}

/* ============================================================
   状态：loading / empty / skeleton / toast
   ============================================================ */

.loading,
.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 72px 20px;
  color: var(--muted);
  font-size: 13.5px;
  flex-direction: column;
  text-align: center;
}

.empty.error {
  color: var(--accent);
}

.spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--panel-2) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--border);
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

.toast-host {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  z-index: 120;
  display: grid;
  gap: 8px;
  justify-items: center;
  pointer-events: none;
}

.toast {
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: rgba(18, 18, 24, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
}

.toast-success {
  background: rgba(18, 133, 90, 0.96);
  border-color: transparent;
}

.toast-error {
  background: rgba(200, 40, 60, 0.96);
  border-color: transparent;
}

.toast-out {
  opacity: 0;
  transform: translateY(8px);
}

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 980px) {
  .detail {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .detail-cover {
    position: static;
    display: grid;
    grid-template-columns: 172px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
  }

  .detail-cover .actions {
    margin-top: 0;
  }
}

@media (max-width: 720px) {
  :root {
    --grid-min: 142px;
    --header-h: 58px;
    --radius: 14px;
  }

  body::before {
    height: 320px;
    opacity: 0.7;
  }

  .header-inner {
    gap: 10px;
    padding: 0 12px;
  }

  .nav {
    display: none;
  }

  .search-bar {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .app-header .header-inner {
    height: auto;
    flex-wrap: wrap;
    padding: 9px 12px;
  }

  .page {
    padding: 16px 12px 96px;
  }

  .movie-grid {
    gap: 16px 12px;
  }

  .detail-cover {
    grid-template-columns: 128px minmax(0, 1fr);
  }

  .detail h1 {
    font-size: 18px;
  }

  .meta-grid {
    grid-template-columns: minmax(0, 1fr);
    padding: 4px 14px;
  }
}

/* 底部导航（移动端） */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: none;
  grid-auto-flow: column;
  background: var(--overlay);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-top: 1px solid var(--hairline);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar a {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 9px 0 7px;
  color: var(--muted);
  font-size: 10.8px;
  font-weight: 500;
  transition: color 0.16s var(--ease);
}

.tabbar a.active {
  color: var(--accent);
}

.tabbar .tab-icon {
  font-size: 18px;
  line-height: 1;
}

@media (max-width: 720px) {
  .tabbar {
    display: grid;
  }
}

/* 尊重减少动画偏好 */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
