/* ============================================================
   麻将记账 —— 牌桌风皮肤
   深绿台面 + 奶油卡片 + 金色按钮，粗描边、硬投影
   ============================================================ */

:root {
  --felt: #0f7a46;
  --felt-2: #0a5c34;
  --felt-3: #06411f;
  --felt-bar: #05351a;

  --paper: #fffdf5;
  --paper-2: #f8efd7;
  --paper-3: #f2e6c6;

  --ink: #2a1f0e;
  --ink-2: #5d4a2c;
  --muted: #9c8a66;

  --line: #efe1bf;
  --edge: #e6d6ae;
  --edge-2: #d9c69a;

  --gold: #ffc93c;
  --gold-l: #ffe27a;
  --gold-d: #f0a71c;
  --gold-edge: #b4740a;

  --red: #e8412f;
  --red-l: #ff7a5c;
  --red-edge: #a32415;

  --green: #1d9c66;
  --pos: #d92d1b;
  --neg: #16875a;

  --radius: 18px;
  --tab-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --shadow-card: 0 4px 0 var(--edge-2), 0 10px 22px rgba(0, 0, 0, .16);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  background: var(--felt-2);
}

body {
  background:
    radial-gradient(120% 70% at 50% 0%, #189155 0%, var(--felt) 38%, var(--felt-2) 72%, var(--felt-3) 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 15px 15px;
  opacity: .55;
}

h1, h2, h3, h4, p, ul, li, figure { margin: 0; padding: 0; }
ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; background: var(--paper-2); padding: 1px 5px; border-radius: 5px; }

.app {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
}

.boot { padding: 90px 0; text-align: center; color: rgba(255, 255, 255, .8); font-weight: 700; }

/* ---------- 通用 ---------- */

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.zero { color: var(--muted); }
.hidden { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 16px;
  color: #fff;
  background: rgba(5, 53, 26, .78);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 2px solid rgba(0, 0, 0, .22);
}
.topbar.scrolled { box-shadow: 0 6px 18px rgba(0, 0, 0, .22); }
.topbar h1 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .4px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar .sub { font-size: 12px; color: rgba(255, 255, 255, .66); font-weight: 600; }
.topbar .spacer { flex: 1; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  color: rgba(255, 255, 255, .9);
}
.icon-btn:active { background: rgba(0, 0, 0, .18); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  background: linear-gradient(var(--gold-l), var(--gold-d));
  color: #4a2a00;
  border: 2px solid var(--gold-edge);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .55), 0 3px 0 var(--gold-edge);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .5px;
  transition: transform .07s ease, box-shadow .07s ease;
}
.btn:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .5), 0 0 0 var(--gold-edge); }
.btn[disabled] { opacity: .45; }
.btn.block { width: 100%; }
.btn.ghost {
  background: var(--paper);
  color: var(--ink-2);
  border-color: var(--edge);
  box-shadow: 0 3px 0 var(--edge-2);
  font-weight: 700;
}
.btn.danger {
  background: linear-gradient(var(--red-l), var(--red));
  color: #fff;
  border-color: var(--red-edge);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), 0 3px 0 var(--red-edge);
}
.btn.sm { height: 38px; padding: 0 14px; font-size: 13.5px; border-radius: 11px; letter-spacing: 0; }

.card {
  background: var(--paper);
  border: 2px solid var(--paper-3);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin: 0 12px 14px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.card-head h3 {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink-2);
  letter-spacing: .6px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.card-head h3::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 3px;
  background: linear-gradient(var(--gold-l), var(--gold-d));
  border: 1.5px solid var(--gold-edge);
  transform: rotate(45deg);
  flex: none;
}

.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }

.avatar {
  width: 48px; height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  flex: none;
  border: 2.5px solid rgba(0, 0, 0, .18);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .2);
}

.empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.8;
}

