/* ==========================================================================
   Aurora Store · 玻璃拟态设计系统
   ========================================================================== */

:root {
  --bg: #05060f;
  --ink: #f3f5ff;
  --muted: rgba(230, 235, 255, 0.66);
  --faint: rgba(230, 235, 255, 0.42);
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --glass-hi: rgba(255, 255, 255, 0.1);
  --violet: #8b5cf6;
  --indigo: #6366f1;
  --cyan: #22d3ee;
  --pink: #f472b6;
  --gold: #fbbf24;
  --green: #34d399;
  --red: #fb7185;
  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --shadow-card: 0 24px 60px -22px rgba(0, 0, 0, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.13),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.locked { overflow: hidden; }

h1, h2, h3, h4 { font-weight: 700; line-height: 1.15; }
a { color: inherit; }
button, input, textarea, select { font-family: inherit; }
button { color: inherit; }
::selection { background: rgba(139, 92, 246, 0.45); color: #fff; }

:focus-visible {
  outline: 2px solid rgba(34, 211, 238, 0.6);
  outline-offset: 2px;
}

/* ------------------------------ 背景场景 ------------------------------ */

.scene {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(ellipse 90% 55% at 50% -15%, #151a3a 0%, transparent 60%),
    radial-gradient(ellipse 70% 60% at 100% 100%, #150a22 0%, transparent 55%),
    var(--bg);
}

.aurora {
  position: absolute;
  inset: -25%;
  filter: blur(90px);
  opacity: 0.9;
}

.blob {
  position: absolute;
  width: 48vmax;
  height: 48vmax;
  border-radius: 50%;
  mix-blend-mode: screen;
  opacity: 0.5;
  animation: blobDrift 24s ease-in-out infinite alternate;
  will-change: transform;
}

.blob.b1 {
  top: -12%;
  left: -8%;
  background: radial-gradient(circle at 35% 35%, #6d28d9, transparent 66%);
}
.blob.b2 {
  top: 18%;
  right: -16%;
  background: radial-gradient(circle at 55% 45%, #0e7490, transparent 64%);
  animation-delay: -7s;
  opacity: 0.42;
}
.blob.b3 {
  bottom: -22%;
  left: 22%;
  background: radial-gradient(circle at 50% 50%, #9d174d, transparent 64%);
  animation-delay: -13s;
  opacity: 0.36;
}
.blob.b4 {
  top: 45%;
  left: 40%;
  width: 30vmax;
  height: 30vmax;
  background: radial-gradient(circle at 50% 50%, #4338ca, transparent 65%);
  animation-delay: -3s;
  opacity: 0.3;
}

.grid-plane {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  -webkit-mask-image: radial-gradient(ellipse 85% 55% at 50% 0%, #000 5%, transparent 70%);
  mask-image: radial-gradient(ellipse 85% 55% at 50% 0%, #000 5%, transparent 70%);
  opacity: 0.6;
}

.grain {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 120% 90% at 50% 40%, transparent 45%, rgba(2, 3, 10, 0.55) 100%);
}

/* ------------------------------ 玻璃体系 ------------------------------ */

.glass {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.035) 42%, rgba(255, 255, 255, 0.018) 100%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  box-shadow: var(--shadow-card);
  isolation: isolate;
}

.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.08) 26%,
    rgba(255, 255, 255, 0.02) 55%,
    rgba(255, 255, 255, 0.22) 100%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.glass-soft {
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.glare {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  background: radial-gradient(
    260px circle at var(--gx, 50%) var(--gy, 0%),
    rgba(255, 255, 255, 0.22),
    transparent 62%
  );
  mix-blend-mode: screen;
}

.tilt:hover .glare { opacity: 1; }

/* ------------------------------ 品牌标志 ------------------------------ */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.orb {
  position: relative;
  isolation: isolate;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 32% 26%,
    #ffffff 0%,
    #c4b5fd 13%,
    #7c3aed 40%,
    #312e81 68%,
    #0a0d21 100%
  );
  box-shadow:
    inset -5px -7px 14px rgba(2, 0, 20, 0.72),
    inset 5px 5px 12px rgba(255, 255, 255, 0.42),
    0 10px 26px -8px rgba(124, 58, 237, 0.8);
  animation: orbFloat 6s ease-in-out infinite;
}

.orb::before {
  content: "";
  position: absolute;
  inset: -7px;
  z-index: -1;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(139, 92, 246, 0.55),
    rgba(34, 211, 238, 0.55),
    rgba(244, 114, 182, 0.5),
    rgba(139, 92, 246, 0.55)
  );
  filter: blur(9px);
  opacity: 0.8;
  animation: spinSlow 9s linear infinite;
}

.orb::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.7), transparent 46%);
  mix-blend-mode: screen;
  opacity: 0.65;
}

.orb.orb-lg { width: 54px; height: 54px; }

.brand-text { min-width: 0; }
.brand-name {
  display: block;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.2em;
  line-height: 1.2;
}
.brand-sub {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ------------------------------ 按钮 ------------------------------ */

.btn {
  position: relative;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  overflow: hidden;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition:
    transform 0.28s var(--ease-out),
    box-shadow 0.28s ease,
    background 0.28s ease,
    border-color 0.28s ease;
}

.btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: -130%;
  width: 55%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transform: skewX(-18deg);
  transition: left 0.65s ease;
  pointer-events: none;
}

.btn:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.24); }
.btn:hover::after { left: 145%; }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn:disabled::after { display: none; }

.btn-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 46%, #22d3ee 100%);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow:
    0 14px 34px -12px rgba(99, 102, 241, 0.85),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-primary:hover {
  box-shadow:
    0 20px 46px -14px rgba(99, 102, 241, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-gold {
  background: linear-gradient(135deg, #f59e0b, #fbbf24 52%, #fde68a);
  border-color: rgba(255, 255, 255, 0.5);
  color: #2a1500;
  box-shadow:
    0 14px 32px -14px rgba(251, 191, 36, 0.8),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.btn-gold:hover {
  box-shadow:
    0 20px 42px -14px rgba(251, 191, 36, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.btn-ghost { background: rgba(255, 255, 255, 0.045); }
.btn-danger {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.34);
  color: #fecdd3;
}
.btn-danger:hover { background: rgba(244, 63, 94, 0.2); border-color: rgba(244, 63, 94, 0.55); }

.btn-sm { height: 34px; padding: 0 12px; border-radius: 10px; font-size: 12.5px; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 12px; }
.btn-block { width: 100%; }

.btn .spin {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  animation: spinSlow 0.8s linear infinite;
}

/* ------------------------------ 表单 ------------------------------ */

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.field > label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  padding-left: 2px;
}

.input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(6, 9, 24, 0.55);
  color: var(--ink);
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input::placeholder { color: rgba(230, 235, 255, 0.33); }

.input:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.55);
  background: rgba(6, 9, 24, 0.72);
  box-shadow:
    0 0 0 3px rgba(34, 211, 238, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

textarea.input {
  height: auto;
  min-height: 104px;
  padding: 13px 16px;
  line-height: 1.65;
  resize: vertical;
}

.input-wrap { position: relative; }
.input-wrap .input { padding-left: 44px; }
.input-wrap .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--faint);
  pointer-events: none;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }

.form-error {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border-radius: 11px;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fecdd3;
  font-size: 12.5px;
  line-height: 1.5;
}
.form-error.show { display: flex; }

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.1);
  transition: 0.25s ease;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #c7d2fe);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: 0.25s var(--ease-out);
}
.switch input:checked ~ .track {
  background: linear-gradient(90deg, #8b5cf6, #22d3ee);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 18px -4px rgba(99, 102, 241, 0.8);
}
.switch input:checked ~ .track::after { left: 22px; }

/* ------------------------------ 通用组件 ------------------------------ */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 25px;
  padding: 0 9px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.chip.violet { color: #ddd6fe; border-color: rgba(167, 139, 250, 0.32); background: rgba(139, 92, 246, 0.14); }
.chip.cyan { color: #a5f3fc; border-color: rgba(34, 211, 238, 0.3); background: rgba(34, 211, 238, 0.1); }
.chip.gold { color: #fde68a; border-color: rgba(251, 191, 36, 0.32); background: rgba(251, 191, 36, 0.11); }
.chip.green { color: #a7f3d0; border-color: rgba(52, 211, 153, 0.3); background: rgba(52, 211, 153, 0.1); }
.chip.red { color: #fecdd3; border-color: rgba(244, 63, 94, 0.3); background: rgba(244, 63, 94, 0.1); }
.chip.gray { color: var(--faint); border-color: rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.04); }

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
}

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
.gradient-text {
  background: linear-gradient(100deg, #a78bfa, #67e8f9 48%, #f0abfc 82%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.divider { height: 1px; background: rgba(255, 255, 255, 0.08); }
.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;
}

.coin-svg { flex: none; filter: drop-shadow(0 2px 4px rgba(120, 53, 15, 0.4)); }
.coin-inline { display: inline-flex; align-items: center; gap: 5px; }

/* ------------------------------ 模态框 ------------------------------ */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal.open { opacity: 1; visibility: visible; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 12, 0.62);
  -webkit-backdrop-filter: blur(14px) saturate(125%);
  backdrop-filter: blur(14px) saturate(125%);
}

.modal-panel {
  position: relative;
  width: min(468px, 100%);
  max-height: calc(100vh - 40px);
  padding: 28px;
  border-radius: 26px;
  overflow-y: auto;
  opacity: 0.75;
  transform: translateY(26px) scale(0.965);
  transition: transform 0.45s var(--ease-out), opacity 0.3s ease;
}
.modal.open .modal-panel { opacity: 1; transform: none; }

.modal-panel.wide { width: min(640px, 100%); }

.modal-head { padding-right: 44px; margin-bottom: 22px; }
.modal-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.025em;
}
.modal-head p { margin: 7px 0 0; font-size: 12.5px; color: var(--faint); line-height: 1.6; }

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  cursor: pointer;
  transition: 0.2s ease;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.11); color: #fff; transform: rotate(90deg); }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ------------------------------ Toast ------------------------------ */

.toasts {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px 13px 17px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(150deg, rgba(20, 24, 46, 0.92), rgba(10, 12, 28, 0.92));
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  box-shadow: 0 20px 50px -18px rgba(0, 0, 0, 0.9);
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
  pointer-events: auto;
  animation: toastIn 0.45s var(--ease-out);
}
.toast::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: var(--tone, var(--cyan));
  box-shadow: 0 0 12px var(--tone, var(--cyan));
}
.toast.ok { --tone: var(--green); }
.toast.error { --tone: var(--red); }
.toast.warn { --tone: var(--gold); }
.toast.info { --tone: var(--cyan); }
.toast .t-icon { flex: none; margin-top: 1px; color: var(--tone, var(--cyan)); }
.toast.hide { animation: toastOut 0.3s ease forwards; }

/* ------------------------------ 特效 ------------------------------ */

.fx-layer { position: fixed; inset: 0; z-index: 400; pointer-events: none; overflow: hidden; }
.fx-spark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--c, #fbbf24);
  box-shadow: 0 0 12px var(--c, #fbbf24);
  opacity: 0;
  animation: sparkOut 1.05s cubic-bezier(0.15, 0.7, 0.3, 1) forwards;
  animation-delay: var(--d, 0s);
}

/* ------------------------------ 动画 ------------------------------ */

@keyframes blobDrift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(3vw, -3vh, 0) scale(1.08); }
  100% { transform: translate3d(7vw, 4vh, 0) scale(1.16); }
}
@keyframes orbFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes spinSlow { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { opacity: 0.55; box-shadow: 0 0 6px currentColor; }
  50% { opacity: 1; box-shadow: 0 0 14px currentColor; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(28px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px) scale(0.96); }
}
@keyframes sparkOut {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(0.2) rotate(200deg); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ------------------------------ 滚动条 ------------------------------ */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border: 3px solid transparent;
  border-radius: 99px;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.26); background-clip: content-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
