:root {
  --bg: #030712;
  --surface: rgba(10, 18, 34, 0.82);
  --surface-2: rgba(4, 10, 22, 0.92);
  --border: rgba(56, 189, 248, 0.22);
  --border-bright: rgba(34, 211, 238, 0.55);
  --text: #e8f4ff;
  --muted: #6b8fad;
  --cyan: #22d3ee;
  --cyan-dim: #0891b2;
  --accent: #3b82f6;
  --warn: #fbbf24;
  --error: #f87171;
  --radius: 4px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: Consolas, "SF Mono", "Cascadia Mono", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}

body.modal-open {
  overflow: hidden;
}

/* —— Background —— */
.bg-tech {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(ellipse 100% 80% at 50% 0%, #0c1929 0%, var(--bg) 55%);
}

.bg-tech__vignette {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.75);
}

.bg-tech__hex {
  position: absolute;
  inset: -20%;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath fill='none' stroke='%2322d3ee' stroke-opacity='0.08' d='M28 0L56 16v32L28 64 0 48V16z'/%3E%3C/svg%3E");
  background-size: 56px 49px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 40%, #000 10%, transparent 70%);
}

.bg-tech__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 85% 75% at 50% 35%, #000 15%, transparent 72%);
}

.bg-tech__horizon {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45%;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(34, 211, 238, 0.04) 40%,
    rgba(14, 165, 233, 0.08) 100%
  );
  transform: perspective(400px) rotateX(12deg);
  transform-origin: bottom center;
  opacity: 0.7;
}

.bg-tech__glow {
  position: absolute;
  top: -15%;
  left: 50%;
  width: 140%;
  height: 55%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(34, 211, 238, 0.14) 0%, transparent 62%);
  animation: glow-pulse 5s ease-in-out infinite;
}

.bg-tech__scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(34, 211, 238, 0.04) 48%,
    transparent 100%
  );
  background-size: 100% 6px;
  animation: scan-move 4.5s linear infinite;
  opacity: 0.55;
}

.bg-tech__noise {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes glow-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.65;
  }
}

@keyframes scan-move {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 240px;
  }
}

/* —— HUD frame —— */
.hud-frame {
  position: fixed;
  inset: 10px;
  z-index: 2;
  pointer-events: none;
}

.hud-frame__corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border-color: rgba(34, 211, 238, 0.35);
  border-style: solid;
  border-width: 0;
}

.hud-frame__corner--tl {
  top: 0;
  left: 0;
  border-top-width: 2px;
  border-left-width: 2px;
}

.hud-frame__corner--tr {
  top: 0;
  right: 0;
  border-top-width: 2px;
  border-right-width: 2px;
}

.hud-frame__corner--bl {
  bottom: 0;
  left: 0;
  border-bottom-width: 2px;
  border-left-width: 2px;
}

.hud-frame__corner--br {
  bottom: 0;
  right: 0;
  border-bottom-width: 2px;
  border-right-width: 2px;
}

.hud-bar {
  position: fixed;
  top: 14px;
  left: 48px;
  right: 48px;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: rgba(34, 211, 238, 0.55);
}

.hud-bar__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hud-bar__item--right {
  margin-left: auto;
}

.hud-led {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: led-blink 2s ease-in-out infinite;
}

@keyframes led-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

/* —— Layout —— */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 52px 20px 48px;
}

.page-header {
  margin-bottom: 8px;
}

.page-header__toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 20px;
}

.btn-recharge {
  position: relative;
  overflow: hidden;
  padding: 8px 18px;
  border: 1px solid rgba(251, 191, 36, 0.55);
  border-radius: 2px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.95), rgba(180, 83, 9, 0.9));
  color: #1a0f00;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.3);
}

.btn-recharge__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 60%
  );
  transform: translateX(-100%);
  animation: btn-shine 3.5s ease-in-out infinite;
}

@keyframes btn-shine {
  0%,
  70%,
  100% {
    transform: translateX(-100%);
  }
  85% {
    transform: translateX(100%);
  }
}

.btn-recharge:active {
  transform: scale(0.98);
}

.hero-block {
  position: relative;
  padding: 8px 0;
}

.hero-block__line {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(34, 211, 238, 0.5) 20%,
    rgba(34, 211, 238, 0.15) 50%,
    transparent 80%
  );
}

.hero-block__line--bottom {
  margin-top: 14px;
}

.hero-title {
  text-align: center;
  padding: 16px 8px 0;
}

