/* 创意工坊镜像站 — 接入 Steam Web API */

:root {
  --bg: #0a0c10;
  --ink: #f2efe8;
  --muted: #9aa3b2;
  --line: rgba(242, 239, 232, 0.1);
  --copper: #e08a3c;
  --copper-2: #f0b46a;
  --teal: #2fd6c0;
  --radius: 16px;
  --font-display: "Syne", "Noto Sans SC", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
}

body.is-intro { overflow: hidden; }

a { color: inherit; text-decoration: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

.bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
}
.bg__glow {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.5;
}
.bg__glow--a {
  width: 45vw; height: 45vw; top: -14%; left: -10%;
  background: radial-gradient(circle, rgba(224,138,60,.38), transparent 70%);
}
.bg__glow--b {
  width: 36vw; height: 36vw; right: -8%; bottom: 10%;
  background: radial-gradient(circle, rgba(47,214,192,.25), transparent 70%);
}
.bg__mesh {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(242,239,232,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242,239,232,.03) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse at 50% 20%, #000 15%, transparent 72%);
}
.bg__noise {
  position: absolute; inset: 0; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.top, .shell, .foot { position: relative; z-index: 1; }

.top {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand__mark {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--copper), #c96a28);
  color: #1a0e06; font-family: var(--font-display); font-size: 12px; font-weight: 800;
}
.brand__name { font-family: var(--font-display); font-weight: 800; font-size: 18px; }

.top__meta { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px;
  border-radius: 999px; border: 1px solid rgba(47,214,192,.3);
  background: rgba(47,214,192,.08); color: var(--teal);
  font-family: var(--font-mono); font-size: 11px;
}
.pill.is-bad {
  border-color: rgba(255,120,90,.35);
  background: rgba(255,120,90,.08);
  color: #ff8a6a;
}
.pill--muted {
  border-color: var(--line);
  background: rgba(255,255,255,.03);
  color: var(--muted);
}

.shell { max-width: var(--max); margin: 0 auto; padding: 28px 24px 24px; }

.hero-mini { margin-bottom: 22px; max-width: 42em; }
.eyebrow {
  margin: 0 0 10px; color: var(--teal);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .18em;
}
.hero-mini h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 64px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: .95;
}
.lead { margin: 12px 0 0; color: var(--muted); font-size: 15px; }

.site-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
}
.site-stats__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0,0,0,.18);
}
.site-stats__label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
}
.site-stats__value {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  word-break: break-word;
}
.site-stats__item--uptime .site-stats__value { font-size: 13px; }

@media (max-width: 960px) {
  .site-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-stats__item--uptime { grid-column: 1 / -1; }
}

.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 14px;
}
.field { display: block; }
.field--grow { flex: 1; min-width: 200px; }
.field input, .field select {
  width: 100%; min-height: 44px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line);
  background: rgba(0,0,0,.28); color: var(--ink);
  font-family: var(--font-body); font-size: 14px; outline: none;
}
.field input:focus, .field select:focus {
  border-color: rgba(224,138,60,.5);
  box-shadow: 0 0 0 3px rgba(224,138,60,.18);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--font-body); font-size: 14px; font-weight: 700; cursor: pointer;
  transition: transform .22s var(--ease), box-shadow .22s ease, background .22s ease, border-color .22s ease;
}
.btn--primary {
  background: linear-gradient(120deg, var(--copper), var(--copper-2));
  color: #1a0e06; box-shadow: 0 10px 28px rgba(224,138,60,.32);
}
.btn--primary:hover { transform: translateY(-2px) scale(1.02); }
.btn--ghost {
  border-color: var(--line); background: rgba(255,255,255,.03); color: var(--ink);
}
.btn--ghost:hover { transform: translateY(-2px); border-color: rgba(242,239,232,.28); }
.btn--sm { min-height: 34px; padding: 0 12px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* —— 官方工坊风格：左侧分类侧栏 + 右侧列表 —— */
.browse {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 8px;
}

.tag-side {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 14px 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015));
  scrollbar-width: thin;
}

