:root {
  color-scheme: dark;
  --bg: #080b12;
  --panel: rgba(18, 24, 36, 0.86);
  --panel-solid: #121824;
  --panel-soft: #182132;
  --ink: #f4f7fb;
  --muted: #9ca9ba;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #35d0ff;
  --accent-2: #ffb84d;
  --accent-3: #7bffb2;
  --danger: #ff6b6b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 18% 8%, rgba(53, 208, 255, 0.22), transparent 28rem),
    radial-gradient(circle at 82% 16%, rgba(255, 184, 77, 0.18), transparent 24rem),
    linear-gradient(180deg, #101522 0, #080b12 42rem);
  color: var(--ink);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Noto Sans SC",
    system-ui,
    sans-serif;
  line-height: 1.55;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  content: "";
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.85), transparent 78%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
}

.top-search-header {
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(280px, 520px) auto;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--ink);
  font-size: 1.14rem;
  font-weight: 950;
  letter-spacing: 0;
  text-decoration: none;
}

.brand span:last-child {
  background: linear-gradient(90deg, #fff7e6, #f0bd54 58%, #ff8f4d);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(240, 189, 84, 0.42);
  border-radius: 12px;
  background:
    radial-gradient(circle at 35% 20%, rgba(255, 211, 106, 0.22), transparent 42%),
    rgba(13, 17, 25, 0.88) url("/assets/img/maple-logo.svg") center / 38px 38px no-repeat;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 0 24px rgba(255, 122, 61, 0.24);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.header-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  justify-self: center;
  width: 100%;
}

.header-search input {
  min-height: 46px;
}

.site-nav a,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  padding: 8px 14px;
}

.site-nav a:hover,
.button.subtle:hover {
  border-color: rgba(53, 208, 255, 0.72);
  color: var(--accent);
}

.button.primary {
  border-color: rgba(53, 208, 255, 0.82);
  background: linear-gradient(135deg, #15a7ff, #31d6bd);
  color: #061018;
  box-shadow: 0 12px 32px rgba(53, 208, 255, 0.23);
}

.button.primary:hover {
  filter: brightness(1.08);
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px 56px;
}

.hero,
.detail-hero,
.auth-panel,
.form-panel,
.table-panel,
.message-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 24, 36, 0.9), rgba(12, 16, 25, 0.88));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 26px;
  align-items: end;
  min-height: 300px;
  padding: 30px;
  overflow: hidden;
}

.hero::after {
  position: absolute;
  right: 24px;
  top: 24px;
  width: min(44vw, 520px);
  height: 220px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(53, 208, 255, 0.18), rgba(255, 184, 77, 0.16)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 2px, transparent 2px 38px);
  content: "";
  opacity: 0.65;
  transform: skewX(-10deg);
}

.hero > * {
  position: relative;
  z-index: 1;
}

.announcement-banner {
  border: 1px solid rgba(255, 184, 77, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 184, 77, 0.14), transparent 42%),
    rgba(18, 24, 36, 0.82);
  margin-bottom: 10px;
  overflow: hidden;
}

.announcement-banner summary {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  padding: 8px 12px;
}

.announcement-banner summary::-webkit-details-marker {
  display: none;
}

.announcement-label {
  border: 1px solid rgba(255, 184, 77, 0.34);
  border-radius: 999px;
  background: rgba(255, 184, 77, 0.12);
  color: var(--accent-2);
  font-size: 0.76rem;
  font-weight: 950;
  padding: 2px 8px;
}

.announcement-banner strong {
  white-space: nowrap;
}

.announcement-brief {
  min-width: 0;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.announcement-toggle {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 850;
}

.announcement-banner[open] .announcement-toggle {
  color: var(--accent-2);
}

.announcement-banner[open] .announcement-toggle::before {
  content: "收起";
}

.announcement-banner[open] .announcement-toggle {
  font-size: 0;
}

.announcement-banner[open] .announcement-toggle::before {
  font-size: 0.82rem;
}

.announcement-body {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #dce6f4;
  line-height: 1.7;
  overflow-wrap: anywhere;
  padding: 10px 12px 12px;
}

.essential-tool {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid rgba(53, 208, 255, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(53, 208, 255, 0.1), transparent 46%),
    rgba(18, 24, 36, 0.76);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
  margin: 12px 0 18px;
  padding: 12px;
}

.essential-tool-visual {
  display: grid;
  place-items: center;
  width: 86px;
  height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.essential-tool-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tool-mark {
  position: relative;
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 17px, rgba(255, 255, 255, 0.5) 17px 23px, transparent 23px),
    linear-gradient(180deg, #35d0ff 0 50%, #7bffb2 50% 100%);
  box-shadow: 0 0 18px rgba(53, 208, 255, 0.2);
}

.essential-tool-main h2 {
  margin-bottom: 6px;
  font-size: clamp(1.2rem, 2vw, 1.75rem);
}

.essential-tool-main p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.essential-tool-action {
  justify-self: end;
}

.tool-page-head {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 24, 36, 0.88), rgba(12, 16, 25, 0.82));
  margin-bottom: 14px;
  padding: 20px;
}