/* 小头像 */
.pav {
  width: 28px; height: 28px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  flex: none;
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  border: 2px solid rgba(0, 0, 0, .16);
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .3);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .18);
  font-style: normal;
}
.pav.sm { width: 24px; height: 24px; font-size: 11.5px; border-radius: 8px; }
.pav.add {
  background: var(--paper-2);
  color: var(--gold-edge);
  border: 2px dashed var(--edge-2);
  font-size: 15px;
}

/* ---------- 登录 ---------- */

.auth {
  min-height: 100dvh;
  padding: max(46px, env(safe-area-inset-top)) 22px calc(26px + var(--safe-b));
  display: flex;
  flex-direction: column;
}
.auth .brand {
  width: 72px; height: 72px;
  border-radius: 20px;
  background: linear-gradient(var(--gold-l), var(--gold-d));
  border: 3px solid var(--gold-edge);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .6), 0 7px 0 var(--gold-edge);
  display: grid; place-items: center;
  font-size: 38px;
  margin-bottom: 20px;
  transform: rotate(-4deg);
}
.auth h1 {
  font-size: 28px;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 3px 0 rgba(0, 0, 0, .28);
  margin-bottom: 6px;
}
.auth .tagline { color: rgba(255, 255, 255, .75); font-size: 13.5px; margin-bottom: 28px; font-weight: 600; }
.auth .label {
  font-size: 12px;
  color: rgba(255, 255, 255, .7);
  margin: 0 0 10px 4px;
  letter-spacing: 2px;
  font-weight: 700;
}

.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 22px; }
.pick {
  height: 50px;
  border-radius: 13px;
  background: var(--paper);
  border: 2px solid var(--edge);
  box-shadow: 0 3px 0 var(--edge-2);
  font-size: 14.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
  padding: 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
  transition: transform .07s;
}
.pick:active { transform: translateY(2px); }
.pick.on {
  background: linear-gradient(var(--gold-l), var(--gold));
  border-color: var(--gold-edge);
  box-shadow: 0 3px 0 var(--gold-edge);
  color: #4a2a00;
  font-weight: 800;
}

.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 7px; font-weight: 700; letter-spacing: .4px; }
.field input, .field select, .field textarea {
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 2px solid var(--edge);
  border-radius: 12px;
  background: var(--paper);
  outline: none;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { height: auto; padding: 11px 13px; resize: vertical; min-height: 64px; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--gold-d);
  box-shadow: 0 0 0 3px rgba(255, 201, 60, .35);
}

.auth .field input { height: 52px; font-size: 18px; letter-spacing: 3px; font-weight: 700; }
.auth .foot { margin-top: auto; padding-top: 22px; }
.auth .hint { font-size: 12px; color: rgba(255, 255, 255, .62); text-align: center; margin-top: 14px; line-height: 1.7; }
.auth .hint b { color: var(--gold); }
.auth .err { color: #ffd7cf; font-size: 13px; margin: -4px 0 12px 3px; min-height: 18px; font-weight: 600; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
.shake { animation: shake .3s ease; border-color: var(--red) !important; }

/* ---------- 首页 ---------- */

.page { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 84px); }
.page > .hint { color: rgba(255, 255, 255, .68); }

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--paper-3);
  border: 2px solid var(--paper-3);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 2px 12px 16px;
  box-shadow: var(--shadow-card);
}
.summary .cell { background: var(--paper); padding: 13px 8px 15px; text-align: center; }
.summary .k { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; font-weight: 700; letter-spacing: .3px; }
.summary .v { font-size: 19px; font-weight: 800; letter-spacing: -.3px; }

.month-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 2px 18px 10px;
}
.month-head h2 { font-size: 13px; color: rgba(255, 255, 255, .78); font-weight: 800; letter-spacing: .5px; }
.month-head .small { color: rgba(255, 255, 255, .5); }

