/* TriView Archive — 公有领域影库
   主题：[data-theme=light|dark]  语言：<html lang=zh|en> */

:root {
  --bg: #f6f5f3;
  --bg-elev: #ffffff;
  --bg-sunk: #eceae6;
  --fg: #1a1917;
  --fg-dim: #6b6862;
  --fg-faint: #97938c;
  --line: #dedbd5;
  --accent: #a8321f;
  --accent-soft: rgba(168, 50, 31, .10);
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px -12px rgba(0,0,0,.18);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.06), 0 24px 48px -20px rgba(0,0,0,.30);
  --radius: 10px;
  --maxw: 1180px;
}

[data-theme="dark"] {
  --bg: #131313;
  --bg-elev: #1c1c1c;
  --bg-sunk: #0d0d0d;
  --fg: #eae8e4;
  --fg-dim: #a3a099;
  --fg-faint: #6f6c66;
  --line: #2c2c2c;
  --accent: #e0674f;
  --accent-soft: rgba(224, 103, 79, .13);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.7);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.5), 0 24px 48px -20px rgba(0,0,0,.8);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Roboto, sans-serif;
  transition: background .25s ease, color .25s ease;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- 语言切换：两种语言都渲染在 HTML 里，用 CSS 显隐 ---------- */
html[lang="zh"] [data-lang="en"],
html[lang="en"] [data-lang="zh"] { display: none !important; }

/* ---------- 顶栏 ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(12px);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}
.head-inner { display: flex; align-items: center; gap: 20px; height: 62px; }

.logo { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 17px; letter-spacing: -.01em; flex-shrink: 0; }
.logo-mark {
  width: 32px; height: 32px; flex-shrink: 0;
  background: url("/favicon.svg?v=2") center / contain no-repeat;
  position: relative;
}
.logo > span:last-child { display: block; line-height: 1.15; }
.logo small { display: block; margin-top: 2px; color: var(--fg-faint); font-weight: 400; font-size: 11px; line-height: 1.2; letter-spacing: .08em; text-transform: uppercase; }

.nav { display: flex; gap: 2px; margin-left: 4px; }
.nav a {
  padding: 7px 12px; border-radius: 7px; font-size: 14px; color: var(--fg-dim);
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--bg-sunk); color: var(--fg); }
.nav a.on { color: var(--fg); font-weight: 550; }

.head-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.search {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg-sunk); border: 1px solid transparent;
  border-radius: 8px; padding: 0 10px; height: 34px; width: 210px;
  transition: border-color .15s, background .15s;
}
.search:focus-within { border-color: var(--accent); background: var(--bg-elev); }
.search svg { flex-shrink: 0; opacity: .5; }
.search input {
  border: 0; outline: 0; background: transparent; color: var(--fg);
  font: inherit; font-size: 13.5px; width: 100%; min-width: 0;
}
.search input::placeholder { color: var(--fg-faint); }

.icon-btn {
  min-width: 34px; height: 34px; flex-shrink: 0; padding: 0 9px; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg-elev); color: var(--fg-dim); cursor: pointer;
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  transition: color .15s, border-color .15s, background .15s;
}
.icon-btn:hover { color: var(--fg); border-color: var(--fg-faint); }
.icon-btn svg { display: block; }
[data-theme="dark"] .sun { display: none; }
[data-theme="light"] .moon, :root:not([data-theme="dark"]) .moon { display: none; }

/* ---------- 首页头图 ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); background: var(--bg-sunk); }
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center 22%;
  filter: blur(26px) saturate(.75); transform: scale(1.18); opacity: .34;
}
[data-theme="dark"] .hero-bg { opacity: .22; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 40%, transparent), var(--bg));
}
.hero-inner { position: relative; z-index: 2; display: flex; gap: 34px; align-items: center; padding: 48px 0 52px; }
.hero-poster {
  width: 176px; flex-shrink: 0; border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  /* height:auto 必须写在 aspect-ratio 前生效：img 的 width/height 属性是表现层提示，
     会直接设定 height，导致 aspect-ratio 被忽略 */
  height: auto; aspect-ratio: 2/3; object-fit: cover;
  background: var(--bg-sunk);
}
.hero-body { min-width: 0; }
.hero-kicker {
  display: inline-block; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); font-weight: 650; margin-bottom: 10px;
}
.hero-title { margin: 0 0 6px; font-size: 34px; line-height: 1.18; letter-spacing: -.02em; font-weight: 700; }
.hero-sub { margin: 0 0 14px; color: var(--fg-dim); font-size: 14px; }
.hero-desc {
  margin: 0 0 20px; color: var(--fg-dim); max-width: 62ch; font-size: 14.5px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 8px; border: 1px solid transparent;
  font-size: 14px; font-weight: 550; cursor: pointer; font-family: inherit;
  transition: filter .15s, background .15s, border-color .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: var(--bg-elev); border-color: var(--line); color: var(--fg); }