.tool-page-head h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 4vw, 3.6rem);
}

.tool-page-head p:last-child {
  max-width: 760px;
  color: var(--muted);
  margin-bottom: 0;
}

.tool-card-grid,
.tool-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.tool-card,
.tool-edit-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 36, 0.82);
  padding: 16px;
}

.tool-card h3 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.tool-card p {
  color: var(--muted);
}

.tool-card small {
  display: block;
  color: #dce6f4;
  overflow-wrap: anywhere;
}

.tool-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 950;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  max-width: 760px;
  font-size: clamp(2rem, 5vw, 4.5rem);
  line-height: 0.98;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.3rem, 3vw, 2rem);
}

.hero p,
.lead,
.rich-text,
.game-card p,
.download-card p,
.auth-panel p,
.admin-head p {
  color: var(--muted);
}

.hero p {
  max-width: 620px;
  font-size: 1.04rem;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 7, 13, 0.54);
  padding: 8px;
}

input,
textarea,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.065);
  color: var(--ink);
  outline: 0;
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #748197;
}

input:focus,
textarea:focus {
  border-color: rgba(53, 208, 255, 0.78);
  box-shadow: 0 0 0 3px rgba(53, 208, 255, 0.13);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.chip,
.code-pill,
.count-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.065);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
  text-decoration: none;
  padding: 5px 10px;
}

.chip.active,
.count-pill {
  border-color: rgba(53, 208, 255, 0.62);
  background: rgba(53, 208, 255, 0.12);
  color: var(--accent);
}

.compact-head {
  margin: 22px 0 14px;
}

.top-filter-row {
  margin-top: 0;
}

.spotlight-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 14px;
  align-items: start;
  margin-bottom: 8px;
}

.mini-grid,
.latest-list {
  display: grid;
  gap: 12px;
}

.mini-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.compact-card {
  grid-template-rows: 96px minmax(0, 1fr);
}

.latest-list .compact-card {
  grid-template-columns: 96px minmax(0, 1fr);
  grid-template-rows: auto;
}

.latest-list .compact-card .cover-link {
  min-height: 74px;
}

.latest-list .compact-card .game-card-body {
  padding: 10px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.game-card {
  display: grid;
  grid-template-rows: 96px minmax(0, 1fr);
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 36, 0.82);
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.game-card:hover {
  border-color: rgba(53, 208, 255, 0.58);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34), 0 0 20px rgba(53, 208, 255, 0.08);
  transform: translateY(-2px);
}

.cover-link,
.detail-cover {
  position: relative;
  background: #101722;
  overflow: hidden;
}

.cover-link::after {
  position: absolute;
  inset: auto 0 0;
  height: 58%;
  background: linear-gradient(180deg, transparent, rgba(4, 8, 13, 0.9));
  content: "";
}

.cover-link img,
.detail-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-badge {
  position: absolute;
  right: 7px;
  bottom: 7px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.54);
  color: var(--accent-3);
  font-size: 0.68rem;
  font-weight: 900;
  padding: 2px 6px;
}

.feature-badge {
  position: absolute;
  left: 7px;
  top: 7px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  border-radius: 7px;
  background: rgba(255, 184, 77, 0.92);
  color: #171008;
  font-size: 0.68rem;
  font-weight: 950;
  padding: 2px 6px;
}

.game-card-body {
  display: grid;
  gap: 6px;
  padding: 9px;
}

.game-card h2 {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.22;
}

.game-card h2 a {
  text-decoration: none;
}

.game-card h2 a:hover {
  color: var(--accent);
}

