:root {
  --bg: #07090f;
  --bg-raise: #10182a;
  --line: rgba(212, 175, 92, 0.38);
  --gold: #d4af5c;
  --gold-2: #f0d48a;
  --ink: #1a1408;
  --text: #f6f1e6;
  --muted: #a7b0c3;
  --danger: #ffb4a8;
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
  --tg-height: 100dvh;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100dvh;
  background:
    radial-gradient(1100px 480px at 50% -12%, rgba(212, 175, 92, 0.16), transparent 58%),
    radial-gradient(700px 380px at 100% 0%, rgba(36, 72, 138, 0.32), transparent 52%),
    var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  line-height: 1.5;
}

img { max-width: 100%; }

button, input { font: inherit; }

a { color: inherit; }

[hidden] { display: none !important; }

.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;
}

.wrap {
  width: min(1680px, calc(100% - 28px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
  flex-wrap: wrap;
  min-height: 72px;
  padding: calc(10px + env(safe-area-inset-top)) 18px 10px;
  background: rgba(7, 9, 15, 0.9);
  border-bottom: 1px solid rgba(212, 175, 92, 0.22);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand img {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
}

.brand-text { min-width: 0; }

.brand-name,
.brand-sub { display: block; }

.brand-name {
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.brand-sub {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.16em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  text-decoration: none;
}

.nav a:hover,
.nav a:focus-visible { color: var(--gold-2); }

.hero {
  position: relative;
  margin-top: 18px;
  min-height: 210px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #10182a;
}

.hero-viewport {
  overflow: hidden;
  min-height: inherit;
}

.hero-track {
  display: flex;
  height: 100%;
  min-height: inherit;
  transition: transform 0.45s ease;
}

.slide {
  position: relative;
  display: flex;
  flex: 0 0 100%;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  min-height: 210px;
  padding: 22px 64px 42px;
  background-position: center;
  background-size: cover;
  color: inherit;
  text-decoration: none;
}

.slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 9, 15, 0.05), rgba(7, 9, 15, 0.86));
}

.slide-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  max-width: 760px;
}

.slide-icon {
  position: relative;
  z-index: 1;
  width: 108px;
  height: 108px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  object-fit: cover;
}

.kicker {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.18em;
}

.slide-title {
  margin: 6px 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(1.45rem, 3vw, 2.5rem);
  font-weight: 600;
  line-height: 1.25;
}

.slide-id { color: var(--muted); }

.hero-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(7, 9, 15, 0.55);
  color: var(--gold-2);
  font-size: 28px;
  line-height: 1;
  transform: translateY(-50%);
  cursor: pointer;
}

.hero-nav.prev { left: 10px; }
.hero-nav.next { right: 10px; }

.hero-dots {
  position: absolute;
  right: 0;
  bottom: 8px;
  left: 0;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 4px;
}

.dot {
  position: relative;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.dot::before {
  content: "";
  position: absolute;
  inset: 0;
  width: 8px;
  height: 8px;
  margin: auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}

.dot[aria-current="true"]::before {
  width: 18px;
  border-radius: 999px;
  background: var(--gold);
}

.tools { margin-top: 18px; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  padding: 4px 6px 4px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(16, 24, 42, 0.92);
}

.search:focus-within { border-color: var(--gold); }

.search input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
}

.text-btn,
.bar-btn {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}

.bar-btn.gold,
.text-btn {
  background: linear-gradient(180deg, #f0d48a, #b8903e);
  color: var(--ink);
  border-color: transparent;
  font-weight: 700;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(212, 175, 92, 0.35);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.chip.is-on {
  border-color: transparent;
  background: linear-gradient(180deg, #f0d48a, #b8903e);
  color: var(--ink);
}

.chip-count { font-size: 12px; opacity: 0.72; }

.section-head { margin: 26px 0 12px; }

.section-head h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 1.55rem;
  font-weight: 600;
}

.section-head p,
.about p,
.footer p {
  margin: 6px 0 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 92, 0.22);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(28, 40, 66, 0.96), rgba(10, 14, 24, 0.96));
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
}

