.accounting-page {
  display: none;
  width: min(100%, 760px);
  height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
  position: relative;
}

.accounting-page.active {
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0;
  z-index: 100;
}

/* 顶部标题区 */
.accounting-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(20px + env(safe-area-inset-top)) 20px 15px;
  background: var(--paper);
}

.accounting-back-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.accounting-back-btn svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-left {
  flex: 1;
  margin-left: 0;
  min-width: 0;
}

.accounting-app-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}

.current-date {
  margin: 4px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.current-date::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.7;
}

.accounting-settings-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.accounting-settings-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 滚动区域 */
.accounting-view {
  flex: 1;
  overflow-y: auto;
  padding: 10px 20px 100px;
  -webkit-overflow-scrolling: touch;
  display: none;
}

.accounting-view.active {
  display: block;
}

/* 我的视图 */
.mine-stats-container {
  display: flex;
  gap: 15px;
  margin-bottom: 25px;
}

.mine-stat-card {
  flex: 1;
  background: var(--paper-light, #f8f9fa);
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 16px;
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}

.mine-stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}

.mine-stat-card .stat-label {
  font-size: 13px;
  color: var(--muted);
}

.mine-list-container {
  background: var(--paper-light, #f8f9fa);
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 16px;
  overflow: hidden;
}

.mine-list-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  cursor: pointer;
  background: transparent;
  transition: background 0.2s;
}

.mine-list-item:active {
  background: rgba(0,0,0,0.03);
}

.mine-list-item:not(:last-child) {
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.mine-list-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  color: var(--ink);
}

.mine-list-text {
  flex: 1;
  font-size: 16px;
  color: var(--ink);
}

.mine-list-arrow {
  color: var(--muted);
  font-size: 18px;
  font-family: monospace;
}

/* 视图通用卡片 */
.accounting-card {
  background: var(--white);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.card-title {
  margin: 0 0 15px;
  font-size: 16px;
  font-weight: 600;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.card-header .card-title {
  margin: 0;
}

.card-entry-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.bills-day-group {
  margin-bottom: 16px;
}

.bills-day-group .recent-bills-card {
  margin-bottom: 0;
}

.bills-day-header {
  margin-bottom: 10px;
  padding: 0 4px;
}

.bills-day-header .card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.day-summary-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.day-summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.day-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
  background: #e8e8e6;
  color: var(--ink);
}

/* 总余额卡片 */
.balance-card {
  background: #252523;
  color: var(--white);
}

.balance-card .card-label {
  margin: 0;
  font-size: 13px;
  opacity: 0.7;
}

.balance-amount {
  margin: 8px 0 20px;
  font-size: 32px;
  font-weight: 700;
}

.assets-balance-card .balance-amount {
  margin-bottom: 0;
}

.assets-saved-line {
  margin: 10px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.78);
}

.assets-saved-line span {
  font-weight: 600;
  color: #fff;
}

#billPayFromRow {
  margin-top: 4px;
}

.home-stats-card .balance-stats-slider {
  border-top: none;
  padding-top: 0;
}

.balance-stats-slider {
  position: relative;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 15px;
}

.balance-stats-wrapper {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.balance-stats-wrapper::-webkit-scrollbar {
  display: none;
}

.balance-stats {
  display: flex;
  gap: 20px;
}

.balance-stats.slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
}

.slider-indicators {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.slider-indicators .indicator {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: background 0.3s;
}

.slider-indicators .indicator.active {
  background: rgba(255, 255, 255, 0.9);
}

.stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.stat-item .stat-label {
  font-size: 11px;
  opacity: 0.6;
  margin-bottom: 4px;
}

.stat-item .stat-value {
  font-size: 16px;
  font-weight: 600;
}

.stat-item.income .stat-value {
  color: #a7f3d0;
}

.stat-item.expense .stat-value {
  color: #fca5a5;
}

/* 每日预算卡片 */
.budget-card {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
}

.budget-card.clickable-card {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.budget-card.clickable-card:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

/* 非混合：总预算 → 分类；混合：今日 → 分类 → 本月 */
.budget-card:not(.is-hybrid) #budgetPrimaryBlock { order: 1; }
.budget-card:not(.is-hybrid) #budgetCategoryList { order: 2; }
.budget-card:not(.is-hybrid) #budgetDailyBlock { order: 3; }

.budget-card.is-hybrid #budgetDailyBlock { order: 1; }
.budget-card.is-hybrid #budgetCategoryList { order: 2; }
.budget-card.is-hybrid #budgetPrimaryBlock { order: 3; }

.budget-card.is-hybrid #budgetCategoryList.has-items,
.budget-card.is-hybrid.hybrid-monthly-on #budgetPrimaryBlock,
.budget-card:not(.is-hybrid) #budgetCategoryList.has-items {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.budget-daily-block .budget-daily-value {
  font-size: 20px;
}

.budget-card.is-hybrid #budgetPrimaryBlock .budget-remaining-value {
  font-size: 20px;
}