.hero-title__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--cyan);
  text-shadow: 0 0 20px rgba(34, 211, 238, 0.6);
}

.hero-title__pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan);
  animation: led-blink 1.2s ease-in-out infinite;
}

.hero-title__main {
  display: block;
  line-height: 1.35;
  font-size: clamp(1.2rem, 5vw, 1.7rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #f0f9ff;
  text-shadow:
    0 0 30px rgba(34, 211, 238, 0.4),
    0 2px 0 rgba(0, 0, 0, 0.5);
}

.hero-sub {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 26px;
  font-family: var(--mono);
}

.hero-sub__prefix {
  color: var(--cyan);
  margin-right: 6px;
  opacity: 0.85;
}

/* —— Search card —— */
.search-card {
  position: relative;
  padding: 20px 18px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.08) inset,
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(34, 211, 238, 0.07);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.search-card::before,
.search-card::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(34, 211, 238, 0.45);
  pointer-events: none;
}

.search-card::before {
  top: 8px;
  left: 8px;
  border-right: none;
  border-bottom: none;
}

.search-card::after {
  bottom: 8px;
  right: 8px;
  border-left: none;
  border-top: none;
}

.search-card__scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0.5;
  animation: card-scan 4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes card-scan {
  0% {
    top: 0;
    opacity: 0;
  }
  10% {
    opacity: 0.6;
  }
  90% {
    opacity: 0.6;
  }
  100% {
    top: 100%;
    opacity: 0;
  }
}

.search-card__label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(34, 211, 238, 0.75);
}

.search-card__label-dot {
  width: 4px;
  height: 4px;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 560px) {
  .search-form {
    flex-direction: row;
    align-items: stretch;
  }
}

.input-shell {
  flex: 1;
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--surface-2);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-shell:focus-within {
  border-color: var(--border-bright);
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.2),
    0 0 24px rgba(34, 211, 238, 0.12);
}

.input-shell__prefix {
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: rgba(34, 211, 238, 0.65);
  border-right: 1px solid rgba(34, 211, 238, 0.15);
  background: rgba(34, 211, 238, 0.04);
}

.search-input {
  flex: 1;
  min-width: 0;
  padding: 14px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  outline: none;
}

.search-input::placeholder {
  color: #4a6578;
  font-family: var(--font);
}

.search-input:disabled {
  opacity: 0.5;
}

.btn-collect {
  position: relative;
  overflow: hidden;
  padding: 14px 22px;
  border: 1px solid rgba(125, 211, 252, 0.45);
  border-radius: 2px;
  background: linear-gradient(180deg, #0ea5e9 0%, #1d4ed8 100%);
  color: #fff;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow:
    0 0 28px rgba(14, 165, 233, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-collect__text {
  position: relative;
  z-index: 1;
}

.btn-collect__glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: btn-shine 2.8s ease-in-out infinite;
}

.btn-collect:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-collect:not(:disabled):active {
  transform: scale(0.98);
}

/* —— Status —— */
.status-box {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 2px;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--border);
  font-family: var(--mono);
}

.status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-head__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.status-led {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: led-blink 0.8s ease-in-out infinite;
}

.status-pct {
  font-size: 16px;
  font-weight: 700;
  color: var(--cyan);
  text-shadow: 0 0 16px rgba(34, 211, 238, 0.7);
  flex-shrink: 0;
}

.progress-track {
  margin-top: 12px;
  height: 8px;
  border-radius: 1px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(34, 211, 238, 0.2);
  overflow: hidden;
}

.progress-fill {
  position: relative;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0369a1, var(--cyan), #a5f3fc);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.8);
  transition: width 0.15s linear;
}

.progress-fill__shine {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 4px,
    rgba(255, 255, 255, 0.12) 4px,
    rgba(255, 255, 255, 0.12) 8px
  );
  animation: progress-stripe 0.6s linear infinite;
}

@keyframes progress-stripe {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 16px 0;
  }
}

.status-info {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.35);
  color: #bfdbfe;
}

.status-loading {
  background: rgba(8, 47, 73, 0.45);
  border-color: rgba(34, 211, 238, 0.4);
  color: #a5f3fc;
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.08) inset;
}

.status-warn {
  background: rgba(251, 191, 36, 0.08);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fde68a;
}

.status-error {
  background: rgba(127, 29, 29, 0.35);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fecaca;
}

