@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=Source+Serif+4:wght@400;600;700&display=swap');

:root {
  --bg: #f2f2f2;
  --bg-strong: #ffffff;
  --ink: #0e0e0e;
  --ink-soft: #4a4a4a;
  --color-text: var(--ink);
  --color-text-dim: var(--ink-soft);
  --color-primary: #111111;
  --color-accent: #6366f1;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-hover: rgba(255, 255, 255, 0.86);
  --glass-bg-active: rgba(255, 255, 255, 0.92);
  --glass-border: 1px solid rgba(255, 255, 255, 0.55);
  --glass-blur: blur(14px);
  --glass-shadow: var(--shadow);
  --glass-shadow-hover: 0 28px 46px rgba(0, 0, 0, 0.12);
  --glass-radius: var(--radius);
  --line: #d9d9d9;
  --skeleton-base: #e6e6e6;
  --skeleton-highlight: #f5f5f5;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --duration-fast: 160ms;
  --duration: 280ms;
  --duration-slow: 520ms;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-tap-highlight-color: transparent;
}

a,
button,
input,
textarea,
select,
label,
.glass-btn,
.glass-tab-trigger,
.button {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid rgba(99, 102, 241, 0.55);
  outline-offset: 2px;
}

body {
  margin: 0;
  font-family: 'Sora', sans-serif;
  color: var(--color-text);
  min-height: 100vh;
  overflow-x: hidden;
  background: #f7f7fb;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 215, 235, 0.75), transparent 45%),
    radial-gradient(circle at 80% 15%, rgba(210, 200, 255, 0.6), transparent 50%),
    radial-gradient(circle at 15% 80%, rgba(190, 240, 255, 0.65), transparent 55%),
    linear-gradient(160deg, #f7f5ff 0%, #f7fbff 50%, #fff7fb 100%);
  z-index: -1;
}

h1,
h2,
h3 {
  font-family: 'Source Serif 4', serif;
  letter-spacing: 0.5px;
  margin: 0;
}

p {
  margin: 0;
  color: var(--ink-soft);
}

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

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hero {
  padding: 80px 8vw 48px;
  display: grid;
  gap: 24px;
  align-items: center;
  position: relative;
  overflow: visible;
}

.hero.compact {
  display: flex;
  justify-content: center;
  padding: 96px 6vw 40px;
}

.hero.compact .hero-card {
  text-align: center;
  justify-items: center;
}

.hero.compact .hero-actions {
  justify-content: center;
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.04), transparent 70%);
  filter: blur(4px);
  animation: float 12s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

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

.hero::before {
  top: -120px;
  right: -120px;
}

.hero::after {
  bottom: -220px;
  left: -220px;
  background: radial-gradient(circle, rgba(120, 146, 214, 0.16), transparent 72%);
  opacity: 0.75;
  animation-delay: -6s;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(18px);
  }
}

.hero-card {
  padding: 28px;
  display: grid;
  gap: 16px;
  animation: fadeUp var(--duration-slow) ease;
}

.hero-card.compact {
  width: min(860px, 90vw);
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft);
}

.badge.status-enabled {
  border-color: #111111;
  color: #111111;
}

.badge.status-disabled {
  border-color: #b5b5b5;
  color: #7a7a7a;
}

.badge.status-expired {
  border-color: #c28d00;
  color: #a16d00;
}

.badge.status-full {
  border-color: #8a4b00;
  color: #8a4b00;
}

.glass-badge.status-enabled {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(16, 185, 129, 0.38);
  color: #065f46;
}

.glass-badge.status-disabled {
  background: rgba(148, 163, 184, 0.18);
  border-color: rgba(148, 163, 184, 0.38);
  color: #334155;
}

.glass-badge.status-expired {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.35);
  color: #92400e;
}

.glass-badge.status-full {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.35);
  color: #991b1b;
}

.glass-badge.status-info {
  background: rgba(99, 102, 241, 0.14);
  border-color: rgba(99, 102, 241, 0.32);
  color: #3730a3;
}

.glass-btn.small {
  padding: 0.45rem 0.8rem;
  border-radius: 10px;
  font-size: 0.82rem;
  touch-action: manipulation;
}

.glass-btn.ghost.small {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(17, 17, 17, 0.08);
  color: var(--color-primary);
}

