/* =========================================================
   tree.new.beer — 深色、琥珀、牛皮纸
   ========================================================= */

:root {
  --bg:        #f6f1e5;
  --bg-2:      #efe7d8;
  --surface:   rgba(255, 255, 255, .7);
  --surface-2: #ffffff;
  --line:      rgba(58, 43, 26, .1);
  --line-2:    rgba(58, 43, 26, .17);
  --text:      #2b2118;
  --text-2:    #6d5b45;
  --text-3:    #94826b;
  --amber:     #d4911f;
  --amber-2:   #9a6113;
  --amber-dim: #7d4f0e;
  --green:     #2f8763;
  --paper:     #fffdf7;
  --paper-2:   #f7eedb;
  --ink:       #2b2118;
  --ink-2:     #6d5b45;
  --radius:    16px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
button { font: inherit; }

/* ---------- 背景光 ---------- */
.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 520px at 18% -10%, rgba(232, 163, 61, .2), transparent 62%),
    radial-gradient(760px 480px at 88% 8%, rgba(63, 155, 122, .09), transparent 60%),
    radial-gradient(900px 700px at 50% 108%, rgba(200, 140, 50, .1), transparent 65%);
}

.bg-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image: radial-gradient(rgba(90, 68, 40, .05) .6px, transparent .6px);
  background-size: 3px 3px;
}

.main { position: relative; z-index: 1; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: rgba(246, 241, 229, .86);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { flex: none; }
.brand-mark {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--amber-2);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}
.brand-mark .em {
  font-style: normal;
  font-size: 1.02em;
  margin: 0 .05em;
  line-height: 1;
  transform: translateY(-.02em);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.nav-links a {
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-2);
  transition: .2s;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.on { color: var(--ink); background: var(--amber); font-weight: 600; }

.nav-right { display: flex; align-items: center; gap: 10px; flex: none; }

.wallet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  border: 1px solid rgba(232, 163, 61, .3);
  border-radius: 999px;
  background: rgba(232, 163, 61, .09);
  font-size: 14px;
  transition: .2s;
}
.wallet:hover { background: rgba(232, 163, 61, .16); }
.wallet-ico { font-size: 14px; }
.wallet b { color: var(--amber-2); font-variant-numeric: tabular-nums; }
.wallet-unit { color: var(--text-3); font-size: 12px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .16s, background .2s, border-color .2s, color .2s, box-shadow .2s;
  white-space: nowrap;
  text-align: center;
}
.btn:active { transform: scale(.975); }

.btn-solid {
  background: linear-gradient(180deg, #f3bd66, var(--amber) 55%, #d08c25);
  color: #22180a;
  box-shadow: 0 6px 18px rgba(180, 126, 40, .26), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.btn-solid:hover { box-shadow: 0 10px 26px rgba(180, 126, 40, .34), inset 0 1px 0 rgba(255,255,255,.55); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--line-2);
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface-2); border-color: rgba(58, 43, 26, .26); }

.btn-amber {
  background: rgba(232, 163, 61, .16);
  border-color: rgba(232, 163, 61, .45);
  color: var(--amber-2);
}
.btn-amber:hover { background: rgba(232, 163, 61, .26); }

.btn-sm { padding: 7px 14px; font-size: 13.5px; }
.btn-xs { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn-disabled { opacity: .45; pointer-events: none; }

.btn-xl {
  padding: 19px 40px;
  font-size: 18px;
  gap: 14px;
  border-radius: 999px;
}
.btn-xl .btn-label { font-weight: 800; letter-spacing: .04em; }
.btn-xl .btn-cost {
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .18);
  color: rgba(34, 24, 10, .8);
}

/* ---------- 通用 ---------- */
.muted { color: var(--text-3); font-size: 13.5px; }
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 22px;
}
.sec-head h2 { font-size: 22px; font-weight: 800; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--lv, var(--amber-2));
  background: color-mix(in srgb, var(--lv, var(--amber)) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--lv, var(--amber)) 34%, transparent);
}
.badge-lg { font-size: 13px; padding: 5px 13px; }

