:root {
  color-scheme: dark;
  --page: #10111a;
  --page-soft: #161722;
  --card: #20212e;
  --card-strong: #282a3a;
  --line: rgba(255, 255, 255, 0.09);
  --muted: #9296aa;
  --text: #f7f7fb;
  --gold: #ffb52c;
  --orange: #ff7a00;
  --violet: #7258ff;
  --green: #41d991;
  --pink: #ed347f;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #080910;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--page);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

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

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.is-hidden {
  display: none !important;
}

.desktop-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, rgba(104, 58, 255, 0.13), transparent 33%),
    #070810;
}

.gate-grid {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(150, 125, 255, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 125, 255, 0.18) 1px, transparent 1px);
  background-size: 84px 84px;
  mask-image: radial-gradient(circle, #000 20%, transparent 70%);
}

.gate-card {
  position: relative;
  width: min(430px, calc(100vw - 48px));
  padding: 38px 36px 34px;
  border: 1px solid rgba(134, 91, 255, 0.22);
  border-radius: 40px;
  background: linear-gradient(145deg, rgba(25, 23, 44, 0.88), rgba(8, 9, 18, 0.94));
  box-shadow:
    0 40px 120px rgba(0, 0, 0, 0.58),
    inset 0 1px rgba(255, 255, 255, 0.03);
  text-align: center;
}

.gate-phone {
  position: relative;
  width: 140px;
  height: 244px;
  margin: 0 auto 20px;
  overflow: hidden;
  border: 3px solid transparent;
  border-radius: 34px;
  background:
    linear-gradient(#090a12, #090a12) padding-box,
    linear-gradient(145deg, #ff6da8, #8b5cff 46%, #1de6da) border-box;
  box-shadow:
    0 0 45px rgba(91, 87, 255, 0.3),
    inset 0 0 50px rgba(68, 37, 133, 0.22);
}

.gate-phone span {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  color: #69697d;
  font-size: 11px;
  letter-spacing: 0.45em;
}

.gate-island {
  position: absolute;
  top: 12px;
  left: 50%;
  width: 40px;
  height: 13px;
  border-radius: 99px;
  background: #020207;
  transform: translateX(-50%);
}

.gate-island::after {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8b5cff;
  box-shadow: 0 0 8px #8b5cff;
  content: "";
}

.gate-orbit,
.gate-core {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(127, 207, 255, 0.68);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.gate-orbit-one {
  width: 82px;
  height: 82px;
}

.gate-orbit-two {
  width: 61px;
  height: 61px;
  border-color: rgba(255, 96, 188, 0.52);
}

.gate-core {
  width: 5px;
  height: 5px;
  border: 0;
  background: #ed54b8;
  box-shadow: 0 0 14px #ed54b8;
}

.gate-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 17px;
  padding: 6px 11px;
  border: 1px solid rgba(65, 217, 145, 0.18);
  border-radius: 999px;
  background: rgba(65, 217, 145, 0.07);
  color: #88e9b9;
  font-size: 12px;
}

.gate-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #41d991;
  box-shadow: 0 0 12px #41d991;
}

.gate-card h1 {
  margin: 0 0 10px;
  font-size: 28px;
  letter-spacing: 0.02em;
}

.gate-card p {
  margin: 0 0 24px;
  color: #74788e;
  font-size: 14px;
}

.gate-preview {
  display: inline-flex;
  padding: 11px 18px;
  border: 1px solid rgba(135, 99, 255, 0.3);
  border-radius: 999px;
  color: #a995ff;
  font-size: 13px;
  transition: 0.2s ease;
}

.gate-preview:hover {
  border-color: rgba(135, 99, 255, 0.7);
  background: rgba(135, 99, 255, 0.08);
  color: #fff;
}

.gate-points {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 28px;
}

.gate-points i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #39394c;
}

.gate-points i:nth-child(2) {
  background: #7f5cff;
  box-shadow: 0 0 8px #7f5cff;
}

.app-shell {
  display: none;
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: 76px;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 4%, rgba(111, 71, 255, 0.08), transparent 22%),
    var(--page);
}

html.preview-mobile .desktop-gate {
  display: none;
}