.session {
  display: block;
  /* 有左右 12px 外边距，宽度要减掉，否则右边会顶出屏幕 */
  width: calc(100% - 24px);
  text-align: left;
  background: var(--paper);
  border: 2px solid var(--paper-3);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 13px 14px 11px;
  margin: 0 12px 12px;
  transition: transform .07s;
}
.session:active { transform: translateY(3px); }
.session .s-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.session .s-date { font-size: 15px; font-weight: 800; letter-spacing: .3px; }
.session .s-week { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.session .s-loc {
  font-size: 11.5px;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1.5px solid var(--edge);
  padding: 2px 8px;
  border-radius: 8px;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  margin-left: auto;
}
.session .s-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  padding: 4px 8px 4px 6px;
  border-radius: 9px;
  background: var(--paper-2);
  border: 1.5px solid var(--edge);
  color: var(--ink-2);
  font-weight: 600;
}
.chip b { font-weight: 800; font-variant-numeric: tabular-nums; }
.chip.pos b { color: var(--pos); }
.chip.neg b { color: var(--neg); }
.chip .d { width: 7px; height: 7px; border-radius: 50%; flex: none; }
/* 花销榜里的分组 */
.spend-sec { border-top: 2px dashed var(--paper-3); }
.spend-sec:first-of-type { border-top: 0; }
.spend-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 11px 14px 4px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-2);
}
.spend-title b { font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.spend-title .muted { margin-left: auto; font-size: 11.5px; font-weight: 700; }

.session .s-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 2px dashed var(--paper-3);
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

/* 首页卡片上的最新一条趣闻 */
.session .s-moment {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  min-width: 0;
}
.session .s-moment b {
  flex: none;
  font-weight: 800;
  color: var(--gold-d);
  font-variant-numeric: tabular-nums;
}
.session .s-moment span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.fab {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + var(--safe-b) + 16px);
  transform: translateX(-50%);
  height: 52px;
  padding: 0 24px 0 20px;
  border-radius: 26px;
  background: linear-gradient(var(--red-l), var(--red));
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2.5px solid var(--red-edge);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .4), 0 6px 0 var(--red-edge), 0 12px 22px rgba(0, 0, 0, .28);
  z-index: 30;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .2);
}
.fab:active { transform: translateX(-50%) translateY(3px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .35), 0 2px 0 var(--red-edge); }
.fab svg { width: 19px; height: 19px; }

/* ---------- 底部导航 ---------- */

.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 560px;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--felt-bar);
  border-top: 3px solid #032a14;
  box-shadow: 0 -6px 20px rgba(0, 0, 0, .28);
  z-index: 40;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10.5px;
  color: rgba(255, 255, 255, .48);
  font-weight: 700;
  letter-spacing: .5px;
}
.tab svg { width: 22px; height: 22px; stroke-width: 1.8; }
.tab.on { color: var(--gold); }
.tab.on svg { stroke-width: 2.2; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .35)); }

/* ---------- 统计 ---------- */

.ranges {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 12px 12px;
  scrollbar-width: none;
}
.ranges::-webkit-scrollbar { display: none; }
.range {
  flex: none;
  height: 34px;
  padding: 0 14px;
  border-radius: 17px;
  background: var(--paper);
  border: 2px solid var(--edge);
  box-shadow: 0 3px 0 var(--edge-2);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}
.range.on {
  background: linear-gradient(var(--gold-l), var(--gold));
  border-color: var(--gold-edge);
  box-shadow: 0 3px 0 var(--gold-edge);
  color: #4a2a00;
}

.custom-range { display: flex; gap: 8px; align-items: center; padding: 0 12px 12px; }
.custom-range input {
  flex: 1;
  height: 40px;
  border: 2px solid var(--edge);
  border-radius: 11px;
  padding: 0 10px;
  background: var(--paper);
  font-size: 13px;
  min-width: 0;
  font-weight: 600;
}
.custom-range .muted { color: rgba(255, 255, 255, .7); font-weight: 700; }