.game-card p {
  display: -webkit-box;
  min-height: 0;
  margin-bottom: 0;
  overflow: hidden;
  font-size: 0.8rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.game-card .button {
  display: none;
}

.game-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.game-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.075);
  color: #bac6d8;
  font-size: 0.66rem;
  font-weight: 850;
  padding: 2px 6px;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 26px;
  padding: 20px;
}

.detail-cover {
  min-height: 460px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.detail-main {
  min-width: 0;
  align-self: center;
}

.lead {
  font-size: 1.08rem;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.detail-stats span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  padding: 12px;
  overflow-wrap: anywhere;
}

.detail-stats strong {
  display: block;
  color: var(--ink);
  font-size: 1.08rem;
}

.rich-text {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.section-head,
.admin-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 26px 0 14px;
}

.download-list {
  display: grid;
  gap: 12px;
}

.resource-group {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.resource-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.resource-group-head h3 {
  margin: 0;
  font-size: 1.15rem;
}

.resource-group-head span {
  color: var(--muted);
  font-size: 0.9rem;
}

.copy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.copy-button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 8px;
}

.status-tag {
  border-color: rgba(53, 208, 255, 0.3);
}

.status-recommended {
  color: #171008 !important;
  background: rgba(255, 184, 77, 0.92) !important;
}

.status-broken {
  color: #ffd3d3 !important;
  background: rgba(255, 107, 107, 0.2) !important;
}

.status-backup {
  color: var(--accent-3) !important;
  background: rgba(123, 255, 178, 0.12) !important;
}

.screenshot-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.screenshot-strip figure,
.admin-shot {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 36, 0.82);
  overflow: hidden;
}

.screenshot-strip img,
.admin-shot img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.screenshot-strip figcaption,
.admin-shot figcaption {
  color: var(--muted);
  font-size: 0.78rem;
  padding: 7px 8px;
}

.download-gate {
  max-width: 760px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 24, 36, 0.92), rgba(12, 16, 25, 0.9));
  box-shadow: var(--shadow);
  padding: 22px;
}

.download-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.download-field {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 10px;
}

.download-field span {
  color: var(--muted);
  font-size: 0.78rem;
}

.download-field strong {
  overflow-wrap: anywhere;
}

.download-note {
  color: var(--muted);
  margin-bottom: 14px;
}

.disclaimer-box {
  border: 1px solid rgba(255, 184, 77, 0.28);
  border-radius: 8px;
  background: rgba(255, 184, 77, 0.08);
  color: #d6deea;
  font-size: 0.84rem;
  line-height: 1.65;
  padding: 10px 12px;
}

.download-disclaimer {
  margin: 12px 0 14px;
}

.site-footer {
  max-width: 1240px;
  margin: 10px auto 0;
  padding: 0 24px 28px;
}

.site-footer p {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.7;
  margin: 0;
  padding-top: 14px;
}

.admin-shot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.admin-shot form {
  padding: 0 8px 8px;
}

.admin-shot button {
  width: 100%;
  min-height: 30px;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 107, 107, 0.16);
  color: #ffd3d3;
  cursor: pointer;
  font-weight: 800;
}

.download-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(53, 208, 255, 0.08), transparent 38%),
    rgba(18, 24, 36, 0.86);
  padding: 16px;
}

.download-card h3 {
  margin: 8px 0 6px;
}

.download-action {
  min-width: 128px;
}

.code-pill {
  color: var(--accent-2);
}

.code-pill.muted {
  color: var(--muted);
}

.empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.auth-panel,
.message-panel {
  max-width: 540px;
  margin: 42px auto;
  padding: 24px;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form label {
  display: grid;
  gap: 7px;
  color: #d6deea;
  font-weight: 850;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-subsection {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(53, 208, 255, 0.08), transparent 36%),
    rgba(255, 255, 255, 0.035);
  padding: 14px;
}

.form-subsection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.form-subsection-head h2 {
  margin: 0;
  font-size: 1rem;
}

.download-link-list {
  display: grid;
  gap: 10px;
}

.download-link-row {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 12px;
}

.download-link-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.download-link-row-head strong {
  color: var(--ink);
}

.check-row {
  display: flex !important;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px !important;
}

.check-row input {
  width: auto;
}

.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.full-field {
  grid-column: 1 / -1;
}

.cover-preview {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 10px;
}

.cover-preview img {
  width: 120px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
}

.cover-preview span {
  color: var(--muted);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.delete-inline-form {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.delete-inline-form button {
  min-height: 38px;
  border: 1px solid rgba(255, 107, 107, 0.35);
  border-radius: 8px;
  background: rgba(255, 107, 107, 0.12);
  color: #ffd3d3;
  cursor: pointer;
  font-weight: 850;
  padding: 8px 14px;
}

.form-panel,
.table-panel {
  padding: 18px;
}

.form-error {
  border: 1px solid rgba(255, 107, 107, 0.45);
  border-radius: 8px;
  background: rgba(255, 107, 107, 0.12);
  color: #ffd3d3;
  padding: 10px 12px;
}

.success-message {
  border: 1px solid rgba(123, 255, 178, 0.35);
  border-radius: 8px;
  background: rgba(123, 255, 178, 0.1);
  color: var(--accent-3);
  padding: 10px 12px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 36, 0.82);
  padding: 12px;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.stat-card strong {
  display: block;
  margin-top: 4px;
  font-size: 1.65rem;
}

.admin-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.8fr);
  gap: 14px;
  align-items: start;
}

.filter-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 24, 36, 0.9), rgba(12, 16, 25, 0.88));
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  padding: 12px;
}

.admin-filter-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(3, minmax(120px, auto)) auto auto;
  gap: 8px;
  align-items: center;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.86rem;
}

td small {
  display: block;
  max-width: 360px;
  margin-top: 4px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.table-actions {
  white-space: nowrap;
}

.table-actions a,
.table-actions button {
  display: inline-flex;
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font-weight: 850;
  text-decoration: none;
  padding: 4px 6px;
}

.table-actions button {
  color: var(--danger);
}

.table-actions form {
  display: inline;
}

.transfer-settings {
  margin-bottom: 12px;
}

.helper-text {
  margin: 10px 0 0;
}

.transfer-table td {
  vertical-align: top;
}

.transfer-table a {
  display: inline-block;
  max-width: 360px;
  overflow-wrap: anywhere;
}

.transfer-actions {
  min-width: 210px;
}

.inline-edit {
  max-width: 260px;
}

.inline-edit summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 850;
}

.inline-edit form {
  display: grid;
  gap: 7px;
  margin-top: 8px;
}

.inline-edit input {
  min-height: 36px;
  width: 100%;
}

.danger-text {
  display: block;
  color: #ffd3d3;
  margin-top: 6px;
}

.draft-preview-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.42fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  margin-bottom: 16px;
}

.draft-preview-cover {
  min-height: 260px;
}

.draft-link-row .resource-main {
  min-width: 0;
}

.source-text-card {
  max-height: 420px;
  overflow: auto;
}

.transfer-status-pending,
.transfer-status-running {
  color: var(--accent);
}

.transfer-status-success {
  color: var(--accent-3);
}

.transfer-status-failed,
.transfer-status-needs_login,
.transfer-status-needs_verify,
.transfer-status-needs_manual {
  color: #ffd3d3;
}

@media (max-width: 900px) {
  .site-header,
  .section-head,
  .admin-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .top-search-header {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .header-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .hero,
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .spotlight-layout {
    grid-template-columns: 1fr;
  }

  .hero::after {
    display: none;
  }

  .announcement-banner summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .announcement-brief {
    grid-column: 1 / -1;
  }

  .essential-tool {
    grid-template-columns: 74px minmax(0, 1fr);
  }

  .essential-tool-visual {
    width: 74px;
  }

  .essential-tool-action {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .essential-tool-action .button,
  .essential-tool-action .count-pill {
    width: 100%;
  }

  .tool-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-cover {
    min-height: 300px;
  }

  .download-card {
    grid-template-columns: 1fr;
  }

  .draft-preview-layout {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .detail-stats {
    grid-template-columns: 1fr;
  }

.table-panel {
  overflow-x: auto;
}

.admin-batch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 36, 0.72);
  margin: 12px 0;
  padding: 12px;
}

.admin-batch-bar small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
}

  table {
    min-width: 760px;
  }
}

