/* ====== 基础重置 ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  /* 主色调 - 淡奶咖色系 */
  --color-primary: #B08968;
  --color-primary-hover: #9A7553;
  --color-primary-light: #F5E6D8;
  --color-primary-soft: #EDE0D4;

  /* 背景 */
  --color-bg: #FAF6F1;
  --color-bg-secondary: #F3EBE0;
  --color-card: #FFFDFB;
  --color-sidebar: #F7F1EA;

  /* 文字 */
  --color-text: #4A3B32;
  --color-text-secondary: #8B7B6E;
  --color-text-muted: #B5A695;

  /* 边框 */
  --color-border: #E8DDD0;
  --color-border-light: #F0E8DC;
  --color-border-dashed: #D4C5B3;

  /* 功能色 - 柔和手账风 */
  --color-income: #7BA068;
  --color-income-light: #E8F0E0;
  --color-expense: #D4867A;
  --color-expense-light: #FAEAE6;
  --color-transfer: #9B8BB4;
  --color-transfer-light: #EDE8F5;
  --color-warning: #E6A85C;
  --color-warning-light: #FDF0E0;
  --color-danger: #C9746A;
  --color-danger-light: #FAE6E2;
  --color-success: #7BA068;

  /* 阴影 - 暖色调 */
  --shadow-sm: 0 2px 4px rgba(176, 137, 104, 0.06);
  --shadow-md: 0 4px 10px rgba(176, 137, 104, 0.08), 0 2px 4px rgba(176, 137, 104, 0.04);
  --shadow-lg: 0 8px 20px rgba(176, 137, 104, 0.12), 0 4px 8px rgba(176, 137, 104, 0.06);

  /* 圆角 - 更大更圆润可爱 */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  /* 布局 */
  --sidebar-width: 240px;
  --tabbar-height: 62px;
  --touch-min: 44px;

  /* 字体 */
  --font-family: -apple-system, "SF Pro Rounded", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body {
  font-family: var(--font-family);
  background-color: var(--color-bg);
  background-image:
    radial-gradient(circle at 15% 85%, rgba(176, 137, 104, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 85% 15%, rgba(212, 134, 122, 0.03) 0%, transparent 40%);
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

#app {
  display: flex;
  min-height: 100vh;
}

/* ====== SVG 图标通用 ====== */
.icon-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-svg svg {
  width: 20px;
  height: 20px;
}
.icon-svg.icon-sm svg { width: 16px; height: 16px; }
.icon-svg.icon-lg svg { width: 24px; height: 24px; }
.icon-svg.icon-xl svg { width: 28px; height: 28px; }

/* ====== 加载遮罩 ====== */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.loading-dots {
  display: flex;
  gap: 8px;
}
.loading-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--color-primary);
  animation: bounce-dot 0.6s ease-in-out infinite alternate;
}
.loading-dot:nth-child(2) { animation-delay: 0.2s; background: var(--color-expense); }
.loading-dot:nth-child(3) { animation-delay: 0.4s; background: var(--color-income); }
@keyframes bounce-dot {
  to { transform: translateY(-12px); opacity: 0.6; }
}
.loading-text {
  margin-top: 18px;
  color: var(--color-text-secondary);
  font-size: 14px;
}

/* ====== 侧边栏 ====== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-sidebar);
  background-image: radial-gradient(circle, rgba(176, 137, 104, 0.035) 1px, transparent 1px);
  background-size: 18px 18px;
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
}

.sidebar-nav {
  flex: 1;
  padding: 14px 12px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
  margin-bottom: 4px;
  user-select: none;
  min-height: var(--touch-min);
}
.nav-item:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.nav-item.active {
  background: var(--color-primary);
  color: #FFFDFB;
  box-shadow: var(--shadow-sm);
}
.nav-item .icon-svg svg {
  width: 22px;
  height: 22px;
}
.nav-label {
  font-size: 14px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px dashed var(--color-border-dashed);
}

/* ====== 主内容区 ====== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 28px 32px;
  min-width: 0;
}

.view-section {
  max-width: 1400px;
  margin: 0 auto;
}

/* ====== 页面标题 ====== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  position: relative;
  padding-bottom: 6px;
}
.page-header h1::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 32px;
  height: 3px;
  border-radius: 2px;
  background: var(--color-primary);
  opacity: 0.6;
}
.page-subtitle {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-top: 8px;
}

/* ====== 统计卡片 ====== */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--color-card);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--color-primary-light);
}
.stat-icon .icon-svg svg {
  width: 24px;
  height: 24px;
  color: var(--color-primary);
}
.stat-card.income .stat-icon { background: var(--color-income-light); }
.stat-card.income .stat-icon .icon-svg svg { color: var(--color-income); }
.stat-card.expense .stat-icon { background: var(--color-expense-light); }
.stat-card.expense .stat-icon .icon-svg svg { color: var(--color-expense); }
.stat-card.balance .stat-icon { background: var(--color-transfer-light); }
.stat-card.balance .stat-icon .icon-svg svg { color: var(--color-transfer); }
.stat-card.assets .stat-icon { background: var(--color-primary-light); }
.stat-card.assets .stat-icon .icon-svg svg { color: var(--color-primary); }
.stat-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 2px;
}
.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--color-text);
}
.stat-value.negative { color: var(--color-expense); }