.flash-wrap {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 16px auto 0;
  padding: 0 clamp(16px, 4vw, 44px);
}
.flash {
  padding: 11px 18px;
  border-radius: 12px;
  font-size: 14px;
  margin-bottom: 8px;
  border: 1px solid var(--line-2);
  background: var(--surface);
}
.flash-ok   { border-color: rgba(47, 135, 99, .3); background: rgba(47, 135, 99, .08); color: #266b4f; }
.flash-warn { border-color: rgba(232, 163, 61, .4);  background: rgba(232, 163, 61, .1);  color: var(--amber-2); }
.flash-err  { border-color: rgba(180, 70, 52, .3); background: rgba(180, 70, 52, .08); color: #a8462f; }

/* =========================================================
   Hero
   ======================================================= */
.hero {
  max-width: 900px;
  margin: 0 auto;
  padding: clamp(56px, 9vw, 106px) clamp(20px, 5vw, 32px) 12px;
  text-align: center;
  position: relative;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 15px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 26px;
}
.hero-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .45; transform: scale(.75); }
}

.hero-title {
  font-size: clamp(30px, 5.6vw, 58px);
  font-weight: 900;
  letter-spacing: -.035em;
  line-height: 1.16;
}
.hl {
  background: linear-gradient(100deg, #dfa745, #c07c17 46%, #9c6310);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding: 0 .06em;
}

.hero-sub {
  margin: 24px auto 0;
  max-width: 620px;
  color: var(--text-2);
  font-size: 15.5px;
  line-height: 1.85;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: clamp(24px, 6vw, 62px);
  margin-top: 40px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.hero-stats div { display: flex; flex-direction: column; gap: 2px; }
.hero-stats b {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.hero-stats span { font-size: 12.5px; color: var(--text-3); }

/* =========================================================
   开瓶台
   ======================================================= */
.maker {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(44px, 7vw, 74px) clamp(18px, 4vw, 44px) 10px;
}

.maker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.maker-head h2 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 900; letter-spacing: -.03em; }
.maker-wallet {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13.5px;
  color: var(--text-2);
}
.maker-wallet b { color: var(--amber-2); font-size: 17px; font-variant-numeric: tabular-nums; }

.level-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.level-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 20px 20px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, #ffffff, #fdfaf3);
  box-shadow: 0 1px 3px rgba(122, 90, 45, .05), 0 8px 22px rgba(122, 90, 45, .05);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: .22s;
  overflow: hidden;
}
.level-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--lv);
  opacity: .35;
  transition: .22s;
}
.level-card:hover {
  border-color: color-mix(in srgb, var(--lv) 40%, transparent);
  transform: translateY(-2px);
}
.level-card.on {
  border-color: color-mix(in srgb, var(--lv) 62%, transparent);
  background:
    radial-gradient(120% 100% at 0% 0%, color-mix(in srgb, var(--lv) 12%, transparent), transparent 55%),
    linear-gradient(165deg, #ffffff, #fdfaf0);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--lv) 14%, transparent);
}
.level-card.on::after { opacity: 1; width: 4px; }

.lv-emoji { font-size: 26px; line-height: 1; margin-bottom: 6px; }
.lv-name { font-size: 17px; font-weight: 800; letter-spacing: -.01em; }
.lv-sub { font-size: 13px; color: var(--text-2); }
.lv-cost {
  position: absolute;
  top: 18px;
  right: 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--lv);
  background: color-mix(in srgb, var(--lv) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--lv) 30%, transparent);
  border-radius: 999px;
  padding: 2px 9px;
  font-variant-numeric: tabular-nums;
}
.lv-desc {
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.6;
  min-height: 3.2em;
  color: var(--text-3);
  display: none;
}
@media (min-width: 860px) {
  .lv-desc { display: block; }
}

