:root {
  --bg: #07080c;
  --card: #141822;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f3f5fb;
  --muted: #8b93a7;
  --blue: #3d6bff;
  --blue-2: #8fb0ff;
  --yes: #22c55e;
  --yes-bg: rgba(34, 197, 94, 0.14);
  --no: #f43f5e;
  --no-bg: rgba(244, 63, 94, 0.14);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, "PingFang SC", "Noto Sans SC", sans-serif;
  background: #05060a;
  color: var(--text);
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
.hidden { display: none !important; }

.stage { min-height: 100dvh; }
.phone {
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.notch { display: none; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 8px;
}
.brand { display: flex; align-items: center; gap: 8px; }
.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  object-fit: cover;
  display: block;
  background: #1b2030;
  flex: 0 0 auto;
}
.brand strong { display: block; font-size: 16px; letter-spacing: -0.03em; }
.brand span { display: block; color: var(--muted); font-size: 11px; }
.top-actions { display: flex; gap: 6px; }
.chip {
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #1b2030;
  font-size: 11px;
  font-weight: 600;
  max-width: 124px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip.ghost { background: rgba(255,255,255,.06); }
.chip.balance { background: linear-gradient(135deg, #2a46c9, #3d6bff); }

.content {
  flex: 1;
  overflow: auto;
  padding: 0 14px 92px;
  overscroll-behavior: contain;
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 12px;
  background: #121622;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.search span { color: var(--muted); font-size: 18px; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; }

.gift {
  margin-top: 12px;
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1a274d, #15203b);
  border: 1px solid rgba(61,107,255,.35);
}
.gift b { color: var(--blue-2); font-size: 13px; }
.gift span { color: #d5dcf0; font-size: 12px; line-height: 1.35; }
.gift em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  background: var(--blue);
  border-radius: 999px;
  padding: 6px 8px;
}

.cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 14px 0 8px;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cats button {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: #161b28;
  color: #c5ccdd;
  font-size: 13px;
  font-weight: 600;
}
.cats button.on { background: #fff; color: #0b0d12; }
.source, .muted, .hint { color: var(--muted); font-size: 12px; line-height: 1.5; }

.feed { display: grid; gap: 12px; padding-bottom: 12px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
}
.card.sk {
  height: 148px;
  background: linear-gradient(90deg, #141822, #1b2130, #141822);
  background-size: 200% 100%;
  animation: shine 1.2s infinite;
}
@keyframes shine {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.card-head { display: flex; gap: 10px; margin-bottom: 10px; }
.card-head img, .ph {
  width: 44px; height: 44px; border-radius: 12px;
  object-fit: cover; background: #222838; flex: 0 0 auto;
}
.card-head h3, .sheet h3 { margin: 0; font-size: 15px; line-height: 1.35; }
.card-head p, .desc { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.rows { display: grid; gap: 10px; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.row .label { font-size: 13px; color: #d7dce8; }
.row.col { display: block; }
.row-top { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.btns { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btns button, .btn {
  height: 38px; border-radius: 12px; font-size: 12px; font-weight: 700;
}
.yes { background: var(--yes-bg); color: var(--yes); }
.no { background: var(--no-bg); color: var(--no); }
.btn { width: 100%; background: var(--blue); color: #fff; margin-top: 8px; }
.btn.ghost { background: #1b2130; }

.tabbar {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(10,12,18,.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.tabbar button {
  color: #7f8798;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.tabbar button.on { color: #fff; }
.ico { width: 18px; height: 18px; border: 1.6px solid currentColor; border-radius: 5px; }
.ico.portfolio { border-radius: 99px; }
.ico.profile { border-radius: 99px 99px 4px 4px; }

.mask {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end;
  z-index: 20;
}
.sheet {
  width: 100%;
  max-height: 86%;
  overflow: auto;
  background: #12151e;
  border-radius: 22px 22px 0 0;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  animation: up .28s ease;
}
@keyframes up {
  from { transform: translateY(24px); opacity: .6; }
  to { transform: none; opacity: 1; }
}
.handle { width: 42px; height: 4px; border-radius: 99px; background: #2c3344; margin: 4px auto 12px; }
.field { display: grid; gap: 6px; margin: 10px 0; font-size: 12px; color: var(--muted); }
.field input {
  height: 44px; border-radius: 12px; border: 1px solid var(--line);
  background: #0d1018; padding: 0 12px; outline: none;
}
.captcha-row { display: flex; gap: 10px; align-items: end; }
.grow { flex: 1; }
.captcha { height: 44px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.captcha canvas { display: block; }
.err { color: #ff7b8c; font-size: 12px; }
.link { width: 100%; margin-top: 10px; color: var(--blue-2); font-size: 13px; }
.claim { text-align: center; padding: 12px 0 8px; }
.coin {
  width: 72px; height: 72px; margin: 8px auto 12px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, #ffe08a, #d4a017);
  color: #3a2a00; font-weight: 800; font-size: 18px;
}
.pick {
  display: flex; justify-content: space-between; align-items: center;
  background: #1a2140; border-radius: 12px; padding: 12px; margin: 8px 0;
}
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick button { height: 34px; border-radius: 10px; background: #1b2130; font-size: 12px; font-weight: 700; }
.meta-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 12px 0; }
.meta-grid div { background: #0f1320; border-radius: 12px; padding: 10px; }
.meta-grid span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
.page-title { margin: 6px 0 12px; font-size: 22px; }
.stat {
  background: var(--card); border-radius: 16px; padding: 14px;
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.stat b { font-size: 20px; }
.profile-card { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.profile-card p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.stack { display: grid; gap: 8px; }
.empty { text-align: center; padding: 40px 12px; color: var(--muted); }
.lang-list { display: grid; gap: 8px; }
.lang-list button {
  height: 44px; border-radius: 12px; background: #1b2130;
  text-align: left; padding: 0 14px; font-weight: 600;
}
.lang-list button.on { background: var(--blue); }
.success-mask { align-items: center; padding: 20px; }
.success {
  width: 100%; background: #12151e; border-radius: 22px;
  padding: 24px 18px 18px; text-align: center; animation: up .28s ease;
}
.check {
  width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 50%;
  display: grid; place-items: center; background: var(--yes);
  color: #052e16; font-size: 28px; font-weight: 800;
}
.toast {
  position: absolute; left: 16px; right: 16px;
  top: calc(18px + env(safe-area-inset-top));
  background: #22283a; border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px;
  text-align: center; font-size: 13px; z-index: 30;
}

@media (min-width: 540px) {
  .stage {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 50% 0%, #1a2450 0%, transparent 42%), #05060a;
  }
  .phone {
    width: 390px;
    height: min(844px, 96dvh);
    min-height: 0;
    border-radius: 40px;
    border: 10px solid #171717;
    box-shadow: 0 18px 50px rgba(0,0,0,.45), inset 0 0 0 1px #2a2a2a;
  }
  .notch, .notch {
    display: block;
    position: absolute;
    top: 8px; left: 50%;
    width: 118px; height: 22px;
    transform: translateX(-50%);
    background: #000;
    border-radius: 20px;
    z-index: 5;
  }
  .topbar, .topbar { padding-top: 34px; }
}

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 8px; }
.brand { display: flex; align-items: center; gap: 8px; }
.top-actions { display: flex; gap: 6px; }
.chip { height: 30px; padding: 0 10px; border-radius: 999px; background: #1b2030; font-size: 11px; font-weight: 600; max-width: 124px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip.ghost { background: rgba(255,255,255,.06); }
.chip.balance { background: linear-gradient(135deg, #2a46c9, #3d6bff); }
.content { flex: 1; overflow: auto; padding: 0 14px 92px; overscroll-behavior: contain; }
.tabbar { position: absolute; left: 0; right: 0; bottom: 0; height: calc(64px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(10,12,18,.92); backdrop-filter: blur(16px); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); }
.tabbar button { color: #7f8798; font-size: 11px; font-weight: 600; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.tabbar button.on { color: #fff; }
.ico { width: 18px; height: 18px; border: 1.6px solid currentColor; border-radius: 5px; }
.ico.portfolio { border-radius: 99px; }
.ico.profile { border-radius: 99px 99px 4px 4px; }
.notch { display: none; }
.card-head { display: flex; gap: 10px; margin-bottom: 10px; }
.card-head img, .ph, .ph { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background: #222838; flex: 0 0 auto; }
.handle { width: 42px; height: 4px; border-radius: 99px; background: #2c3344; margin: 4px auto 12px; }
.lang-list { display: grid; gap: 8px; }
.lang-list button { height: 44px; border-radius: 12px; background: #1b2130; text-align: left; padding: 0 14px; font-weight: 600; }
.lang-list button.on { background: var(--blue); }
.captcha-row { display: flex; gap: 10px; align-items: end; }
.profile-card { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.success-mask { align-items: center; padding: 20px; z-index: 50; }

.welcome-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 40;
  padding: 20px;
}
.welcome-card {
  position: relative;
  width: 100%;
  background: linear-gradient(180deg, #1a2748, #12151e);
  border: 1px solid rgba(61, 107, 255, 0.35);
  border-radius: 22px;
  padding: 22px 18px 18px;
  text-align: center;
  animation: pop 0.28s ease;
}
.welcome-card.shrink {
  animation: shrink-away 0.26s ease forwards;
}
@keyframes pop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@keyframes shrink-away {
  to { transform: scale(0.18) translate(140px, 220px); opacity: 0; }
}
.welcome-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-size: 20px;
  color: #c5ccdd;
}
.welcome-card h3 { margin: 8px 0; font-size: 18px; }
.welcome-card .desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin: 0 0 16px;
}
.gift-mini {
  position: absolute;
  right: 14px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  z-index: 35;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #2a46c9, #3d6bff);
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(61, 107, 255, 0.4);
  animation: pop 0.28s ease;
}

@media (min-width: 540px) {
  .topbar, .topbar { padding-top: 34px; }
}