/* ====== 卡片 ====== */
.card {
  background: var(--color-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
  margin-bottom: 18px;
  overflow: hidden;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border-light);
}
.card-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}
.card-body { padding: 20px; }
.card-body.no-padding { padding: 0; }

/* ====== 仪表盘布局 ====== */
.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.account-overview-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--color-border-light);
}
.account-overview-item:last-child { border-bottom: none; }
.account-type-icon { font-size: 18px; }
.account-type-name { flex: 1; color: var(--color-text-secondary); }
.account-type-amount { font-weight: 600; color: var(--color-text); }
.account-type-amount.negative { color: var(--color-expense); }

/* ====== 表格 ====== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-bg-secondary);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
}
.data-table tbody tr:hover { background: var(--color-bg-secondary); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tfoot td {
  padding: 12px 16px;
  font-weight: 600;
  background: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
}
.amount-col { text-align: right; }
.note-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text-secondary);
}
.empty-row { text-align: center; color: var(--color-text-muted); padding: 40px 16px; }
.empty-hint { text-align: center; color: var(--color-text-muted); padding: 20px; }

/* ====== 标签 ====== */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 600;
}
.tag-income { background: var(--color-income-light); color: var(--color-income); }
.tag-expense { background: var(--color-expense-light); color: var(--color-expense); }
.tag-transfer { background: var(--color-transfer-light); color: var(--color-transfer); }
.tag-pill {
  display: inline-block;
  padding: 2px 10px;
  margin-right: 4px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: 20px;
  font-size: 12px;
  border: 1px dashed var(--color-border-dashed);
}

/* ====== 金额颜色 ====== */
.amount-income { color: var(--color-income); font-weight: 600; }
.amount-expense { color: var(--color-expense); font-weight: 600; }
.amount-transfer { color: var(--color-transfer); font-weight: 600; }
.negative { color: var(--color-expense); }

/* ====== 按钮 ====== */
.btn-primary {
  background: var(--color-primary);
  color: #FFFDFB;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary:hover { background: var(--color-primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { background: var(--color-text-muted); cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  background: var(--color-bg-secondary);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: var(--touch-min);
}
.btn-secondary:hover { background: var(--color-border-light); }

.btn-danger {
  background: var(--color-danger);
  color: #FFFDFB;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: var(--touch-min);
}
.btn-danger:hover { background: #B8615A; }

.btn-link {
  background: none;
  border: none;
  color: var(--color-primary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-link:hover { color: var(--color-primary-hover); }

.btn-sm { padding: 7px 14px; font-size: 13px; }

.btn-text {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.btn-text:hover { background: var(--color-primary-light); color: var(--color-primary); }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-xs);
  transition: all 0.2s ease;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}
.btn-icon:hover { background: var(--color-primary-light); color: var(--color-primary); }
.btn-icon.danger:hover { background: var(--color-danger-light); color: var(--color-danger); }

/* ====== 筛选栏 ====== */
.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: center;
}
.filter-select, .filter-input {
  padding: 9px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--color-card);
  color: var(--color-text);
  outline: none;
  transition: border-color 0.2s ease;
  min-height: var(--touch-min);
  font-family: inherit;
}
.filter-select:focus, .filter-input:focus { border-color: var(--color-primary); }
.filter-input { min-width: 140px; }

/* ====== 分类管理 ====== */
.categories-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.category-tree { margin-bottom: 8px; }
.category-level1 {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  border: 1px solid var(--color-border-light);
}
.category-icon { font-size: 18px; }
.category-name { font-weight: 600; flex: 1; }
.category-count { font-size: 12px; color: var(--color-text-muted); }
.category-actions { display: flex; gap: 2px; }
.category-level2 {
  padding-left: 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.subcategory-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: 20px;
  font-size: 12px;
  border: 1px dashed var(--color-border-dashed);
}