.maker-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
}
.maker-tip { font-size: 12.5px; color: var(--text-3); }

/* =========================================================
   信封
   ======================================================= */
.result-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px clamp(16px, 4vw, 32px) 10px;
}

.env {
  position: relative;
  width: 100%;
  min-height: 400px;
  cursor: pointer;
}
.env.open { min-height: 0; cursor: default; }

.env-shell {
  position: absolute;
  inset: 0;
  perspective: 1500px;
  transition: opacity .45s .35s, transform .5s .3s;
}
.env.open .env-shell {
  opacity: 0;
  transform: translateY(18px) scale(.985);
  pointer-events: none;
}

.env-body {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background-color: #f2e6cb;
  background-image:
    radial-gradient(120% 90% at 50% 0%, rgba(255, 255, 255, .7), transparent 62%),
    linear-gradient(158deg, #f8efdb 0%, #efe0c1 52%, #f4e9d2 100%);
  border: 1px solid rgba(176, 133, 63, .42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .85),
    inset 0 -40px 80px rgba(160, 120, 50, .1),
    0 22px 50px rgba(122, 90, 45, .18);
}
.env-body::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 52%;
  background:
    linear-gradient(198deg, transparent 49.3%, rgba(176, 133, 63, .4) 49.5%, rgba(176, 133, 63, .4) 50%, transparent 50.2%),
    linear-gradient(-198deg, transparent 49.3%, rgba(176, 133, 63, .4) 49.5%, rgba(176, 133, 63, .4) 50%, transparent 50.2%);
  border-radius: 0 0 16px 16px;
  pointer-events: none;
}

.env-flap {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 56%;
  background: linear-gradient(180deg, #fbf3e1 0%, #f4e6c9 42%, #eeddc0 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transform: rotateX(0deg);
  transition: transform .9s cubic-bezier(.55, -.08, .3, 1.25);
  z-index: 3;
  filter: drop-shadow(0 8px 16px rgba(122, 90, 45, .16));
  border-radius: 16px 16px 0 0;
}
.env.open .env-flap {
  transform: rotateX(-179deg);
  z-index: 0;
}

.seal {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%);
  width: 82px;
  height: 82px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 32px;
  z-index: 4;
  background: radial-gradient(circle at 34% 28%, #f7c877, #d99b34 52%, #a5701a 88%);
  box-shadow:
    0 8px 18px rgba(140, 100, 40, .3),
    inset 0 -4px 10px rgba(140, 95, 25, .3),
    inset 0 4px 8px rgba(255, 255, 255, .5);
  transition: transform .55s cubic-bezier(.3, .9, .3, 1.4), opacity .5s;
}
.seal::before {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px dashed rgba(176, 133, 63, .5);
  opacity: .8;
  animation: spin 24s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.env.open .seal {
  transform: translate(-50%, -50%) scale(1.9) rotate(38deg);
  opacity: 0;
}

.env-sealed:not(.open) .env-card { opacity: 0; }

.seal-hint {
  position: absolute;
  left: 0; right: 0; bottom: 26px;
  text-align: center;
  font-size: 13.5px;
  color: rgba(122, 84, 26, .82);
  letter-spacing: .03em;
  transition: opacity .3s;
  z-index: 5;
  pointer-events: none;
}
.seal-hint span { animation: bob 2.6s ease-in-out infinite; display: inline-block; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
.env.open .seal-hint { opacity: 0; }

/* 卡片（牛皮纸） */
.env-card {
  position: relative;
  z-index: 5;
  border-radius: 14px;
  padding: clamp(26px, 5vw, 42px) clamp(22px, 5vw, 40px) clamp(22px, 4vw, 30px);
  background: linear-gradient(172deg, var(--paper) 0%, var(--paper-2) 100%);
  color: var(--ink);
  border: 1px solid rgba(176, 133, 63, .22);
  box-shadow:/n    0 24px 54px rgba(122, 90, 45, .2),
    0 4px 12px rgba(122, 90, 45, .1),
    0 2px 0 rgba(255, 255, 255, .9) inset;
  opacity: 0;
  transform: translateY(28px) scale(.955);
  transition: opacity .5s .22s, transform .75s .22s cubic-bezier(.16, .9, .24, 1);
}
.env-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background-image: radial-gradient(rgba(80, 58, 30, .05) .7px, transparent .7px);
  background-size: 3px 3px;
  pointer-events: none;
}
.env.open .env-card { opacity: 1; transform: none; }

/* 纸上配色：badge 要用深色版，否则对比度不够 */
.env-card .badge {
  color: color-mix(in srgb, var(--lv) 82%, #241a0b);
  background: color-mix(in srgb, var(--lv) 20%, transparent);
  border-color: color-mix(in srgb, var(--lv) 48%, transparent);
  font-weight: 700;
}
.env-card .m-bar { background: rgba(43, 33, 24, .16); }
.env-card .m-label { color: #6b5a44; }

.ec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  position: relative;
}
.ec-time { font-size: 12.5px; color: var(--ink-2); opacity: .65; }

.ec-title {
  font-size: clamp(21px, 3.4vw, 29px);
  font-weight: 900;
  letter-spacing: -.025em;
  line-height: 1.32;
  color: var(--ink);
  position: relative;
}

.ec-body {
  margin-top: 18px;
  font-size: clamp(15px, 1.9vw, 16.5px);
  line-height: 1.95;
  color: #3c2f21;
  position: relative;
  letter-spacing: .005em;
}

.meters {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px dashed rgba(43, 33, 24, .22);
  position: relative;
}
.meter {
  flex: 1 1 160px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.m-label { font-size: 12px; color: var(--ink-2); white-space: nowrap; opacity: .85; }
.m-bar {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: rgba(43, 33, 24, .12);
  overflow: hidden;
}
.m-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--lv) 70%, #000), var(--lv));
  transform-origin: left;
  animation: grow .9s .55s cubic-bezier(.2, .9, .3, 1) both;
}
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.meter b {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  min-width: 22px;
  text-align: right;
}

.ec-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--ink-2);
  opacity: .8;
  position: relative;
}

