/* 乒乓啪 · 游戏风设计系统
   参考：Duolingo 的厚边 3D 按钮与卡片、Supercell 的段位徽章与对战页、iOS 的分段控件与底部导航 */
:root {
  --ink: #1B1340;
  --muted: #7A7393;
  --bg: #F3F0FF;
  --card: #FFFFFF;
  --line: #E7E2F5;
  --line-d: #D6CFEA;

  --brand: #6C3CF0;   --brand-d: #4B22C4;
  --night: #24105E;   --night-2: #3D1A9E;
  --coral: #FF5A3C;   --coral-d: #D2381C;
  --green: #4CCB2F;   --green-d: #37A01C;
  --blue: #1CB0F6;    --blue-d: #1490CC;
  --gold: #FFC800;    --gold-d: #E0A100;
  --red: #FF4B4B;

  /* 表面与辅助色：白天 / 夜间各一套（夜间见文件末尾 [data-theme="dark"]） */
  --surface: #FFFFFF;  --field: #F9F7FF;  --soft: #F1ECFF;  --tint: #F7F4FF;  --soft-d: #D9CCFF;
  --seg: #E9E4F8;  --track: rgba(27, 19, 64, .1);  --sep: #F2EFF9;  --faint: #C2BBD6;  --switch-off: #DDD7EE;
  --dots: rgba(108, 60, 240, .07);  --star-off: rgba(27, 19, 64, .16);  --edge: #FFFFFF;
  --alert-bg: #FFF8F5;  --alert-line: #FFC3B6;  --win-bg: #EEFBE8;  --lose-bg: #FFF0F0;  --danger-line: #F3C3C3;
  --brand-ink: #4B22C4;  --coral-ink: #D2381C;  --blue-ink: #1490CC;  --green-ink: #37A01C;
  --even-bg: #FFE8E3;  --even-fg: #C2361A;  --up-bg: #DDF4FF;  --up-fg: #0B7FB5;  --down-bg: #E4F8DC;  --down-fg: #2E8A14;
  --warn-bg: #FFF4CC;  --warn-fg: #8A5B00;  --gray-bg: #EEECF4;

  --r: 20px;
  --font: "Nunito", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* 防止连点按钮时双击放大 */
html { touch-action: manipulation; }
html, body { margin: 0; }
body {
  background-color: var(--bg);
  background-image: radial-gradient(var(--dots) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  color: var(--ink);
  font: 600 15px/1.5 var(--font);
  -webkit-text-size-adjust: 100%;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
  min-height: 100vh;
}
a { color: var(--brand); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
b, strong { font-weight: 900; }

#app { max-width: 480px; margin: 0 auto; padding: 12px 16px 24px; }
.boot { display: grid; place-items: center; min-height: 70vh; }

/* 路由进场动画（只在换页时触发，轮询刷新不触发） */
#app.enter > * { animation: rise .42s cubic-bezier(.2, .9, .3, 1.2) both; }
#app.enter > *:nth-child(2) { animation-delay: .04s; }
#app.enter > *:nth-child(3) { animation-delay: .08s; }
#app.enter > *:nth-child(4) { animation-delay: .12s; }
#app.enter > *:nth-child(5) { animation-delay: .16s; }
#app.enter > *:nth-child(n+6) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* 顶部加载条 */
#loadbar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 50;
  background: linear-gradient(90deg, var(--gold), var(--coral), var(--brand));
  transition: width .3s ease, opacity .3s ease; opacity: 0;
}
#loadbar.on { opacity: 1; width: 70%; transition: width 2.5s cubic-bezier(.1, .7, .2, 1); }
#loadbar.done { opacity: 0; width: 100%; }

/* 顶部标题 */
.top { display: flex; align-items: center; gap: 8px; margin: 2px 0 14px; min-height: 40px; }
.top h1 { font-size: 24px; margin: 0; font-weight: 900; flex: 1; letter-spacing: .5px; }
.back {
  width: 40px; height: 40px; border-radius: 14px; border: 2px solid var(--line); border-bottom-width: 4px;
  background: var(--surface); font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink); display: grid; place-items: center;
  padding: 0 0 2px;
}
.back:active { border-bottom-width: 2px; transform: translateY(2px); }

h2 { font-size: 18px; margin: 24px 2px 10px; font-weight: 900; display: flex; align-items: baseline; gap: 8px; }
h2 small { font-weight: 700; color: var(--muted); font-size: 13px; }
h2 .more { margin-left: auto; font-size: 13px; color: var(--brand); font-weight: 800; }

/* 卡片：Duolingo 式厚底边 */
.card {
  background: var(--card); border-radius: var(--r); padding: 14px;
  border: 2px solid var(--line); border-bottom-width: 5px; margin-bottom: 12px; position: relative;
}
.tap { cursor: pointer; }
.card.tap:active { transform: translateY(2px); border-bottom-width: 3px; margin-bottom: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); font-size: 13px; font-weight: 600; }
.small { font-size: 12.5px; }
.center { text-align: center; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.num { font-variant-numeric: tabular-nums; font-weight: 900; }

/* 空状态 */
.empty { text-align: center; color: var(--muted); padding: 22px 12px 12px; font-size: 14px; }
.empty .art { font-size: 54px; line-height: 1; margin-bottom: 8px; display: block; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }

/* 头像：外圈颜色跟段位走 */
.avatar {
  --ring: var(--gold);
  width: 50px; height: 50px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 27px; background: var(--soft); box-shadow: 0 0 0 3px var(--edge), 0 0 0 6px var(--ring); margin: 6px;
}
.avatar.sm { width: 40px; height: 40px; font-size: 22px; margin: 5px; box-shadow: 0 0 0 2px var(--edge), 0 0 0 4px var(--ring); }
.avatar.lg { width: 68px; height: 68px; font-size: 38px; }
.avatar.xl { width: 88px; height: 88px; font-size: 50px; }

/* 段位徽章 */
.badge { display: inline-flex; flex-direction: column; align-items: center; flex: none; line-height: 1; }
.badge svg { width: var(--s, 56px); height: auto; display: block; filter: drop-shadow(0 3px 0 rgba(27, 19, 64, .18)); overflow: visible; }
.stars { display: flex; gap: 1px; margin-top: 2px; font-size: calc(var(--s, 56px) * .2); letter-spacing: 0; }
.stars i { font-style: normal; color: var(--gold); text-shadow: 0 1px 0 var(--gold-d); }
.stars i.off { color: var(--star-off); text-shadow: none; }
.tiername { font-weight: 900; }
.locked svg { filter: grayscale(1) opacity(.35); }

/* 标签 */
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 800; background: var(--soft); color: var(--brand-ink); white-space: nowrap;
}
.chip.even { background: var(--even-bg); color: var(--even-fg); }
.chip.up { background: var(--up-bg); color: var(--up-fg); }
.chip.down { background: var(--down-bg); color: var(--down-fg); }
.chip.battle { background: var(--even-bg); color: var(--even-fg); }
.chip.practice { background: var(--up-bg); color: var(--up-fg); }
.chip.warn { background: var(--warn-bg); color: var(--warn-fg); }
.chip.fire { background: linear-gradient(90deg, #FF8A00, #FF3D3D); color: #fff; }
.chip.gray { background: var(--gray-bg); color: var(--muted); }
.chip.solid { background: var(--brand); color: #fff; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }

/* 按钮：厚底 3D，按下沉下去 */
.btn {
  --c: var(--coral); --d: var(--coral-d);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 50px; padding: 0 20px; border-radius: 16px; border: 0; cursor: pointer;
  font-weight: 900; font-size: 16px; letter-spacing: .5px; background: var(--c); color: #fff;
  box-shadow: 0 5px 0 var(--d); margin-bottom: 5px; position: relative; top: 0;
  transition: top .06s, box-shadow .06s; text-align: center; line-height: 1.15; user-select: none;
}
.btn::after {
  content: ""; position: absolute; left: 10px; right: 10px; top: 5px; height: 30%;
  border-radius: 99px; background: rgba(255, 255, 255, .22); pointer-events: none;
}
.btn:active:not([disabled]) { top: 5px; box-shadow: 0 0 0 var(--d); }
.btn[disabled] { filter: grayscale(.6); opacity: .55; cursor: default; }
.btn.block { width: 100%; }
.btn.green { --c: var(--green); --d: var(--green-d); }
.btn.blue { --c: var(--blue); --d: var(--blue-d); }
.btn.gold { --c: var(--gold); --d: var(--gold-d); color: #5A3B00; }
.btn.brand { --c: var(--brand); --d: var(--brand-d); }
.btn.ghost { --c: var(--surface); --d: var(--line-d); color: var(--ink); box-shadow: 0 5px 0 var(--d), inset 0 0 0 2px var(--line-d); }
.btn.ghost::after, .btn.soft::after { display: none; }
.btn.soft { --c: var(--soft); --d: var(--soft-d); color: var(--brand-ink); }
.btn.danger { --c: var(--surface); --d: var(--danger-line); color: var(--red); box-shadow: 0 5px 0 var(--d), inset 0 0 0 2px var(--danger-line); }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 13px; box-shadow: 0 4px 0 var(--d); margin-bottom: 4px; }
.btn.sm.ghost { box-shadow: 0 4px 0 var(--d), inset 0 0 0 2px var(--line-d); }
.btn.sm:active:not([disabled]) { top: 4px; }
.btn.lg { min-height: 58px; font-size: 18px; border-radius: 18px; }
.btns { display: flex; gap: 10px; margin-top: 14px; }
.btns > .btn { flex: 1; padding: 0 8px; }
.link { background: none; border: 0; color: var(--brand); font-weight: 800; cursor: pointer; padding: 6px 4px; }
.pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }

/* 表单 */
label.f { display: block; margin: 16px 2px 6px; font-weight: 900; font-size: 14px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 50px; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--field); outline: none; font-size: 16px; font-weight: 700;
}
.input:focus { border-color: var(--brand); background: var(--surface); }
.input::placeholder { color: var(--faint); font-weight: 600; }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 2px 0; }
.err { color: var(--red); font-size: 13.5px; margin-top: 8px; min-height: 1em; font-weight: 800; }
.err:not(:empty) { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* 选择胶囊 */
.pick { display: flex; gap: 8px; flex-wrap: wrap; }
.pick button {
  border: 2px solid var(--line); border-bottom-width: 4px; background: var(--surface); border-radius: 14px;
  padding: 8px 14px; cursor: pointer; font-weight: 800; font-size: 14px;
}
.pick button:active { transform: translateY(2px); border-bottom-width: 2px; }
.pick button.on { border-color: var(--brand); background: var(--soft); color: var(--brand-ink); }
.pick.avatars button { font-size: 26px; padding: 4px 9px; }
.pick.avatars button.on { transform: scale(1.08); }

/* 分段控件 */
.seg { display: flex; background: var(--seg); border-radius: 16px; padding: 4px; gap: 4px; }
.seg button {
  flex: 1; border: 0; background: none; border-radius: 12px; padding: 9px 6px; font-weight: 900; font-size: 14px;
  color: var(--muted); cursor: pointer;
}
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 2px 0 var(--line-d); }