/* ====== 预算管理 ====== */
.period-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  background: var(--color-card);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
  width: fit-content;
  flex-wrap: wrap;
}
.period-tab {
  padding: 9px 20px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
  min-height: var(--touch-min);
}
.period-tab:hover { color: var(--color-text); }
.period-tab.active { background: var(--color-primary); color: #FFFDFB; }

.budget-item { margin-bottom: 16px; }
.budget-item:last-child { margin-bottom: 0; }
.budget-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 6px;
}
.budget-item-info { display: flex; align-items: center; gap: 8px; }
.budget-cat-icon { font-size: 16px; }
.budget-cat-name { font-weight: 600; font-size: 14px; }
.budget-period-tag {
  font-size: 11px;
  color: var(--color-text-muted);
  background: var(--color-bg-secondary);
  padding: 2px 8px;
  border-radius: 20px;
}
.budget-item-actions { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.budget-spent { color: var(--color-expense); font-weight: 600; }
.budget-amount { color: var(--color-text-secondary); }
.budget-remaining { font-weight: 600; color: var(--color-income); }
.budget-remaining.negative { color: var(--color-expense); }

/* ====== 设置子 Tab ====== */
.settings-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  background: var(--color-card);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
  width: fit-content;
  flex-wrap: wrap;
}
.settings-tab {
  padding: 9px 20px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
  min-height: var(--touch-min);
}
.settings-tab:hover { color: var(--color-text); }
.settings-tab.active { background: var(--color-primary); color: #FFFDFB; }

.page-header-inline {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 14px;
}

.data-settings-panel {
  max-width: 560px;
}

/* ====== 进度条 ====== */
.progress-bar {
  height: 10px;
  background: var(--color-border-light);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.progress-bar.inline { width: 100%; max-width: 200px; }
.progress-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.3s ease;
}
.progress-fill.ok { background: var(--color-income); }
.progress-fill.warning { background: var(--color-warning); }
.progress-fill.danger { background: var(--color-expense); }
.progress-text {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-secondary);
}
.budget-progress-item { margin-bottom: 12px; }
.budget-progress-item:last-child { margin-bottom: 0; }
.budget-progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 13px;
}
.budget-amounts { color: var(--color-text-secondary); font-weight: 500; }
.type-total { font-size: 18px; font-weight: 700; color: var(--color-text); }
.type-total.negative { color: var(--color-expense); }

/* ====== 图表 ====== */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.chart-canvas { width: 100% !important; height: 280px !important; }
.chart-period-label { font-size: 12px; color: var(--color-text-muted); font-weight: normal; }

/* ====== 模态框 ====== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(74, 59, 50, 0.35);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  width: 560px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.25s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-sm { width: 420px; }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--color-border-light);
}
.modal-header h2 { font-size: 17px; font-weight: 700; }
.modal-body { padding: 24px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--color-border-light);
}
.confirm-message { font-size: 14px; color: var(--color-text); line-height: 1.6; white-space: pre-line; }

/* ====== 表单 ====== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-input, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-card);
  outline: none;
  transition: border-color 0.2s ease;
  font-family: inherit;
  min-height: var(--touch-min);
}
.form-input:focus, .form-select:focus { border-color: var(--color-primary); }
.form-input:disabled { background: var(--color-bg-secondary); color: var(--color-text-muted); }

.type-selector {
  display: flex;
  gap: 4px;
  background: var(--color-bg-secondary);
  padding: 4px;
  border-radius: var(--radius-sm);
}
.type-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
  min-height: var(--touch-min);
}
.type-btn.active {
  background: var(--color-card);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* ====== Emoji 选择器 ====== */
.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 120px;
  overflow-y: auto;
  padding: 8px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-sm);
}
.emoji-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid transparent;
  background: var(--color-card);
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s ease;
}
.emoji-btn:hover { border-color: var(--color-border); transform: scale(1.1); }
.emoji-btn.active { border-color: var(--color-primary); background: var(--color-primary-light); }

/* ====== 数据管理面板 ====== */
.data-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.data-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: var(--touch-min);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-align: center;
}
.data-action-btn:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-color: var(--color-primary-soft);
  transform: translateY(-2px);
}
.data-action-btn .icon-svg svg { width: 24px; height: 24px; }
.data-action-btn.danger:hover { background: var(--color-danger-light); color: var(--color-danger); border-color: var(--color-danger); }

.data-section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  margin-top: 16px;
}
.data-section-label:first-child { margin-top: 0; }