.ec-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 18px;
  color: rgba(43, 33, 24, .3);
  font-size: 13px;
  position: relative;
}
.ec-divider::before,
.ec-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(43, 33, 24, .14);
}

.ec-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  position: relative;
}
.ec-actions .btn {
  border-color: rgba(43, 33, 24, .2);
  background: rgba(43, 33, 24, .05);
  color: var(--ink);
  font-size: 13.5px;
  padding: 9px 16px;
}
.ec-actions .btn:hover { background: rgba(43, 33, 24, .1); }
.ec-actions .btn-solid {
  background: linear-gradient(180deg, #f3bd66, var(--amber) 55%, #d08c25);
  border-color: transparent;
  color: #22180a;
}
.ec-actions .btn-amber {
  background: rgba(200, 137, 42, .22);
  border-color: rgba(160, 105, 20, .45);
  color: #7a4e0c;
}

.ec-owner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(43, 33, 24, .1);
  font-size: 13px;
  color: var(--ink-2);
  position: relative;
}
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch input { accent-color: var(--amber-dim); }
.link-danger {
  background: none;
  border: none;
  color: #a34a32;
  font-size: 12.5px;
  cursor: pointer;
  padding: 4px 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
  flex-wrap: wrap;
}

/* =========================================================
   广场卡片
   ======================================================= */
.plaza, .how {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(52px, 8vw, 90px) clamp(18px, 4vw, 44px) 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 14px;
}

.idea-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 20px 20px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(168deg, #ffffff, #fdfaf3);
  transition: .24s;
  overflow: hidden;
}
.idea-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--lv), transparent);
  opacity: .55;
}
.idea-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--lv) 38%, transparent);
  box-shadow: 0 14px 32px rgba(122, 90, 45, .14);
}
.ic-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.ic-time { font-size: 11.5px; color: var(--text-3); }
.ic-title {
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1.45;
  color: var(--text);
}
.ic-body {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-2);
  flex: 1;
}
.ic-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 11px;
  border-top: 1px solid rgba(58, 43, 26, .08);
  font-size: 12px;
  color: var(--text-3);
}
.ic-like { color: var(--text-2); }

