:root {
  --bg: #0c0c0b;
  --bg-2: #121211;
  --bg-3: #171716;
  --paper: #f2efe6;
  --paper-2: #cfcabf;
  --muted: #8f8b81;
  --line: rgba(242, 239, 230, 0.13);
  --line-strong: rgba(242, 239, 230, 0.26);
  --acid: #d6ff4b;
  --green: #9be7a0;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --pad: clamp(20px, 4vw, 64px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--acid); color: #111; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
kbd {
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--muted);
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  z-index: 200;
  background: var(--acid);
  color: #111;
  padding: 8px 14px;
}
.skip:focus { left: 12px; }

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

/* ---------- top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 48px);
  height: 68px;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(120%);
}

.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark { width: 22px; height: 22px; color: var(--acid); align-self: center; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-name {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.brand-sub {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.nav { display: flex; gap: 26px; margin-left: auto; font-size: 13.5px; }
.nav a { color: var(--paper-2); transition: color 0.2s; }
.nav a:hover { color: var(--acid); }

.sync {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: clamp(16px, 3vw, 32px);
  white-space: nowrap;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(155, 231, 160, 0.12);
  flex: none;
}
.dot.off { background: var(--muted); box-shadow: none; }

/* ---------- hero ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(24px, 4vw, 72px);
  align-items: center;
  padding: clamp(52px, 7vw, 104px) var(--pad) clamp(56px, 7vw, 96px);
  max-width: 1560px;
  margin: 0 auto;
}

.kicker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 28px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
}
.kicker-line { width: clamp(28px, 6vw, 72px); height: 1px; background: var(--line-strong); }

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(52px, 7.4vw, 108px);
  line-height: 0.99;
  letter-spacing: -0.02em;
}
h1 em {
  font-style: normal;
  color: var(--acid);
  position: relative;
}
h1 em::after {
  content: "";
  position: absolute;
  left: 0.04em;
  right: 0;
  bottom: 0.02em;
  height: 0.055em;
  background: currentColor;
  opacity: 0.35;
}

.lede {
  max-width: 36em;
  margin: 30px 0 0;
  font-size: clamp(15px, 1.25vw, 17.5px);
  color: var(--paper-2);
  line-height: 1.85;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  font-size: 14px;
  letter-spacing: 0.04em;
  transition: transform 0.2s, background 0.2s, border-color 0.2s, color 0.2s;
}
.btn-solid { background: var(--acid); color: #111; font-weight: 600; }
.btn-solid:hover { background: #e4ff7a; transform: translateY(-2px); }
.btn-line { border-color: var(--line-strong); color: var(--paper); }
.btn-line:hover { border-color: var(--acid); color: var(--acid); transform: translateY(-2px); }

.figures {
  display: flex;
  gap: clamp(24px, 4vw, 56px);
  margin: 48px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.figures div { display: flex; flex-direction: column-reverse; gap: 4px; }
.figures dt {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.figures dd {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(22px, 2.2vw, 28px);
  font-variant-numeric: tabular-nums;
}

.hero-side {
  position: relative;
  min-height: clamp(360px, 42vw, 540px);
}
.plate {
  position: absolute;
  margin: 0;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}
.plate img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.plate figcaption {
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
  border-top: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plate-a { width: 62%; right: 4%; top: 2%; transform: rotate(-2.2deg); z-index: 3; }
.plate-b { width: 46%; left: 0; top: 38%; transform: rotate(1.8deg); z-index: 2; }
.plate-c { width: 38%; right: 12%; bottom: 0; transform: rotate(-1deg); z-index: 1; }

.hero-coord {
  position: absolute;
  left: 0;
  bottom: 6%;
  font-family: var(--mono);
  font-size: 9.5px;
  line-height: 1.8;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.hero-coord span { color: var(--acid); opacity: 0.7; }

/* ---------- sections ---------- */

.section {
  padding: clamp(44px, 5vw, 76px) var(--pad);
  max-width: 1560px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 30px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.count {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--acid);
  letter-spacing: 0.06em;
  vertical-align: middle;
}
.count::before { content: "/ "; opacity: 0.45; }

.section-note {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

/* ---------- collection ---------- */

.collection {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--bg-2);
  transition: border-color 0.25s, transform 0.25s;
}
.card:hover { border-color: rgba(214, 255, 75, 0.4); transform: translateY(-3px); }

.card-media { position: relative; overflow: hidden; background: var(--bg-3); }
.card-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.4s;
}
.card:hover .card-media img { transform: scale(1.03); filter: brightness(1.04); }

.card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  background: rgba(10, 10, 9, 0.82);
  border: 1px solid rgba(214, 255, 75, 0.35);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--acid);
  backdrop-filter: blur(6px);
}

.card-body { padding: clamp(18px, 2vw, 28px); display: flex; flex-direction: column; flex: 1; }
.card-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.card-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.15;
  font-weight: 700;
}
.card-no { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.1em; }
.card-desc {
  margin: 12px 0 0;
  color: var(--paper-2);
  font-size: 14.5px;
  line-height: 1.8;
  flex: 1;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 0; padding: 0; list-style: none; }