.budget-main-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 12px;
}

.budget-info-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.budget-stats-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
}

.budget-stats-block #budgetPercent {
  font-weight: 600;
  color: var(--ink);
  font-size: 12px;
}

.budget-remaining-label {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.budget-remaining-value {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}

.budget-category-list {
  display: none;
  flex-direction: column;
  gap: 10px;
}

.budget-category-list.has-items {
  display: flex;
}

.budget-category-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.budget-category-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.budget-category-item-name {
  color: var(--ink);
  font-weight: 600;
}

.budget-category-item-meta {
  white-space: nowrap;
}

.budget-category-item .progress-bar-wrap {
  height: 5px;
}

.budget-category-item .progress-bar-fill.is-over {
  background: var(--expense);
}

.budget-period-tabs {
  margin-bottom: 0;
  flex-wrap: wrap;
  gap: 4px;
}

.budget-period-tabs .bill-type-tab {
  flex: 1 1 calc(50% - 4px);
  min-width: 0;
  padding: 8px 6px;
  font-size: 13px;
}

.budget-field-label-spaced {
  display: block;
  margin-top: 14px;
}

#budgetPeriodHint[hidden],
#budgetHybridAmountsField[hidden],
#budgetSingleAmountField[hidden],
#budgetResetTimeField[hidden],
#budgetDailyBlock[hidden],
#budgetPrimaryBlock[hidden],
#billIncludeMonthlyRow[hidden],
#billIncludeDailyRow[hidden],
#billIncludeBudgetRow[hidden],
#categoryBudgetField[hidden],
#budgetGroupsField[hidden],
#hybridDailySettings[hidden],
#hybridMonthlySettings[hidden],
#budgetGroupDeleteBtn[hidden] {
  display: none !important;
}

.hybrid-module-switch {
  margin: 0 0 8px;
  padding: 4px 0;
}

.hybrid-module-body {
  margin: 0 0 18px;
  padding: 12px 14px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.hybrid-module-body > label:first-of-type {
  display: block;
  margin-bottom: 6px;
}

.hybrid-category-check-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.budget-category-item-nested {
  margin-left: 12px;
  opacity: 0.92;
}

.budget-category-item-nested .budget-category-item-name {
  font-weight: 500;
  font-size: 13px;
}

.budget-group-category-check {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.budget-group-category-amount {
  width: 88px;
  flex-shrink: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.budget-group-category-amount:disabled {
  opacity: 0.4;
}

.budget-group-category-item {
  gap: 8px;
}

.budget-groups-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.budget-group-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.budget-group-row:active {
  background: #f3f3f0;
}

.budget-group-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.budget-group-row-name {
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
}

.budget-group-row-amount {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  flex-shrink: 0;
}

.budget-group-row-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.budget-group-category-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.budget-group-category-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  cursor: pointer;
  min-height: 48px;
}

.budget-group-category-item.is-taken {
  opacity: 0.55;
  cursor: not-allowed;
}

.budget-group-category-name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.budget-group-category-taken {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}

.budget-group-edit-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.budget-group-edit-actions .accounting-btn-secondary,
.budget-group-edit-actions .accounting-btn-primary {
  flex: 1;
}

.category-budget-hint-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

.category-budget-hint-row .field-hint {
  margin: 0 0 0 4px;
  flex: 1;
  min-width: 0;
}

.category-budget-select-all {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  min-height: 44px;
  padding: 0 2px;
}

.category-budget-check-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.category-budget-check {
  width: 20px;
  height: 20px;
  border: 1.5px solid rgba(0, 0, 0, 0.22);
  border-radius: 6px;
  background: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
  flex-shrink: 0;
}

.category-budget-check::after {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--white);
  border-bottom: 2px solid var(--white);
  transform: rotate(-45deg) translateY(-1px) scale(0);
  transition: transform 0.12s ease;
}

.category-budget-check-input:checked + .category-budget-check {
  background: var(--ink);
  border-color: var(--ink);
}

.category-budget-check-input:checked + .category-budget-check::after {
  transform: rotate(-45deg) translateY(-1px) scale(1);
}

.category-budget-check-input:focus-visible + .category-budget-check {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.category-budget-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-budget-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.category-budget-include {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin: -10px;
  cursor: pointer;
}

.category-budget-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
  min-width: 0;
}

.category-budget-dial {
  position: relative;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
}

.category-budget-dial-ring {
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(-90deg);
}

.category-budget-dial-track {
  fill: none;
  stroke: #ecece8;
  stroke-width: 3.2;
}

.category-budget-dial-fill {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3.2;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.25s ease, stroke 0.2s ease;
}

.category-budget-dial.is-empty .category-budget-dial-fill {
  stroke: #cfcfc9;
}

.category-budget-dial-value,
.category-budget-dial-input {
  position: absolute;
  inset: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 20px);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  padding: 0;
}