.empty {
  text-align: center;
  padding: 56px 20px;
  border: 1px dashed var(--line-2);
  border-radius: 16px;
  color: var(--text-2);
}
.empty-emoji { font-size: 34px; margin-bottom: 10px; }

.empty-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 100px 24px;
  text-align: center;
}
.empty-page h1 { font-size: 28px; margin-bottom: 12px; }
.empty-page p { color: var(--text-2); margin-bottom: 24px; }

/* ---------- how ---------- */
.how h2 { font-size: 22px; font-weight: 800; margin-bottom: 22px; }
.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.how-item {
  padding: 22px 20px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.how-n {
  font-size: 12px;
  font-weight: 800;
  color: var(--amber-2);
  letter-spacing: .12em;
}
.how-item h3 { font-size: 16px; margin: 6px 0 8px; font-weight: 700; }
.how-item p { font-size: 13.5px; color: var(--text-2); line-height: 1.75; }

/* =========================================================
   认证页
   ======================================================= */
.auth {
  min-height: calc(100vh - 200px);
  display: grid;
  place-items: center;
  padding: 60px 20px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 38px clamp(24px, 5vw, 36px) 30px;
  border-radius: 20px;
  border: 1px solid var(--line-2);
  background: linear-gradient(170deg, #ffffff, #fdfaf3);
  box-shadow: 0 24px 56px rgba(122, 90, 45, .16);
}
.auth-emoji { font-size: 30px; }
.auth-card h1 { font-size: 27px; font-weight: 900; margin-top: 8px; letter-spacing: -.02em; }
.auth-sub { color: var(--text-2); font-size: 14px; margin-top: 6px; margin-bottom: 24px; }
.auth-alt { margin-top: 20px; font-size: 13.5px; color: var(--text-3); text-align: center; }
.auth-alt a { color: var(--amber-2); text-decoration: underline; text-underline-offset: 3px; }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span {
  font-size: 12.5px;
  color: var(--text-2);
  letter-spacing: .01em;
}
.field > span em { font-style: normal; color: var(--text-3); font-size: 11.5px; }
.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--line-2);
  background: #fffdf9;
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  transition: .18s;
  outline: none;
}
.field input::placeholder { color: var(--text-3); }
.field input:focus {
  border-color: rgba(180, 126, 40, .8);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(212, 145, 31, .16);
}

/* =========================================================
   我的
   ======================================================= */
.my {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(36px, 6vw, 64px) clamp(18px, 4vw, 44px) 40px;
}