.fee-card { display: flex; align-items: flex-start; gap: 14px; }
.fee-card .big { flex: none; }
.fee-card .big .n {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--gold-d);
  text-shadow: 0 2px 0 rgba(180, 116, 10, .18);
  line-height: 1.1;
}
.fee-card .big .l { font-size: 11.5px; color: var(--muted); margin-top: 3px; font-weight: 700; }
.fee-card .payers { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.fee-card .payers li { display: flex; justify-content: space-between; padding: 3px 0; gap: 10px; }
.fee-card .payers li span:last-child { font-variant-numeric: tabular-nums; color: var(--muted); }

.rank { padding: 0; overflow: hidden; }
.rank li {
  display: grid;
  grid-template-columns: 24px 24px 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border-bottom: 2px dashed var(--paper-3);
}
.rank li:last-child { border-bottom: 0; }
.rank .no {
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.rank .no.top {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: linear-gradient(var(--gold-l), var(--gold-d));
  border: 1.5px solid var(--gold-edge);
  color: #4a2a00;
  font-size: 11.5px;
}
.rank .who { min-width: 0; }
.rank .who .nm { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.rank .who .meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; font-weight: 600; }
.rank .amt { text-align: right; font-variant-numeric: tabular-nums; }
.rank .amt .t { font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.rank .amt .s { font-size: 11px; color: var(--muted); margin-top: 1px; font-weight: 600; }
.rank .bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--paper-2); overflow: hidden; margin-top: -2px; }
.rank .bar i { display: block; height: 100%; border-radius: 3px; }

.chart-wrap { padding: 6px 6px 0; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--paper-3); stroke-width: 1; }
.chart .zero { stroke: var(--edge-2); stroke-width: 1.2; stroke-dasharray: 4 4; }
.chart text { font-size: 9px; fill: var(--muted); font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 12px 12px 2px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-2); font-weight: 700; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }

.net-toggle {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, .22);
  border: 1.5px solid rgba(255, 255, 255, .1);
  padding: 4px;
  border-radius: 12px;
  margin: 0 12px 12px;
}
.net-toggle button {
  flex: 1;
  height: 32px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, .62);
}
.net-toggle button.on { background: var(--paper); color: var(--ink); box-shadow: 0 2px 0 var(--edge-2); }

/* ---------- 表单 ---------- */

.form-page { padding-bottom: 40px; }
.form-page > .hint { color: rgba(255, 255, 255, .68); }
.form-meta { margin: 0 0 10px; padding: 0 18px; }

.form-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 12px;
  color: #fff;
  background: rgba(5, 53, 26, .82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid rgba(0, 0, 0, .22);
}
.form-top h2 { font-size: 16px; font-weight: 800; letter-spacing: .5px; }

.picker { display: flex; flex-wrap: wrap; gap: 7px; }
.pchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 11px 0 5px;
  border-radius: 12px;
  background: var(--paper-2);
  border: 2px solid var(--edge);
  box-shadow: 0 2px 0 var(--edge-2);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-2);
  transition: transform .07s;
}
.pchip:active { transform: translateY(2px); }
.pchip.on {
  background: linear-gradient(var(--gold-l), var(--gold));
  border-color: var(--gold-edge);
  box-shadow: 0 2px 0 var(--gold-edge);
  color: #4a2a00;
}
.pchip.on .pav { border-color: rgba(0, 0, 0, .28); }
.pchip .pflag {
  font-size: 9.5px;
  font-style: normal;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .1);
  color: var(--muted);
  font-weight: 800;
}
.pchip-add { border-style: dashed; background: transparent; }

/* 常用地点 */
.places { display: flex; flex-wrap: wrap; gap: 7px; }
.place {
  max-width: 100%;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--paper-2);
  border: 2px solid var(--edge);
  box-shadow: 0 2px 0 var(--edge-2);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: transform .07s;
}
.place:active { transform: translateY(2px); }
.place.on {
  background: linear-gradient(var(--gold-l), var(--gold));
  border-color: var(--gold-edge);
  box-shadow: 0 2px 0 var(--gold-edge);
  color: #4a2a00;
}
.places-empty { font-size: 12px; color: var(--muted); font-weight: 600; line-height: 1.6; }