.glass-btn.ghost.small:hover {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(17, 17, 17, 0.12);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.topbar-tabs {
  background: rgba(255, 255, 255, 0.62);
  border-color: rgba(17, 17, 17, 0.06);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
  flex-wrap: wrap;
}

.topbar-tabs .glass-tab-trigger {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.topbar-tabs .glass-tab-trigger[data-state='active'] {
  background: rgba(17, 17, 17, 0.92);
  color: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.14);
}

.topbar-tabs .glass-tab-trigger[data-state='active']:hover {
  background: rgba(17, 17, 17, 0.92);
  color: rgba(255, 255, 255, 0.96);
}

.glass-btn:disabled,
.glass-btn[disabled] {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
}

.glass-btn:disabled:hover,
.glass-btn[disabled]:hover {
  transform: none;
}

.glass-btn.primary:disabled,
.glass-btn.primary[disabled] {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(17, 17, 17, 0.08);
  color: rgba(17, 17, 17, 0.48);
  box-shadow: none;
}

.glass-btn.gradient:disabled,
.glass-btn.gradient[disabled] {
  opacity: 0.78;
  filter: saturate(0.75);
}

.glass-input,
.glass-textarea {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(17, 17, 17, 0.1);
}

.glass-input:hover,
.glass-textarea:hover {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(17, 17, 17, 0.14);
}

.glass-input:focus,
.glass-textarea:focus {
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.glass-input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.glass-input[readonly] {
  opacity: 0.8;
}

.leaderboard-tabs {
  margin-bottom: 18px;
}

.leaderboard-tabs .glass-tab-trigger[data-state='active'] {
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.14);
}

.rank-controls .glass-tab-trigger[data-state='active'] {
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.14);
}

.user-avatar {
  width: 42px;
  height: 42px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 999px;
  border: 1px solid #0a0a0a;
  background: #000000;
  position: relative;
  overflow: hidden;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.button.small {
  padding: 8px 12px;
  font-size: 12px;
}

.button.secondary {
  background: transparent;
  color: var(--ink);
  overflow: visible;
}

.button.secondary.active {
  background: #000;
  color: #fff;
  border-color: #000;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.button:active {
  transform: scale(0.98);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
  transform: none;
}

.button:disabled::before {
  display: none;
}

@keyframes flow {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes flowSheen {
  0% {
    transform: translateX(-35%);
  }

  50% {
    transform: translateX(35%);
  }

  100% {
    transform: translateX(-35%);
  }
}

.skeleton-line {
  height: 12px;
  border-radius: 999px;
}

.skeleton-line:not(.glass-skeleton) {
  background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-highlight) 37%, var(--skeleton-base) 63%);
  background-size: 400% 100%;
  animation: skeleton 1.1s ease-in-out infinite;
}

.skeleton-line.sm {
  height: 10px;
}

.skeleton-line.w-40 {
  width: 40%;
}

.skeleton-line.w-55 {
  width: 55%;
}

.skeleton-line.w-70 {
  width: 70%;
}

.skeleton-line.w-85 {
  width: 85%;
}

.card.loading {
  position: relative;
  overflow: hidden;
}

.card.loading>*:not(.card-skeleton) {
  visibility: hidden;
}

.card-skeleton {
  position: absolute;
  inset: 20px;
  display: none;
  gap: 12px;
  z-index: 1;
  pointer-events: none;
}

.card.loading .card-skeleton {
  display: grid;
}

.card.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0) 100%),
    linear-gradient(var(--skeleton-base), var(--skeleton-base));
  background-size: 200% 100%, 100% 100%;
  animation: skeleton-sheen 1.1s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes skeleton {
  0% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0 50%;
  }
}

@keyframes skeleton-sheen {
  0% {
    background-position: -120% 0, 0 0;
  }

  100% {
    background-position: 120% 0, 0 0;
  }
}

.button::before {
  content: '';
  position: absolute;
  inset: -60% -120%;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0.06));
  opacity: 0.85;
  animation: flowSheen 5.5s ease-in-out infinite;
  pointer-events: none;
}

.button.secondary::before {
  display: none;
}

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

.container {
  width: min(1200px, 90vw);
  margin: 0 auto;
  padding: 32px 0 80px;
}

.panel-card {
  padding: 28px 28px 80px;
  margin-top: 26px;
}

.panel-card.glass {
  --glass-radius: calc(var(--radius) + 6px);
}

.leaderboard-panel {
  padding: 24px 24px 40px;
}

.leaderboard-panel .glass-tabs-list {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(17, 17, 17, 0.08);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.grid {
  display: grid;
  gap: 18px;
}

.grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.card {
  padding: 20px;
  position: relative;
}

.card.selected {
  box-shadow: 0 0 0 2px rgba(17, 17, 17, 0.28), var(--glass-shadow-hover);
}

.card h3 {
  margin-bottom: 8px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13px;
  color: var(--color-text-dim);
}

.rank-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 16px;
  align-items: center;
  justify-content: space-between;
}

