:root {
  --bg: #080b14;
  --bg-soft: #0c111d;
  --panel: rgba(17, 23, 39, 0.78);
  --panel-solid: #111726;
  --text: #f3f6ff;
  --muted: #8d96ae;
  --muted-2: #667089;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --mint: #7cf7d4;
  --pink: #ff6ec7;
  --violet: #8a7dff;
  --gold: #ffd166;
  --danger: #ff7a8a;
  --radius: 18px;
  --wrap: 1320px;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 12% -8%, rgba(124, 247, 212, 0.11), transparent 60%),
    radial-gradient(900px 600px at 88% 2%, rgba(255, 110, 199, 0.11), transparent 62%),
    radial-gradient(1000px 700px at 50% 110%, rgba(138, 125, 255, 0.1), transparent 65%),
    var(--bg);
  font-family: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.18;
  pointer-events: none;
}

.ambient-a {
  top: 18vh;
  left: -180px;
  background: var(--mint);
}

.ambient-b {
  top: 40vh;
  right: -180px;
  background: var(--pink);
}

.wrap {
  width: min(var(--wrap), calc(100% - 48px));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 11, 20, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #04110d;
  background: linear-gradient(135deg, var(--mint), #4ed7ff);
  font-size: 17px;
  font-weight: 800;
  box-shadow: 0 0 24px rgba(124, 247, 212, 0.25);
}

.account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 5px 7px 5px 12px;
  border: 1px solid rgba(124, 247, 212, 0.2);
  border-radius: 999px;
  color: #bfffe9;
  background: rgba(124, 247, 212, 0.07);
  font-size: 12px;
  white-space: nowrap;
}

.account-label {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.03em;
}

.account strong {
  max-width: 16ch;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.account-quota {
  padding-left: 8px;
  border-left: 1px solid rgba(124, 247, 212, 0.18);
  color: #9ef2d8;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.account-edit {
  height: 24px;
  padding: 0 10px;
  border: 1px solid rgba(124, 247, 212, 0.24);
  border-radius: 999px;
  color: #bfffe9;
  background: rgba(124, 247, 212, 0.08);
  font: inherit;
  font-size: 11px;
  cursor: pointer;
}

.account-edit:hover {
  background: rgba(124, 247, 212, 0.16);
}

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

.hero {
  padding: 64px 0 34px;
}

.kicker {
  margin: 0 0 16px;
  color: var(--mint);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.hero h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(38px, 6.2vw, 78px);
  font-weight: 760;
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--mint) 0%, #8ee8ff 38%, var(--pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  max-width: 620px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.lede strong {
  color: var(--text);
  font-weight: 700;
}

/* 身份输入放在不可关闭的首次弹窗里，页面本身不再放 QQ 输入框。 */

/* ---------- toolbar ---------- */

.board {
  padding-bottom: 40px;
}

.toolbar {
  position: sticky;
  top: 58px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 10px 0 20px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(9, 13, 23, 0.82);
  backdrop-filter: blur(18px);
}

.search {
  position: relative;
  flex: 1 1 280px;
  min-width: 200px;
}

.search-icon {
  position: absolute;
  top: 50%;
  left: 13px;
  transform: translateY(-52%);
  color: var(--muted-2);
  font-size: 18px;
  line-height: 1;
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  font: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.18s, background 0.18s;
}

.search input:focus {
  border-color: rgba(124, 247, 212, 0.45);
  background: rgba(255, 255, 255, 0.055);
}

.search input::placeholder {
  color: var(--muted-2);
}

.select-wrap {
  position: relative;
  flex: 0 0 auto;
}

.select-wrap select {
  height: 40px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: #d7deee;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 15px) 17px / 5px 5px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 10px) 17px / 5px 5px no-repeat,
    rgba(255, 255, 255, 0.035);
  background-color: var(--panel-solid);
  font: inherit;
  font-size: 12.5px;
  outline: none;
  appearance: none;
  cursor: pointer;
}

.select-wrap select option,
.select-wrap select optgroup {
  color: var(--text);
  background-color: var(--panel-solid);
}

.select-wrap select:focus {
  border-color: rgba(124, 247, 212, 0.45);
}

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