.csv-status-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--color-bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-light);
  margin-bottom: 10px;
}
.csv-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.csv-dot-on { background: var(--color-income); box-shadow: 0 0 6px rgba(123, 160, 104, 0.4); }
.csv-dot-warn { background: var(--color-warning); box-shadow: 0 0 6px rgba(230, 168, 92, 0.4); }
.csv-dot-off { background: var(--color-text-muted); }
.csv-status-text { font-size: 13px; color: var(--color-text); flex: 1; }
.csv-info-text { font-size: 12px; color: var(--color-text-muted); line-height: 1.5; padding: 8px 0; }

/* ====== Toast ====== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-text);
  color: #FFFDFB;
  padding: 12px 26px;
  border-radius: var(--radius-xl);
  font-size: 14px;
  z-index: 2000;
  box-shadow: var(--shadow-lg);
}
.toast-enter-active, .toast-leave-active { transition: all 0.3s ease; }
.toast-enter-from, .toast-leave-to { opacity: 0; transform: translateX(-50%) translateY(10px); }

/* ====== 手机顶部栏 ====== */
.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--color-sidebar);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 52px;
}
.mobile-header-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
}
.mobile-header-btn:active { background: var(--color-primary-light); }
.mobile-header-btn .icon-svg svg { width: 22px; height: 22px; }

/* ====== 底部 Tab 栏 ====== */
.bottom-tabbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--color-card);
  border-top: 1px solid var(--color-border);
  z-index: 100;
  align-items: flex-end;
}
.bottom-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--tabbar-height);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 0.2s ease;
  user-select: none;
  -webkit-user-select: none;
}
.bottom-tab.active { color: var(--color-primary); }
.bottom-tab .icon-svg svg { width: 22px; height: 22px; }
.bottom-tab-label { font-size: 10px; font-weight: 600; }

/* 中间放大 Tab */
.bottom-tab.tab-center {
  flex: 1.1;
  position: relative;
}
.bottom-tab.tab-center .icon-svg {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -18px;
  box-shadow: 0 4px 10px rgba(176, 137, 104, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.bottom-tab.tab-center .icon-svg svg {
  width: 26px;
  height: 26px;
  color: #FFFDFB;
  stroke: #FFFDFB;
}
.bottom-tab.tab-center:active .icon-svg {
  transform: scale(0.92);
}
.bottom-tab.tab-center.active .icon-svg {
  background: var(--color-primary-hover);
  box-shadow: 0 6px 14px rgba(176, 137, 104, 0.4);
}

.account-name { font-weight: 500; }
.account-bank { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }
.account-subtype { display: inline-block; padding: 2px 8px; background: var(--color-bg-secondary); border-radius: var(--radius-sm); font-size: 12px; color: var(--color-text-secondary); }
.account-excluded { margin-left: 4px; font-size: 12px; }

.form-toggle { margin-bottom: 8px; }
.form-toggle .toggle-label { display: flex; align-items: center; gap: 8px; cursor: pointer; margin-bottom: 4px; }
.form-toggle .toggle-text { font-size: 14px; font-weight: 500; color: var(--color-text); }
.form-hint { font-size: 12px; color: var(--color-text-muted); margin: 0; }

/* ====== 响应式 ====== */
@media (max-width: 1024px) {
  .chart-grid, .dashboard-row, .categories-container { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .bottom-tabbar { display: flex; }
  .main-content {
    margin-left: 0;
    padding: 16px;
    padding-bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0px) + 16px);
  }
  .form-row { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-icon { width: 40px; height: 40px; }
  .stat-value { font-size: 17px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-select, .filter-input { width: 100%; }
  .page-header h1 { font-size: 19px; }
  .modal { width: 100%; border-radius: var(--radius-md); }
  .modal-sm { width: 100%; }
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; animation: sheet-up 0.3s ease; }
  @keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
  .data-table { font-size: 12px; }
  .data-table thead th, .data-table tbody td { padding: 10px 10px; }
  .period-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .period-tab { padding: 9px 14px; white-space: nowrap; }
  .settings-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .settings-tab { padding: 9px 14px; white-space: nowrap; }
  .data-action-grid { grid-template-columns: 1fr 1fr; }
  .budget-item-actions { flex-wrap: wrap; gap: 6px; }
  .toast { bottom: calc(var(--tabbar-height) + env(safe-area-inset-bottom, 0px) + 16px); }
}

@media (max-width: 380px) {
  .stat-cards { grid-template-columns: 1fr; }
  .bottom-tab-label { font-size: 9px; }
}

/* ====== 滚动条 ====== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-text-muted); }