.btn-ghost:hover { border-color: var(--fg-faint); }

/* ---------- 区块 ---------- */
.section { padding: 40px 0; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 20px; }
.section-head h2 { margin: 0; font-size: 19px; letter-spacing: -.01em; font-weight: 650; }
.section-head .count { color: var(--fg-faint); font-size: 13px; }

.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 24px; }
.chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg-elev); color: var(--fg-dim); font-size: 13px;
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.chip:hover { color: var(--fg); border-color: var(--fg-faint); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- 影片网格 ---------- */
.grid {
  display: grid; gap: 22px 18px;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}
.card { display: block; position: relative; }
.card-thumb {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--bg-sunk); aspect-ratio: 2/3; box-shadow: var(--shadow);
  transition: transform .22s cubic-bezier(.2,.7,.3,1), box-shadow .22s;
}
.card:hover .card-thumb { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.55), transparent 42%);
  opacity: 0; transition: opacity .22s;
}
.card:hover .card-thumb::after { opacity: 1; }
.card-play {
  position: absolute; left: 50%; top: 50%; width: 44px; height: 44px;
  margin: -22px 0 0 -22px; border-radius: 50%;
  background: rgba(255,255,255,.92); color: #111;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(.8); transition: opacity .22s, transform .22s;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.card:hover .card-play { opacity: 1; transform: scale(1); }
.badge-hd {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  background: rgba(0,0,0,.66); color: #fff; backdrop-filter: blur(4px);
  font-size: 10px; font-weight: 700; letter-spacing: .06em;
  padding: 3px 6px; border-radius: 4px;
}
.card-title {
  margin: 10px 0 2px; font-size: 14px; font-weight: 550; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { font-size: 12.5px; color: var(--fg-faint); }
.card:hover .card-title { color: var(--accent); }

.empty { padding: 60px 0; text-align: center; color: var(--fg-faint); }

/* ---------- 详情页 ---------- */
.crumb { font-size: 13px; color: var(--fg-faint); padding: 20px 0 0; }
.crumb a:hover { color: var(--accent); }
.crumb span { margin: 0 7px; opacity: .5; }

.detail { display: grid; grid-template-columns: 268px 1fr; gap: 40px; padding: 26px 0 48px; align-items: start; }
.detail-poster { border-radius: var(--radius); box-shadow: var(--shadow-lg); width: 100%; height: auto; aspect-ratio: 2/3; object-fit: cover; }
.detail h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.2; letter-spacing: -.02em; }
.detail-alt { color: var(--fg-dim); font-size: 15px; margin: 0 0 18px; font-style: italic; }

.tags { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 22px; }
.tag {
  font-size: 12.5px; padding: 4px 11px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-weight: 550;
}
.tag.plain { background: var(--bg-sunk); color: var(--fg-dim); font-weight: 400; }

.facts { border-top: 1px solid var(--line); margin: 24px 0; }
.fact { display: flex; gap: 18px; padding: 11px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.fact dt { color: var(--fg-faint); width: 92px; flex-shrink: 0; }
.fact dd { margin: 0; }

.synopsis h3 { font-size: 15px; margin: 26px 0 10px; font-weight: 650; }
.synopsis p { margin: 0; color: var(--fg-dim); line-height: 1.8; font-size: 14.5px; }

.note {
  margin-top: 26px; padding: 13px 15px; border-radius: 8px;
  background: var(--bg-sunk); border-left: 3px solid var(--accent);
  font-size: 13px; color: var(--fg-dim);
}

/* ---------- 播放器占位 ---------- */
.player {
  position: relative; aspect-ratio: 16/9; border-radius: var(--radius);
  background: #08090a; overflow: hidden; margin-bottom: 22px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
}
.player-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  filter: blur(18px) brightness(.32); transform: scale(1.12);
}
.player-center { position: relative; z-index: 2; text-align: center; color: #fff; }
.play-big {
  width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.94); color: #111;
  display: flex; align-items: center; justify-content: center; margin: 0 auto;
  transition: transform .18s, background .18s;
}
.play-big:hover { transform: scale(1.07); }
.player-hint { margin-top: 12px; font-size: 13px; color: rgba(255,255,255,.62); }
.spinner {
  width: 40px; height: 40px; margin: 0 auto;
  border: 3px solid rgba(255,255,255,.2); border-top-color: #fff;
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.player-progress {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 0;
  background: var(--accent); z-index: 3; transition: width .3s linear;
}
.srcbar {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  font-size: 13px; color: var(--fg-dim); margin-bottom: 4px;
}
.srcbar b { color: var(--fg); font-weight: 550; margin-right: 4px; }
.src {
  padding: 5px 12px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg-elev); cursor: pointer; font-family: inherit; font-size: 13px; color: var(--fg-dim);
  transition: all .15s;
}
.src:hover { border-color: var(--fg-faint); color: var(--fg); }
.src.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100; display: none;
  align-items: center; justify-content: center; padding: 22px;
  background: rgba(0,0,0,.55); backdrop-filter: blur(3px);
  animation: fade .18s ease;
}
.modal-mask.show { display: flex; }
@keyframes fade { from { opacity: 0 } }
.modal {
  background: var(--bg-elev); border-radius: 13px; padding: 28px;
  max-width: 380px; width: 100%; text-align: center;
  box-shadow: var(--shadow-lg); animation: pop .22s cubic-bezier(.2,.8,.3,1);
}
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97) } }
.modal-icon {
  width: 48px; height: 48px; margin: 0 auto 16px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
.modal h3 { margin: 0 0 8px; font-size: 17px; }
.modal p { margin: 0 0 20px; color: var(--fg-dim); font-size: 14px; }
.modal code {
  display: block; margin-top: 10px; font-size: 11.5px; color: var(--fg-faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- 页脚 ---------- */
.site-foot {
  border-top: 1px solid var(--line); margin-top: 40px;
  padding: 32px 0 44px; color: var(--fg-faint); font-size: 13px;
}
.foot-inner { display: flex; gap: 30px; flex-wrap: wrap; justify-content: space-between; }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a:hover { color: var(--accent); }

/* ---------- 关于页 ---------- */
.prose { max-width: 68ch; padding: 30px 0 40px; }
.prose h1 { font-size: 27px; letter-spacing: -.02em; margin: 0 0 18px; }
.prose h2 { font-size: 17px; margin: 30px 0 10px; }
.prose p, .prose li { color: var(--fg-dim); line-height: 1.8; font-size: 14.5px; }
.prose a { color: var(--accent); }
.prose a:hover { text-decoration: underline; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .detail { grid-template-columns: 1fr; gap: 24px; }
  .detail-poster { max-width: 210px; }
  .hero-inner { flex-direction: column; align-items: flex-start; gap: 22px; padding: 34px 0 38px; }
  .hero-poster { width: 132px; }
  .hero-title { font-size: 26px; }
  .nav { display: none; }
  .search { width: 148px; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(126px, 1fr)); gap: 18px 13px; }
  .search { display: none; }
  .wrap { padding: 0 16px; }
}