.boot {
  margin: 48px 0;
  color: var(--muted-2);
  text-align: center;
  font-size: 13px;
}

.boot.error {
  color: var(--danger);
}

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

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(23, 30, 49, 0.86), rgba(13, 18, 31, 0.9));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(124, 247, 212, 0.28);
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.32);
}

.card.is-voted {
  border-color: rgba(124, 247, 212, 0.4);
  box-shadow: 0 0 0 1px rgba(124, 247, 212, 0.12), 0 15px 34px rgba(0, 0, 0, 0.25);
}

.card[hidden] {
  display: none;
}

.cover {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #0a0e19;
}

.cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease, filter 0.3s ease;
}

.card:hover .cover img {
  transform: scale(1.045);
}

.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(4, 7, 14, 0.02) 52%, rgba(4, 7, 14, 0.62) 100%);
  pointer-events: none;
}

.cover-fallback {
  display: grid;
  place-content: center;
  gap: 6px;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(240px 120px at 50% 30%, rgba(124, 247, 212, 0.12), transparent 70%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 12px),
    #0a0e19;
  color: var(--muted-2);
  text-align: center;
  font-size: 11.5px;
  letter-spacing: 0.08em;
}

.cover-fallback b {
  color: rgba(124, 247, 212, 0.65);
  font-size: 24px;
  font-weight: 500;
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 13px 14px 14px;
}

