/* 桂补余额 — liquid glass design system */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  --ink: rgba(255,255,255,.96);
  --ink-2: rgba(255,255,255,.74);
  --ink-3: rgba(255,255,255,.56);
  --glass: linear-gradient(180deg, rgba(255,255,255,.17) 0%, rgba(255,255,255,.07) 100%);
  --glass-strong: linear-gradient(180deg, rgba(255,255,255,.24) 0%, rgba(255,255,255,.10) 100%);
  --edge: inset 0 1px 0 rgba(255,255,255,.50), inset 0 -1px 0 rgba(255,255,255,.07), inset 0 0 0 1px rgba(255,255,255,.11);
  --drop: 0 30px 60px -28px rgba(4,8,20,.65), 0 8px 24px -12px rgba(4,8,20,.35);
  --blur: blur(30px) saturate(185%);
  --r-xl: 34px; --r-lg: 26px; --r-md: 18px; --r-sm: 13px;
  --spring: cubic-bezier(.34,1.36,.64,1);
  --ease: cubic-bezier(.22,.8,.24,1);
  --live: #4ee6a6; --warn: #ffc369; --off: #b8c0cc; --danger: #ff8a7a;
  --focus: 0 0 0 3px rgba(255,255,255,.9), 0 0 0 7px rgba(120,190,255,.45);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; font-family: var(--font); color: var(--ink);
  background: #0c1424; -webkit-font-smoothing: antialiased; line-height: 1.5; letter-spacing: .005em;
  overflow-x: hidden;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }

/* ---------- background field ---------- */
.field { position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 120%, #f0a36b 0%, rgba(240,163,107,0) 55%),
    radial-gradient(90% 70% at 100% 0%, #1f5e7a 0%, rgba(31,94,122,0) 60%),
    linear-gradient(180deg, #0b1322 0%, #15233a 45%, #3b3550 78%, #7a4f4b 100%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .75; will-change: transform; animation: drift 26s var(--ease) infinite alternate; }
.orb.a { width: 46vmax; height: 46vmax; left: -12vmax; top: -10vmax; background: radial-gradient(circle at 40% 40%, #3fb6c8, rgba(63,182,200,0) 68%); }
.orb.b { width: 40vmax; height: 40vmax; right: -14vmax; top: 18vh; background: radial-gradient(circle at 50% 50%, #ff9c6b, rgba(255,156,107,0) 66%); animation-duration: 32s; animation-delay: -8s; }
.orb.c { width: 34vmax; height: 34vmax; left: 22vw; bottom: -16vmax; background: radial-gradient(circle at 50% 50%, #f2d27a, rgba(242,210,122,0) 66%); opacity: .55; animation-duration: 38s; animation-delay: -14s; }
.orb.d { width: 28vmax; height: 28vmax; left: 55vw; top: -12vmax; background: radial-gradient(circle at 50% 50%, #5d8cff, rgba(93,140,255,0) 66%); opacity: .45; animation-duration: 44s; }
.grain { position: absolute; inset: 0; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
@keyframes drift { 0% { transform: translate3d(0,0,0) scale(1); } 100% { transform: translate3d(6vmax,4vmax,0) scale(1.12); } }

/* ---------- glass primitive ---------- */
.glass { position: relative; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-radius: var(--r-xl); box-shadow: var(--edge), var(--drop); isolation: isolate; }
.glass::before { /* specular sheen */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1;
  background: radial-gradient(120% 60% at 15% -10%, rgba(255,255,255,.30), rgba(255,255,255,0) 55%),
              radial-gradient(80% 50% at 100% 110%, rgba(255,255,255,.10), rgba(255,255,255,0) 60%);
}
.glass::after { /* refraction rim */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; padding: 1px;
  background: linear-gradient(160deg, rgba(255,255,255,.55), rgba(255,255,255,.05) 35%, rgba(255,255,255,0) 60%, rgba(255,255,255,.22));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .7;
}
.glass.soft { background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(255,255,255,.05)); border-radius: var(--r-lg); box-shadow: var(--edge), 0 14px 34px -22px rgba(4,8,20,.6); }

/* ---------- layout ---------- */
.shell { width: min(1120px, 100% - 32px); margin: 0 auto; padding: 18px 0 40px; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
main { flex: 1; padding-top: 28px; }
.nav { position: sticky; top: 14px; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 999px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 650; letter-spacing: .02em; margin-right: auto; min-width: 0; }
.brand small { display: block; font-weight: 500; font-size: 11.5px; color: var(--ink-3); letter-spacing: .04em; }
.brand-mark { width: 30px; height: 30px; border-radius: 50%; flex: none; position: relative;
  background: radial-gradient(circle at 35% 30%, #fff 0, #ffe7c2 18%, #ffb070 48%, #e0743f 100%);
  box-shadow: inset 0 -3px 6px rgba(120,40,0,.35), inset 0 2px 3px rgba(255,255,255,.9), 0 4px 12px -4px rgba(255,140,80,.7); }
.brand-mark::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.75); border-right-color: transparent; transform: rotate(-30deg); }
.nav-links { display: flex; gap: 6px; align-items: center; }

/* ---------- buttons ---------- */
.btn { --bg: rgba(255,255,255,.12); appearance: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 999px; font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap;
  background: var(--bg); color: var(--ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 0 0 1px rgba(255,255,255,.12);
  -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  transition: transform .32s var(--spring), background-color .25s var(--ease), box-shadow .25s var(--ease), opacity .2s; -webkit-tap-highlight-color: transparent; }
.btn:hover { --bg: rgba(255,255,255,.2); transform: translateY(-1px); }
.btn:active { transform: scale(.96); transition-duration: .12s; }
.btn:focus-visible, .field-input:focus-visible, .switch input:focus-visible + span, a:focus-visible, .seg button:focus-visible { outline: none; box-shadow: var(--focus); }
.btn.primary { --bg: rgba(255,255,255,.92); color: #17202f; box-shadow: inset 0 1px 0 #fff, 0 10px 24px -12px rgba(255,190,140,.8); }
.btn.primary:hover { --bg: #fff; }
.btn.ghost { --bg: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.btn.ghost:hover { --bg: rgba(255,255,255,.12); }
.btn.sm { min-height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn.danger { color: #ffd2cb; }
.btn[disabled] { opacity: .55; cursor: default; transform: none; }
.btn.wide { width: 100%; min-height: 50px; font-size: 16px; }

/* ---------- hero ---------- */
.hero { padding: clamp(26px, 5vw, 56px) clamp(22px, 5vw, 60px) clamp(26px, 4vw, 44px); text-align: center; overflow: hidden; }
.eyebrow { font-size: 13px; letter-spacing: .2em; color: var(--ink-2); font-weight: 600; }
.amount-wrap { position: relative; margin: 14px auto 6px; height: clamp(108px, 22vw, 210px); display: flex; align-items: center; justify-content: center; }
.amount { display: flex; align-items: baseline; justify-content: center; gap: .14em; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; transition: opacity .45s var(--ease), filter .45s var(--ease), transform .45s var(--spring); }
.amount .num { font-size: clamp(76px, 17vw, 176px); font-weight: 600; letter-spacing: .015em; line-height: 1; 
  background: linear-gradient(180deg, #fff 30%, rgba(255,255,255,.72)); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 0 transparent; filter: drop-shadow(0 6px 22px rgba(255,200,150,.18)); }
.amount .unit { font-size: clamp(22px, 3.4vw, 34px); font-weight: 600; color: var(--ink-2); letter-spacing: .08em; }
.amount.pulse { animation: pop .7s var(--spring); }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.035); } 100% { transform: scale(1); } }
.amount.dim { opacity: 0; filter: blur(8px); transform: scale(.97); pointer-events: none; }
.interrupt { position: absolute; inset: 0; display: grid; place-content: center; gap: 6px; opacity: 0; transform: scale(1.02); transition: opacity .45s var(--ease), transform .45s var(--ease); pointer-events: none; }
.interrupt.show { opacity: 1; transform: none; }
.interrupt strong { font-size: clamp(30px, 6vw, 54px); font-weight: 600; letter-spacing: .06em; }
.interrupt span { color: var(--ink-2); font-size: 14px; }
.hero-caption { min-height: 24px; color: var(--ink-2); font-size: 15px; margin: 4px 0 22px; }
.meta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; font-size: 13.5px; color: var(--ink-2);
  background: rgba(255,255,255,.09); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 0 0 1px rgba(255,255,255,.08); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--off); position: relative; flex: none; transition: background-color .3s; }
.dot.live { background: var(--live); } .dot.warn { background: var(--warn); } .dot.off { background: var(--off); }
.dot.live::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--live); opacity: 0; animation: ring 2.4s var(--ease) infinite; }
@keyframes ring { 0% { transform: scale(.5); opacity: .7; } 100% { transform: scale(1.6); opacity: 0; } }
.cta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.tile { padding: 20px 22px; }
.tile h3 { margin: 0 0 6px; font-size: 13px; letter-spacing: .12em; color: var(--ink-3); font-weight: 600; }
.tile p { margin: 0; font-size: 16px; color: var(--ink); }
.tile p.big { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- forms ---------- */
.auth { width: min(440px, 100%); margin: 4vh auto 0; padding: 34px clamp(22px, 5vw, 36px) 30px; }
.auth h1, .page-title { margin: 0 0 4px; font-size: 28px; font-weight: 650; letter-spacing: .02em; }
.sub { margin: 0 0 24px; color: var(--ink-2); font-size: 14.5px; }
.form { display: grid; gap: 14px; }
.label { display: grid; gap: 7px; font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.field-input { width: 100%; min-height: 50px; padding: 0 16px; border: 0; border-radius: var(--r-md); font-size: 16px;
  background: rgba(8,14,28,.28); box-shadow: inset 0 1px 2px rgba(0,0,0,.25), inset 0 0 0 1px rgba(255,255,255,.12), 0 1px 0 rgba(255,255,255,.12);
  transition: box-shadow .25s var(--ease), background-color .25s; }
.field-input::placeholder { color: rgba(255,255,255,.4); }
.field-input:hover { background: rgba(8,14,28,.34); }
.field-input[aria-invalid="true"] { box-shadow: inset 0 0 0 1.5px var(--danger); }
.hint { font-size: 12.5px; color: var(--ink-3); }
.err { min-height: 20px; font-size: 13.5px; color: #ffc4ba; }
.alt { margin-top: 18px; text-align: center; font-size: 14px; color: var(--ink-2); }
.alt a { color: #fff; font-weight: 600; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.35); }

/* switch */
.switch { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { width: 52px; height: 32px; border-radius: 999px; background: rgba(255,255,255,.18); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), inset 0 1px 3px rgba(0,0,0,.2); transition: background-color .3s var(--ease); position: relative; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.25); transition: transform .38s var(--spring); }
.switch input:checked + span { background: #3ccf8e; }
.switch input:checked + span::after { transform: translateX(20px); }

/* ---------- user center / admin ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card { padding: 26px 26px 24px; }
.card h2 { margin: 0 0 4px; font-size: 19px; font-weight: 650; }
.row { display: flex; align-items: center; gap: 14px; justify-content: space-between; }
.row + .row { margin-top: 14px; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 4px 18px; flex-wrap: wrap; }
.mini-amount { font-variant-numeric: tabular-nums; font-weight: 650; font-size: 22px; }
.list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; }
.list li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: var(--r-sm); background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); font-size: 14px; }
.list li .t { color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.empty { padding: 22px 8px; text-align: center; color: var(--ink-3); font-size: 14px; }
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.12); white-space: nowrap; }
.badge.ok { background: rgba(78,230,166,.18); color: #b5f7d9; } .badge.warn { background: rgba(255,195,105,.18); color: #ffe2b5; } .badge.bad { background: rgba(255,138,122,.2); color: #ffd0c8; }
.seg { display: inline-flex; padding: 4px; border-radius: 999px; gap: 2px; background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1), inset 0 1px 2px rgba(0,0,0,.15); overflow-x: auto; max-width: 100%; }
.seg button { border: 0; background: transparent; cursor: pointer; padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--ink-2); transition: background-color .3s var(--ease), color .2s, box-shadow .3s; white-space: nowrap; }
.seg button[aria-selected="true"] { background: rgba(255,255,255,.9); color: #16202f; box-shadow: 0 4px 12px -6px rgba(0,0,0,.45); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { padding: 18px 20px; }
.stat b { display: block; font-size: 30px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat span { color: var(--ink-3); font-size: 13px; letter-spacing: .06em; }
.table { width: 100%; border-collapse: separate; border-spacing: 0 6px; font-size: 14px; }
.table th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: 12.5px; letter-spacing: .06em; padding: 0 12px 2px; }
.table td { padding: 12px; background: rgba(255,255,255,.06); vertical-align: middle; }
.table td:first-child { border-radius: 12px 0 0 12px; } .table td:last-child { border-radius: 0 12px 12px 0; text-align: right; }
.table .muted { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; margin: 0 -6px; padding: 0 6px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; font-size: 14.5px; margin: 14px 0 0; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; font-variant-numeric: tabular-nums; word-break: break-all; }

.footer { margin-top: 40px; text-align: center; font-size: 12.5px; color: var(--ink-3); line-height: 1.75; padding: 0 12px; }
.footer b { color: var(--ink-2); font-weight: 600; }

.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 500; z-index: 50; transition: opacity .3s var(--ease), transform .4s var(--spring); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.view { animation: enter .5s var(--ease) both; }
@keyframes enter { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (max-width: 860px) { .stats { grid-template-columns: repeat(2, 1fr); } .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .shell { width: calc(100% - 24px); padding-top: 10px; }
  .nav { top: 8px; padding-left: 12px; }
  .brand small { display: none; }
  .tiles { grid-template-columns: 1fr; gap: 12px; }
  .tile { padding: 16px 18px; }
  .card { padding: 22px 18px 20px; }
  main { padding-top: 18px; }
  .hide-sm { display: none !important; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { margin-bottom: 8px; border-radius: 14px; overflow: hidden; }
  .table td { border-radius: 0 !important; padding: 8px 14px; text-align: left !important; }
  .table td:first-child { padding-top: 14px; } .table td:last-child { padding-bottom: 14px; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass, .btn { background: rgba(28,38,58,.86); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .orb { animation: none; }
}
.grid2 + .card, .stats + .card { margin-top: 18px; }
.card .meta-row { justify-content: flex-start; margin-top: 6px; }
.card .sub { margin-bottom: 16px; }
.head .sub { margin: 4px 0 0; }
.card .row .field-input { min-height: 40px; width: min(280px, 52vw); }
.card > .row:first-child { margin-bottom: 8px; }
.hero-caption, .tile p, .footer div, .sub, .interrupt span { text-wrap: balance; }
body { background: linear-gradient(180deg, #0b1322 0%, #15233a 45%, #3b3550 78%, #7a4f4b 100%) fixed, #0c1424; }
.head > .btn { margin-left: auto; }
@media (max-width: 640px) { .meta-row { gap: 8px; } .hero-caption { font-size: 14px; } }
.interrupt, .interrupt * { font-family: var(--font); }