.tag-side__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.tag-side__title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.tag-side__clear {
  min-height: 28px;
  max-width: 70%;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: 600 11px/1.2 var(--font-body);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag-side__clear:hover { color: var(--ink); }
.tag-side__clear.is-on {
  color: var(--ink);
  border-color: rgba(242,239,232,.35);
  background: rgba(255,255,255,.06);
}

.tag-side__loading,
.tag-side__empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.tag-group + .tag-group { margin-top: 14px; }

.tag-group__title {
  margin: 0 0 6px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(242,239,232,.55);
}

.tag-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 4px 8px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: rgba(242,239,232,.82);
  font: 500 13px/1.3 var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.tag-item:hover {
  background: rgba(255,255,255,.04);
  color: var(--ink);
}
.tag-item.is-on {
  border-color: rgba(242,239,232,.55);
  background: rgba(255,255,255,.07);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
.tag-item__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag-item__count {
  flex: 0 0 auto;
  max-width: 52%;
  color: var(--muted);
  font: 500 10px/1.2 var(--font-mono);
  text-align: right;
  white-space: nowrap;
}
.tag-item.is-on .tag-item__count { color: rgba(242,239,232,.7); }

.browse__main { min-width: 0; }

.meta {
  margin: 0 0 16px; color: var(--muted);
  font-family: var(--font-mono); font-size: 12px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 960px) {
  .browse {
    grid-template-columns: 1fr;
  }
  .tag-side {
    position: static;
    max-height: 280px;
  }
}

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
}

.card {
  display: flex; flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
  overflow: hidden;
  opacity: 0; transform: translateY(18px);
  cursor: pointer;
  transition: transform .35s var(--ease), border-color .35s ease, box-shadow .35s ease, opacity .4s var(--ease);
}
.card.is-in { opacity: 1; transform: translateY(0); }
.card:hover {
  transform: translateY(-5px);
  border-color: rgba(224,138,60,.38);
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
}

.card__cover {
  aspect-ratio: 16/9;
  background: #141820 center/cover no-repeat;
  position: relative;
}
.card__cover.is-empty {
  background:
    linear-gradient(145deg, rgba(224,138,60,.25), transparent 55%),
    linear-gradient(200deg, #1a222c, #0c1016);
}
.card__tag {
  position: absolute; left: 10px; bottom: 10px;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.12);
  color: var(--teal); font-family: var(--font-mono); font-size: 10px;
}
.card__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.card__pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.28);
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
}
.card__pill.is-on {
  color: var(--ink);
  border-color: rgba(242,239,232,.35);
  background: rgba(255,255,255,.08);
}
.card__body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__body h3 {
  margin: 0; font-size: 15px; font-weight: 700; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card__desc {
  margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  flex: 1;
}
.card__stats {
  display: flex; flex-wrap: wrap; gap: 8px 12px;
  margin: 0; padding: 0; list-style: none;
  font-family: var(--font-mono); font-size: 11px; color: var(--muted);
}
.card__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.card__actions .btn { text-decoration: none; border: none; }

.empty {
  text-align: center; padding: 56px 16px; color: var(--muted);
}
.empty__hint { font-size: 13px; max-width: 36em; margin: 8px auto 0; }

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 12px;
  padding: 28px 0 12px;
}
.pager[hidden] { display: none !important; }
.pager__btn {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(242,239,232,.04);
  color: var(--ink);
  font: 500 13px/1 var(--font-body);
  cursor: pointer;
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
.pager__btn:hover:not(:disabled) {
  border-color: rgba(224,138,60,.45);
  background: rgba(224,138,60,.1);
  transform: translateY(-1px);
}
.pager__btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.pager__pages {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.pager__num {
  min-width: 36px;
  min-height: 36px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font: 500 13px/1 var(--font-mono);
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s, transform .2s;
}
.pager__num:hover {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(242,239,232,.05);
}
.pager__num.is-on {
  color: #1a120c;
  background: linear-gradient(135deg, var(--copper-2), var(--copper));
  border-color: transparent;
  font-weight: 700;
}
.pager__ellipsis {
  min-width: 28px;
  text-align: center;
  color: var(--muted);
  font: 500 13px/36px var(--font-mono);
  user-select: none;
}
.pager__goto {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}
.pager__goto input {
  width: 64px;
  min-height: 36px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.28);
  color: var(--ink);
  font: 500 13px/1 var(--font-mono);
  text-align: center;
}
.pager__goto input:focus {
  outline: none;
  border-color: rgba(224,138,60,.55);
}
.pager__btn--go { padding: 0 12px; }
.pager__info {
  width: 100%;
  margin: 4px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-mono);
}