.loc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  border-bottom: 1.5px dashed var(--paper-3);
}
.loc-row:last-child { border-bottom: 0; }
.loc-name {
  flex: 1;
  min-width: 0;
  height: 38px;
  border: 2px solid transparent;
  border-radius: 9px;
  padding: 0 8px;
  background: var(--paper-2);
  font-weight: 700;
  outline: none;
}
.loc-name:focus { border-color: var(--gold-d); background: #fff; }
.loc-count { flex: none; font-size: 11.5px; color: var(--muted); font-weight: 700; }

.result-list { display: flex; flex-direction: column; gap: 9px; }
.result-row {
  display: grid;
  grid-template-columns: 24px 1fr auto 88px;
  align-items: center;
  gap: 9px;
}
.result-row .rname { font-size: 14.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 没填金额的行（= 这场没来）淡化，一眼能看出今天到底几个人 */
.result-row.idle .pav,
.result-row.idle .rname { opacity: .45; }
.result-row.idle .rname { font-weight: 600; }
.sign-toggle { display: flex; gap: 2px; background: var(--paper-2); border: 1.5px solid var(--edge); border-radius: 10px; padding: 2px; }
.sign-toggle button {
  width: 36px;
  height: 28px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}
.sign-toggle button.on-win { background: var(--pos); color: #fff; box-shadow: 0 1.5px 0 rgba(0, 0, 0, .2); }
.sign-toggle button.on-loss { background: var(--green); color: #fff; box-shadow: 0 1.5px 0 rgba(0, 0, 0, .2); }
.rnum {
  width: 88px;
  height: 42px;
  border: 2px solid var(--edge);
  border-radius: 11px;
  background: var(--paper);
  text-align: right;
  padding: 0 10px;
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  outline: none;
  color: var(--ink);
}
.rnum:focus { border-color: var(--gold-d); box-shadow: 0 0 0 3px rgba(255, 201, 60, .35); }
.rnum::-webkit-outer-spin-button, .rnum::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.sum-badge {
  font-size: 12.5px;
  padding: 3px 10px;
  border-radius: 9px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: var(--paper-2);
  border: 1.5px solid var(--edge);
  color: var(--muted);
}
.sum-badge.ok { background: #e2f6ea; border-color: #a8ddbe; color: #16794b; }
.sum-badge.bad { background: #fde7e3; border-color: #f3bdb4; color: var(--pos); }

.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; min-width: 0; }
.field-row .field input,
.field-row .field select { min-width: 0; }

/* iOS 的日期控件有原生最小宽度，单独占一行，别塞进半栏 */
input[type="date"] { min-width: 0; width: 100%; }
.place-field { margin-bottom: 10px; }

.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 10px;
  font-weight: 600;
}
.hint.warn { color: #b06a12; }

.form-actions { padding: 6px 12px 0; display: flex; flex-direction: column; gap: 9px; }

/* ---------- 明细 ---------- */

.subtabs {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, .22);
  border: 1.5px solid rgba(255, 255, 255, .1);
  padding: 4px;
  border-radius: 12px;
  margin: 0 12px 12px;
}
.subtabs button {
  flex: 1;
  height: 34px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, .62);
}
.subtabs button.on { background: var(--paper); color: var(--ink); box-shadow: 0 2px 0 var(--edge-2); }

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 2px solid var(--paper-3);
  box-shadow: var(--shadow-card);
  margin: 0 12px 12px;
  background: var(--paper);
  -webkit-overflow-scrolling: touch;
}
table.ledger { border-collapse: collapse; width: max-content; min-width: 100%; font-size: 12px; }
table.ledger th, table.ledger td {
  padding: 10px 9px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1.5px solid var(--paper-3);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
table.ledger th {
  font-weight: 800;
  color: var(--muted);
  font-size: 11.5px;
  background: var(--paper-2);
  position: sticky;
  top: 0;
}
table.ledger th:first-child, table.ledger td:first-child {
  position: sticky;
  left: 0;
  text-align: left;
  background: var(--paper);
  z-index: 1;
  font-variant-numeric: normal;
}
table.ledger th:first-child { background: var(--paper-2); z-index: 2; }
table.ledger tbody tr:last-child td { border-bottom: 0; }
table.ledger tfoot td { border-top: 2px solid var(--edge-2); background: var(--paper-2); }

.table-wrap::-webkit-scrollbar { height: 6px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--edge-2); border-radius: 3px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }

.audit-item { padding: 13px 15px; border-bottom: 2px dashed var(--paper-3); }
.audit-item:last-child { border-bottom: 0; }
.audit-item .a-head { display: flex; align-items: center; gap: 7px; font-size: 13px; margin-bottom: 6px; }
.audit-item .a-head b { font-weight: 800; }
.audit-item .a-tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--paper-2);
  border: 1.5px solid var(--edge);
  color: var(--ink-2);
  font-weight: 800;
}
.audit-item .a-tag.create { background: #e2f6ea; border-color: #a8ddbe; color: #16794b; }
.audit-item .a-tag.delete { background: #fde7e3; border-color: #f3bdb4; color: var(--pos); }
.audit-item .a-tag.restore { background: #e6eefc; border-color: #b9cdf3; color: #2f5fa8; }
.audit-item .a-tag.player { background: #fff2d6; border-color: #f0d79a; color: #96620a; }
.audit-item .a-tag.location { background: #e6f2fc; border-color: #b3d4ef; color: #1d5f8a; }
.audit-item .a-time { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 600; }
.audit-item .a-body { font-size: 12.5px; color: var(--ink-2); line-height: 1.8; font-weight: 600; }
.audit-item .a-body .chg { display: block; }
.audit-item .a-body del { color: var(--muted); text-decoration: line-through; }
.audit-item .a-body ins { color: #16794b; text-decoration: none; font-weight: 800; }

/* ---------- 我的 ---------- */

.me-head { display: flex; align-items: center; gap: 12px; }
.me-head .info { flex: 1; min-width: 0; }
.me-head .info .n { font-size: 18px; font-weight: 800; }
.me-head .info .r { font-size: 12px; color: var(--muted); margin-top: 2px; font-weight: 600; }

.list-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 15px 16px;
  border-bottom: 2px dashed var(--paper-3);
  font-size: 14.5px;
  font-weight: 700;
  text-align: left;
}
.list-btn:last-child { border-bottom: 0; }
.list-btn .chev { color: var(--edge-2); font-size: 17px; font-weight: 800; }
.list-btn .lv { color: var(--muted); font-size: 13px; font-weight: 600; }

/* 页脚备案号：低调但要看得清（工信部要求带链接） */
.icp {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, .6);
  padding: 20px 0 2px;
  letter-spacing: .3px;
}
.icp a { color: inherit; text-decoration: none; }
.icp a:active { text-decoration: underline; }

/* 静态兜底备案号（给爬虫看的那份，app 渲染后会被移除） */
.icp-static {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--safe-b) + 2px);
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  color: rgba(255, 255, 255, .5);
  text-decoration: none;
  z-index: 3;
  pointer-events: none;
}

.path {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  word-break: break-all;
  background: var(--paper-2);
  border: 1.5px solid var(--edge);
  border-radius: 9px;
  padding: 8px 10px;
  color: var(--ink-2);
  line-height: 1.5;
}

.banner {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 12px 14px;
  padding: 11px 14px;
  border-radius: 13px;
  background: #fff3d6;
  border: 2px solid #f0d79a;
  box-shadow: 0 3px 0 #e6c883;
  color: #8a5a10;
  font-size: 12.5px;
  line-height: 1.55;
  font-weight: 700;
}

/* ---------- 牌友管理 ---------- */

.pm-add { display: flex; gap: 8px; margin-bottom: 14px; }
.pm-add input {
  flex: 1;
  height: 42px;
  border: 2px solid var(--edge);
  border-radius: 11px;
  padding: 0 12px;
  background: var(--paper);
  outline: none;
  min-width: 0;
  font-weight: 600;
}
.pm-add input:focus { border-color: var(--gold-d); }
.pm-list { max-height: 46vh; overflow-y: auto; margin: 0 -4px; }
.pm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  border-bottom: 1.5px dashed var(--paper-3);
}
.pm-row.off { opacity: .58; }
.pm-name {
  flex: 1;
  min-width: 0;
  height: 38px;
  border: 2px solid transparent;
  border-radius: 9px;
  padding: 0 8px;
  background: var(--paper-2);
  font-weight: 700;
  outline: none;
}
.pm-name:focus { border-color: var(--gold-d); background: #fff; }
.pm-toggle {
  flex: none;
  height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 800;
  background: var(--paper-2);
  border: 1.5px solid var(--edge);
  color: var(--muted);
}
.pm-toggle.on { background: #e2f6ea; border-color: #a8ddbe; color: #16794b; }
.pm-del {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  color: var(--red);
  background: #fdece9;
  border: 1.5px solid #f5c6bd;
  font-weight: 700;
}

/* 牌局趣闻 */
.moment-empty {
  padding: 14px 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
.moment {
  padding: 11px 0;
  border-bottom: 1.5px dashed var(--paper-3);
}
.moment:last-child { border-bottom: 0; }
.m-head { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.m-head b { font-size: 13px; font-weight: 800; color: var(--ink-2); }
.m-time { font-size: 11px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.m-del {
  margin-left: auto;
  width: 24px; height: 24px;
  border-radius: 7px;
  font-size: 15px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
}
.m-del:active { background: var(--paper-2); color: var(--red); }
.moment p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  word-break: break-word;
}
.moment-add { display: flex; gap: 8px; margin-top: 12px; }.moment-add input {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 2px solid var(--edge);
  border-radius: 11px;
  padding: 0 12px;
  background: var(--paper);
  outline: none;
  font-size: 14px;
  font-weight: 600;
}
.moment-add input:focus { border-color: var(--gold-d); box-shadow: 0 0 0 3px rgba(255, 201, 60, .3); }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + var(--safe-b) + 88px);
  transform: translate(-50%, 10px);
  max-width: 84vw;
  padding: 11px 18px;
  border-radius: 12px;
  background: #2a1f0e;
  border: 2px solid #4a3a20;
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  z-index: 100;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 弹层 ---------- */

.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(6, 40, 22, .55);
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade .18s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet-box {
  width: 100%;
  max-width: 560px;
  background: var(--paper);
  border-top: 3px solid var(--paper-3);
  border-radius: 22px 22px 0 0;
  padding: 20px 18px calc(20px + var(--safe-b));
  animation: up .22s cubic-bezier(.2, .8, .3, 1);
  max-height: 90dvh;
  overflow-y: auto;
}
@keyframes up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-box h3 { font-size: 17px; font-weight: 800; margin-bottom: 6px; }
.sheet-box p { font-size: 13px; color: var(--ink-2); line-height: 1.6; margin-bottom: 18px; font-weight: 600; }
.sheet-box .acts { display: flex; gap: 9px; margin-top: 18px; }
.sheet-box .acts .btn { flex: 1; }

/* ---------- 小屏 ---------- */

@media (max-width: 360px) {
  .summary .v { font-size: 17px; }
  .rank .amt .t { font-size: 15px; }
  .result-row { grid-template-columns: 22px 1fr auto 78px; gap: 6px; }
  .rnum { width: 78px; }
}