.option {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 2px solid var(--line);
  border-bottom-width: 5px; background: var(--surface); border-radius: 18px; padding: 10px 14px; margin-bottom: 10px; cursor: pointer;
}
.option:active { transform: translateY(2px); border-bottom-width: 3px; }
.option.on { border-color: var(--brand); background: var(--tint); }
.option .key {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  border: 2px solid var(--line); font-weight: 900; color: var(--muted);
}
.option.on .key { border-color: var(--brand); background: var(--brand); color: #fff; }

/* 开关 */
.switch { appearance: none; -webkit-appearance: none; width: 52px; height: 32px; border-radius: 99px; background: var(--switch-off); position: relative; cursor: pointer; flex: none; transition: .2s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 0 rgba(0, 0, 0, .12); transition: .2s; }
.switch:checked { background: var(--green); }
.switch:checked::after { left: 23px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); flex: none; margin: 0; }

/* 进度条（经验条） */
.bar {
  height: 16px; border-radius: 99px; background: var(--track); overflow: hidden; margin: 12px 0 6px; position: relative;
}
.bar > i {
  display: block; height: 100%; border-radius: inherit; position: relative;
  background: linear-gradient(90deg, var(--gold), #FF9F1C); transition: width 1s cubic-bezier(.2, .8, .2, 1);
}
.bar > i::after {
  content: ""; position: absolute; left: 8px; right: 8px; top: 3px; height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .45);
}
.barlabel { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 800; }

