:root {
  --bg: #050507;
  --bg-elev: #0a0b0f;
  --panel: #0e1015;
  --panel-2: #13161d;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f5f7;
  --text-2: #b7bbc4;
  --muted: #777c89;
  --cyan: #25f4ee;
  --cyan-dim: rgba(37, 244, 238, 0.12);
  --pink: #fe2c55;
  --pink-dim: rgba(254, 44, 85, 0.12);
  --violet: #8b5cf6;
  --amber: #f5b84b;
  --green: #3ddc97;
  --blue: #46a6ff;
  --up: #3ddc97;
  --down: #fe5475;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
}

::selection {
  background: rgba(37, 244, 238, 0.25);
  color: #fff;
}

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

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

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

img,
svg {
  display: block;
}

h1,
h2,
h3,
h4,
h5,
p {
  margin: 0;
}

strong {
  font-weight: 600;
}

.container {
  width: min(1240px, calc(100% - 64px));
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

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

.up {
  color: var(--up) !important;
}

.down {
  color: var(--down) !important;
}

.text-gradient {
  background: linear-gradient(96deg, #ffffff 4%, #9ffcf9 38%, #25f4ee 61%, #fe2c55 105%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.serif-accent {
  font-family: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.glass {
  background: linear-gradient(180deg, rgba(24, 27, 35, 0.72), rgba(10, 11, 15, 0.82));
  border: 1px solid var(--line);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-2);
}

.pulse-dot,
.live-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 0 rgba(37, 244, 238, 0.6);
  animation: pulse 2.4s infinite;
  flex: none;
}

.live-dot {
  width: 5px;
  height: 5px;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 244, 238, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(37, 244, 238, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 244, 238, 0); }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.btn-primary {
  background: linear-gradient(110deg, #ffffff 0%, #d9fffe 55%, #b6fffd 100%);
  color: #050507;
  box-shadow: 0 8px 30px rgba(37, 244, 238, 0.16);
}

.btn-primary:hover {
  box-shadow: 0 12px 40px rgba(37, 244, 238, 0.28);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-outline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-sm {
  min-height: 38px;
  padding: 0 16px;
  font-size: 13px;
}

.btn-lg {
  min-height: 54px;
  padding: 0 28px;
  font-size: 15px;
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge-cyan {
  color: var(--cyan);
  border-color: rgba(37, 244, 238, 0.28);
  background: rgba(37, 244, 238, 0.08);
}

.badge-pink {
  color: #ff6d89;
  border-color: rgba(254, 44, 85, 0.28);
  background: rgba(254, 44, 85, 0.08);
}

.badge-amber {
  color: var(--amber);
  border-color: rgba(245, 184, 75, 0.3);
  background: rgba(245, 184, 75, 0.08);
}

.badge-green {
  color: var(--green);
  border-color: rgba(61, 220, 151, 0.28);
  background: rgba(61, 220, 151, 0.08);
}

.tag-live {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(37, 244, 238, 0.1);
  color: var(--cyan);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
  vertical-align: 2px;
}

.tag-live::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  animation: pulse 2s infinite;
}

.skeleton-card {
  min-height: 280px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(100deg, rgba(255,255,255,0.025) 30%, rgba(255,255,255,0.055) 50%, rgba(255,255,255,0.025) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite linear;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 3, 5, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-backdrop.open {
  opacity: 1;
}

.modal {
  position: relative;
  width: min(920px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0c0e13;
  box-shadow: var(--shadow);
  transform: translateY(14px) scale(0.985);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  scrollbar-width: thin;
}

.modal-backdrop.open .modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text-2);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: 0.2s;
}

.modal-close:hover {
  color: #fff;
  border-color: var(--line-strong);
  transform: rotate(90deg);
}

.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 280px;
  max-width: 400px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #14171e;
  border: 1px solid var(--line-strong);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  animation: toastIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: auto;
}

.toast.out {
  animation: toastOut 0.25s ease forwards;
}

.toast .toast-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
}

.toast.success .toast-icon {
  background: rgba(61, 220, 151, 0.14);
  color: var(--green);
}

.toast.error .toast-icon {
  background: rgba(254, 44, 85, 0.14);
  color: #ff6d89;
}

.toast.info .toast-icon {
  background: rgba(37, 244, 238, 0.12);
  color: var(--cyan);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px) scale(0.97); }
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.2s;
}

.text-link span {
  transition: transform 0.2s;
}

.text-link:hover {
  color: var(--cyan);
}

.text-link:hover span {
  transform: translateX(3px);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #08090c;
}

::-webkit-scrollbar-thumb {
  background: #272b35;
  border-radius: 10px;
  border: 2px solid #08090c;
}

::-webkit-scrollbar-thumb:hover {
  background: #363b48;
}

@media (max-width: 720px) {
  .container {
    width: min(100% - 36px, 1240px);
  }

  .modal-backdrop {
    padding: 12px;
    align-items: flex-end;
  }

  .modal {
    max-height: calc(100vh - 24px);
    border-radius: 22px;
  }

  .toast-stack {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .toast {
    min-width: 0;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
