/* ============================================================
   场景概念设计 · Concept Art Archive
   ============================================================ */
:root {
  --bg: #0b0c0f;
  --bg-elev: #121419;
  --bg-soft: #171a20;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --txt: #ecebe8;
  --txt-dim: #9a9ca4;
  --txt-faint: #6b6e78;
  --accent: #e3a35f;
  --accent-soft: rgba(227, 163, 95, 0.14);
  --col-min: 268px;
  --gap: 14px;
  --topbar-h: 104px;
  --radius: 10px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei",
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.lb-open { overflow: hidden; }

::selection { background: rgba(227, 163, 95, 0.32); }

/* ---------------------------------------------------------- loader */
.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--bg);
  transition: opacity 0.5s var(--ease), visibility 0.5s;
}
.loader.gone { opacity: 0; visibility: hidden; }
.loader-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { color: var(--txt-faint); font-size: 13px; letter-spacing: 0.08em; }

/* ---------------------------------------------------------- topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(11, 12, 15, 0.82);
  backdrop-filter: saturate(150%) blur(16px);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 13px clamp(14px, 3.2vw, 40px) 11px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--txt);
  flex: 0 0 auto;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: linear-gradient(150deg, rgba(227, 163, 95, 0.22), rgba(227, 163, 95, 0.05));
  border: 1px solid rgba(227, 163, 95, 0.22);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b {
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
}
.brand-text i {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--txt-faint);
  margin-top: 3px;
}

.search {
  position: relative;
  flex: 1 1 auto;
  max-width: 460px;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: var(--txt-faint);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 38px;
  padding: 0 34px 0 36px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--txt);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.search input::placeholder { color: var(--txt-faint); }
.search input:focus {
  border-color: rgba(227, 163, 95, 0.5);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 0 3px rgba(227, 163, 95, 0.1);
}
.search input::-webkit-search-cancel-button { display: none; }
.q-clear {
  position: absolute;
  right: 8px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  color: var(--txt-dim);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.q-clear:hover { background: rgba(255, 255, 255, 0.16); color: var(--txt); }

.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: 0 0 auto; }

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--txt-dim);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.18s var(--ease);
  white-space: nowrap;
}
.ghost-btn:hover { color: var(--txt); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.07); }
.ghost-btn.icon-only { padding: 0; width: 36px; justify-content: center; }
.ghost-btn.active { color: var(--accent); border-color: rgba(227, 163, 95, 0.45); background: var(--accent-soft); }

/* ---------------------------------------------------------- filter bar */
.filterbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 clamp(14px, 3.2vw, 40px) 11px;
}
.chips {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1 1 auto;
  padding-bottom: 1px;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--txt-dim);
  font-family: inherit;
  font-size: 12.5px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.16s var(--ease);
  white-space: nowrap;
}
.chip:hover { color: var(--txt); border-color: var(--line-strong); }
.chip .n {
  font-size: 10.5px;
  color: var(--txt-faint);
  font-variant-numeric: tabular-nums;
}
.chip.on {
  background: var(--txt);
  border-color: var(--txt);
  color: #101114;
  font-weight: 600;
}
.chip.on .n { color: rgba(16, 17, 20, 0.55); }
.chip.heart.on { background: #e2607a; border-color: #e2607a; color: #fff; }
.chip.heart.on .n { color: rgba(255, 255, 255, 0.75); }

.filter-meta {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--txt-faint);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
#resultCount b { color: var(--txt-dim); font-weight: 600; }

/* ---------------------------------------------------------- hero */
.hero {
  max-width: 1680px;
  margin: 0 auto;
  padding: clamp(30px, 4vw, 52px) clamp(14px, 3.2vw, 40px) clamp(16px, 2vw, 24px);
}
.hero-kicker {
  font-size: 10px;
  letter-spacing: 0.36em;
  color: var(--accent);
  opacity: 0.9;
}
.hero-title {
  margin: 11px 0 0;
  font-size: clamp(26px, 3.3vw, 40px);
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.16;
  color: #f4f2ee;
}
.hero-sub {
  margin: 11px 0 0;
  font-size: 12.5px;
  color: var(--txt-faint);
  letter-spacing: 0.03em;
}

/* ---------------------------------------------------------- stage */
main { min-height: 60vh; }

.stage {
  margin: 0 auto;
  padding: 18px clamp(14px, 3.2vw, 40px) 0;
}
.grid { position: relative; width: 100%; }

.card {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: #15171c;
  cursor: zoom-in;
  transform: translate3d(0, 0, 0);
  contain: layout paint style;
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.055);
  pointer-events: none;
  transition: box-shadow 0.25s var(--ease);
}
.card:hover::after { box-shadow: inset 0 0 0 1px rgba(227, 163, 95, 0.55); }