/* 主角卡（大厅 / 个人页） */
.hero {
  position: relative; overflow: hidden; color: #fff; border-radius: 26px; padding: 16px;
  background: radial-gradient(120% 90% at 100% 0%, #8A5CFF 0%, transparent 60%), linear-gradient(160deg, var(--night-2), var(--night));
  box-shadow: 0 6px 0 #170A40;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .35) 1px, transparent 1px); background-size: 18px 18px;
  mask-image: linear-gradient(180deg, #000, transparent 70%); -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%);
}
.hero > * { position: relative; }
.hero .muted { color: rgba(255, 255, 255, .72); }
.hero .name { color: #fff; }
.hero .bar { background: rgba(255, 255, 255, .16); }
.hero .avatar { background: rgba(255, 255, 255, .14); box-shadow: 0 0 0 3px var(--night), 0 0 0 6px var(--ring); }
.hero .stars i.off { color: rgba(255, 255, 255, .22); }
.hero .chip { background: rgba(255, 255, 255, .16); color: #fff; }
.hero .chip.fire { background: linear-gradient(90deg, #FF8A00, #FF3D3D); }
.name { font-weight: 900; font-size: 17px; }
.rating { font-weight: 900; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.rating small { font-size: 13px; font-weight: 800; opacity: .7; margin-left: 2px; }

.stat { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; margin-top: 14px; }
.stat > div { background: rgba(255, 255, 255, .1); border-radius: 14px; padding: 8px 2px; font-size: 12px; font-weight: 700; }
.stat b { display: block; font-size: 20px; line-height: 1.2; }
.card .stat > div { background: var(--tint); }

/* 球友卡 */
.pcard .meter { margin-top: 12px; }
.pcard .btns { margin-top: 12px; }
.pcard .btns .btn { min-height: 44px; font-size: 15px; }
.pcard .btns .btn.icon { flex: 0 0 52px; padding: 0; }
.ago { font-size: 11.5px; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.ago .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.ago .dot.live { background: var(--green); box-shadow: 0 0 0 3px rgba(76, 203, 47, .2); }

/* 胜率条：你 vs TA */
.meter .mbar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--blue); }
.meter .mbar i { display: block; background: var(--coral); border-right: 3px solid var(--card); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.meter .ml { display: flex; justify-content: space-between; font-size: 12px; font-weight: 900; margin-top: 4px; }
.meter .ml .a { color: var(--coral-ink); }
.meter .ml .b { color: var(--blue-ink); }
.meter .ml .t { color: var(--muted); font-weight: 800; }

/* 今天想打：Stories 式 */
.stories { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.stories::-webkit-scrollbar { display: none; }
.story { flex: none; width: 76px; text-align: center; cursor: pointer; }
.story .ring {
  width: 70px; height: 70px; margin: 0 auto; border-radius: 50%; padding: 3px; display: grid; place-items: center;
  background: conic-gradient(from 200deg, var(--gold), var(--coral), var(--brand), var(--gold));
}
.story .ring > div { width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; font-size: 32px; border: 3px solid var(--bg); background-color: var(--soft); }
.story .nm { font-size: 12.5px; font-weight: 900; margin-top: 4px; }
.story .sl { font-size: 11px; color: var(--muted); font-weight: 700; }
.story.add .ring { background: none; border: 3px dashed var(--line-d); }
.story.add .ring > div { background: var(--surface); color: var(--brand); font-size: 30px; font-weight: 900; }

/* 待处理 */
.alert { border-color: var(--alert-line); background: var(--alert-bg); }
.alert::before {
  content: ""; position: absolute; top: -5px; right: -5px; width: 14px; height: 14px; border-radius: 50%; background: var(--coral);
  box-shadow: 0 0 0 0 rgba(255, 90, 60, .6); animation: ping 1.6s infinite;
}
@keyframes ping { 70% { box-shadow: 0 0 0 10px rgba(255, 90, 60, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 90, 60, 0); } }
.kicker { font-size: 12px; font-weight: 900; letter-spacing: 1px; color: var(--coral-ink); }

/* VS 对战卡 */
.vs {
  position: relative; overflow: hidden; border-radius: 26px; padding: 18px 12px 16px; color: #fff; margin-bottom: 12px;
  background: linear-gradient(105deg, #FF6A3D 0%, #FF3D6E 49.6%, #fff 49.6%, #fff 50.4%, #2D8CFF 50.4%, #5B3CF0 100%);
  box-shadow: 0 6px 0 #2A1468;
}
.vs::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(105deg, rgba(255, 255, 255, .06) 0 12px, transparent 12px 24px);
}
.vs .sides { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; position: relative; z-index: 1; }
.vs .side { text-align: center; min-width: 0; }
.vs .side .avatar { margin: 6px auto 8px; background: rgba(255, 255, 255, .2); box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 0 0 6px var(--ring); }
.vs .side .name { font-size: 15px; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.vs .side .small { font-weight: 800; opacity: .92; }
.vs .mid {
  font-size: 38px; font-weight: 900; font-style: italic; color: var(--gold); letter-spacing: -2px; padding: 0 4px;
  text-shadow: 0 3px 0 #8A4B00, 0 0 18px rgba(255, 200, 0, .55); animation: vsin .6s cubic-bezier(.2, 1.6, .4, 1) both .15s;
}
@keyframes vsin { from { transform: scale(2.4) rotate(-12deg); opacity: 0; } }
.vs .meter { position: relative; z-index: 1; margin-top: 14px; background: rgba(23, 10, 64, .55); border-radius: 14px; padding: 8px 10px; }
.vs .meter .mbar { background: rgba(255, 255, 255, .35); }
.vs .meter .mbar i { background: #fff; border-right-color: var(--gold); }
.vs .meter .ml span { color: #fff !important; }

/* 比分选择 */
.scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.scores button {
  border: 2px solid var(--line); border-bottom-width: 5px; border-radius: 16px; background: var(--surface); padding: 10px 4px 8px; cursor: pointer;
}
.scores button b { display: block; font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.scores button span { font-size: 12px; font-weight: 900; }
.scores button.w span { color: var(--green-ink); }
.scores button.l span { color: var(--red); }
.scores button:active { transform: translateY(3px); border-bottom-width: 2px; }
.scores button.on.w { border-color: var(--green); background: var(--win-bg); }
.scores button.on.l { border-color: var(--red); background: var(--lose-bg); }

/* 结算页 */
.settle {
  position: relative; overflow: hidden; color: #fff; text-align: center; border-radius: 28px; padding: 26px 18px 20px;
  background: radial-gradient(80% 60% at 50% 30%, #7B4DFF 0%, var(--night-2) 55%, var(--night) 100%);
  box-shadow: 0 6px 0 #170A40;
}
.settle.lose { background: radial-gradient(80% 60% at 50% 30%, #4F4A78 0%, #2F2A55 60%, #1F1B3D 100%); box-shadow: 0 6px 0 #15122B; }
.settle .rays {
  position: absolute; left: 50%; top: 130px; width: 760px; height: 760px; margin: -380px 0 0 -380px; pointer-events: none; opacity: .18;
  background: repeating-conic-gradient(#fff 0 9deg, transparent 9deg 22.5deg); border-radius: 50%;
  mask-image: radial-gradient(circle, #000 10%, transparent 60%); -webkit-mask-image: radial-gradient(circle, #000 10%, transparent 60%);
  animation: spin 24s linear infinite;
}
.settle.lose .rays { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.settle > * { position: relative; }
.settle .muted { color: rgba(255, 255, 255, .72); }
.settle .big {
  font-size: 44px; font-weight: 900; letter-spacing: 2px; margin: 6px 0 0; color: var(--gold);
  text-shadow: 0 4px 0 #A35A00, 0 8px 24px rgba(0, 0, 0, .25); animation: slam .55s cubic-bezier(.2, 1.5, .4, 1) both;
}
.settle.lose .big { font-size: 32px; color: #fff; text-shadow: 0 3px 0 rgba(0, 0, 0, .3); }
@keyframes slam { from { transform: scale(2.2); opacity: 0; } }
.settle .score { font-size: 54px; font-weight: 900; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.settle .delta { font-size: 56px; font-weight: 900; margin: 10px 0 0; line-height: 1; font-variant-numeric: tabular-nums; }
.settle .delta.plus { color: #8CFF5C; text-shadow: 0 4px 0 #2F7F12; }
.settle .delta.minus { color: #FFB3A5; text-shadow: 0 3px 0 rgba(0, 0, 0, .25); }
.settle .deltal { font-size: 13px; font-weight: 900; letter-spacing: 2px; opacity: .8; }
.settle .line { margin: 6px 0; font-size: 15px; font-weight: 800; }
.settle .bar { background: rgba(255, 255, 255, .16); }
.settle .badge { margin-top: 14px; animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) both .5s; }
.settle .up {
  display: inline-block; background: var(--gold); color: #5A3B00; font-weight: 900; border-radius: 99px; padding: 6px 16px; margin: 10px 0 4px;
  box-shadow: 0 4px 0 var(--gold-d); animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) both 1.1s; font-size: 15px;
}
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.note { font-size: 12.5px; background: rgba(255, 255, 255, .1); border-radius: 12px; padding: 7px 10px; margin-top: 8px; font-weight: 700; }

.poster-wrap { margin-top: 16px; text-align: center; }
.poster-wrap img { width: 100%; border-radius: 20px; border: 2px solid var(--line); border-bottom-width: 5px; }

/* 列表 */
.list-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 2px solid var(--sep); }
.list-item:last-child { border-bottom: 0; }
.list-item .chev { color: var(--faint); font-size: 20px; font-weight: 900; }
.plus { color: var(--green-ink); font-weight: 900; }
.minus { color: var(--red); font-weight: 900; }
.res { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-weight: 900; color: #fff; flex: none; font-size: 14px; }
.res.w { background: var(--green); box-shadow: 0 3px 0 var(--green-d); }
.res.l { background: #FF7A7A; box-shadow: 0 3px 0 #D85555; }
.badge-dot {
  display: inline-block; min-width: 20px; height: 20px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px;
  line-height: 20px; text-align: center; padding: 0 6px; font-weight: 900; border: 2px solid var(--edge);
}

/* 段位之路 */
.road { display: flex; gap: 6px; overflow-x: auto; padding: 8px 2px 4px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.road::-webkit-scrollbar { display: none; }
.road .step { flex: none; width: 74px; text-align: center; scroll-snap-align: center; position: relative; }
.road .step .badge { height: 66px; justify-content: flex-start; }
.road .step .nm { font-size: 11.5px; font-weight: 900; margin-top: 6px; }
.road .step .mn { font-size: 11px; color: var(--muted); font-weight: 700; }
.road .step.me::before {
  content: attr(data-here); position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 1;
  background: var(--coral); color: #fff; font-size: 10px; font-weight: 900; padding: 1px 6px; border-radius: 99px; white-space: nowrap;
}
.road .step.me .badge { animation: bob 2.4s ease-in-out infinite; }

/* 排行榜 */
.podium { display: grid; grid-template-columns: 1fr 1.1fr 1fr; gap: 8px; align-items: end; margin: 16px 0 14px; }
.podium .p { text-align: center; min-width: 0; }
.podium .p .avatar { margin: 6px auto; }
.podium .p .name { font-size: 14px; }
.podium .block {
  margin-top: 8px; border-radius: 16px 16px 8px 8px; color: #fff; font-weight: 900; font-size: 30px; display: grid; place-items: center;
}
.podium .p1 .block { height: 96px; background: linear-gradient(180deg, #FFD84D, #FFB800); box-shadow: 0 5px 0 #D29500; color: #6B4300; }
.podium .p2 .block { height: 72px; background: linear-gradient(180deg, #DCE3F0, #B8C4D9); box-shadow: 0 5px 0 #96A3BB; color: #4A5468; }
.podium .p3 .block { height: 56px; background: linear-gradient(180deg, #FFC79A, #F09B5C); box-shadow: 0 5px 0 #C9733A; color: #6B3A12; }
.podium .crown { font-size: 26px; line-height: 1; animation: bob 2.4s ease-in-out infinite; }
.rk { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; background: var(--soft); color: var(--brand-ink); flex: none; font-size: 14px; }
.mine { border-color: var(--brand); background: var(--tint); }

/* 设置列表 */
.menu .list-item { min-height: 52px; }
.menu .ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; flex: none; background: var(--soft); }

/* 底部导航 */
#tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 10;
  width: min(calc(100% - 20px), 460px); background: var(--surface); border: 2px solid var(--line); border-bottom-width: 5px;
  border-radius: 24px; display: flex; align-items: flex-end; justify-content: space-around; padding: 6px 4px;
}
#tabbar[hidden] { display: none; }
#tabbar a {
  flex: 1; text-align: center; padding: 4px 0 2px; font-size: 11px; color: var(--muted); font-weight: 900; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
#tabbar a svg { width: 26px; height: 26px; transition: transform .2s; }
#tabbar a.on { color: var(--brand); }
#tabbar a.on svg { transform: translateY(-2px) scale(1.08); }
#tabbar a.main svg { display: none; }
#tabbar a.main .fab {
  width: 56px; height: 56px; border-radius: 18px; margin-top: -26px; display: grid; place-items: center; font-size: 28px;
  background: linear-gradient(160deg, #FF7A50, var(--coral)); box-shadow: 0 5px 0 var(--coral-d); border: 3px solid var(--edge);
  transition: transform .15s;
}
#tabbar a.main:active .fab { transform: translateY(4px); box-shadow: 0 1px 0 var(--coral-d); }
#tabbar a.main.on { color: var(--coral-ink); }
#tabbar a .badge-dot { position: absolute; top: -6px; left: 54%; }

#toast {
  position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translate(-50%, -30px) scale(.9);
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 16px; font-size: 14.5px; font-weight: 800;
  opacity: 0; pointer-events: none; transition: .3s cubic-bezier(.2, 1.4, .4, 1); max-width: 88vw; text-align: center; z-index: 60;
  box-shadow: 0 5px 0 rgba(0, 0, 0, .25);
}
#toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* 登录页 */
.splash {
  margin: -12px -16px 16px; padding: 46px 20px 34px; text-align: center; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 0%, #8A5CFF, var(--night-2) 55%, var(--night)); border-radius: 0 0 36px 36px;
}
.splash h1 { font-size: 34px; margin: 14px 0 4px; font-weight: 900; letter-spacing: 2px; text-shadow: 0 4px 0 rgba(0, 0, 0, .25); }
/* 品牌：主推 PingPop，中文版在旁边小字带出“乒乓啪” */
.splash h1.brand { font-size: 44px; letter-spacing: 1px; display: inline-flex; align-items: center; gap: 10px; }
.splash h1.brand small {
  font-size: 14px; font-weight: 900; letter-spacing: 2px; padding: 3px 9px; border-radius: 10px; text-shadow: none;
  background: rgba(255, 255, 255, .16); border: 1.5px solid rgba(255, 255, 255, .28); color: rgba(255, 255, 255, .9);
}
.splash .muted { color: rgba(255, 255, 255, .78); font-size: 15px; }
.ballstage { height: 108px; position: relative; }
.ball {
  position: absolute; left: 50%; top: 0; width: 46px; height: 46px; margin-left: -23px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #FFE3C2 45%, #FF9A3C); box-shadow: inset -4px -6px 0 rgba(0, 0, 0, .08);
  animation: bounce 1.1s cubic-bezier(.5, 0, .5, 1) infinite;
}
.shadow { position: absolute; left: 50%; bottom: 0; width: 60px; height: 10px; margin-left: -30px; border-radius: 50%; background: rgba(0, 0, 0, .3); animation: shadow 1.1s cubic-bezier(.5, 0, .5, 1) infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(54px) scaleY(.92); } }
@keyframes shadow { 0%, 100% { transform: scale(.5); opacity: .4; } 50% { transform: scale(1); opacity: .8; } }
.paddles { font-size: 42px; display: flex; justify-content: center; gap: 70px; margin-top: -54px; }
.paddles span:last-child { transform: scaleX(-1); display: inline-block; }

/* 语言切换 */
.langbtn {
  border: 2px solid var(--line); border-bottom-width: 4px; background: var(--surface); color: var(--ink); border-radius: 12px;
  padding: 5px 12px; font-weight: 900; font-size: 13px; cursor: pointer;
}
.langbtn:active { transform: translateY(2px); border-bottom-width: 2px; }
.splash .langbtn { position: absolute; top: 14px; right: 16px; z-index: 2; background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .3); }
.seg button[data-lang], .seg button[data-theme-set] { padding: 6px 4px; font-size: 13px; white-space: nowrap; }

.steps { display: flex; gap: 6px; margin-bottom: 14px; }
.steps i { flex: 1; height: 8px; border-radius: 99px; background: var(--line); }
.steps i.on { background: var(--green); }

table.admin { width: 100%; border-collapse: collapse; font-size: 12px; }
table.admin td, table.admin th { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; vertical-align: top; }

#fx { position: fixed; inset: 0; pointer-events: none; z-index: 40; }

/* 夜间模式：<html data-theme="dark">（“自动”时由 theme.js 跟随系统设置） */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #ECE8FF;  --muted: #9C95B8;  --bg: #110A24;  --card: #1C1437;  --line: #2D2452;  --line-d: #3A3068;
  --surface: #241B45;  --field: #170F2F;  --soft: #2D2259;  --tint: #221944;  --soft-d: #3F327C;
  --seg: #170F2F;  --track: rgba(255, 255, 255, .1);  --sep: #271E48;  --faint: #5B527F;  --switch-off: #3A3068;
  --dots: rgba(160, 130, 255, .08);  --star-off: rgba(255, 255, 255, .2);  --edge: #1C1437;
  --alert-bg: #2A1530;  --alert-line: #7A3326;  --win-bg: #16301B;  --lose-bg: #371A24;  --danger-line: #6B2B36;
  --brand-ink: #C4B0FF;  --coral-ink: #FF8A70;  --blue-ink: #5EC6FF;  --green-ink: #6EDB4D;
  --even-bg: #3D1F1E;  --even-fg: #FF9C85;  --up-bg: #0F2F4A;  --up-fg: #6BCBFF;  --down-bg: #17341A;  --down-fg: #7FDD5E;
  --warn-bg: #3A2E0C;  --warn-fg: #FFD34D;  --gray-bg: #2A2349;
}
:root[data-theme="dark"] .hero, :root[data-theme="dark"] .settle:not(.lose), :root[data-theme="dark"] .vs { box-shadow: 0 6px 0 #07031A; }
:root[data-theme="dark"] .badge svg { filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .45)); }
:root[data-theme="dark"] .podium .block { filter: saturate(.9) brightness(.92); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
