/* ============================================================
   深空进化 — 作品档案
   与首页同一套设计语言：结构网格 + 液态磨砂玻璃 + 深黑底
   （数据/播放逻辑仍由 works.js 驱动，此处只负责外观）
   ============================================================ */

:root {
  --bg: #000000;
  --fg: #e8e8e8;
  --muted: #8d8d8d;
  --gold: #e4d08a;

  --font-sans: "Inter", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", monospace;

  --line-left: 5.371%;
  --line-c1: 33.203%;
  --line-c2: 66.797%;
  --line-right: 95.02%;

  --lg-line: rgba(255, 255, 255, 0.14);
  --lg-line-soft: rgba(255, 255, 255, 0.08);
  --lg-hi: rgba(255, 255, 255, 0.22);
  --lg-blur: blur(30px) saturate(180%);
  --lg-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  --lg-shadow-sm: 0 10px 28px rgba(0, 0, 0, 0.38);

  --header-h: 72px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { background: var(--bg); }

body {
  margin: 0;
  color: var(--fg);
  font-family: var(--font-sans);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 背景柔光 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(58% 42% at 50% 0%, rgba(255, 255, 255, 0.055), transparent 70%),
    radial-gradient(42% 32% at 8% 88%, rgba(28, 88, 255, 0.10), transparent 72%),
    radial-gradient(36% 28% at 96% 8%, rgba(255, 90, 40, 0.055), transparent 72%);
}

/* ---------- 结构网格 ---------- */
.grid-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.g-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.085);
}
.v-left  { left: var(--line-left); }
.v-c1    { left: var(--line-c1); }
.v-c2    { left: var(--line-c2); }
.v-right { left: var(--line-right); }

/* ---------- 顶部磨砂玻璃条 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: var(--header-h);
  display: grid;
  grid-template-columns:
    var(--line-left)
    27.832%
    33.594%
    28.223%
    calc(100% - var(--line-right));
  align-items: center;
}
.header-bar {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 16, 20, 0.62) 0%, rgba(8, 8, 11, 0.36) 100%);
  backdrop-filter: var(--lg-blur);
  -webkit-backdrop-filter: var(--lg-blur);
  border-bottom: 1px solid var(--lg-line-soft);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
/* 让内容浮在磨砂条之上：header-bar 是绝对定位 + backdrop-filter，
   否则它会把品牌与导航整块模糊掉 */
.site-header > :not(.header-bar) {
  position: relative;
  z-index: 1;
}

.brand {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 0.62rem;
  padding-left: 0.85rem;
  text-decoration: none;
}
.brand-mark { display: block; flex: none; }
.brand-word {
  font-family: var(--font-mono);
  font-size: clamp(14px, 1.55vw, 18px);
  letter-spacing: 0.02em;
  color: #bcbab8;
  white-space: nowrap;
}
.nav {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.4rem;
}
.nav-link {
  font-size: clamp(13px, 1.38vw, 16px);
  color: #dcdcdc;
  text-decoration: none;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.65);
  transition: color 0.22s ease;
}
.nav-link:hover, .nav-link.is-active { color: #fff; }
.header-cta {
  grid-column: 4;
  display: flex;
  justify-content: flex-end;
}

/* 双层框按钮（与首页同款） */
.btn-frame {
  display: inline-flex;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  border: 2px solid rgba(255, 255, 255, 0.10);
  border-radius: 12px;
  padding: 3px;
  box-shadow: var(--lg-shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  min-width: 7rem;
  padding: 0 1rem;
  border: 1px solid #0d1220;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: #f4f7ff;
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(180deg, #0170c4 0%, #0058b8 18%, #0039c4 55%, #0018ae 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.30),
    inset 0 -8px 18px rgba(0, 20, 90, 0.42),
    0 6px 18px rgba(0, 40, 160, 0.30);
  transition: filter 0.25s ease, transform 0.25s ease;
}
.btn:hover { filter: brightness(1.1) saturate(1.06); transform: translateY(-1px); }

/* ---------- 主体 ---------- */
main {
  position: relative;
  z-index: 10;
  padding:
    calc(var(--header-h) + clamp(38px, 6.5vh, 84px))
    calc(100% - var(--line-right))
    140px
    var(--line-left);
}

/* 标题区玻璃面板 */
.glass-panel {
  position: relative;
  padding: clamp(22px, 3.2vw, 40px) clamp(22px, 3vw, 44px);
  border: 1px solid var(--lg-line);
  border-radius: 24px;
  background:
    linear-gradient(140deg,
      rgba(255, 255, 255, 0.060) 0%,
      rgba(255, 255, 255, 0.014) 46%,
      rgba(255, 255, 255, 0.034) 100%),
    rgba(13, 13, 17, 0.52);
  backdrop-filter: blur(34px) saturate(185%);
  -webkit-backdrop-filter: blur(34px) saturate(185%);
  box-shadow:
    var(--lg-shadow),
    inset 0 1px 0 var(--lg-hi),
    inset 0 -1px 0 rgba(255, 255, 255, 0.05);
}
.intro .eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.30em;
  text-transform: uppercase;
  color: var(--muted);
}
.intro .display {
  margin: 14px 0 22px;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(44px, 7.2vw, 108px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: #ececec;
}
.intro .count { color: var(--gold); }
.intro .summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.intro .summary span {
  padding: 0.42rem 0.95rem;
  border: 1px solid var(--lg-line-soft);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.035)),
    rgba(8, 8, 12, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  font-family: var(--font-mono);
  font-size: 12px;
  color: #d8d8d8;
}

/* 筛选胶囊 */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: clamp(28px, 4vh, 46px) 0 18px;
}
.filters button {
  padding: 0.6rem 1.05rem;
  border: 1px solid var(--lg-line-soft);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)),
    rgba(8, 8, 12, 0.34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.11);
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  color: #cfcfcf;
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.22s ease, background 0.22s ease, color 0.22s ease, transform 0.22s ease;
}
.filters button:hover {
  border-color: rgba(255, 255, 255, 0.26);
  color: #fff;
  transform: translateY(-1px);
}
.filters button.active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.80));
  color: #0a0a0c;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.42);
}
.filters span { opacity: 0.55; margin-left: 6px; }