@media (max-width: 640px) {
  .pager__goto { width: 100%; justify-content: center; }
}

/* —— Mod 详情弹窗 —— */
.modal[hidden] { display: none !important; }
.modal {
  position: fixed; inset: 0; z-index: 2000;
  display: grid; place-items: center;
  padding: 20px;
}
.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
}
.modal__panel {
  position: relative; z-index: 1;
  width: min(720px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #12161e, #0b0e13);
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  animation: modal-in .35s var(--ease) both;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal__close {
  position: absolute; top: 10px; right: 12px; z-index: 2;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(0,0,0,.45);
  color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer;
}
.modal__cover {
  aspect-ratio: 16/8;
  background: #141820 center/cover no-repeat;
}
.modal__cover.is-empty {
  background:
    linear-gradient(145deg, rgba(224,138,60,.28), transparent 55%),
    linear-gradient(200deg, #1a222c, #0c1016);
}
.modal__body { padding: 18px 20px 22px; }
.modal__tags {
  margin: 0 0 8px;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.modal__tags span {
  padding: 3px 8px; border-radius: 999px;
  border: 1px solid rgba(47,214,192,.25);
  color: var(--teal); font-size: 11px; font-family: var(--font-mono);
}
.modal__body h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 800;
  letter-spacing: -.01em;
}
.modal__stats {
  display: flex; flex-wrap: wrap; gap: 10px 16px;
  margin: 0 0 14px; padding: 0; list-style: none;
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
}
.modal__stats a {
  color: var(--accent, #c9a66b);
  text-decoration: none;
}
.modal__stats a:hover { text-decoration: underline; }
.modal__desc {
  margin: 0 0 18px;
  color: rgba(242,239,232,.82);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  max-height: 220px;
  overflow: auto;
}
.modal__actions {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.modal__actions a.btn { text-decoration: none; }
.modal__hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.foot {
  max-width: var(--max); margin: 36px auto 0; padding: 24px 24px 48px;
  border-top: 1px solid var(--line); text-align: center;
}
.foot p { margin: 0; }
.foot__muted { margin-top: 6px !important; color: var(--muted); font-size: 12px; }

/* —— IP 封禁提示窗 —— */
.ban-gate[hidden] { display: none !important; }
.ban-gate {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 6, 10, 0.88);
  backdrop-filter: blur(10px);
}
.ban-gate__card {
  width: min(420px, 100%);
  padding: 28px 24px;
  border-radius: 18px;
  border: 1px solid rgba(232, 93, 93, 0.35);
  background: rgba(18, 12, 12, 0.95);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.ban-gate__eyebrow {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: #ffb4b4;
}
.ban-gate__card h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
}
.ban-gate__msg {
  margin: 0 0 10px;
  color: rgba(242, 239, 232, 0.82);
  font-size: 14px;
  line-height: 1.7;
}
.ban-gate__ip {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

@media (max-width: 960px) {
  .grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .top { flex-direction: column; align-items: flex-start; }
}