.card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.cover {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #0c1220;
}

.cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pill {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(7, 9, 15, 0.72);
  color: var(--gold-2);
  font-size: 11px;
}

.pill.fail {
  right: 8px;
  left: auto;
  border-color: rgba(255, 180, 168, 0.7);
  color: var(--danger);
}

.meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 52px;
  padding: 10px 10px 12px;
}

.card-name {
  display: -webkit-box;
  overflow: hidden;
  min-height: 2.7em;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-id {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.empty,
.about,
.data-errors {
  border-radius: 16px;
}

.empty {
  margin-top: 12px;
  padding: 28px 16px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

.about {
  padding: 4px 2px 8px;
}

.data-errors {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 180, 168, 0.5);
  background: rgba(120, 32, 32, 0.35);
  color: #ffd7d1;
}

.footer {
  margin-top: 28px;
  padding: 22px 0 calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(212, 175, 92, 0.2);
  font-size: 13px;
}

.play-shell {
  display: flex;
  flex-direction: column;
  height: var(--tg-height);
  max-width: 100%;
}

.play-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: calc(8px + env(safe-area-inset-top)) 10px 8px;
  border-bottom: 1px solid rgba(212, 175, 92, 0.22);
  background: rgba(7, 9, 15, 0.94);
}

.play-title {
  flex: 1 1 160px;
  min-width: 0;
}

.play-title strong,
.play-title span { display: block; }

.play-title strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.play-title span {
  color: var(--gold);
  font-size: 12px;
}

.play-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.play-note {
  margin: 0;
  padding: 6px 12px;
  color: var(--muted);
  font-size: 12px;
  background: #0c1220;
}

.play-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #000;
}

.play-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.play-loading,
.play-fallback {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  background: rgba(7, 9, 15, 0.94);
  text-align: center;
}

.play-fallback h2 {
  margin: 0;
  font-family: "Songti SC", "STSong", "SimSun", serif;
}

.play-fallback p {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
}

.spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(212, 175, 92, 0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (hover: hover) {
  .card:hover {
    border-color: var(--gold);
    transform: translateY(-2px);
  }
}

.card:active { transform: scale(0.985); }

@media (min-width: 760px) {
  .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (min-width: 900px) {
  .hero,
  .slide { min-height: 340px; }
}

@media (min-width: 1100px) {
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (min-width: 1360px) {
  .grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .site-header { padding-inline: 12px; }
  .brand-name { font-size: 1.02rem; }
  .wrap { width: calc(100% - 20px); }
  .slide { padding: 18px 46px 36px; }
  .slide-icon { width: 76px; height: 76px; border-radius: 18px; }
}

.account-chip {
  display: inline-flex;
  align-items: center;
  max-width: 180px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--gold-2);
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.66);
}

.account-dialog {
  position: relative;
  width: min(420px, 100%);
  padding: 22px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #10182a;
  box-shadow: var(--shadow);
}

.account-dialog h2 {
  margin: 0 0 8px;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 1.6rem;
}

.account-dialog label {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.account-dialog input {
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #07090f;
  color: var(--text);
  font-size: 16px;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.account-error {
  margin: 12px 0 0;
  color: var(--danger);
}

.account-rule,
.account-log p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.points-balance {
  margin: 4px 0 0;
  color: var(--gold-2);
  font-size: 2.4rem;
  line-height: 1.1;
}

.account-close {
  position: absolute;
  top: 12px;
  right: 12px;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.points-toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 50;
  max-width: calc(100% - 28px);
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(16, 24, 42, 0.96);
  color: var(--gold-2);
  transform: translateX(-50%);
}

@media (prefers-reduced-motion: reduce) {
  .hero-track { transition: none; }
  .spinner { animation: none; }
  .card:hover,
  .card:active { transform: none; }
}
