/* 小figure · 游戏美术素材库 —— 暗色主题 */
:root {
  --bg: #0b0e14;
  --bg-soft: #10141d;
  --panel: #141926;
  --panel-2: #1a2130;
  --line: #232b3b;
  --text: #e8eef7;
  --muted: #8b96a9;
  --accent: #5eead4;
  --accent-2: #f472b6;
  --accent-3: #7dd3fc;
  --radius: 14px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .45);
  --checker: repeating-conic-gradient(#202839 0% 25%, #171d2b 0% 50%) 50% / 22px 22px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
}

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 14, 20, .86);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { color: var(--accent); display: flex; }
.brand-text h1 { font-size: 20px; letter-spacing: .5px; }
.brand-text h1::after { content: ".com"; color: var(--accent); font-weight: 400; font-size: 13px; margin-left: 2px; }
.subtitle { color: var(--muted); font-size: 12.5px; margin-top: 1px; }

.search-box {
  flex: 1; min-width: 240px; max-width: 460px; margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; color: var(--muted);
  transition: border-color .2s;
}
.search-box:focus-within { border-color: var(--accent); }
.search-box input {
  flex: 1; background: none; border: none; outline: none; color: var(--text);
  font-size: 14px; font-family: inherit;
}
.search-box input::placeholder { color: #5d6779; }
.search-box kbd {
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
  font-size: 11px; padding: 1px 6px; color: var(--muted); background: var(--bg-soft);
}

/* ---------- 工具栏 ---------- */
.toolbar {
  position: sticky; top: 63px; z-index: 40;
  background: rgba(11, 14, 20, .9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.toolbar-inner { display: flex; align-items: center; gap: 16px; padding-top: 10px; padding-bottom: 10px; flex-wrap: wrap; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.chip {
  border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  border-radius: 999px; padding: 5px 14px; font-size: 13px; cursor: pointer;
  font-family: inherit; transition: all .18s; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: #33405a; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #06231e; font-weight: 600; }
.chip .n { opacity: .65; font-size: 11px; margin-left: 3px; }

.filters { display: flex; gap: 10px; }
.sel { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.sel select {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 8px; font-size: 13px; font-family: inherit;
  outline: none; cursor: pointer;
}
.sel select:focus { border-color: var(--accent); }

/* ---------- 计数与网格 ---------- */
.count-line { color: var(--muted); font-size: 13px; padding: 18px 0 14px; }
.count-line b { color: var(--accent); font-weight: 600; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding-bottom: 60px;
}

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: transform .18s, border-color .18s, box-shadow .18s;
  display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); border-color: #33405a; box-shadow: var(--shadow); }

.stage {
  height: 190px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft); position: relative; overflow: hidden;
}
.stage.checker { background-image: var(--checker); }
.stage img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

.badge {
  position: absolute; top: 8px; left: 8px;
  font-size: 10.5px; padding: 2px 8px; border-radius: 999px;
  background: rgba(11, 14, 20, .78); color: var(--accent);
  border: 1px solid rgba(94, 234, 212, .35); backdrop-filter: blur(4px);
}
.badge.anim { color: var(--accent-2); border-color: rgba(244, 114, 182, .4); }

.card-meta { padding: 10px 12px 12px; }
.card-meta h3 { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.card-meta .dims { color: var(--muted); font-size: 12px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.card-meta .cat { margin-top: 7px; font-size: 11px; color: var(--accent-3); opacity: .85; }

/* ---------- 动画特效 ---------- */
.fx-shake { animation: fxShake .45s steps(2) infinite; }
@keyframes fxShake {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-2px, 1px); }
  50% { transform: translate(2px, -1px); }
  75% { transform: translate(-1px, -2px); }
}
.fx-bounce { animation: fxBounce .8s ease-in-out infinite; }
@keyframes fxBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-7%) scale(1.03); }
}
.fx-pulse { animation: fxPulse .6s ease-in-out infinite; }
@keyframes fxPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}
.fx-flash { animation: fxFlash 1.1s ease-in-out infinite; }
@keyframes fxFlash {
  0%, 100% { filter: brightness(1); }
  45% { filter: brightness(1.55) saturate(1.2); }
}
.fx-sheet { background-repeat: no-repeat; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 80px 0; color: var(--muted); }
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty p { margin-bottom: 18px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 9px; padding: 8px 16px; font-size: 13.5px; cursor: pointer;
  font-family: inherit; text-decoration: none; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); transition: all .18s;
}
.btn:hover { border-color: #3a4763; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #06231e; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--text); }

/* ---------- 灯箱 ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.lightbox[hidden] { display: none; } /* 必须显式覆盖 .lightbox 的 display:flex，否则隐形遮罩会拦截点击 */
.lb-mask { position: absolute; inset: 0; background: rgba(4, 6, 10, .82); backdrop-filter: blur(6px); }
.lb-panel {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  width: min(1060px, 100%); max-height: calc(100vh - 48px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  overflow: hidden; box-shadow: var(--shadow);
}
.lb-close {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(11, 14, 20, .7); color: var(--text); font-size: 18px; cursor: pointer;
}
.lb-close:hover { background: var(--panel-2); }

.lb-stage {
  background: var(--bg-soft); display: flex; align-items: center; justify-content: center;
  padding: 28px; overflow: auto; min-height: 300px;
}
.lb-stage.checker { background-image: var(--checker); }
.lb-stage img { max-width: 100%; max-height: calc(100vh - 130px); object-fit: contain; }

.lb-info { padding: 26px 24px; overflow-y: auto; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.lb-cat { font-size: 12px; color: var(--accent-3); letter-spacing: 1px; }
.lb-info h2 { font-size: 19px; line-height: 1.4; }
.lb-desc { color: var(--muted); font-size: 13.5px; }
.lb-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.lb-meta dt { color: var(--muted); }
.lb-meta dd { text-align: right; font-variant-numeric: tabular-nums; }
.lb-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.lb-tags span {
  font-size: 11.5px; color: var(--muted); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px;
}
.lb-actions { display: flex; gap: 10px; margin-top: 4px; }
.lb-nav { margin-top: auto; padding-top: 16px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); }
.lb-nav span { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--muted); font-size: 13px; }
.site-footer p { margin-bottom: 6px; }
.site-footer .dim { opacity: .7; font-size: 12px; }
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer code { background: var(--panel-2); border-radius: 5px; padding: 1px 6px; font-size: 12px; color: var(--accent); }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .lb-panel { grid-template-columns: 1fr; max-height: calc(100vh - 32px); overflow-y: auto; }
  .lb-info { border-left: none; border-top: 1px solid var(--line); }
  .lb-stage img { max-height: 46vh; }
  .toolbar { top: 117px; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .stage { height: 150px; }
  .header-inner { gap: 12px; }
  .toolbar { top: 165px; }
  .filters { width: 100%; }
  .sel { flex: 1; }
  .sel select { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
