/* 定义手机小账本的颜色、排版、纸张背景和无障碍基础规则。 */
:root {
  --paper: #f5efe2;
  --paperDeep: #e7dcc7;
  --surface: #fffaf0;
  --ink: #26231f;
  --muted: #6f685f;
  --line: rgb(72 61 45 / 16%);
  --income: #2f7353;
  --incomeSoft: #dceadf;
  --expense: #ad4f3f;
  --expenseSoft: #f4ddd4;
  --blueInk: #47677f;
  --gold: #c98a32;
  --shadow: 0 16px 34px rgb(60 47 30 / 12%);
  --displayFont: "Kaiti SC", "STKaiti", "Songti SC", serif;
  --bodyFont: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  background: var(--paperDeep);
  color: var(--ink);
}

body {
  min-width: 0;
  min-height: 100dvh;
  margin: 0;
  font-family: var(--bodyFont);
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, rgb(201 138 50 / 12%) 0 1px, transparent 1px),
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--line) 31px 32px);
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
}

button,
[data-action] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgb(47 115 83 / 30%);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.appShell {
  width: min(100%, 620px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 20px calc(112px + env(safe-area-inset-bottom));
}

.screen {
  animation: pageIn 360ms cubic-bezier(.22, 1, .36, 1) both;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font: 700 2.7rem/1.08 var(--displayFont);
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.08rem;
}

.eyebrow {
  margin-bottom: 9px;
  color: var(--blueInk);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.visuallyHidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 380px) {
  .appShell { padding-inline: 14px; }
  h1 { font-size: 2.15rem; }
}