.tags li {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 3px 8px;
}
.card-foot {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.card-meta b { color: var(--paper-2); font-weight: 500; }
.card-enter {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 16px;
  background: var(--acid);
  color: #111;
  font-size: 13px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.card-enter:hover { background: #e4ff7a; transform: translateX(2px); }
.card-enter.secondary { background: transparent; color: var(--paper); border: 1px solid var(--line-strong); }
.card-enter.secondary:hover { border-color: var(--acid); color: var(--acid); transform: none; }

/* ---------- index tools ---------- */

.section-head-tools { align-items: center; }
.tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.seg { display: inline-flex; border: 1px solid var(--line); }
.seg button {
  background: transparent;
  border: 0;
  padding: 0 13px;
  height: 34px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--paper); color: #111; font-weight: 600; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  transition: border-color 0.2s;
}
.search:focus-within { border-color: var(--acid); }
.search svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.search input {
  width: clamp(110px, 13vw, 180px);
  background: transparent;
  border: 0;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 13px;
  outline: none;
}
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { filter: invert(0.6); }

.result-line {
  margin: -12px 0 22px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  min-height: 1em;
}

/* ---------- index grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: clamp(14px, 1.7vw, 22px) clamp(10px, 1.4vw, 18px);
}

.tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tile-media {
  position: relative;
  overflow: hidden;
  background: var(--bg-3);
  border: 1px solid var(--line);
  transition: border-color 0.25s;
}
.tile-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.35s;
  filter: saturate(0.92);
}
.tile:hover .tile-media { border-color: rgba(214, 255, 75, 0.45); }
.tile:hover .tile-media img { transform: scale(1.045); filter: saturate(1.05) brightness(1.03); }

.tile-no {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--paper);
  background: rgba(10, 10, 9, 0.7);
  padding: 2px 5px;
  opacity: 0;
  transition: opacity 0.2s;
}
.tile:hover .tile-no { opacity: 1; }

.tile-local {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px;
  background: rgba(10, 10, 9, 0.82);
  border: 1px solid rgba(214, 255, 75, 0.35);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  color: var(--acid);
}
.tile-local .dot { width: 4px; height: 4px; }

.tile-new {
  position: absolute;
  top: 8px;
  left: 8px;
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  color: #111;
  background: var(--acid);
  padding: 2px 6px;
}

.tile-media.noimg::after,
.card-media.noimg::after {
  content: "预览不可用";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.card-media::before,
.tile-media::before { content: ""; display: block; padding-top: 75%; }
.card-media img,
.tile-media img { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; }

.tile-caption { padding: 9px 2px 0; min-width: 0; }
.tile-host {
  display: block;
  font-size: 12.5px;
  color: var(--paper);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile-path {
  display: block;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}
.tile-mirrored .tile-host { color: var(--acid); }

.empty {
  padding: 56px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.more {
  display: block;
  margin: 40px auto 0;
  height: 42px;
  padding: 0 26px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--paper);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.more:hover { border-color: var(--acid); color: var(--acid); }

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--line);
  padding: clamp(40px, 5vw, 72px) var(--pad) 28px;
  max-width: 1560px;
  margin: 0 auto;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: clamp(24px, 4vw, 64px);
}
.foot-kicker {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  color: var(--acid);
}
.foot p { margin: 0 0 12px; font-size: 13px; line-height: 1.85; color: var(--muted); }
.foot .foot-strong { color: var(--paper-2); }
.foot a { color: var(--paper-2); border-bottom: 1px solid var(--line-strong); }
.foot a:hover { color: var(--acid); border-color: var(--acid); }
.foot code { font-family: var(--mono); font-size: 11px; color: var(--paper-2); }
.foot details summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--paper-2);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.foot details summary::before { content: "+"; color: var(--acid); font-family: var(--mono); }
.foot details[open] summary::before { content: "−"; }
.foot pre {
  margin: 14px 0 10px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  overflow-x: auto;
  line-height: 1.9;
}
.foot-small { font-size: 11.5px; }
.foot-base {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* ---------- player ---------- */

.player {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: #080807;
  animation: player-in 0.28s ease-out;
}
.player[hidden] { display: none; }
@keyframes player-in {
  from { opacity: 0; transform: scale(0.985); }
  to { opacity: 1; transform: none; }
}
.player-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 54px;
  padding: 0 12px 0 18px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  flex: none;
}
.player-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.player-index { font-family: var(--mono); font-size: 10px; color: var(--acid); letter-spacing: 0.1em; }
.player-title strong {
  font-family: var(--serif);
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-meta {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}
.player-meta:hover { color: var(--acid); }
.player-tools { display: flex; align-items: center; gap: 6px; }
.player-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.player-status.ready { color: var(--green); }
.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--paper-2);
  cursor: pointer;
  font-size: 14px;
  transition: border-color 0.2s, color 0.2s;
}
.icon-btn:hover { border-color: var(--acid); color: var(--acid); }
.icon-close:hover { border-color: #ff7a6b; color: #ff7a6b; }
.player-stage { flex: 1; min-height: 0; background: #000; }
.player-stage iframe { width: 100%; height: 100%; border: 0; display: block; }

.noscript { padding: 40px var(--pad); color: var(--muted); }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .nav { display: none; }
  .sync { margin-left: auto; }
  .hero { grid-template-columns: 1fr; }
  .hero-side { display: none; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .collection { grid-template-columns: 1fr; }
  .section-head-tools { flex-direction: column; align-items: flex-start; }
  .tools { width: 100%; justify-content: flex-start; }
  .search { flex: 1; }
  .search input { width: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .figures { gap: 22px; }
  .foot-grid { grid-template-columns: 1fr; }
  .player-meta { display: none; }
  .player-status { display: none; }
}

@media (max-width: 520px) {
  .topbar { height: 60px; gap: 12px; }
  .brand-sub { display: none; }
  .sync { border-left: 0; padding-left: 0; }
  .figures { flex-wrap: wrap; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
  .card-foot { flex-wrap: wrap; }
  .card-enter { margin-left: 0; width: 100%; justify-content: center; }
  .foot-base { flex-direction: column; gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