.rank-controls .inline {
  flex-wrap: wrap;
}

.tabs {
  display: inline-flex;
  gap: 10px;
  padding: 6px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  margin-bottom: 18px;
}

.tab-btn {
  border: 1px solid transparent;
  background: transparent;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.tab-btn.active {
  background: #000;
  color: #fff;
}

.tab-section {
  display: none;
}

.tab-section.active {
  display: block;
  animation: leaderboardTabIn 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes leaderboardTabIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tab-section.active {
    animation: none;
  }
}

.inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
}

.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  gap: 14px;
}

.status-bar .inline {
  flex-wrap: wrap;
}

.status-bar.glass {
  --glass-radius: var(--radius-sm);
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

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

.table {
  display: grid;
  gap: 12px;
}

.table-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(10px);
  font-size: 14px;
}

.reward-code-table .table-row {
  grid-template-columns: 1.1fr 0.6fr 1.4fr 0.7fr 0.5fr 1fr 1fr 0.9fr;
}

.recharge-table .table-row {
  grid-template-columns: 1.1fr 1.6fr 1fr 0.7fr 0.7fr;
}

.reward-code-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.table-row.header {
  background: rgba(17, 17, 17, 0.92);
  color: rgba(255, 255, 255, 0.96);
  font-weight: 700;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}

.footer {
  text-align: center;
  color: var(--color-text-dim);
  padding: 40px 0;
}

.notice {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--color-text-dim);
}

.test-panel {
  margin-top: 18px;
  padding: 16px;
  display: none;
  animation: fadeUp var(--duration) ease;
}

.test-panel.show {
  display: block;
}

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

.progress {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-dim);
  min-height: 140px;
  overflow: hidden;
}

.progress>div {
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.progress>div span {
  font-family: 'Consolas', 'Monaco', monospace;
}

.progress-bar {
  height: 8px;
  background: #e5e5e5;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: #000;
  width: 0%;
  transition: width 240ms ease;
}

.toast-container {
  position: fixed;
  right: 24px;
  top: auto;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 2000;
  pointer-events: none;
  align-items: flex-end;
  justify-content: flex-end;
}

.glass-toast.toast-exit {
  opacity: 0;
  transform: translateX(12px);
}

.glass-toast .toast-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.glass-toast .toast-icon svg {
  width: 16px;
  height: 16px;
}

.glass-toast.toast-success {
  border-color: rgba(16, 185, 129, 0.35);
}

.glass-toast.toast-success .toast-icon {
  background: rgba(16, 185, 129, 0.16);
  color: #065f46;
}

.glass-toast.toast-error {
  border-color: rgba(239, 68, 68, 0.35);
}

.glass-toast.toast-error .toast-icon {
  background: rgba(239, 68, 68, 0.14);
  color: #991b1b;
}

.glass-toast.toast-info {
  border-color: rgba(99, 102, 241, 0.28);
}

.glass-toast.toast-info .toast-icon {
  background: rgba(99, 102, 241, 0.14);
  color: #3730a3;
}

.toast {
  padding: 12px 16px;
  border-radius: 12px;
  background: #000;
  color: #fff;
  min-width: 220px;
  box-shadow: var(--shadow);
  animation: slideIn var(--duration) ease;
}

@keyframes slideIn {
  from {
    transform: translateX(20px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.modal-backdrop.show {
  display: flex;
  animation: fadeIn var(--duration) ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  padding: 24px;
  max-width: 520px;
  width: 100%;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.form {
  display: grid;
  gap: 16px;
}

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

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-dim);
}

.field input:not(.glass-input),
.field textarea:not(.glass-input),
.field select:not(.glass-input) {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}

.field input:not(.glass-input):disabled {
  background: #f4f4f4;
  color: var(--color-text-dim);
}

.field textarea {
  min-height: 96px;
}

.checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--color-text-dim);
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 20px 0;
}

@media (max-width: 980px) {
  .grid.cols-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .reward-code-table .table-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .hero {
    padding: 60px 6vw 36px;
  }

  .grid.cols-2,
  .grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .status-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

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

  .toast-container {
    right: 16px;
    left: 16px;
  }

  .panel-card {
    padding: 22px 18px 60px;
  }

  /* POW 卡片移动端稳定布局 */
  #powCard .grid.cols-2 {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  #powCard .progress {
    min-height: 160px;
    max-width: 100%;
    box-sizing: border-box;
  }

  #powCard .progress>div {
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  /* 让 hash 值可以截断而不是换行 */
  #hashText {
    display: inline-block;
    max-width: calc(100% - 70px);
    vertical-align: bottom;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
