:root {
  --ink: #0a0f02;
  --ink-1: #11170a;
  --ink-2: #192110;
  --ink-3: #252e1a;
  --lime: #b8ed6e;
  --lime-hi: #dafca9;
  --lime-lo: #94bf58;
  --mint: #74facb;
  --blue: #66d6ff;
  --pink: #ffcbe9;
  --yellow: #f5eb66;
  --danger: #ff0040;
  --white: #fff;
  --t1: rgba(255, 255, 255, 0.96);
  --t2: rgba(255, 255, 255, 0.68);
  --t3: rgba(255, 255, 255, 0.44);
  --line: rgba(218, 252, 169, 0.12);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --hud-h: 48px;
  --brand-h: 64px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
    "Helvetica Neue", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--t1);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

button { font-family: inherit; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--ink);
}

/* 桌面端居中成手机比例 */
@media (min-width: 640px) and (pointer: fine) {
  body { background: radial-gradient(80% 70% at 50% 30%, #1b2410, #050702); }
  #app {
    left: 50%;
    right: auto;
    width: 420px;
    transform: translateX(-50%);
    top: 20px;
    bottom: 20px;
    border-radius: 36px;
    box-shadow: 0 0 0 10px #151b0c, 0 0 0 11px rgba(218, 252, 169, 0.12), 0 40px 120px rgba(0, 0, 0, 0.7);
  }
}

/* ---------- buttons ---------- */
.btn {
  position: relative;
  appearance: none;
  border: 0;
  height: 52px;
  padding: 0 22px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--ink);
  background: var(--lime);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset, 0 -3px 0 rgba(0, 0, 0, 0.14) inset,
    0 12px 32px -10px rgba(184, 237, 110, 0.65);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.25s var(--ease-spring), filter 0.2s ease;
}
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.55) 48%, transparent 66%);
  transform: translateX(-120%);
  animation: sheen 3.2s 1.2s var(--ease-out) infinite;
}
.btn:active { transform: scale(0.96); filter: brightness(0.96); }
.btn-ghost {
  color: var(--t1);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}
.btn-ghost::after { display: none; }
.btn:disabled { opacity: 0.5; }

/* ---------- toast ---------- */
.toast {
  position: absolute;
  left: 50%;
  top: calc(var(--safe-t) + 64px);
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 86%;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(17, 23, 10, 0.92);
  box-shadow: inset 0 0 0 1px var(--line), 0 16px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  animation: toastIn 0.45s var(--ease-spring) both;
  transform: translateX(-50%);
}
.toast::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); flex: 0 0 auto; }
.toast.bad::before { background: var(--danger); box-shadow: 0 0 10px var(--danger); }
.toast.out { animation: toastOut 0.25s ease both; }

/* ---------- keyframes ---------- */
@keyframes sheen { 0% { transform: translateX(-120%); } 40%, 100% { transform: translateX(120%); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.6); } 100% { opacity: 1; transform: scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -14px) scale(0.9); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, -8px) scale(0.96); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

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