html.preview-mobile .app-shell {
  display: block;
  box-shadow: 0 0 80px #000;
}

.sticky-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
  background: rgba(16, 17, 26, 0.96);
  backdrop-filter: blur(16px);
}

.notice-bar {
  height: 30px;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 181, 44, 0.13);
  background: linear-gradient(90deg, #191626, #1f1a31, #191626);
  color: #ffd06b;
  font-size: 12px;
  line-height: 30px;
}

.notice-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  animation: notice-scroll 22s linear infinite;
}

.notice-track span {
  padding: 0 42px;
}

@keyframes notice-scroll {
  to {
    transform: translateX(-50%);
  }
}

.category-tabs {
  display: flex;
  gap: 7px;
  padding: 8px 10px 5px;
}

.category-tab {
  flex: 1;
  min-width: 0;
  height: 35px;
  padding: 0 3px;
  border: 1px solid rgba(255, 181, 44, 0.26);
  border-radius: 999px;
  background: rgba(255, 181, 44, 0.045);
  color: #b9bac4;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  transition: 0.18s ease;
}

.category-tab span {
  margin-right: 2px;
  font-size: 14px;
}

.category-tab.is-active {
  border-color: #ffac20;
  background: linear-gradient(135deg, #ff7500, #ffb229);
  box-shadow: 0 5px 18px rgba(255, 125, 0, 0.29);
  color: #fff;
  transform: translateY(-1px);
}

.search-box {
  margin: 0;
  padding: 6px 12px 4px;
}

.search-inner {
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.18);
}

.search-inner svg {
  width: 20px;
  height: 20px;
  margin-left: 14px;
  fill: none;
  stroke: #23775b;
  stroke-linecap: round;
  stroke-width: 2;
}

.search-inner input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 8px 0 10px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #171823;
  font-size: 14px;
}

.search-inner input::placeholder {
  color: #7b7d88;
}

.search-inner button {
  height: 36px;
  margin-right: 4px;
  padding: 0 19px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff7a00, #ffbd38);
  box-shadow: 0 4px 12px rgba(255, 138, 0, 0.28);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.online-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  margin: 4px 12px 0;
  border: 1px solid rgba(255, 181, 44, 0.19);
  border-radius: 999px;
  background: rgba(5, 6, 11, 0.38);
  color: #ddd5cb;
  font-size: 13px;
}

.people-icon {
  font-size: 16px;
}

.online-pill strong {
  min-width: 45px;
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 17px;
}

.live-dot {
  width: 7px;
  height: 7px;
  margin-left: 2px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 9px var(--green);
  animation: live-pulse 1.5s ease-in-out infinite;
}

@keyframes live-pulse {
  50% {
    opacity: 0.35;
    transform: scale(0.75);
  }
}

.content-view {
  min-height: 70vh;
}

.sub-tabs {
  display: flex;
  gap: 9px;
  padding: 10px 12px 1px;
}

.sub-tabs button {
  flex: 1;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.sub-tabs button.is-active {
  border-color: rgba(255, 181, 44, 0.35);
  background: rgba(255, 181, 44, 0.1);
  color: var(--gold);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 12px 10px;
}

.section-heading > div {
  display: flex;
  align-items: center;
}

.heading-line {
  width: 4px;
  height: 24px;
  margin-right: 8px;
  border-radius: 99px;
  background: linear-gradient(#ffca57, #ff7a00);
  box-shadow: 0 0 10px rgba(255, 153, 0, 0.35);
}

.section-heading h2 {
  margin: 0;
  font-size: 16px;
}

.section-heading > span {
  color: #6f7284;
  font-size: 12px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 10px;
  padding: 0 12px 12px;
}

.resource-grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 7px;
}

.resource-grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px 6px;
}

.resource-card {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.resource-card:active .cover-frame {
  transform: scale(0.975);
}

.cover-frame {
  position: relative;
  display: block;
  aspect-ratio: 1.28 / 1;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.17);
  transition: transform 0.15s ease;
}

.cols-3 .cover-frame {
  aspect-ratio: 0.9 / 1;
}

.cols-4 .cover-frame {
  aspect-ratio: 1 / 0.78;
  border-radius: 9px;
}

