.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: 4px;
}

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

.current-date {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.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: 22px;
  height: 22px;
  fill: currentColor;
}

/* 滚动区域 */
.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;
}

/* 总余额卡片 */
.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;
}

.balance-stats {
  display: flex;
  gap: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 15px;
}

.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 {
  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-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;
}

/* 进度条 */
.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 { background: #fbbf24; }
.debt-card .progress-bar-fill { background: #6366f1; }

/* 存钱 & 债务概览内容 */
.empty-savings, .empty-debt {
  padding: 10px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.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 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f8f8f7;
}

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

.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;
}

.bill-amount.income { color: #10b981; }
.bill-amount.expense { color: var(--ink); }

.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-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;
}

.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;
}

.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);
}

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

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

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

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

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

.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;
}

.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);
}

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

.accounting-btn-primary {
  width: 100%;
  padding: 16px;
  background: #252523;
  color: var(--white);
  border: 0;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease, background 0.2s ease;
}

.accounting-btn-primary:active {
  transform: scale(0.98);
  background: #1a1a18;
}

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