.category-budget-dial-value {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  word-break: break-all;
}

.category-budget-dial-value:active {
  opacity: 0.7;
}

.category-budget-dial.is-empty .category-budget-dial-value {
  color: var(--muted);
  font-weight: 600;
}

.category-budget-dial-input {
  display: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.category-budget-dial-input::-webkit-outer-spin-button,
.category-budget-dial-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.category-budget-dial.is-editing .category-budget-dial-value {
  display: none;
}

.category-budget-dial.is-editing .category-budget-dial-input {
  display: block;
}

.category-budget-dial-input:focus {
  outline: none;
}

.category-budget-remove-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-budget-remove-btn:active {
  background: rgba(0, 0, 0, 0.05);
  color: var(--expense, #c0392b);
}

.category-budget-add-btn {
  margin-top: 10px;
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 14px;
  border: 1.5px dashed rgba(0, 0, 0, 0.18);
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.category-budget-add-btn:active {
  background: rgba(0, 0, 0, 0.03);
  border-color: var(--ink);
  color: var(--ink);
}

.category-budget-add-icon {
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

.category-budget-picker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-budget-picker-item {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.category-budget-picker-item:active {
  background: rgba(0, 0, 0, 0.03);
}

.category-budget-picker-item-hint {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

/* 进度条 */
.progress-bar-wrap {
  height: 8px;
  background: #f0f0ee;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: #252523;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.savings-card .progress-bar-fill,
.plan-overview-card.is-savings .progress-bar-fill { background: #fbbf24; }
.debt-card .progress-bar-fill,
.plan-overview-card.is-debt .progress-bar-fill { background: #6366f1; }

/* 财务页：存钱 / 还钱 Tab */
.financial-plan-tabs {
  display: flex;
  background: #f0f0ee;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 16px;
}

.financial-plan-tab {
  flex: 1;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.financial-plan-tab.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.financial-tab-panel[hidden] {
  display: none;
}

.plan-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-overview-card {
  margin-bottom: 0;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.plan-overview-card:active {
  transform: scale(0.985);
}

.plan-overview-card .goal-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 0;
}

.plan-overview-card .plan-card-chevron {
  margin-left: auto;
  color: var(--muted);
  font-size: 18px;
  font-weight: 400;
  line-height: 1;
}

/* 存钱 & 债务概览内容 */
.empty-savings, .empty-debt {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.create-goal-btn {
  margin-top: 10px;
  padding: 8px 20px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}

.goal-name {
  margin: 0 0 10px;
  font-weight: 600;
  font-size: 15px;
}

.savings-progress-text, .debt-progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

.debt-remaining-label {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.debt-remaining-value {
  margin: 4px 0 15px;
  font-size: 20px;
  font-weight: 600;
}

/* 最近账单 */
.bills-list {
  display: flex;
  flex-direction: column;
}

.bill-item-swipe {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid #f8f8f7;
}

.bill-item-swipe:last-child {
  border-bottom: 0;
}

.bill-item-delete-action {
  position: absolute;
  inset: 0 0 0 auto;
  width: 72px;
  border: 0;
  padding: 0;
  background: var(--expense);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bill-item-delete-action:active {
  filter: brightness(0.92);
}

.bill-item {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  background: var(--white);
  transform: translateX(0);
  transition: transform 0.22s ease;
  touch-action: pan-y;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.bill-item.is-swiping {
  transition: none;
}

.bill-item.is-open {
  transform: translateX(-72px);
}

.bill-item-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bill-category {
  font-size: 15px;
  font-weight: 500;
}

.bill-note-time {
  font-size: 11px;
  color: var(--muted);
}

.bill-amount {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.bill-amount.income,
.bill-amount.expense,
.bill-amount.transfer {
  color: var(--ink);
}

.day-summary.transfer .day-tag {
  background: #eef0ff;
  color: #4338ca;
}

@media (prefers-reduced-motion: reduce) {
  .bill-item {
    transition: none;
  }
}

.empty-bills {
  padding: 30px 0;
  text-align: center;
  color: var(--muted);
}

.start-accounting-btn {
  margin-top: 12px;
  padding: 10px 24px;
  background: #252523;
  color: var(--white);
  border: 0;
  border-radius: 12px;
  font-size: 14px;
  cursor: pointer;
}

/* 全屏子页面（如预算设置） */
.accounting-subpage {
  position: absolute;
  inset: 0;
  z-index: 120;
  display: none;
  flex-direction: column;
  background: var(--paper);
}

.accounting-subpage.active {
  display: flex;
}

#budgetPeriodEditPage,
#planEditPage,
#achievementsPage {
  z-index: 121;
}

/* 计划类型选择 */
.plan-type-section {
  margin-bottom: 22px;
}

.plan-type-section-title {
  margin: 0 0 10px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.plan-type-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-type-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 12px 14px 14px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  background: var(--paper-light, #f8f9fa);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  min-height: 76px;
}

.plan-type-card:active {
  background: #f0f0ee;
  transform: scale(0.99);
}

.plan-type-card-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.plan-type-card-icon svg {
  width: 20px;
  height: 20px;
}

.plan-type-card[data-kind="savings"] .plan-type-card-icon {
  color: #b45309;
  background: #fff8eb;
}

.plan-type-card[data-kind="debt"] .plan-type-card-icon {
  color: #4338ca;
  background: #eef0ff;
}

.plan-type-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.plan-type-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.plan-type-card-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.plan-type-card-arrow {
  flex-shrink: 0;
  font-size: 22px;
  color: #c4c4be;
  line-height: 1;
  padding-right: 2px;
}

.plan-color-input {
  width: 100%;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
}

.plan-suggest-hint {
  margin: 4px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f0f0ee;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}

.plan-mode-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
  background: #f0f0ee;
  color: var(--muted);
}

.savings-info .plan-mode-tag,
.plan-overview-card.is-savings .plan-mode-tag {
  background: #fff8eb;
  color: #b45309;
}

.debt-info .plan-mode-tag,
.plan-overview-card.is-debt .plan-mode-tag {
  background: #eef0ff;
  color: #4338ca;
}

.plan-meta-line {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.accounting-subpage-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(20px + env(safe-area-inset-top)) 16px 15px;
  background: var(--paper);
  flex-shrink: 0;
}

.accounting-subpage-back {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.accounting-subpage-back svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.accounting-subpage-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.accounting-subpage-action {
  width: 36px;
  height: 36px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.accounting-subpage-action svg {
  width: 22px;
  height: 22px;
}

.achievements-hint {
  margin: 0 0 16px 4px;
}

.empty-achievements {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
}

.empty-achievements p {
  margin: 0;
  font-size: 14px;
}

.empty-achievements-sub {
  margin-top: 8px !important;
  font-size: 12px !important;
  line-height: 1.5;
  opacity: 0.85;
}

.achievements-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.achievement-item {
  padding: 14px 14px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.02);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.achievement-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.achievement-item .goal-name {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.achievement-done-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(37, 37, 35, 0.08);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.achievement-item .plan-meta-line {
  margin: 0 0 8px;
}

.achievement-item-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.achievement-item.is-savings .achievement-done-badge {
  background: rgba(251, 191, 36, 0.22);
}

.achievement-item.is-debt .achievement-done-badge {
  background: rgba(99, 102, 241, 0.16);
}

.accounting-subpage-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

.accounting-subpage-actions {
  margin-top: 12px;
}

.field-hint {
  margin: 4px 0 0 4px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* 预算设置入口卡片 */
.budget-type-list-hint {
  margin: 0 0 14px 4px;
}

.budget-type-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.budget-type-card {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 8px 8px 8px 14px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  background: var(--paper-light, #f8f9fa);
  color: inherit;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 88px;
}

.budget-type-card.is-active {
  border-color: rgba(22, 22, 22, 0.14);
  background: var(--white);
  box-shadow: 0 8px 20px rgba(21, 21, 19, 0.06);
}

.budget-type-card-select {
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  cursor: pointer;
  border-radius: 12px;
}

.budget-type-card-select-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.budget-type-card-select-mark {
  width: 22px;
  height: 22px;
  border: 1.5px solid rgba(0, 0, 0, 0.22);
  border-radius: 50%;
  background: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.budget-type-card-select-mark::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--white);
  transform: scale(0);
  transition: transform 0.12s ease;
}

.budget-type-card-select-input:checked + .budget-type-card-select-mark {
  background: var(--ink);
  border-color: var(--ink);
}

.budget-type-card-select-input:checked + .budget-type-card-select-mark::after {
  transform: scale(1);
}

.budget-type-card-select-input:focus-visible + .budget-type-card-select-mark {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.budget-type-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 4px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  border-radius: 12px;
  transition: background 0.15s ease;
}

.budget-type-card-body:active {
  background: rgba(0, 0, 0, 0.03);
}

.budget-type-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.budget-type-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.budget-type-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.budget-type-card-badge {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.budget-type-card-amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.3;
  word-break: break-word;
}

.budget-type-card[data-period="hybrid"].is-active .budget-type-card-amount {
  font-size: 15px;
}

.budget-type-card:not(.is-active) .budget-type-card-amount {
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}

.budget-type-card-meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.budget-type-card-arrow {
  flex-shrink: 0;
  color: var(--muted);
  font-size: 22px;
  font-family: monospace;
  line-height: 1;
}

/* 底部导航栏 */
.accounting-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(70px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 10;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 0;
  cursor: pointer;
  flex: 1;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

.nav-item span {
  font-size: 10px;
}

.nav-item.active {
  color: var(--ink);
}

.nav-add {
  width: 48px;
  height: 48px;
  background: #252523;
  color: var(--white);
  border: 0;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-5px);
}

.add-icon {
  font-size: 24px;
  font-weight: 300;
}

/* 记一笔半屏模态框 (Bottom Sheet) */
.accounting-sheet-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.accounting-sheet-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.accounting-sheet {
  background: var(--paper);
  width: min(100%, 760px);
  margin: 0 auto;
  border-radius: 24px 24px 0 0;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.1);
}

.accounting-sheet-modal.active .accounting-sheet {
  transform: translateY(0);
}

.accounting-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.accounting-sheet-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.accounting-sheet-close {
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.accounting-sheet-content {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.add-bill-tabs {
  display: flex;
  background: #f0f0ee;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 30px;
}

#addBillModal .add-bill-tabs {
  margin-bottom: 14px;
}

.bill-type-tab {
  flex: 1;
  padding: 10px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

#addBillModal .bill-type-tab {
  padding: 8px;
  font-size: 14px;
}

.bill-type-tab.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.amount-input-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 30px;
  background: var(--white);
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

#addBillModal .amount-input-wrap {
  gap: 4px;
  margin-bottom: 10px;
  padding: 6px 12px;
  border-radius: 12px;
  cursor: text;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
}

#addBillModal .amount-input-wrap:focus-within,
#addBillModal .amount-input-wrap.is-active {
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.amount-input-wrap .currency {
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
}

#addBillModal .amount-input-wrap .currency {
  font-size: 16px;
}

#billAmount {
  width: 100%;
  max-width: 200px;
  border: 0;
  background: transparent;
  font-size: 42px;
  font-weight: 700;
  text-align: center;
  padding: 0;
  color: var(--ink);
}

#addBillModal #billAmount {
  max-width: 160px;
  font-size: 24px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  caret-color: var(--ink);
}

#billAmount:focus { outline: none; }
#billAmount::placeholder { color: #d2d2cd; }

.bill-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

#addBillModal .bill-field {
  gap: 6px;
  margin-bottom: 0;
  min-width: 0;
}

.bill-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 8px;
  margin-bottom: 10px;
}

.bill-field label {
  font-size: 14px;
  color: var(--ink);
  font-weight: 600;
  padding-left: 4px;
}

#addBillModal .bill-field label {
  font-size: 12px;
  padding-left: 2px;
}

.bill-field input, .bill-field select {
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 16px;
  font-size: 15px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  transition: all 0.2s ease;
}

#addBillModal .bill-field input,
#addBillModal .bill-field select {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  box-sizing: border-box;
}

#addBillModal .bill-field input[type="datetime-local"] {
  font-size: 11px;
  padding: 8px 6px;
}

.bill-field input:focus, .bill-field select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#addBillModal .bill-budget-switches {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

#addBillModal .bill-budget-switches:not(.is-hybrid) .bill-budget-row {
  flex: 1;
}

#addBillModal .bill-budget-switches.is-hybrid .bill-budget-row {
  flex: 1;
  min-width: 0;
}

#addBillModal .bill-budget-row {
  margin-bottom: 0;
  padding: 2px 0;
  gap: 8px;
}

#addBillModal .bill-budget-row strong {
  color: var(--ink);
  font-size: 12px;
  padding-left: 2px;
  font-weight: 600;
  white-space: nowrap;
}

#addBillModal .bill-budget-row .settings-switch {
  flex: 0 0 40px;
  width: 40px;
  height: 24px;
}

#addBillModal .bill-budget-row .settings-switch::after {
  width: 18px;
  height: 18px;
}

#addBillModal .bill-budget-row .settings-switch-input:checked + .settings-switch::after {
  transform: translateX(16px);
}

#addBillModal .bill-note-field {
  margin-bottom: 4px;
}

#addBillModal .accounting-sheet-header {
  padding: 14px 20px;
}