#status {
  margin: 10px 0 26px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

/* ---------- 作品网格 ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 46px 18px;
}
.card { min-width: 0; }

.card-media {
  display: block;
  position: relative;
  width: 100%;
  padding: 0;
  border: 1px solid var(--lg-line-soft);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16 / 9;
  box-shadow: var(--lg-shadow-sm);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s var(--ease);
}
.card.portrait .card-media { aspect-ratio: 9 / 16; }
.card.cinema { grid-column: 1 / -1; }
.card.cinema .card-media { aspect-ratio: 2.2 / 1; }

.card-media:hover {
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.10);
  transform: translateY(-3px);
}
.card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter 0.4s ease;
}
.card-media:hover img { transform: scale(1.035); filter: brightness(0.72) saturate(1.05); }

/* 播放 / 时长：玻璃小件 */
.play {
  position: absolute;
  left: 16px;
  bottom: 16px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #050505;
  font-size: 12px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45), inset 0 1px 0 #fff;
  transition: transform 0.25s var(--ease);
}
.card-media:hover .play { transform: scale(1.08); }
.duration {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(6, 6, 8, 0.62);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  border: 1px solid var(--lg-line-soft);
  color: #eaeaea;
  font-family: var(--font-mono);
  font-size: 10px;
}
.card h2 {
  margin: 14px 0 0;
  font-size: 15px;
  font-weight: 500;
  color: #efefef;
}
.card p {
  margin: 6px 0 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* ---------- 播放器 ---------- */
dialog#player {
  width: min(1200px, 94vw);
  padding: 0;
  border: 1px solid var(--lg-line);
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(135deg, rgba(22, 22, 26, 0.86), rgba(10, 10, 13, 0.86));
  backdrop-filter: blur(34px) saturate(180%);
  -webkit-backdrop-filter: blur(34px) saturate(180%);
  box-shadow: 0 40px 110px rgba(0, 0, 0, 0.72), inset 0 1px 0 var(--lg-hi);
  overflow: hidden;
}
dialog#player::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}
.player-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--lg-line-soft);
}
.player-head h2 { margin: 0; font-size: 16px; font-weight: 500; }
.player-head p {
  margin: 5px 0 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.player-head button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--lg-line-soft);
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.03));
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: background 0.22s ease, border-color 0.22s ease;
}
.player-head button:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.07));
  border-color: rgba(255, 255, 255, 0.30);
}
.video-mount {
  display: grid;
  place-items: center;
  min-height: 200px;
  background: #000;
}
.video-mount video {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 78vh;
  background: #000;
}
body.modal-open { overflow: hidden; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .nav-link { font-size: 13px; }
  .btn { min-width: 6.5rem; font-size: 12px; }
}
@media (max-width: 900px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card.cinema { grid-column: 1 / -1; }
  .site-header {
    grid-template-columns: 20px 1fr auto;
    padding-right: 16px;
  }
  .brand { grid-column: 2; padding-left: 0; }
  .nav { display: none; }
  .header-cta { grid-column: 3; }
  main {
    padding-left: 20px;
    padding-right: 20px;
  }
  .v-left, .v-right, .v-c1, .v-c2 { display: none; }
}
@media (max-width: 560px) {
  .gallery { gap: 34px 10px; }
  .card.landscape { grid-column: 1 / -1; }
  .intro .display { margin-bottom: 16px; }
  .intro .summary { gap: 7px; }
  .intro .summary span { font-size: 11px; padding: 0.34rem 0.7rem; }
  .card h2 { font-size: 13px; }
  .play { width: 36px; height: 36px; left: 10px; bottom: 10px; }
  .btn { min-width: 0; padding: 0 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  .card-media, .card-media img, .play, .btn, .filters button {
    transition: none !important;
    transform: none !important;
  }
}