.cover-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.free-tag {
  position: absolute;
  top: 0;
  left: 0;
  padding: 3px 8px 4px;
  border-radius: 0 0 10px;
  background: linear-gradient(135deg, #ff3e83, #ff7439);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.play-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  background: rgba(5, 6, 11, 0.42);
  backdrop-filter: blur(5px);
  color: #fff;
  font-size: 12px;
  transform: translate(-50%, -50%);
}

.play-mark::before {
  margin-left: 2px;
  content: "▶";
}

.card-meta {
  position: absolute;
  right: 7px;
  bottom: 6px;
  left: 7px;
  display: flex;
  justify-content: space-between;
  color: #fff;
  font-size: 10px;
  text-shadow: 0 1px 4px #000;
}

.complete-tag {
  position: absolute;
  right: 5px;
  bottom: 5px;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #c7c9d5;
  font-size: 9px;
}

.resource-card h3 {
  margin: 7px 1px 0;
  overflow: hidden;
  color: #eeeef4;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cols-3 .resource-card h3 {
  font-size: 11px;
}

.cols-4 .resource-card {
  overflow: hidden;
  padding-bottom: 6px;
  border-radius: 10px;
  background: var(--card);
}

.cols-4 .resource-card h3 {
  margin: 6px 6px 4px;
  font-size: 10px;
}

.card-action {
  display: block;
  margin: 0 5px;
  padding: 4px 2px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff7800, #ffb423);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.game-card .card-action {
  background: linear-gradient(135deg, #0abf8b, #1bcbd1);
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 7px;
  padding: 2px 12px 18px;
}

.pagination button {
  min-width: 32px;
  height: 32px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  background: var(--card);
  color: #9a9dad;
  font-size: 12px;
  font-weight: 700;
}

.pagination button.is-active {
  background: linear-gradient(135deg, #ff7900, #ffb52c);
  color: #fff;
}

.pagination button:disabled {
  opacity: 0.35;
}

.bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 60;
  display: flex;
  width: min(100%, 520px);
  height: 66px;
  margin: auto;
  padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(24, 25, 36, 0.94);
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(18px);
}

.bottom-nav button {
  flex: 1;
  border: 0;
  background: transparent;
  color: #6e7181;
}

.bottom-nav button.is-active {
  color: var(--gold);
}

.bottom-icon {
  display: block;
  width: 27px;
  height: 27px;
  margin: 0 auto 3px;
  border: 1px solid currentColor;
  border-radius: 9px;
  font-size: 17px;
  line-height: 25px;
}

.bottom-nav small {
  font-size: 10px;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  opacity: 0;
  pointer-events: none;
  background: rgba(3, 4, 9, 0.77);
  backdrop-filter: blur(10px);
  transition: opacity 0.25s ease;
}

.modal-layer.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.welcome-modal,
.access-modal {
  width: min(390px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  background:
    radial-gradient(circle at 100% 0, rgba(113, 77, 255, 0.16), transparent 31%),
    linear-gradient(145deg, #242534, #171822);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
  transform: translateY(18px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.modal-layer.is-visible .welcome-modal,
.modal-layer.is-visible .access-modal {
  transform: translateY(0) scale(1);
}

.welcome-modal {
  padding: 30px 24px 24px;
}

.welcome-mark {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  place-items: center;
  border: 1px solid rgba(255, 181, 44, 0.32);
  border-radius: 18px;
  background: rgba(255, 181, 44, 0.09);
  box-shadow: 0 0 30px rgba(255, 150, 0, 0.09);
  color: var(--gold);
  font-size: 27px;
}

.welcome-modal h2 {
  margin: 0 0 20px;
  text-align: center;
  font-size: 23px;
}

.welcome-list {
  display: grid;
  gap: 8px;
  margin-bottom: 22px;
}

.welcome-list p {
  display: flex;
  gap: 9px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.045);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: #c2c4d0;
  font-size: 13px;
}

.primary-button {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff7800, #ffbd32);
  box-shadow: 0 7px 22px rgba(255, 128, 0, 0.25);
  color: #fff;
  font-weight: 800;
}

.access-modal {
  position: relative;
  padding: 28px 18px 20px;
}

.modal-close {
  position: absolute;
  top: 11px;
  right: 13px;
  width: 35px;
  height: 35px;
  border: 0;
  background: transparent;
  color: #7e8293;
  font-size: 27px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--gold);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-align: center;
}

.access-modal h2 {
  margin: 0;
  font-size: 21px;
  text-align: center;
}

.access-subtitle {
  margin: 6px 0 15px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.modal-resource-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.035);
}

.modal-resource-card img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
}

.modal-resource-card strong {
  display: block;
  max-width: 220px;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-resource-card p {
  display: flex;
  gap: 13px;
  margin: 7px 0 0;
  color: #85899b;
  font-size: 11px;
}

.modal-resource-card b {
  font-weight: 500;
}

.action-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 53px;
  margin-top: 9px;
  border-radius: 13px;
  color: #fff;
}

.action-button strong {
  font-size: 16px;
}

.action-button small {
  margin-top: 2px;
  opacity: 0.75;
  font-size: 10px;
}

.free-action {
  background: linear-gradient(135deg, #ed347f, #d82273);
  box-shadow: 0 7px 18px rgba(237, 52, 127, 0.2);
}

.paid-action {
  background: linear-gradient(135deg, #ff7900, #ffb429);
}

.code-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.code-form input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(255, 181, 44, 0.52);
  border-radius: 11px;
  outline: 0;
  background: #fff;
  color: #171823;
  font-size: 14px;
}

.code-form input:focus {
  box-shadow: 0 0 0 3px rgba(255, 181, 44, 0.13);
}

.code-form button {
  min-width: 72px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #7458ff, #5a3be6);
  color: #fff;
  font-weight: 800;
}

.code-form button:disabled {
  opacity: 0.6;
}

.form-feedback {
  min-height: 18px;
  margin: 7px 2px 0;
  color: #ff7272;
  font-size: 11px;
  text-align: center;
}

.form-feedback.is-success {
  color: var(--green);
}

.unlock-link {
  display: block;
  margin-top: 7px;
  padding: 10px;
  border: 1px solid rgba(65, 217, 145, 0.3);
  border-radius: 11px;
  background: rgba(65, 217, 145, 0.08);
  color: #7de8b4;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.search-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 360px;
  padding: 44px 20px;
  text-align: center;
}

.search-spinner {
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.search-state h2 {
  margin: 0 0 8px;
  font-size: 19px;
}

.search-state > p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.folder-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 230px;
  margin: 26px 0 8px;
  padding: 20px;
  border: 1px solid rgba(255, 181, 44, 0.22);
  border-radius: 18px;
  background: rgba(255, 181, 44, 0.055);
}

.folder-result span {
  font-size: 48px;
}

.folder-result strong {
  margin-top: 8px;
  color: var(--gold);
  font-size: 16px;
}

.folder-result small {
  margin-top: 5px;
  color: var(--muted);
}

.text-button {
  margin-top: 18px;
  padding: 8px 13px;
  border: 0;
  border-bottom: 1px dashed #5e6172;
  background: transparent;
  color: #888c9e;
  font-size: 12px;
}

.empty-state {
  padding: 48px 20px;
  text-align: center;
}

.empty-state span {
  font-size: 52px;
}

.empty-state h3 {
  margin: 10px 0 5px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.toast {
  position: fixed;
  bottom: 94px;
  left: 50%;
  z-index: 400;
  max-width: calc(100vw - 40px);
  padding: 11px 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  background: rgba(7, 8, 14, 0.92);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 12px;
  text-align: center;
  transform: translate(-50%, 12px);
  transition: 0.22s ease;
}

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

@media (max-width: 760px) {
  .desktop-gate {
    display: none;
  }

  .app-shell {
    display: block;
  }
}

@media (min-width: 761px) {
  html.preview-mobile body {
    background:
      radial-gradient(circle at 50% 0, rgba(90, 66, 198, 0.11), transparent 30%),
      #080910;
  }
}

@media (max-width: 360px) {
  .category-tabs {
    gap: 4px;
    padding-right: 7px;
    padding-left: 7px;
  }

  .category-tab {
    font-size: 11px;
  }

  .category-tab span {
    display: none;
  }
}