.card-title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 680;
  line-height: 1.36;
  letter-spacing: -0.01em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-artist {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.tag {
  max-width: 100%;
  overflow: hidden;
  padding: 3px 7px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 5px;
  color: #aab4c9;
  background: rgba(255, 255, 255, 0.04);
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag.game {
  color: #bfffe9;
  border-color: rgba(124, 247, 212, 0.16);
  background: rgba(124, 247, 212, 0.07);
}

.tag.section {
  color: #ffd8f2;
  border-color: rgba(255, 110, 199, 0.16);
  background: rgba(255, 110, 199, 0.07);
}

.actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
}

.action-btn {
  display: inline-flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: #dbe4f7;
  background: rgba(255, 255, 255, 0.045);
  font: inherit;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, filter 0.18s, transform 0.18s,
    opacity 0.18s;
}

.action-btn:hover:not(:disabled) {
  border-color: rgba(124, 247, 212, 0.32);
  background: rgba(124, 247, 212, 0.09);
}

.action-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.action-btn:disabled {
  color: #7f8a9f;
  background: rgba(255, 255, 255, 0.035);
  cursor: not-allowed;
  opacity: 0.72;
}

.vote-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.vote-actions .action-btn {
  flex: 1 1 0;
}

.vote-normal {
  border-color: transparent;
  color: #04120d;
  background: linear-gradient(135deg, var(--mint), #55dfc0);
  font-weight: 750;
}

.vote-normal:hover:not(:disabled) {
  border-color: transparent;
  background: linear-gradient(135deg, #9bffe3, #68efd3);
  filter: brightness(1.03);
}

.vote-favorite {
  border-color: rgba(255, 110, 199, 0.28);
  color: #ffd8f2;
  background: linear-gradient(135deg, rgba(255, 110, 199, 0.22), rgba(138, 125, 255, 0.17));
  font-weight: 750;
}

.vote-favorite:hover:not(:disabled) {
  border-color: rgba(255, 110, 199, 0.5);
  background: linear-gradient(135deg, rgba(255, 110, 199, 0.32), rgba(138, 125, 255, 0.25));
}

.voted-row {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.vote-badge {
  display: inline-flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 34px;
  padding: 0 8px;
  border: 1px solid rgba(124, 247, 212, 0.3);
  border-radius: 9px;
  color: var(--mint);
  background: rgba(124, 247, 212, 0.09);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.vote-badge[data-type="favorite"] {
  border-color: rgba(255, 110, 199, 0.32);
  color: #ffd8f2;
  background: rgba(255, 110, 199, 0.1);
}

.cancel-vote {
  flex: 0 0 auto;
  min-width: 86px;
  color: #cbd4e8;
}

.cancel-vote:hover:not(:disabled) {
  border-color: rgba(255, 122, 138, 0.32);
  color: #ffd9de;
  background: rgba(255, 122, 138, 0.08);
}

.secondary-actions {
  margin-top: auto;
  padding-top: 8px;
}

.comment-btn {
  color: #ffd8f2;
  border-color: rgba(255, 110, 199, 0.2);
  background: rgba(255, 110, 199, 0.07);
}

.comment-btn:hover:not(:disabled) {
  border-color: rgba(255, 110, 199, 0.36);
  background: rgba(255, 110, 199, 0.13);
}

.empty {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 60px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.empty strong {
  color: var(--text);
  font-size: 15px;
}

.empty span {
  font-size: 12.5px;
}

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

.footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 26px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 11px;
}

.footer p {
  margin: 0;
}

.footer-dim {
  opacity: 0.72;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 200;
  max-width: min(420px, calc(100% - 32px));
  padding: 11px 16px;
  border: 1px solid rgba(124, 247, 212, 0.25);
  border-radius: 10px;
  color: #d8fff4;
  background: rgba(10, 20, 24, 0.94);
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  border-color: rgba(255, 122, 138, 0.3);
  color: #ffd9de;
  background: rgba(26, 10, 15, 0.95);
}

/* ---------- modals ---------- */

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(3, 6, 12, 0.78);
  backdrop-filter: blur(10px);
}

.modal {
  width: min(460px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background:
    radial-gradient(420px 180px at 20% 0%, rgba(124, 247, 212, 0.1), transparent 70%),
    linear-gradient(180deg, #151d30, #0d1320);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-kicker {
  margin: 0 0 8px;
  color: var(--mint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.modal h2 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.modal-desc {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.modal-input,
.modal-textarea {
  width: 100%;
  margin-top: 18px;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--text);
  background: rgba(4, 7, 14, 0.65);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.modal-input {
  height: 44px;
  letter-spacing: 0.09em;
}

.modal-textarea {
  min-height: 132px;
  line-height: 1.65;
  resize: vertical;
}

.modal-input:focus,
.modal-textarea:focus {
  border-color: rgba(124, 247, 212, 0.62);
  box-shadow: 0 0 0 3px rgba(124, 247, 212, 0.1);
}

.modal-input::placeholder,
.modal-textarea::placeholder {
  color: var(--muted-2);
  letter-spacing: 0;
}

.modal-hint {
  margin: 9px 0 0;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.55;
}

.modal-hint.error {
  color: var(--danger);
}

.comment-meta {
  display: flex;
  justify-content: flex-end;
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
}

.btn {
  height: 38px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.18s, background 0.18s, opacity 0.18s, transform 0.18s;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn.primary {
  color: #04120d;
  background: linear-gradient(135deg, var(--mint), #55dfc0);
}

.btn.primary:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn.ghost {
  color: #cbd4e8;
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
}

.btn.ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.09);
}

.btn:disabled {
  color: #7f8a9f;
  background: rgba(255, 255, 255, 0.07);
  cursor: default;
  opacity: 0.8;
}

.icon-btn {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 200;
  padding: 12px 16px;
  border-radius: 10px;
  color: #ffd9de;
  background: #301018;
  text-align: center;
  font-size: 13px;
}

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

@media (max-width: 820px) {
  .wrap {
    width: calc(100% - 32px);
  }

  .hero {
    padding-top: 42px;
  }

  .toolbar {
    position: static;
    padding: 9px;
  }

  .search {
    flex-basis: 100%;
  }

  .select-wrap {
    flex: 1;
  }

  .select-wrap select {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .topbar-inner {
    min-height: 54px;
  }

  .brand span:last-child {
    display: none;
  }

  .hero h1 {
    font-size: clamp(34px, 10vw, 46px);
  }

  .lede {
    font-size: 13.5px;
  }

  .account {
    gap: 6px;
    padding-left: 9px;
  }

  .account-label {
    display: none;
  }

  .account-quota {
    padding-left: 6px;
    font-size: 10px;
  }

  .modal {
    padding: 20px;
  }

  .modal h2 {
    font-size: 19px;
  }

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

  .cover {
    aspect-ratio: 16 / 10;
  }

  .footer {
    display: block;
    line-height: 1.7;
  }

  .footer-dim {
    margin-top: 6px !important;
  }
}

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