@media (max-width: 560px) {
  .site-header,
  main {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero,
  .detail-hero,
  .form-panel,
  .table-panel,
  .auth-panel {
    padding: 14px;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .header-search {
    grid-template-columns: 1fr;
  }

  .game-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .game-card {
    grid-template-columns: 118px minmax(0, 1fr);
    grid-template-rows: auto;
  }

  .game-card .cover-link {
    min-height: 82px;
  }

  .game-card h2 {
    font-size: 0.92rem;
  }

  .game-card p {
    -webkit-line-clamp: 1;
  }

  .latest-list .compact-card {
    grid-template-columns: 118px minmax(0, 1fr);
  }

  .latest-list .compact-card .cover-link {
    min-height: 82px;
  }

  .cover-preview {
    grid-template-columns: 1fr;
  }

  .cover-preview img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
}

/* Dense library mode: show many resources without oversized cards. */
.spotlight-layout {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.7fr);
  gap: 12px;
  margin-bottom: 4px;
}

.mini-grid,
.latest-list,
.game-grid {
  gap: 8px;
}

.mini-grid,
.game-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.game-card,
.compact-card,
.latest-list .compact-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  grid-template-rows: auto;
  min-height: 78px;
}

.game-card .cover-link,
.compact-card .cover-link,
.latest-list .compact-card .cover-link {
  width: 112px;
  min-height: 78px;
  height: 78px;
}

.game-card-body,
.latest-list .compact-card .game-card-body {
  align-content: center;
  gap: 4px;
  min-width: 0;
  padding: 8px 9px;
}

.game-card h2 {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.88rem;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.game-card p {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.75rem;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.game-meta {
  gap: 3px;
}

.game-meta span {
  min-height: 18px;
  border-radius: 5px;
  font-size: 0.62rem;
  padding: 1px 5px;
}

.cover-badge,
.feature-badge {
  min-height: 18px;
  border-radius: 5px;
  font-size: 0.62rem;
  padding: 1px 5px;
}

.cover-badge {
  right: 5px;
  bottom: 5px;
}

.feature-badge {
  left: 5px;
  top: 5px;
}

.section-head.compact-head {
  margin: 12px 0 8px;
}

.filter-row {
  margin: 8px 0 10px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin: 18px auto 6px;
  padding: 2px 0;
  text-align: center;
}

.page-link,
.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  margin: 0 1px;
  padding: 6px 11px;
}

.page-link:hover {
  border-color: rgba(53, 208, 255, 0.56);
  color: var(--accent);
}

.page-link.active {
  border-color: rgba(53, 208, 255, 0.72);
  background: rgba(53, 208, 255, 0.15);
  color: var(--accent);
}

.page-link.disabled {
  opacity: 0.45;
  pointer-events: none;
}

.page-ellipsis {
  min-width: 26px;
  border-color: transparent;
  background: transparent;
  padding-inline: 2px;
}

@media (max-width: 900px) {
  .spotlight-layout,
  .mini-grid,
  .game-grid {
    grid-template-columns: 1fr;
  }

  .admin-two-col,
  .admin-filter-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .pagination {
    gap: 7px;
    margin-top: 14px;
  }

  .page-link,
  .page-ellipsis {
    min-width: 34px;
    min-height: 32px;
    padding: 5px 9px;
  }

  .game-card,
  .compact-card,
  .latest-list .compact-card {
    grid-template-columns: 104px minmax(0, 1fr);
    min-height: 72px;
  }

  .game-card .cover-link,
  .compact-card .cover-link,
  .latest-list .compact-card .cover-link {
    width: 104px;
    min-height: 72px;
    height: 72px;
  }

  .game-card-body,
  .latest-list .compact-card .game-card-body {
    padding: 6px 8px;
  }
}

/* Game detail profile layout */
.game-detail-page {
  display: grid;
  gap: 18px;
}

.game-profile {
  display: grid;
  grid-template-columns: minmax(220px, 310px) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(53, 208, 255, 0.13), transparent 32%),
    linear-gradient(315deg, rgba(255, 184, 77, 0.1), transparent 34%),
    rgba(18, 24, 36, 0.88);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  padding: 16px;
  overflow: hidden;
}

.profile-cover {
  position: relative;
  min-height: 0;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111824;
  overflow: hidden;
}

.profile-cover::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 42%, rgba(4, 8, 13, 0.82)),
    linear-gradient(90deg, transparent 72%, rgba(18, 24, 36, 0.9));
  content: "";
}

.profile-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info {
  display: grid;
  align-content: center;
  gap: 12px;
  min-width: 0;
  padding: 2px 4px 2px 0;
}

.profile-info h1 {
  margin: 0;
  font-size: clamp(1.75rem, 2.6vw, 3rem);
  line-height: 1.05;
}