#addBillModal .accounting-sheet-content {
  padding: 14px 20px 16px;
}

#addBillModal .accounting-sheet-actions {
  margin-top: 12px;
}

#addBillModal .accounting-btn-primary {
  padding: 14px;
  border-radius: 14px;
}

.amount-keypad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
  user-select: none;
}

.keypad-key {
  min-height: 44px;
  border: 0;
  border-radius: 11px;
  background: var(--white);
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.keypad-key:active {
  transform: scale(0.96);
  background: #ecece8;
  box-shadow: none;
}

.keypad-key-action {
  color: var(--muted);
  background: #f0f0ee;
}

.keypad-key-action svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: block;
}

.accounting-sheet-actions {
  margin-top: 10px;
  padding-bottom: env(safe-area-inset-bottom);
}

.accounting-btn-primary {
  width: 100%;
  padding: 16px;
  background: linear-gradient(180deg, #333333 0%, #1a1a18 100%);
  color: var(--white);
  border: 1px solid #111;
  border-top: 1px solid #444;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.accounting-btn-primary:active {
  transform: scale(0.98);
  background: #1a1a18;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.accounting-btn-secondary {
  width: 100%;
  padding: 16px;
  background: var(--paper-light, #f8f9fa);
  color: var(--ink);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.accounting-btn-secondary:active {
  transform: scale(0.98);
  background: rgba(0, 0, 0, 0.05);
}

@media (min-width: 600px) {
  .accounting-page {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
}

/* 账单视图样式 */
.bills-filter-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
}

.bills-type-tabs {
  display: flex;
  background: #f0f0ee;
  border-radius: 12px;
  padding: 4px;
}

.bill-filter-tab {
  flex: 1;
  padding: 8px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.bill-filter-tab.active {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.bills-date-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.date-nav-btn {
  background: var(--white);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.current-date-display {
  font-size: 16px;
  font-weight: 600;
  min-width: 100px;
  text-align: center;
}

/* 账单月历 */
.bills-calendar-card {
  padding: 16px 14px 12px;
}

.bills-calendar-card[hidden] {
  display: none;
}

.bills-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 6px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.bills-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px 0;
}

.bills-calendar-cell {
  position: relative;
  min-height: 58px;
  padding: 4px 2px 6px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}

.bills-calendar-cell:disabled {
  cursor: default;
  pointer-events: none;
}

.bills-calendar-cell.is-outside {
  visibility: hidden;
}

.bills-calendar-cell.is-today .bills-calendar-daynum {
  background: var(--ink);
  color: var(--white);
}

.bills-calendar-cell.is-selected {
  background: rgba(0, 0, 0, 0.05);
}

.bills-calendar-cell.is-over {
  background: rgba(244, 67, 54, 0.08);
}

.bills-calendar-cell.is-over.is-selected {
  background: rgba(244, 67, 54, 0.14);
}

.bills-calendar-daynum {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
}

.bills-calendar-expense,
.bills-calendar-income {
  font-size: 10px;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bills-calendar-expense {
  color: #e57373;
  font-weight: 600;
}

.bills-calendar-cell.is-over .bills-calendar-expense {
  color: var(--expense);
}

.bills-calendar-income {
  color: #10b981;
}

.bills-calendar-overdot {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--expense);
}

.bills-day-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.bills-day-detail[hidden] {
  display: none;
}

.bills-day-detail-date {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.bills-day-detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  font-size: 12px;
  color: var(--muted);
}

.bills-day-detail-stats strong {
  font-weight: 700;
  margin-left: 2px;
}

.bills-day-detail-stats strong.expense {
  color: var(--ink);
}

.bills-day-detail-stats strong.income {
  color: #10b981;
}

.bills-day-detail-stats strong.is-over {
  color: var(--expense);
}

.summary-card {
  padding: 16px 20px;
}

.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.summary-item .summary-label {
  font-size: 12px;
  color: var(--muted);
}

.summary-item .summary-value {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-value.expense { color: var(--ink); }
.summary-value.income { color: #10b981; }
.summary-value.savings { color: #d97706; }
.summary-value.debt { color: #6366f1; }

/* 图形分布区域 */
.chart-card {
  padding: 20px;
}

.chart-tabs {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.chart-tab {
  padding: 8px 4px;
  background: transparent;
  border: none;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  position: relative;
}

.chart-tab.active {
  color: var(--ink);
  font-weight: 600;
}

.chart-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
}

.chart-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 12px;
}

.donut-chart-wrap {
  position: relative;
  width: min(100%, 340px);
  aspect-ratio: 340 / 260;
  margin: 0 auto;
}

.donut-callouts {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 2;
}

.donut-callout-line {
  fill: none;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}

.donut-callout-dot {
  stroke: var(--white);
  stroke-width: 1.5;
}

.donut-callout-name {
  font-size: 11px;
  font-weight: 600;
  fill: var(--ink);
}

.donut-callout-pct {
  font-size: 10px;
  fill: var(--muted);
}

.donut-chart {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.donut-hole {
  width: 100px;
  height: 100px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.03);
}

.donut-hole-label {
  font-size: 13px;
  color: var(--muted);
}

.donut-hole-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 4px;
}

/* 分类排行榜 */
.category-summary-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 8px;
}

.category-summary-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.category-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.category-summary-left {
  display: flex;
  align-items: center;
}

.category-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 10px;
  flex-shrink: 0;
}

.category-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}

.category-percent {
  font-size: 12px;
  color: var(--muted);
  margin-left: 8px;
}

.category-amount {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.category-progress-wrap {
  height: 6px;
  background: #f0f0ee;
}

.category-progress-fill {
  border-radius: 4px;
}

.chart-empty {
  width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 40px 0;
}

/* 应用设置页 */
.settings-section {
  margin-bottom: 24px;
}

.settings-section-title {
  margin: 0 0 10px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.settings-card {
  background: var(--paper-light, #f8f9fa);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 16px;
  overflow: hidden;
}

.pwa-icon-setting {
  display: flex;
  gap: 16px;
  padding: 18px 16px;
  align-items: flex-start;
}

.pwa-icon-preview-wrap {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 14px rgba(21, 21, 19, 0.1);
}

.pwa-icon-preview {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pwa-icon-meta {
  flex: 1;
  min-width: 0;
}

.pwa-icon-title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.pwa-icon-desc {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.pwa-icon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pwa-icon-btn {
  width: auto;
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
}

#pwaIconStatus,
#pwaUpdateStatus {
  min-height: 1.2em;
  margin-top: 10px;
}

.pwa-update-setting {
  padding: 18px 16px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.pwa-update-meta {
  min-width: 0;
}

/* 首页月份选择半屏 */
.home-month-picker-sheet {
  max-height: 55dvh;
}

.home-month-year-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.home-month-year-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.home-month-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 8px;
}

.home-month-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 56px;
  padding: 10px 4px 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

.home-month-cell:hover {
  background: rgba(0, 0, 0, 0.04);
}

.home-month-cell.is-selected {
  background: var(--ink);
  color: var(--paper);
}

.home-month-cell.is-future {
  opacity: 0.35;
  pointer-events: none;
}

.home-month-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink);
}

.home-month-cell.is-selected .home-month-dot {
  background: var(--paper);
}

.home-month-dot.is-empty {
  visibility: hidden;
}