.status-error .status-cta {
  display: block;
  margin-top: 10px;
}

.status-cta-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 16px;
  border: 1px solid rgba(251, 191, 36, 0.5);
  border-radius: 2px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #1a1200;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.page-footer {
  margin-top: 28px;
  text-align: center;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.25em;
  color: rgba(34, 211, 238, 0.35);
}

.page-footer__blink {
  animation: led-blink 1s step-end infinite;
  margin-left: 4px;
}

/* —— Modal —— */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 14, 0.88);
  backdrop-filter: blur(6px);
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  background: linear-gradient(165deg, rgba(14, 22, 40, 0.98), rgba(4, 8, 18, 0.98));
  border: 1px solid var(--border-bright);
  border-radius: 2px;
  padding: 20px 18px 22px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.65),
    0 0 80px rgba(34, 211, 238, 0.12);
}

.modal-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

.modal-panel__hud {
  margin: -4px 0 14px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.3em;
  color: rgba(34, 211, 238, 0.6);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.modal-body {
  font-size: 14px;
  line-height: 1.75;
  color: #e2e8f0;
}

.modal-body p {
  margin-bottom: 10px;
}

.modal-body .pay-line {
  font-size: 15px;
  font-weight: 700;
  color: #fbbf24;
}

.modal-currencies {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.modal-currencies__label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.coin-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #f1f5f9;
  padding: 4px 10px 4px 6px;
  border-radius: 2px;
  border: 1px solid rgba(38, 161, 123, 0.4);
  background: rgba(38, 161, 123, 0.1);
  font-family: var(--mono);
  font-size: 12px;
}

.coin-item--tether {
  padding: 4px 12px 4px 8px;
  border: 1px solid rgba(0, 147, 147, 0.55);
  background: rgba(0, 147, 147, 0.15);
  box-shadow: 0 0 12px rgba(0, 147, 147, 0.15);
}

.coin-icon-wrap {
  position: relative;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  box-shadow:
    0 0 12px rgba(0, 147, 147, 0.65),
    0 0 4px rgba(255, 255, 255, 0.25);
  animation: coin-glow 2.4s ease-in-out infinite;
}

@keyframes coin-glow {
  0%,
  100% {
    box-shadow:
      0 0 10px rgba(0, 147, 147, 0.5),
      0 0 3px rgba(255, 255, 255, 0.2);
  }
  50% {
    box-shadow:
      0 0 16px rgba(34, 211, 238, 0.55),
      0 0 6px rgba(255, 255, 255, 0.45);
  }
}

.coin-icon {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  vertical-align: top;
}

.coin-icon__shine {
  position: absolute;
  inset: -20%;
  background: linear-gradient(
    105deg,
    transparent 38%,
    rgba(255, 255, 255, 0.15) 44%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0.15) 56%,
    transparent 62%
  );
  transform: translateX(-120%) skewX(-12deg);
  animation: coin-shine 2.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes coin-shine {
  0%,
  52%,
  100% {
    transform: translateX(-120%) skewX(-12deg);
  }
  72% {
    transform: translateX(120%) skewX(-12deg);
  }
}

.modal-body .addr-label {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}

.wallet-addr {
  display: block;
  margin: 8px 0 12px;
  padding: 12px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  font-size: 11px;
  word-break: break-all;
  color: var(--cyan);
  font-family: var(--mono);
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.3);
}

.btn-copy {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(74, 222, 128, 0.45);
  border-radius: 2px;
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(34, 197, 94, 0.25);
}

.modal-tip {
  margin-top: 12px;
  font-size: 13px;
  color: #86efac;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  padding: 10px 18px;
  border-radius: 2px;
  background: rgba(8, 16, 32, 0.96);
  border: 1px solid var(--border-bright);
  color: #fff;
  font-family: var(--mono);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 200;
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.2);
}

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

.toast[hidden] {
  display: block;
  opacity: 0;
}

@media (max-width: 767px) {
  .search-card {
    backdrop-filter: none;
  }

  .hud-bar {
    left: 36px;
    right: 36px;
    top: 12px;
  }

  .hud-frame {
    inset: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg-tech__glow,
  .bg-tech__scan,
  .search-card__scan,
  .btn-recharge__shine,
  .btn-collect__glow,
  .progress-fill__shine,
  .hud-led,
  .hero-title__pulse,
  .page-footer__blink,
  .status-led,
  .coin-icon__shine,
  .coin-icon-wrap {
    animation: none;
  }
}