.profile-summary {
  max-width: 780px;
  color: #cdd7e7;
  font-size: 1rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 620px;
}

.profile-stats span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 0.82rem;
  padding: 9px 10px;
  overflow-wrap: anywhere;
}

.profile-stats strong {
  display: block;
  color: var(--ink);
  font-size: 1.1rem;
  line-height: 1.2;
}

.profile-desc {
  display: -webkit-box;
  max-width: 820px;
  color: var(--muted);
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.game-intro-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 36, 0.62);
  color: #dce6f4;
  line-height: 1.68;
  padding: 14px;
  overflow-wrap: anywhere;
}

.preview-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.preview-controls .copy-button {
  width: 32px;
  min-height: 32px;
  padding: 0;
  font-size: 1.1rem;
}

.preview-strip {
  display: grid;
  grid-auto-columns: minmax(260px, 42%);
  grid-auto-flow: column;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
}

.preview-strip::-webkit-scrollbar {
  height: 8px;
}

.preview-strip::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(53, 208, 255, 0.35);
}

.preview-card {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 36, 0.82);
  overflow: hidden;
  scroll-snap-align: start;
}

.preview-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.preview-card figcaption {
  color: var(--muted);
  font-size: 0.78rem;
  padding: 7px 8px;
}

.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.detail-info-block {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 36, 0.62);
  padding: 12px;
}

.detail-info-block h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.detail-info-block ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.info-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.info-list div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.info-list dt {
  color: var(--muted);
  font-size: 0.82rem;
}

.info-list dd {
  min-width: 0;
  margin: 0;
  color: #dce6f4;
  overflow-wrap: anywhere;
}

.detail-section {
  display: grid;
  gap: 12px;
}

.detail-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-top: 2px;
}

.detail-section-head h2 {
  margin: 0;
}

.detail-screenshots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 10px;
}

.detail-screenshots figure {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 36, 0.82);
  overflow: hidden;
}

.detail-screenshots img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.detail-screenshots figcaption {
  color: var(--muted);
  font-size: 0.78rem;
  padding: 7px 8px;
}

.group-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.group-nav a {
  min-height: 30px;
  border: 1px solid rgba(53, 208, 255, 0.28);
  border-radius: 7px;
  background: rgba(53, 208, 255, 0.09);
  color: #cbefff;
  font-size: 0.78rem;
  font-weight: 850;
  text-decoration: none;
  padding: 5px 9px;
}

.detail-resource-group {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 36, 0.62);
  padding: 12px;
}

.detail-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-group-head h3 {
  margin: 0;
  font-size: 1.02rem;
}

.detail-group-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.detail-resource-list {
  display: grid;
  gap: 8px;
}

.download-only-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 36, 0.62);
  padding: 12px;
}

.resource-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(53, 208, 255, 0.09), transparent 38%),
    rgba(255, 255, 255, 0.035);
  padding: 10px;
}

.resource-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.resource-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.resource-title-line h4 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 0.98rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-row p {
  display: -webkit-box;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.resource-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.resource-meta > span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
  color: #bfcade;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 8px;
}

.resource-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.resource-actions .button {
  min-height: 32px;
  padding: 6px 12px;
}

@media (max-width: 900px) {
  .game-profile {
    grid-template-columns: 220px minmax(0, 1fr);
    padding: 14px;
  }

  .profile-info {
    padding: 0;
  }

  .profile-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .game-profile {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 10px;
  }

  .profile-cover {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .profile-cover::after {
    background: linear-gradient(180deg, transparent 42%, rgba(4, 8, 13, 0.82));
  }

  .profile-info {
    padding: 2px;
  }

  .profile-info h1 {
    font-size: 1.55rem;
  }

  .profile-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .profile-stats span {
    font-size: 0.74rem;
    padding: 7px;
  }

  .profile-stats strong {
    font-size: 0.96rem;
  }

  .detail-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .group-nav {
    justify-content: flex-start;
  }

  .detail-screenshots {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .preview-strip {
    grid-auto-columns: minmax(230px, 86vw);
  }

  .resource-row {
    grid-template-columns: 1fr;
  }

  .resource-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 430px) {
  .profile-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .resource-title-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .resource-title-line h4 {
    white-space: normal;
  }

  .resource-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .resource-actions .button,
  .resource-actions .copy-button {
    justify-content: center;
    width: 100%;
  }
}