.my-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 26px 28px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(232, 163, 61, .16), transparent 55%),
    linear-gradient(170deg, #ffffff, #fdfaf3);
}
.my-id { display: flex; align-items: center; gap: 16px; }
.avatar {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 800;
  color: #241a0b;
  background: linear-gradient(160deg, #f7d9a0, var(--amber) 60%, #c8842a);
  box-shadow: 0 8px 20px rgba(180, 126, 40, .26);
}
.my-id h1 { font-size: 23px; font-weight: 900; letter-spacing: -.02em; }
.my-wallet {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.mw-label { font-size: 12.5px; color: var(--text-3); }
.mw-num {
  font-size: 34px;
  font-weight: 900;
  color: var(--amber-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.03em;
  line-height: 1;
}
.mw-actions { display: flex; gap: 8px; }

.my-stats {
  display: flex;
  gap: clamp(22px, 5vw, 54px);
  margin: 26px 0 46px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--line);
}
.my-stats div { display: flex; flex-direction: column; }
.my-stats b { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.my-stats span { font-size: 12.5px; color: var(--text-3); }

.ledger { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ledger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid rgba(58, 43, 26, .07);
  font-size: 13.5px;
}
.ledger-row:last-child { border-bottom: none; }
.lg-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.lg-kind { font-weight: 600; color: var(--text); white-space: nowrap; }
.lg-note { color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lg-right { display: flex; align-items: center; gap: 14px; flex: none; }
.lg-delta { font-weight: 800; font-variant-numeric: tabular-nums; }
.lg-delta.plus { color: #2f8763; }
.lg-delta.minus { color: #b5563c; }
.lg-bal { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.lg-time { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }

/* =========================================================
   充值
   ======================================================= */
.recharge {
  max-width: 1040px;
  margin: 0 auto;
  padding: clamp(36px, 6vw, 64px) clamp(18px, 4vw, 44px) 60px;
}
.rc-head h1 { font-size: clamp(28px, 4.4vw, 40px); font-weight: 900; letter-spacing: -.03em; }
.rc-head p { color: var(--text-2); margin-top: 10px; max-width: 560px; }
.rc-balance {
  display: inline-block;
  margin-top: 18px;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  color: var(--text-2);
  border: 1px solid rgba(232, 163, 61, .28);
  background: rgba(232, 163, 61, .08);
}
.rc-balance b { color: var(--amber-2); font-size: 16px; }

.pkg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 30px 0 40px;
}
.pkg {
  padding: 26px 22px 22px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(168deg, #ffffff, #fdfaf3);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: .22s;
}
.pkg:hover { border-color: rgba(232, 163, 61, .35); transform: translateY(-2px); }
.pkg-name { font-size: 13px; color: var(--text-2); letter-spacing: .06em; }
.pkg-token { display: flex; align-items: baseline; gap: 6px; }
.pkg-token b {
  font-size: 32px;
  font-weight: 900;
  color: var(--amber-2);
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.pkg-token span { font-size: 12.5px; color: var(--text-3); }
.pkg-price { font-size: 18px; font-weight: 700; }
.pkg-note { font-size: 12.5px; color: var(--text-3); margin-bottom: 14px; }
.pkg .btn { margin-top: auto; }

.rc-note {
  padding: 24px 26px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .7);
}
.rc-note h3 { font-size: 16px; margin-bottom: 10px; font-weight: 700; }
.rc-note p { font-size: 13.5px; color: var(--text-2); line-height: 1.9; }
.rc-contact { margin-top: 12px; }
.rc-contact b { color: var(--amber-2); }

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(58, 43, 26, .38);
  backdrop-filter: blur(6px);
}
.modal-box {
  width: 100%;
  max-width: 400px;
  padding: 32px 28px 24px;
  border-radius: 20px;
  border: 1px solid var(--line-2);
  background: #fffdf8;
  text-align: center;
  box-shadow: 0 30px 70px rgba(90, 68, 40, .28);
  animation: pop .32s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(10px); } }
.modal-emoji { font-size: 32px; }
.modal-box h3 { font-size: 20px; margin: 8px 0 8px; font-weight: 800; }
.modal-box p { font-size: 13.5px; color: var(--text-2); }
.order-no {
  margin: 18px 0;
  padding: 14px;
  border-radius: 10px;
  background: rgba(232, 163, 61, .1);
  border: 1px dashed rgba(232, 163, 61, .4);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px;
  letter-spacing: .06em;
  color: var(--amber-2);
  word-break: break-all;
  user-select: all;
}
.modal-actions { display: flex; justify-content: center; gap: 10px; }

/* =========================================================
   点子详情页
   ======================================================= */
.idea-page {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 52px) clamp(16px, 4vw, 32px) 60px;
}
.idea-crumb {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 22px;
}
.idea-crumb a:hover { color: var(--amber-2); }
.crumb-lv {
  color: var(--lv);
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--lv) 32%, transparent);
  background: color-mix(in srgb, var(--lv) 10%, transparent);
}

/* =========================================================
   后台
   ======================================================= */
.admin {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(32px, 5vw, 54px) clamp(16px, 3vw, 32px) 60px;
}
.admin h1 { font-size: 30px; font-weight: 900; letter-spacing: -.03em; margin-bottom: 22px; }
.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}
.admin-stats div {
  padding: 16px 18px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.admin-stats b { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.admin-stats span { font-size: 12px; color: var(--text-3); }
.admin-h2 { font-size: 18px; font-weight: 800; margin: 36px 0 14px; }

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  display: block;
  overflow-x: auto;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.tbl thead th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--text-3);
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  background: rgba(58, 43, 26, .035);
}
.tbl td { padding: 10px 14px; border-bottom: 1px solid rgba(58, 43, 26, .07); }
.tbl tr:last-child td { border-bottom: none; }
.tbl a { color: var(--amber-2); }
.tbl a:hover { text-decoration: underline; }
.td-actions { display: flex; gap: 6px; align-items: center; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.num {
  width: 68px;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: #fffdf9;
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--text-2); }
.pill {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  background: rgba(232, 163, 61, .16);
  color: var(--amber-2);
  border: 1px solid rgba(232, 163, 61, .3);
  vertical-align: middle;
}
.pill-off { background: rgba(180, 70, 52, .1); color: #a8462f; border-color: rgba(180, 70, 52, .26); }
.row-off { opacity: .45; }
.warn-text { color: #9a6113 !important; }

/* =========================================================
   安装页
   ======================================================= */
.install-body { background: var(--bg); min-height: 100vh; }
.install-wrap {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0 auto;
  padding: 54px 20px 80px;
}
.install-logo {
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 26px;
  color: var(--amber-2);
}
.install-logo .em { font-style: normal; font-size: .92em; margin: 0 .05em; }
.install-card {
  padding: 34px clamp(22px, 5vw, 34px);
  border-radius: 20px;
  border: 1px solid var(--line-2);
  background: linear-gradient(170deg, #ffffff, #fdfaf3);
}
.install-card h1 { font-size: 26px; font-weight: 900; margin-bottom: 10px; }
.install-sub { color: var(--text-2); font-size: 14px; margin-bottom: 24px; }
.install-card p { color: var(--text-2); font-size: 14px; margin-bottom: 12px; }
.install-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.form-h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: .06em;
  margin: 14px 0 2px;
}
.form-row { display: flex; gap: 10px; }
.form-row .field { flex: 1; }
.form-row .field.w-narrow { flex: 0 0 96px; }
.warn-box {
  padding: 13px 16px;
  border-radius: 11px;
  border: 1px solid rgba(232, 163, 61, .34);
  background: rgba(232, 163, 61, .09);
  color: var(--amber-2);
  font-size: 13px;
  margin: 14px 0;
}
.code-block {
  padding: 16px;
  border-radius: 11px;
  background: #f5eee1;
  border: 1px solid var(--line);
  font-size: 11.5px;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-all;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .92em;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(58, 43, 26, .07);
}

/* =========================================================
   页脚
   ======================================================= */
.foot {
  position: relative;
  z-index: 1;
  margin-top: clamp(70px, 12vw, 130px);
  padding: 44px clamp(18px, 4vw, 44px) 46px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.foot-logo {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 14px;
  color: var(--amber-2);
}
.foot-logo .em {
  font-style: normal;
  font-size: .92em;
  margin: 0 .05em;
}
.foot-line { font-size: 13px; color: var(--text-2); line-height: 1.9; }
.foot-meta { font-size: 12px; color: var(--text-3); margin-top: 14px; }

/* =========================================================
   响应式
   ======================================================= */
@media (max-width: 820px) {
  .nav {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px 10px;
    padding: 10px 14px;
  }
  .brand { grid-column: 1; grid-row: 1; min-width: 0; overflow: hidden; }
  .nav-right { grid-column: 2; grid-row: 1; justify-self: end; }
  .nav-links {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    flex: 0 0 auto;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 1px;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { padding: 5px 10px; font-size: 12.5px; white-space: nowrap; }
  .brand-mark { font-size: 15px; }
  .wallet { padding: 5px 10px; font-size: 13px; }
  .level-picker { grid-template-columns: 1fr; }
  .level-card { flex-direction: row; align-items: center; gap: 10px; padding: 15px 16px; }
  .lv-emoji { font-size: 22px; margin: 0; }
  .lv-sub { margin-left: auto; font-size: 12px; }
  .lv-desc { display: none !important; }
  .lv-cost { position: static; margin-left: 4px; }
  .btn-xl { width: 100%; padding: 17px 24px; font-size: 16.5px; }
  .hero-stats { gap: 22px; }
  .env { min-height: 330px; }
  .seal { width: 66px; height: 66px; font-size: 25px; }
  .ec-actions .btn { flex: 1 1 auto; }
  .my-top { padding: 20px; }
  .my-wallet { width: 100%; justify-content: space-between; }
  .ledger-row { font-size: 12.5px; padding: 11px 13px; }
  .lg-note { display: none; }
  .grid { grid-template-columns: 1fr; }
}

/* 防溢出保险 */
.env, .env-card, .ec-head, .ec-foot, .ec-body, .ec-title, .meters, .ec-actions,
.idea-card, .pkg, .my-top, .maker-head, .grid { min-width: 0; }
.ec-title, .ec-body, .ic-title, .ic-body { overflow-wrap: anywhere; text-wrap: pretty; }
.badge { max-width: 100%; }

@media (max-width: 520px) {
  .nav { gap: 8px; padding: 10px 12px; }
  .brand-mark { font-size: 14px; }
  .wallet { padding: 4px 9px; gap: 4px; font-size: 12.5px; }
  .wallet-unit { display: none; }
  .nav-right { gap: 6px; }
  .nav-right .btn-sm { padding: 5px 10px; font-size: 12.5px; }
  .nav-links { gap: 2px; }
  .nav-links a { padding: 5px 9px; font-size: 12.5px; }
  .hero { padding-top: 38px; }
  .hero-title { font-size: 25px; }
  .hero-sub { font-size: 14px; line-height: 1.8; }
  .hero-badge { font-size: 11.5px; padding: 5px 11px; margin-bottom: 18px; }
  .hero-stats b { font-size: 20px; }
  .maker-wallet { font-size: 12.5px; gap: 8px; }
  .lv-sub { display: none; }
  .btn-xl { font-size: 15.5px; padding: 15px 22px; }
  .btn-xl .btn-cost { font-size: 11.5px; }
  .ec-title { font-size: 20px; }
  .ec-body { font-size: 14.5px; line-height: 1.9; }
  .ec-actions .btn { flex: 1 1 44%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- 密封态：卡片不占位 ---------- */
.env:not(.open) .env-card {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  pointer-events: none;
}

/* ---------- 生成中 ---------- */
.btn.is-loading {
  pointer-events: none;
  opacity: .78;
}
.btn.is-loading .btn-label::after {
  content: "";
  display: inline-block;
  width: 1.1em;
  text-align: left;
  animation: dots 1.2s steps(4, end) infinite;
}
@keyframes dots {
  0%   { content: ""; }
  25%  { content: "."; }
  50%  { content: ".."; }
  75%  { content: "..."; }
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 20px);
  z-index: 120;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 13.5px;
  color: var(--text);
  background: #fffdf8;
  border: 1px solid rgba(176, 133, 63, .4);
  box-shadow: 0 16px 36px rgba(90, 68, 40, .22);
  opacity: 0;
  transition: .3s cubic-bezier(.2, .9, .3, 1);
  max-width: min(90vw, 420px);
  text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: rgba(180, 70, 52, .4); color: #a8462f; }

/* ---------- 数字跳动 ---------- */
.bump { animation: bump .45s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes bump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.22); color: #9a6113; }
  100% { transform: scale(1); }
}

