* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f8f4f0;
  --card: #fffbf7;
  --accent: #e8a87c;
  --accent-dark: #c97b4a;
  --text: #2d2a26;
  --text-muted: #6b6560;
  --checked: #41b3a3;
  --checked-bg: #e8f6f4;
  --disabled: #d4cfc9;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.app {
  max-width: 420px;
  margin: 0 auto;
  padding: 1.5rem;
}

.header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

.stats-card {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  text-align: left;
  max-width: 280px;
  margin: 0 auto;
}

.stat-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  font-size: 0.9rem;
}

.stat-row + .stat-row {
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.stat-balance {
  padding-top: 0.5rem;
  margin-top: 0.15rem;
  font-weight: 600;
}

.stat-label {
  opacity: 0.92;
}

.stat-value {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.stat-balance .stat-value {
  font-size: 1.35rem;
}

.stat-value.negative {
  color: #ffcccb;
}

.stat-muted {
  opacity: 0.88;
}

.stat-unit {
  opacity: 0.85;
  font-size: 0.8rem;
  margin-left: 0.15rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.withdraw-section {
  margin-top: 1.25rem;
}

.withdraw-section,
.withdraw-list-section {
  background: var(--card);
  padding: 1rem 1.25rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.withdraw-section h3,
.withdraw-list-section h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.withdraw-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.withdraw-form input {
  flex: 1;
  min-width: 100px;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--disabled);
  border-radius: 8px;
  font-size: 1rem;
}

.btn-withdraw {
  padding: 0.55rem 1rem;
  border: none;
  background: var(--accent-dark);
  color: white;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
}

.btn-withdraw:hover {
  filter: brightness(1.05);
}

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

.withdraw-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  min-height: 1.2em;
}

.withdraw-list {
  list-style: none;
  font-size: 0.9rem;
}

.withdraw-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--bg);
  gap: 0.75rem;
}

.withdraw-list li:last-child {
  border-bottom: none;
}

.withdraw-list .w-amount {
  font-weight: 600;
  color: var(--accent-dark);
  font-variant-numeric: tabular-nums;
}

.withdraw-list .w-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: right;
}

.withdraw-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.rules {
  background: var(--card);
  padding: 1rem 1.25rem;
  border-radius: 10px;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.rules h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.rules ul {
  list-style: none;
  font-size: 0.9rem;
}

.rules li {
  padding: 0.2rem 0;
}

.rules strong {
  color: var(--accent-dark);
}

.calendar-section {
  background: var(--card);
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.btn-nav {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg);
  color: var(--text);
  font-size: 1.5rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.btn-nav:hover {
  background: var(--accent);
  color: white;
}

.btn-nav:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.month-title {
  font-size: 1.1rem;
  font-weight: 600;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.day.empty {
  cursor: default;
  background: transparent;
}

.day.other-month {
  color: var(--disabled);
}

.day.today {
  font-weight: 600;
  border: 2px solid var(--accent);
}

.day.checkable:hover:not(.checked) {
  background: var(--bg);
}

.day.checked {
  background: var(--checked-bg);
  color: var(--checked);
  font-weight: 600;
}

.day.checked:hover {
  background: #d4ebe8;
}

.day.disabled {
  cursor: not-allowed;
  color: var(--disabled);
}

.day.disabled:hover {
  background: transparent;
}
