/* 青时作品集 — 暗黑电影感 / 霓虹墨色 */
:root {
  --ink: #050608;
  --ink-2: #0b0d11;
  --line: rgba(255, 255, 255, 0.10);
  --line-2: rgba(255, 255, 255, 0.18);
  --fg: #eef0f3;
  --dim: #8b9099;
  --mute: #565b63;
  --accent: #d8ff4a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--ink);
  color: var(--fg);
  font-family: "Noto Sans SC", -apple-system, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
body.view-list { overflow: auto; }

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

/* 网格氛围底纹 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, #000 30%, transparent 85%);
}
/* 颗粒噪点 */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#webgl { position: fixed; inset: 0; z-index: 2; display: block; }
body.view-list #webgl, body.no-webgl #webgl { display: none; }

#stage { position: fixed; inset: 0; z-index: 3; }
body.view-list #stage { display: none; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed; z-index: 20; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 30px; pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.brand {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
}
.brand img { width: 104px; height: 104px; display: block; filter: brightness(0) invert(1) drop-shadow(0 2px 10px rgba(0,0,0,0.6)); }
.brand .bname { display: none; }

.view-toggle {
  display: flex; align-items: center; gap: 14px;
  font-family: "DM Mono", monospace; font-size: 13px; letter-spacing: 0.5px;
}
.view-toggle button {
  background: none; border: none; color: var(--mute); cursor: pointer;
  font: inherit; padding: 4px 2px; transition: color 0.3s; position: relative;
}
.view-toggle button.active { color: var(--fg); }
.view-toggle button.active::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; width: 4px; height: 4px;
  border-radius: 50%; background: var(--accent); transform: translateX(-50%);
  box-shadow: 0 0 8px var(--accent);
}
.view-toggle .sep { color: var(--mute); opacity: 0.5; }

.menu-btn {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.92); color: #0a0a0a;
  border: none; border-radius: 999px; padding: 9px 18px; cursor: pointer;
  font-family: "DM Mono", monospace; font-size: 13px; letter-spacing: 0.5px;
  transition: transform 0.3s, background 0.3s;
}
.menu-btn:hover { transform: translateY(-1px); background: #fff; }
.menu-btn .dot { width: 6px; height: 6px; border-radius: 50%; background: #0a0a0a; }

/* ---------- 菜单抽屉 ---------- */
.drawer {
  position: fixed; z-index: 30; top: 0; right: 0; height: 100%; width: min(380px, 86vw);
  background: rgba(8, 9, 12, 0.92); backdrop-filter: blur(18px);
  border-left: 1px solid var(--line); padding: 88px 38px 38px;
  transform: translateX(105%); transition: transform 0.5s cubic-bezier(.7,0,.2,1);
  display: flex; flex-direction: column; gap: 6px;
}
body.menu-open .drawer { transform: translateX(0); }
.drawer a {
  font-family: "Fraunces", serif; font-size: 30px; line-height: 1.5; color: var(--dim);
  transition: color 0.3s, padding-left 0.3s; padding: 6px 0;
}
.drawer a:hover { color: var(--fg); padding-left: 10px; }
.drawer .drawer-foot {
  margin-top: auto; font-family: "DM Mono", monospace; font-size: 12px; color: var(--mute); line-height: 2;
}
.drawer-close {
  position: fixed; z-index: 31; top: 26px; right: 30px; width: 34px; height: 34px;
  border: 1px solid var(--line-2); background: none; border-radius: 50%; color: var(--fg);
  cursor: pointer; font-size: 16px; opacity: 0; pointer-events: none; transition: opacity 0.4s;
}
body.menu-open .drawer-close { opacity: 1; pointer-events: auto; }
.scrim {
  position: fixed; inset: 0; z-index: 29; background: rgba(0,0,0,0.5);
  opacity: 0; pointer-events: none; transition: opacity 0.5s;
}
body.menu-open .scrim { opacity: 1; pointer-events: auto; }

/* ---------- 中央提示（仅螺旋视图） ---------- */
.hint {
  position: fixed; z-index: 15; left: 50%; bottom: 30px; transform: translateX(-50%);
  font-family: "DM Mono", monospace; font-size: 12px; letter-spacing: 1px; color: var(--mute);
  text-align: center; pointer-events: none; transition: opacity 0.6s;
}
body.view-list .hint { opacity: 0; }
.hint .yr { color: var(--dim); }

/* ---------- 列表视图 ---------- */
#list-view {
  position: relative; z-index: 5; max-width: 1280px; margin: 0 auto;
  padding: 120px 30px 90px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 26px;
}
body.view-spiral #list-view { display: none; }

.work-cell { display: block; group: ; }
.work-thumb {
  position: relative; aspect-ratio: 16/9; border-radius: 4px; overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 30%, hsl(var(--h) 70% 28% / 0.9), transparent),
    linear-gradient(160deg, hsl(var(--h) 60% 16%), hsl(calc(var(--h) + 70) 55% 22%));
  border: 1px solid var(--line); transition: transform 0.5s cubic-bezier(.6,0,.2,1), border-color 0.4s;
}
.work-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.work-cell:hover .work-thumb { transform: translateY(-6px) scale(1.012); border-color: var(--line-2); }
.work-meta {
  display: flex; align-items: baseline; gap: 10px; padding: 12px 2px 0;
  font-family: "DM Mono", monospace;
}
.work-no { color: var(--accent); font-size: 12px; }
.work-title { font-family: "Noto Sans SC", sans-serif; font-size: 15px; color: var(--fg); }
.work-tag { margin-left: auto; font-size: 11px; color: var(--mute); }

/* 列表视图标题区 */
.list-head {
  position: relative; z-index: 5; max-width: 1280px; margin: 0 auto; padding: 0 30px;
}
body.view-spiral .list-head { display: none; }
.list-head h1 {
  font-family: "Fraunces", serif; font-weight: 400; font-size: clamp(40px, 7vw, 84px);
  line-height: 1.02; letter-spacing: -1px; padding-top: 130px;
}
.list-head h1 em { font-style: italic; color: var(--accent); }
.list-head p {
  font-family: "DM Mono", monospace; font-size: 13px; color: var(--dim);
  margin-top: 18px; max-width: 540px; line-height: 1.8;
}

/* ---------- 备案 footer ---------- */
.beian {
  position: relative; z-index: 5; text-align: center; padding: 30px 20px 26px;
  font-family: "DM Mono", monospace; font-size: 12px; color: var(--mute);
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: center;
}
body.view-spiral .beian {
  position: fixed; bottom: 0; left: 0; right: 0; padding: 14px; z-index: 14;
  background: linear-gradient(transparent, rgba(5,6,8,0.7));
}
.beian a { color: var(--mute); transition: color 0.3s; display: inline-flex; align-items: center; gap: 5px; }
.beian a:hover { color: var(--dim); }
.beian img { height: 15px; width: auto; vertical-align: middle; opacity: 0.8; }

@media (max-width: 820px) {
  .topbar { padding: 16px 18px; }
  .brand .bname { display: none; }
  #list-view { padding: 96px 18px 70px; gap: 18px; grid-template-columns: repeat(2, 1fr); }
  .view-toggle { font-size: 12px; gap: 10px; }
}