.card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s var(--ease), transform 0.5s var(--ease);
  transform: scale(1.001);
  background: #15171c;
}
.card img.in { opacity: 1; }
.card:hover img { transform: scale(1.035); }

.card .cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px 11px 9px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.01em;
  background: linear-gradient(to top, rgba(6, 7, 9, 0.82), rgba(6, 7, 9, 0));
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card:hover .cap { opacity: 1; transform: translateY(0); }

.card .heart-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(10, 11, 14, 0.55);
  backdrop-filter: blur(6px);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.85);
  transition: all 0.18s var(--ease);
  padding: 0;
}
.card:hover .heart-btn, .card .heart-btn.on { opacity: 1; transform: scale(1); }
.card .heart-btn:hover { background: rgba(226, 96, 122, 0.9); color: #fff; }
.card .heart-btn.on { color: #f0708c; background: rgba(12, 13, 16, 0.7); }
.card .heart-btn.on svg { fill: currentColor; }

.sentinel { height: 1px; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 120px 20px 140px;
  color: var(--txt-faint);
  font-size: 13.5px;
}
.empty svg { color: var(--line-strong); }

/* ---------------------------------------------------------- footer */
.site-foot {
  margin-top: 54px;
  padding: 26px clamp(14px, 3.2vw, 40px) 46px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--txt-faint);
  letter-spacing: 0.02em;
}
.site-foot b { color: var(--txt-dim); font-weight: 600; }
.foot-note { opacity: 0.75; }

/* ---------------------------------------------------------- to top */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 22px;
  z-index: 55;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(22, 24, 29, 0.86);
  backdrop-filter: blur(10px);
  color: var(--txt-dim);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.22s var(--ease);
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { color: var(--txt); background: rgba(40, 43, 50, 0.95); }

/* ---------------------------------------------------------- lightbox */
.lb {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 7, 9, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: lbfade 0.22s var(--ease);
}
@keyframes lbfade { from { opacity: 0; } to { opacity: 1; } }
.lb[hidden] { display: none; }

.lb-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 54px 70px 76px;
  overflow: hidden;
}
.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  cursor: zoom-in;
  transition: transform 0.28s var(--ease);
  will-change: transform;
}
.lb-stage.zoomed { cursor: grab; }
.lb-stage.zoomed img { cursor: grab; border-radius: 0; }
.lb-stage.dragging { cursor: grabbing; }

.lb-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(20, 22, 27, 0.7);
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.18s var(--ease);
  z-index: 3;
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.2); }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.lb-close {
  top: 16px;
  right: 18px;
  transform: none;
  width: 38px;
  height: 38px;
}

.lb-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(16px, 3vw, 34px) calc(18px + env(safe-area-inset-bottom, 0));
  background: linear-gradient(to top, rgba(6, 7, 9, 0.92), rgba(6, 7, 9, 0));
  z-index: 3;
}
.lb-meta { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.lb-idx {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  letter-spacing: 0.06em;
  flex: 0 0 auto;
}
.lb-title {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.86);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-dims { font-size: 11px; color: var(--txt-faint); font-variant-numeric: tabular-nums; flex: 0 0 auto; }

.lb-tools { display: flex; gap: 8px; flex: 0 0 auto; }
.lb-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.16s var(--ease);
}
.lb-tool:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.lb-tool.on { color: #f0708c; border-color: rgba(240, 112, 140, 0.45); background: rgba(240, 112, 140, 0.12); }
.lb-tool.on svg { fill: currentColor; }

/* ---------------------------------------------------------- density */
body[data-density="compact"] { --col-min: 190px; --gap: 10px; }
body[data-density="wide"] { --col-min: 380px; --gap: 16px; }

/* ---------------------------------------------------------- responsive */
@media (max-width: 760px) {
  :root { --col-min: 150px; --gap: 8px; }
  .topbar-inner { flex-wrap: wrap; gap: 10px; padding-bottom: 9px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .brand-text i { display: none; }
  .filter-meta { display: none; }
  .chips { mask-image: linear-gradient(to right, #000 88%, transparent); -webkit-mask-image: linear-gradient(to right, #000 88%, transparent); }
  .hero-sub { font-size: 12px; line-height: 1.75; max-width: 92%; }
  .hero-sub .hint { display: none; }
  .lb-stage { padding: 46px 8px 88px; }
  .lb-prev, .lb-next { width: 38px; height: 38px; top: auto; bottom: 92px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
  .lb-meta { flex-wrap: wrap; gap: 6px 10px; }
  .lb-title { max-width: 100%; }
  .lb-tool span { display: none; }
  .lb-tool { padding: 0 10px; }
  .site-foot { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
