:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --sheet: #ffffff;
  --ink: #0f172a;
  --dim: #64748b;
  --line: #e6ebf2;
  --up: #059669;
  --down: #e11d48;
  --gold: #d97706;
  --flat: #e8edf4;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #e7eef8;
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

.app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  padding-bottom: calc(64px + env(safe-area-inset-bottom));
}

.page.hide, .sheet.hide, .toast.hide, .hide { display: none; }

.top, .trade-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  background: var(--bg);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
}

.brand em {
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #f0b90b;
  color: #111;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.brand svg {
  width: 22px;
  height: 22px;
  display: block;
}

.banner-wrap {
  position: relative;
  margin: 8px 16px 10px;
  overflow: hidden;
  border-radius: 14px;
}

.banner-track {
  display: flex;
  transition: transform 0.45s ease;
}

.banner {
  flex: 0 0 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 132px;
  padding: 18px 16px 26px;
  background: linear-gradient(135deg, #fff7e8, #ffffff);
  border: 1px solid #f3e2c4;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.banner.tone-gold { background: linear-gradient(135deg, #fff4d6, #fffdf8); border-color: #f3e2c4; }
.banner.tone-green { background: linear-gradient(135deg, #ecfdf5, #ffffff); border-color: #bbf7d0; }
.banner.tone-blue { background: linear-gradient(135deg, #eff6ff, #ffffff); border-color: #dbeafe; }

.banner h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
}

.banner p {
  margin: 0;
  color: var(--dim);
  font-size: 12px;
}

.banner .gold {
  margin: 4px 0 12px;
  color: #b45309;
  font-size: 13px;
}

.banner button {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 15px;
  background: linear-gradient(90deg, #f0c36a, #e7b34a);
  color: #3a2a0a;
  font-size: 12px;
  font-weight: 600;
}

.banner.done button {
  background: #e8edf4;
  color: #888;
}

.gift {
  width: 108px;
  height: 88px;
  position: relative;
}

.gift .lid {
  position: absolute;
  left: 10px;
  top: 0;
  width: 88px;
  height: 18px;
  border-radius: 4px 4px 0 0;
  background: #3d7cff;
}

.gift .box {
  position: absolute;
  left: 8px;
  top: 16px;
  width: 92px;
  height: 68px;
  display: grid;
  place-items: center;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(180deg, #4d8dff, #2f6dff);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 10px 8px 0 #1a4fc7;
}

.gift.deco {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 18px;
  background: #2f6dff;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  box-shadow: 8px 8px 0 #1a4fc7;
}

.tone-gold .gift.deco { background: #d4af37; box-shadow: 8px 8px 0 #8a6d12; color: #1a1405; }
.tone-green .gift.deco { background: #0ecb81; box-shadow: 8px 8px 0 #0a7a4e; }
.tone-blue .gift.deco { background: #3d7cff; box-shadow: 8px 8px 0 #1a4fc7; }

.banner-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  display: flex;
  justify-content: center;
  gap: 5px;
}

.banner-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #cbd5e1;
}

.banner-dots i.on {
  width: 14px;
  border-radius: 4px;
  background: var(--gold);
}

.notice-wrap {
  margin: 0 16px 12px;
}

.notice {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  text-align: left;
}

.notice svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: var(--gold);
}

.notice-track {
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.notice-track span {
  display: inline-block;
  padding-left: 100%;
  white-space: nowrap;
  color: #475569;
  font-size: 12px;
  animation: notice-roll 22s linear infinite;
}

@keyframes notice-roll {
  to { transform: translateX(-100%); }
}

.notice-list {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.notice-list p {
  margin: 0;
  padding: 7px 0;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.45;
}

.notice-list p + p {
  border-top: 1px solid var(--line);
}

.notice-list b {
  color: var(--ink);
  font-weight: 600;
}

.hot {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 0 16px 12px;
}

.hot .card {
  padding: 10px 10px 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.hot .name { color: var(--dim); font-size: 11px; }
.hot .px { margin: 4px 0 2px; font-size: 13px; font-weight: 600; }
.hot .chg { font-size: 11px; }
.hot canvas { display: block; width: 100%; height: 22px; }

.quick {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  padding: 6px 8px 10px;
}

.quick button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 12px;
}

.quick svg {
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  fill: none;
  stroke: #0f172a;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.market-tabs {
  display: flex;
  gap: 0;
  padding: 0 16px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line);
}
.market-tabs button {
  flex: 1;
  padding: 12px 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--dim);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.market-tabs button.on {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.cats {
  padding: 4px 0 12px;
}

.cat {
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.8fr;
  align-items: center;
  min-height: 72px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  cursor: pointer;
}

.cat .mid { text-align: right; }
.cat .chg { text-align: right; font-weight: 600; }

.cols {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.9fr;
  padding: 8px 16px;
  color: var(--dim);
  font-size: 12px;
}

.cols span:nth-child(2), .cols span:nth-child(3) { text-align: right; }

.row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.9fr;
  align-items: center;
  min-height: 62px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
}

.coin {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.sym { font-weight: 600; }
.sub { margin-top: 3px; color: var(--dim); font-size: 11px; }
.px { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.chg {
  justify-self: end;
  min-width: 72px;
  text-align: right;
  color: var(--dim);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.chg.up, .px.up, .hot .chg.up { color: var(--up); }
.chg.down, .px.down, .hot .chg.down { color: var(--down); }
.chg.up { background: none; }
.chg.down { background: none; }
.row > div:nth-child(2) {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.row canvas { display: block; width: 56px; height: 22px; margin-left: auto; }

.trade-head {
  align-items: flex-start;
  flex-wrap: wrap;
}
.trade-title {
  display: flex;
  align-items: center;
  gap: 2px;
  width: 100%;
}
.back-ico {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  margin: -4px 0 -4px -8px;
  border: 0;
  background: none;
  color: var(--ink);
  padding: 0;
}
.back-ico svg {
  display: block;
  width: 22px;
  height: 22px;
  margin: 0 auto;
}
.back-ico path {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.trade-head .pair { width: auto; flex: 1; text-align: left; }
.meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.5;
}
.meta > div:last-child { text-align: right; }
.pair {
  border: 0;
  background: none;
  padding: 0;
  font-size: 16px;
  font-weight: 700;
}

.price-xl {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tfs {
  display: flex;
  gap: 14px;
  padding: 0 16px 6px;
  color: var(--dim);
  font-size: 12px;
}

.tfs button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--dim);
}

.tfs button.on { color: var(--gold); }

.ind-bar {
  display: flex;
  gap: 8px;
  padding: 8px 16px;
}
.ind-bar button {
  flex: 1;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--dim);
  font-size: 12px;
}
.ind-bar button.on {
  color: #1f2937;
  border-color: var(--gold);
  background: #fff8e8;
  font-weight: 700;
}
.pos-log {
  margin-left: auto;
  border: 1px solid var(--gold);
  border-radius: 8px;
  background: #fff;
  color: var(--gold);
  font-size: 13px;
  font-weight: 700;
  padding: 4px 10px;
}
.pos-box {
  margin: 8px 12px 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.pos-hd {
  padding: 10px 12px 0;
  font-size: 13px;
  font-weight: 700;
}
.pos-row { padding: 10px 12px; border-top: 1px solid var(--line); }
.pos-row .hd, .pos-row .ft { display: flex; justify-content: space-between; gap: 8px; }
.pos-row .ft { margin-top: 4px; color: var(--dim); font-size: 12px; }
.pos-row .up { color: #0ecb81; }
.pos-row .down { color: #f6465d; }
.chart-box { height: 280px; margin: 0 12px; padding: 8px 4px 0; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.chart-box.osc { height: 348px; }
#chart { display: block; width: 100%; height: 100%; }

.live-pos { padding: 8px 16px; font-size: 12px; color: var(--gold); }
.live-pos:empty { display: none; }

.book {
  margin: 10px 12px 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.book-hd, .book-row {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr 0.95fr 1.15fr;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  font-variant-numeric: tabular-nums;
}

.book-hd {
  height: 28px;
  color: var(--dim);
  font-size: 11px;
  border-bottom: 1px solid var(--line);
}

.book-hd span:nth-child(2),
.book-row .px.bid { text-align: right; }

.book-row {
  height: 22px;
  font-size: 11px;
}

.book-row .q {
  position: relative;
  display: flex;
  align-items: center;
  height: 20px;
  color: var(--ink);
}

.book-row .q.ask { justify-content: flex-end; }

.book-row .q i {
  position: absolute;
  top: 2px;
  bottom: 2px;
  border-radius: 2px;
}

.book-row .q.bid i { right: 0; background: rgba(5, 150, 105, 0.18); }
.book-row .q.ask i { left: 0; background: rgba(225, 29, 72, 0.14); }
.book-row .q em { position: relative; z-index: 1; font-style: normal; }
.book-row .px.bid { color: #059669; font-weight: 600; }
.book-row .px.ask { color: #e11d48; font-weight: 600; }
.book-empty { padding: 16px; color: var(--dim); font-size: 12px; text-align: center; }
.book-age { margin: 0; padding: 0 10px 6px; color: #b45309; font-size: 11px; }
.book-age:empty { display: none; }

.trade-acts {
  position: sticky;
  bottom: calc(64px + env(safe-area-inset-bottom));
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 16px 12px;
  background: linear-gradient(to top, var(--bg) 70%, rgba(244, 247, 251, 0));
}

.buy, .side, .confirm {
  height: 42px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
}

.buy:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.buy.up, .side.up, .confirm.up { background: var(--up); }
.buy.down, .side.down, .confirm.down { background: var(--down); }
.side { opacity: 1; }
.side:not(.on) { filter: brightness(0.62); }

.ostats {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.ostats button {
  border: 0;
  background: none;
  padding: 10px 8px 12px;
  color: var(--dim);
}

.ostats button.on { color: var(--ink); }
.ostats em { display: block; font-style: normal; font-size: 12px; margin-bottom: 4px; }
.ostats b { font-size: 16px; }

.orow {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.orow .hd, .orow .ft {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.orow .time { color: var(--dim); font-size: 12px; margin: 4px 0 8px; }
.orow .ft { color: var(--dim); font-size: 12px; }
.tag {
  min-width: 36px;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 12px;
}
.tag.win { background: rgba(14, 203, 129, 0.15); color: var(--up); }
.tag.lose { background: rgba(246, 70, 93, 0.15); color: var(--down); }
.tag.draw { background: #e8edf4; color: #475569; }
.pnl { font-weight: 600; }
.pnl.win { color: var(--up); }
.pnl.lose { color: var(--down); }

.profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 16px;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff7e0;
  font-weight: 700;
}

.nick { font-size: 16px; font-weight: 600; }
.uid { margin-top: 4px; color: var(--dim); font-size: 12px; }
.lv { margin-top: 4px; color: var(--dim); font-size: 12px; }
.lv b {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 4px;
  background: #ecfdf5;
  color: #047857;
  font-weight: 700;
}

.wallet {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: calc(100% - 32px);
  margin: 0 16px 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  color: var(--dim);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.wallet b {
  color: var(--ink);
  font-size: 22px;
}

.wallet small { font-size: 12px; color: var(--dim); margin-left: 4px; }
#page-income .bns-card {
  align-items: center;
  padding: 18px 18px;
}
#page-income .bns-card > span {
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
}
#page-income .bns-card b {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
}
#page-income .bns-card small {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-left: 6px;
}
#page-income .pending-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: calc(100% - 32px);
  margin: 0 16px 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}
#page-income .pending-card > span {
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
}
#page-income .pending-card b {
  color: var(--gold);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}
#page-income .pending-card small {
  margin-left: 6px;
  color: var(--dim);
  font-size: 15px;
  font-weight: 600;
}
.wallet em {
  margin-left: 8px;
  font-style: normal;
  font-size: 12px;
  color: var(--gold);
}
.wallet-sub {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: -4px 16px 10px;
  padding: 0 16px;
  font-size: 15px;
  color: var(--dim);
}
.wallet-sub b { color: var(--gold); font-weight: 700; font-size: 16px; }
.vault-line {
  margin: -6px 16px 8px;
  padding: 0 16px;
  font-size: 15px;
  color: var(--dim);
}
.vault-line b { color: var(--gold); font-weight: 700; font-size: 16px; }
.wallet-row {
  display: flex;
  justify-content: space-around;
  margin: 0 16px 12px;
  padding: 10px 0;
  border-radius: 10px;
  background: var(--card);
  text-align: center;
}
.wallet-row div, .wallet-row .team-stat { flex: 1; }
.wallet-row span { display: block; font-size: 11px; color: var(--dim); margin-bottom: 4px; }
.wallet-row b { font-size: 14px; color: var(--ink); }
.custody-note {
  margin: 0 16px 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--down);
}
.wallet-row .team-stat {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  padding: 0;
}
.wallet-row .team-stat.on b { color: var(--gold); }
.form-box {
  margin: 0 16px 16px;
  padding: 16px;
  border-radius: 12px;
  background: var(--card);
}
.form-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.form-tabs button {
  flex: 1;
  padding: 8px 0;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--dim);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.form-tabs button.on {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.form-box input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
.btn-gold {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: var(--gold);
  color: #000;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.sub-title {
  margin: 16px 16px 8px;
  font-size: 14px;
  color: var(--ink);
}
.rule-block {
  margin: 0 16px 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--card);
  font-size: 12px;
  line-height: 1.8;
  color: var(--dim);
}
.rule-block b { color: var(--gold); font-weight: 600; }

.menu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 32px);
  margin: 6px 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  color: var(--ink);
}

.menu em {
  color: var(--dim);
  font-style: normal;
  font-size: 12px;
}

.invite {
  margin: 8px 16px 10px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--card);
}

.invite span {
  color: var(--dim);
  font-size: 12px;
}

.invite b {
  display: block;
  margin: 8px 0 12px;
  word-break: break-all;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.invite button {
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--gold);
  color: #111;
  font-weight: 700;
}

.link, .back {
  border: 0;
  background: none;
  color: var(--dim);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
}

.form input, .amt-box input, .composer input {
  height: 42px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 0 12px;
}

.form button, .composer button {
  height: 42px;
  border: 0;
  background: var(--up);
  color: #04140c;
  font-weight: 600;
}

.tip { color: var(--dim); font-size: 12px; line-height: 1.5; }
.tip.gold { color: #b45309; font-weight: 600; }

.feed { padding: 8px 16px 70px; }
.item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.item .svc { color: var(--gold); }
.item .meta { display: flex; justify-content: space-between; color: var(--dim); font-size: 12px; margin-bottom: 6px; }

.composer {
  position: fixed;
  left: 50%;
  bottom: calc(64px + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 480px;
  transform: translateX(-50%);
  display: none;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border-top: 1px solid var(--line);
}

body.show-svc .composer { display: flex; }

.sheet {
  position: fixed;
  inset: 0;
  z-index: 8;
  background: rgba(0, 0, 0, 0.45);
}

.sheet-card {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow: auto;
  transform: translateX(-50%);
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: 16px 16px 0 0;
  background: var(--sheet);
}

.x {
  position: absolute;
  right: 12px;
  top: 10px;
  border: 0;
  background: none;
  font-size: 22px;
  color: var(--dim);
}

.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 12px; }

.modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.modes button {
  height: 34px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  color: var(--dim);
}

.modes button.on {
  border-color: var(--gold);
  color: var(--gold);
}

.time-pick {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 14px;
}
.time-pick span { font-size: 13px; color: var(--dim); }
.time-pick input {
  height: 44px;
  min-width: 148px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 0 12px;
  font-size: 16px;
  color: inherit;
}
.clocks {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.clocks button {
  flex: 0 0 auto;
  min-width: 76px;
  height: 48px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: var(--dim);
}

.clocks button small { display: block; margin-top: 2px; font-size: 11px; }
.clocks button.on {
  border-color: var(--gold);
  color: var(--gold);
}

.clocks button.lead {
  border-color: #86efac;
  color: #047857;
}

.lead-note { white-space: pre-line; }
.clocks button.lead.on {
  border-color: #059669;
  color: #047857;
  background: #ecfdf5;
}

.preview {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #ffffff;
  color: var(--dim);
  font-size: 12px;
}

.preview div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.preview b { color: var(--ink); font-weight: 600; }
.preview .up { color: var(--up); }

.row-lab {
  display: flex;
  justify-content: space-between;
  color: var(--dim);
  font-size: 12px;
  margin-bottom: 8px;
}

.row-lab.thin { margin: 10px 0 14px; }
.row-lab b { color: var(--ink); font-weight: 600; }

.periods {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.periods button {
  height: 52px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: var(--dim);
}

.periods button small { display: block; margin-top: 2px; font-size: 11px; }
.periods button.on {
  border-color: var(--gold);
  color: var(--gold);
}

.lab { color: var(--dim); font-size: 12px; }

.amt-box {
  display: flex;
  align-items: center;
  margin: 6px 0 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
}

.amt-box b { flex: 1; padding: 0 12px; font-size: 16px; }
.amt-box span { padding-right: 10px; color: var(--dim); }
.amt-box input {
  flex: 1;
  height: 42px;
  border: 0;
  background: transparent;
  padding: 0 12px;
  font-size: 18px;
  font-weight: 700;
}
.amt-box.plan input { display: none; }
.amt-box:not(.plan) b { display: none; }

.amts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.amts button {
  height: 48px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: var(--dim);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  line-height: 1.1;
}
.amts button b { font-size: 13px; font-weight: 700; }
.amts button small { font-size: 10px; color: var(--dim); }
.amts button.on { border-color: var(--gold); color: var(--gold); }
.amts button.done { opacity: 0.5; border-color: #27ae60; color: #27ae60; }
.amts button.lock { opacity: 0.35; }
.amts button.plan-toggle { border-color: var(--gold); color: var(--gold); font-size: 11px; grid-column: span 2; }
.amts button.plan-toggle.on { background: var(--gold); color: #000; }

#guardHelp { margin: 0 16px 12px; }
.guard-list { padding: 0 16px 24px; }
.guard-list article {
  margin-bottom: 10px;
  padding: 14px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid transparent;
}
.guard-list article.on { border-color: var(--gold); }
.guard-list .hd { display: flex; justify-content: space-between; align-items: center; }
.guard-list em { color: var(--gold); font-style: normal; font-weight: 700; }
.guard-list p { margin: 8px 0 12px; color: var(--dim); font-size: 12px; }
.guard-list button {
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--gold);
  color: #111;
  font-weight: 700;
}
.guard-list button:disabled { background: #e2e8f0; color: var(--dim); }

.confirm { width: 100%; height: 46px; border-radius: 8px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 9;
  transform: translateX(-50%);
  padding: 8px 14px;
  border-radius: 6px;
  background: #0f172a;
  color: #fff;
}

.empty, .err {
  padding: 24px 16px;
  color: var(--dim);
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 5;
  width: 100%;
  max-width: 480px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  background: #ffffff;
  border-top: 1px solid #e6ebf2;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 56px;
  border: 0;
  background: none;
  color: #64748b;
  font-size: 11px;
}

.tabbar svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.tabbar button { position: relative; }
.tabbar button.on { color: var(--up); }

.tabbar .dot {
  position: absolute;
  top: 6px;
  right: 22%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--down);
}

.paybox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #ffffff;
}

.paybox b {
  flex: 1;
  word-break: break-all;
  font-size: 12px;
  font-weight: 500;
}

.pay-qr {
  display: flex;
  justify-content: center;
  margin: 8px 0 12px;
}

.pay-qr img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  padding: 8px;
}

.pay-link {
  display: block;
  margin: 0 0 12px;
  color: #b45309;
  font-size: 13px;
  text-decoration: none;
}

.paybox button {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: var(--gold);
  color: #111;
  font-size: 12px;
  font-weight: 700;
}

.rules {
  padding: 8px 16px 24px;
}

.rules h3 {
  margin: 16px 0 6px;
  font-size: 15px;
}

.rules p {
  margin: 0;
  color: var(--dim);
  font-size: 13px;
  line-height: 1.65;
}

.tabbar .mid {
  width: 52px;
  height: 52px;
  margin: -14px auto 0;
  border-radius: 50%;
  background: #fff7e0;
  color: #b45309;
  box-shadow: 0 0 0 6px #f4f7fb;
}

.tabbar .mid.on { color: var(--up); }

.sub .top { gap: 12px; justify-content: flex-start; }

.hide { display: none !important; }

/* ─── 群聊 ─── */
.group-list { padding: 12px; }
.group-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 12px; margin-bottom: 8px;
  background: var(--card); border-radius: 10px; cursor: pointer;
}
.group-card.joined { border-left: 3px solid var(--up); }
.gc-left { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.gc-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, #e0b44a, #c49530);
  color: #000; font-weight: 700; font-size: 18px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.gc-info { flex: 1; min-width: 0; }
.gc-info b { display: block; font-size: 15px; color: var(--ink); }
.gc-sub { display: block; font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.gc-members { font-size: 11px; color: var(--dim); }
.btn-join {
  padding: 4px 14px; border-radius: 14px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #e0b44a, #c49530); color: #000;
  font-size: 12px; font-weight: 600;
}

.chat-notice {
  padding: 8px 16px; background: #fff7e8; color: #b45309;
  font-size: 12px; line-height: 1.5;
}
.chat-msgs {
  flex: 1; overflow-y: auto; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.chat-msgs .empty { text-align: center; color: var(--dim); padding-top: 60px; }
.chat-row { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.chat-row.mine { align-items: flex-end; }
.chat-row.official { align-items: center; }
.chat-row.official .chat-bubble { background: #fff7e8; color: #b45309; }
.chat-nick { font-size: 11px; color: var(--dim); margin-left: 4px; }
.chat-admin {
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 4px;
  background: #fff7e8;
  color: #b45309;
  font-style: normal;
  font-size: 10px;
}
.chat-row.admin .chat-bubble { border-color: #f0d7a2; }
.chat-bubble {
  max-width: 75%; padding: 10px 14px; border-radius: 12px;
  font-size: 14px; line-height: 1.5; word-break: break-word;
  background: #f8fafc; color: var(--ink); border: 1px solid var(--line);
}
.chat-row.mine .chat-bubble {
  background: linear-gradient(135deg, #e0b44a, #c49530); color: #000;
}
.chat-time { font-size: 10px; color: var(--dim); margin: 0 4px; }
.chat-input {
  display: flex; gap: 8px; padding: 10px 14px;
  border-top: 1px solid var(--line); background: #fff;
}
.chat-input input {
  flex: 1; padding: 10px 14px; border-radius: 20px;
  border: 1px solid var(--line); background: #f8fafc; color: var(--ink);
  font-size: 14px; outline: none;
}
.chat-input button {
  padding: 10px 18px; border-radius: 20px; border: none; cursor: pointer;
  background: linear-gradient(135deg, #e0b44a, #c49530); color: #000;
  font-weight: 600; font-size: 14px;
}

#page-chatroom {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 4;
  width: 100%;
  max-width: 480px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding-bottom: calc(56px + env(safe-area-inset-bottom));
}
#page-chatroom .top { flex-shrink: 0; justify-content: space-between; }
#page-chatroom .top b {
  flex: 1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#chatLeave {
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 13px;
  padding: 0;
}
#page-chatroom .chat-notice { flex-shrink: 0; }
#page-chatroom .chat-msgs { flex: 1; min-height: 0; }
#page-chatroom .chat-input { flex-shrink: 0; }

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e7eef8;
  padding: 24px;
}
.auth-card {
  width: 100%;
  max-width: 360px;
  padding: 28px 22px;
  border-radius: 16px;
  background: var(--card);
}
.auth-card b { display: block; font-size: 28px; color: var(--gold); margin-bottom: 8px; }
.auth-card p { color: var(--dim); font-size: 13px; margin: 0 0 16px; }
.auth-code { display: flex; gap: 8px; }
.auth-code.hide { display: none; }
.auth-code input { flex: 1; }
.auth-code button {
  flex: 0 0 112px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
.auth-card input {
  width: 100%;
  height: 42px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 0 12px;
}
.auth-card button[type="submit"] {
  width: 100%;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--gold);
  color: #111;
  font-weight: 700;
}
.auth-card p#authHint { margin: 0 0 10px; line-height: 1.45; }
.auth-link {
  display: block;
  margin: 12px auto 0;
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 13px;
}
.auth-card em { display: block; min-height: 18px; margin-top: 10px; color: var(--down); font-style: normal; }
.box-pad { padding: 0 16px 16px; }
.menu.danger em, .menu.danger span { color: var(--down); }
.has-unread { position: relative; }
.has-unread::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--down);
}
