/* 手机账页。橙色只给「记」和当前页签。 */

:root {
  --paper: #f6f3ee;
  --sheet: #fffcf8;
  --ink: #241c16;
  --quiet: #8a7564;
  --refund: #1f7a4d;
  --pen: #ef7d1a;
  --line: #eadfd2;
  --serif: "Newsreader", "Songti SC", "Noto Serif SC", serif;
  --sans: "Manrope", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
}

.phone {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 132px;
}

#top {
  padding: 22px 22px 8px;
}

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.switch a {
  color: var(--pen);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  flex: none;
}
.switch-pad {
  flex: none;
  visibility: hidden;
  white-space: nowrap;
  font-size: 14px;
}

.ym { text-align: center; flex: 1; min-width: 0; }
.ym .year {
  display: block;
  color: var(--quiet);
  font-size: 13px;
  letter-spacing: 0.08em;
}
.ym strong {
  font-family: var(--serif);
  font-size: 46px;
  font-weight: 650;
  line-height: 1;
}
.ym.long strong {
  font-size: 26px;
  line-height: 1.15;
}

.spans {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.spans a {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: var(--quiet);
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.spans a.on {
  color: var(--pen);
  border-bottom-color: var(--pen);
  font-weight: 700;
}

.totals {
  display: flex;
  gap: 18px;
  margin: 18px 0 0;
  padding-bottom: 4px;
}

.totals div span,
.rank-head,
.day-head span {
  color: var(--quiet);
  font-size: 13px;
}

.totals strong,
.money,
.day-head strong,
.rank strong,
.balance {
  font-family: var(--serif);
  font-weight: 650;
}

.totals strong { display: block; margin-top: 2px; font-size: 28px; }
.refund { color: var(--refund); }

#sheet {
  margin: 8px 16px 0;
  background: var(--sheet);
  border-radius: 18px 18px 0 0;
  min-height: 50vh;
  padding: 6px 0 24px;
}

.day-head,
.row,
.bill-row,
.rank-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
}

.day-head {
  border-bottom: 0;
  padding-bottom: 0;
  margin-top: 8px;
}

.day-head span { flex: 1; }
.day-head strong { font-size: 20px; }

.row .who { flex: 1; min-width: 0; }
.row .who strong { display: block; font-weight: 600; }
.row .who em {
  display: block;
  margin-top: 2px;
  color: var(--quiet);
  font-style: normal;
  font-size: 12px;
}

.money { font-size: 22px; }

.empty {
  margin: 28px 18px;
  color: var(--quiet);
}

.bill-head,
.bill-row {
  display: grid;
  grid-template-columns: 52px 1fr 1fr 1fr;
  gap: 8px;
  align-items: center;
}

.bill-head {
  margin: 8px 18px 0;
  color: var(--quiet);
  font-size: 12px;
}

.trend {
  display: block;
  width: calc(100% - 36px);
  height: 140px;
  margin: 8px 18px 12px;
}

.trend polyline {
  fill: none;
  stroke: var(--pen);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.rank-row .name { flex: 1; }
.swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
}
.pct { color: var(--quiet); font-size: 13px; width: 52px; text-align: right; }

.editor {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
}

.editor h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 650;
}

.types, .chips { display: flex; flex-wrap: wrap; gap: 8px; }

.types label, .chips label {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--quiet);
}

.types label:has(input:checked),
.chips label:has(input:checked) {
  border-color: var(--pen);
  color: var(--pen);
}

.types input, .chips input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.editor label.field { color: var(--quiet); font-size: 13px; }
.editor input[type="text"],
.editor input[type="datetime-local"],
.editor input[name="amount"] {
  display: block;
  width: 100%;
  margin-top: 4px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  padding: 8px 0;
}

.editor input[name="amount"] {
  font-family: var(--serif);
  font-size: 40px;
}

.editor button {
  border: 0;
  background: var(--pen);
  color: #fff;
  border-radius: 999px;
  padding: 14px;
  font-size: 16px;
}

.back {
  text-align: center;
  color: var(--quiet);
  text-decoration: none;
}

.error { margin: 0; color: #a33b24; }

#pen {
  position: fixed;
  right: max(20px, calc(50vw - 220px));
  bottom: 74px;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--pen);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 26px;
  box-shadow: 0 10px 24px rgba(239, 125, 26, 0.28);
}

body.writing #pen { display: none; }

.tabs {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(480px, 100%);
  height: 58px;
  display: flex;
  background: var(--sheet);
  border-top: 1px solid var(--line);
}

.tabs a {
  flex: 1;
  text-align: center;
  line-height: 58px;
  text-decoration: none;
  color: var(--quiet);
}

.tabs a.on { color: var(--pen); font-weight: 700; }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--pen);
  outline-offset: 2px;
}
