/* ============================================
   记账与资金管理应用 — 现代金融风样式
   ============================================ */

:root {
  /* 背景色 */
  --bg-primary: #0f1729;
  --bg-secondary: #1a2333;
  --bg-card: rgba(30, 41, 59, 0.6);
  --bg-card-hover: rgba(30, 41, 59, 0.8);
  --bg-input: rgba(15, 23, 41, 0.6);

  /* 强调色 */
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-gold: #f59e0b;
  --accent-gold-light: #fbbf24;
  --accent-purple: #8b5cf6;

  /* 文字色 */
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* 边框 */
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.15);

  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

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

html, body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

body {
  background: radial-gradient(ellipse at top, #1a2333 0%, var(--bg-primary) 50%);
  min-height: 100vh;
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ============================================
   布局
   ============================================ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* 侧边栏（桌面端） */
.sidebar {
  width: 240px;
  min-height: 100vh;
  background: linear-gradient(180deg, #0f1729 0%, #1a2333 100%);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
}

/* 移动端顶栏（默认隐藏，小屏显示） */
.mobile-topbar {
  display: none;
}

.sidebar-header {
  padding: 24px 20px 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 30px;
  height: 30px;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon svg {
  width: 26px;
  height: 26px;
}

.logo-text {
  font-size: 18px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-total {
  padding: 16px 20px 24px;
  border-bottom: 1px solid var(--glass-border);
}

.st-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.st-value {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

.st-liabilities {
  font-size: 12px;
  color: var(--accent-red);
  margin-top: 4px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent-blue);
  border-radius: 2px;
}

.nav-icon {
  font-size: 18px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-icon svg {
  width: 20px;
  height: 20px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--glass-border);
}

.sidebar-footer p {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}

/* 主内容区 */
.main-content {
  flex: 1;
  margin-left: 240px;
  padding: 24px 32px;
  min-height: 100vh;
}

/* ============================================
   仪表盘
   ============================================ */

/* NLP 输入栏 */
.dashboard-top {
  margin-bottom: 20px;
}

.nlp-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.nlp-input {
  flex: 1;
  padding: 14px 20px;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  transition: all 0.2s ease;
  backdrop-filter: blur(12px);
}

.nlp-input::placeholder {
  color: var(--text-dim);
}

.nlp-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  background: rgba(15, 23, 41, 0.8);
}

.nlp-btn {
  padding: 14px 28px;
  white-space: nowrap;
}

.nlp-hints {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hint-item {
  font-size: 12px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.hint-item:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--accent-blue);
}

/* 月度统计栏 */
.monthly-stats-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 28px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  margin-bottom: 20px;
}

.msb-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.msb-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.msb-divider {
  width: 1px;
  height: 40px;
  background: var(--glass-border);
}

/* 仪表盘卡片 */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

.dash-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(12px);
  transition: border-color 0.2s ease;
}

.dash-card:hover {
  border-color: var(--glass-border-hover);
}

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

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.chart-container {
  position: relative;
  height: 220px;
}

/* 仪表盘底部 */
.dashboard-bottom {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ============================================
   定期存款概览
   ============================================ */
.deposit-overview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.deposit-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--glass-border);
}

.deposit-stat:last-of-type {
  border-bottom: none;
}

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

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

.deposit-alert {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--accent-gold);
}

.deposit-list-mini {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.deposit-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.deposit-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.deposit-item.matured {
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.dep-item-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dep-principal {
  font-weight: 600;
  font-size: 15px;
}

.dep-rate {
  font-size: 11px;
  color: var(--text-muted);
}

.dep-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.dep-interest {
  font-size: 12px;
  color: var(--accent-green);
}

.dep-days {
  font-size: 11px;
  color: var(--text-muted);
}

.deposit-more {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  padding: 8px;
}

/* ============================================
   最近交易列表
   ============================================ */
.recent-tx-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 300px;
  overflow-y: auto;
}

.tx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s ease;
}

.tx-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.tx-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
}

.tx-icon.tx-income {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
}

.tx-icon.tx-expense {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.tx-icon.tx-transfer {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.tx-info {
  flex: 1;
  min-width: 0;
}

.tx-note {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-meta {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.tx-category {
  font-size: 12px;
  color: var(--text-muted);
}

.tx-account {
  font-size: 12px;
  color: var(--text-dim);
}

.tx-amount {
  font-size: 15px;
  font-weight: 600;
  flex-shrink: 0;
}

.tx-amount.tx-income {
  color: var(--accent-green);
}

.tx-amount.tx-expense {
  color: var(--accent-red);
}

.tx-amount.tx-transfer {
  color: var(--accent-blue);
}

.tx-date {
  font-size: 12px;
  color: var(--text-dim);
  flex-shrink: 0;
  width: 50px;
  text-align: right;
}

/* ============================================
   页面通用
   ============================================ */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 24px;
  font-weight: 700;
}

/* 账户管理页定存入口 */
.deposit-entrance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.deposit-entrance:hover {
  border-color: var(--glass-border-hover);
  background: var(--bg-card-hover);
}

.de-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.de-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.de-icon svg {
  width: 22px;
  height: 22px;
}

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

.de-title {
  font-size: 15px;
  font-weight: 600;
}

.de-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

.de-arrow {
  font-size: 18px;
  color: var(--text-dim);
}

/* 账户管理 */
.accounts-summary {
  display: flex;
  gap: 20px;
  padding: 20px 28px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  margin-bottom: 24px;
}

.as-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.as-value {
  font-size: 20px;
  font-weight: 600;
}

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.account-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.account-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-color, var(--accent-blue));
}

.account-card:hover {
  transform: translateY(-2px);
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow-md);
}

.ac-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.ac-icon {
  font-size: 24px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.ac-icon svg {
  width: 24px;
  height: 24px;
}

.ac-type {
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
}

.ac-edit {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.ac-edit:hover {
  background: rgba(255,255,255,0.05);
  color: var(--accent-blue);
}

.ac-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.ac-balance {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.ac-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.ac-actions {
  display: flex;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}

/* ============================================
   交易明细页
   ============================================ */
.tx-filters {
  display: flex;
  gap: 12px;
}

.tx-filters select,
.tx-filters input {
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
}

.tx-filters select:focus,
.tx-filters input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.tx-date-group {
  margin-bottom: 20px;
}

.tx-date-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  margin-bottom: 4px;
}

.tx-date-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.tx-date-summary {
  display: flex;
  gap: 12px;
  font-size: 12px;
}

.tx-date-list {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 4px 12px;
  backdrop-filter: blur(12px);
}

/* ============================================
   定期存款页
   ============================================ */
.deposit-summary-bar {
  display: flex;
  gap: 20px;
  padding: 20px 28px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  margin-bottom: 24px;
}

.dsb-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

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

.dsb-value {
  font-size: 22px;
  font-weight: 600;
}

.deposit-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.deposit-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
}

.deposit-card.status-ready {
  border-color: rgba(245, 158, 11, 0.4);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.1);
}

.deposit-card.status-matured {
  opacity: 0.7;
}

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

.dc-account {
  font-size: 16px;
  font-weight: 600;
}

.dc-status {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 500;
}

.badge-active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

.badge-ready {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
}

.badge-matured {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}

.dc-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.dc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.dc-row.highlight {
  padding: 8px 0;
  border-top: 1px solid var(--glass-border);
  font-weight: 600;
}

.dc-label {
  color: var(--text-muted);
}

.dc-value {
  color: var(--text-primary);
  font-weight: 500;
}

.dc-principal {
  font-size: 15px !important;
  font-weight: 600 !important;
}

.dc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
}

.dc-days-left {
  font-size: 13px;
  color: var(--text-muted);
}

.dc-done {
  font-size: 12px;
  color: var(--text-dim);
}

/* ============================================
   设置页
   ============================================ */

/* 云端同步状态 */
.sync-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.sync-status-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sync-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.05);
}

.sync-status-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sync-status-text {
  font-size: 14px;
  font-weight: 500;
}

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

.sync-error-msg {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--accent-red);
  margin-bottom: 12px;
}

.sync-config-info {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.sci-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sci-row span:first-child {
  font-size: 11px;
  color: var(--text-muted);
}

.sci-value {
  font-size: 13px;
  font-family: monospace;
  word-break: break-all;
}

.sync-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.sync-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(59, 130, 246, 0.08);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

/* 同步教程折叠面板 */
.sync-tutorial {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.sync-tutorial summary {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-blue);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.sync-tutorial summary:hover {
  background: rgba(255, 255, 255, 0.02);
}

.tutorial-content {
  padding: 0 16px 16px;
  font-size: 13px;
}

.tutorial-content h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 12px 0 6px;
}

.tutorial-content h4:first-child {
  margin-top: 0;
}

.tutorial-content p {
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.6;
}

.tutorial-content ul {
  list-style: none;
  padding-left: 0;
  margin: 6px 0;
}

.tutorial-content li {
  color: var(--text-secondary);
  padding: 3px 0;
  padding-left: 14px;
  position: relative;
}

.tutorial-content li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent-blue);
}

.tutorial-content code {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  word-break: break-all;
}

.tutorial-content a {
  color: var(--accent-blue);
}

.sql-code {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  color: #93c5fd;
  overflow-x: auto;
  white-space: pre;
  margin: 8px 0;
  line-height: 1.5;
}

.btn-sm {
  padding: 8px 14px !important;
  font-size: 13px !important;
}

.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(12px);
  margin-bottom: 20px;
}

.settings-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.settings-row {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}

.sr-info {
  flex: 1;
  text-align: center;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
}

.sr-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.sr-value {
  font-size: 24px;
  font-weight: 700;
}

.settings-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.help-content h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-blue);
  margin: 16px 0 8px;
}

.help-content h4:first-child {
  margin-top: 0;
}

.help-content p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.help-content ul {
  list-style: none;
  padding-left: 0;
}

.help-content li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 0;
  padding-left: 16px;
  position: relative;
}

.help-content li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent-blue);
}

.about-text {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ============================================
   按钮
   ============================================ */
.btn-primary,
.btn-secondary,
.btn-danger {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), #2563eb);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--glass-border-hover);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent-blue);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  padding: 4px 8px;
  transition: opacity 0.2s ease;
}

.btn-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.btn-link-danger {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  padding: 4px 8px;
  transition: color 0.2s ease;
}

.btn-link-danger:hover {
  color: var(--accent-red);
}

.btn-text-danger {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  padding: 4px 8px;
  transition: color 0.2s ease;
}

.btn-text-danger:hover {
  color: var(--accent-red);
}

.btn-deposit-mature {
  padding: 4px 12px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  color: #1a2333;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.2s ease;
}

.btn-deposit-mature:hover {
  transform: scale(1.05);
}

.btn-mature {
  width: 100%;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  color: #1a2333;
}

/* ============================================
   模态框
   ============================================ */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 90%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}

.modal-content.modal-sm {
  max-width: 420px;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

.modal-body {
  margin-bottom: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--glass-border);
}

/* 表单 */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input[readonly] {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-hint {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* 类型选择器 */
.type-selector {
  display: flex;
  gap: 8px;
}

.type-btn {
  flex: 1;
  padding: 10px;
  background: var(--bg-input);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.type-btn:hover {
  border-color: var(--glass-border-hover);
  color: var(--text-primary);
}

.type-btn.active.expense {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.type-btn.active.income {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-green);
  color: var(--accent-green);
}

.type-btn.active.transfer {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

/* 定存预览 */
.deposit-preview {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 8px;
}

.dp-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}

.dp-row span:first-child {
  color: var(--text-muted);
}

/* ============================================
   工具类
   ============================================ */
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-gold { color: var(--accent-gold); }
.text-blue { color: var(--accent-blue); }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state p {
  font-size: 16px;
  margin-bottom: 4px;
}

.empty-state .sub {
  font-size: 13px;
  color: var(--text-dim);
}

.empty-hint {
  text-align: center;
  padding: 24px;
  color: var(--text-dim);
  font-size: 13px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
}

.toast.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-success {
  background: rgba(16, 185, 129, 0.95);
  color: white;
}

.toast-error {
  background: rgba(239, 68, 68, 0.95);
  color: white;
}

.toast-info {
  background: rgba(59, 130, 246, 0.95);
  color: white;
}

/* ============================================
   移动端组件：底部导航 / FAB / 顶栏
   ============================================ */

/* 移动端顶栏 */
.mobile-topbar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 90;
  background: linear-gradient(135deg, #0f1729, #1a2333);
  border-bottom: 1px solid var(--glass-border);
  padding: 12px 16px;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding-top: max(12px, env(safe-area-inset-top));
}

.mt-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mt-logo {
  width: 26px;
  height: 26px;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mt-logo svg {
  width: 22px;
  height: 22px;
}

.mt-title {
  font-size: 17px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mt-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}

.mt-total-label {
  font-size: 10px;
  color: var(--text-muted);
}

.mt-total-value {
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 悬浮记账按钮 */
.fab-btn {
  display: none;
  position: fixed;
  right: 20px;
  z-index: 95;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), #2563eb);
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fab-btn:active {
  transform: scale(0.92);
}

.fab-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fab-icon svg {
  width: 22px;
  height: 22px;
}

/* 底部导航栏 */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(15, 23, 41, 0.95);
  border-top: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding-bottom: env(safe-area-inset-bottom);
  justify-content: space-around;
  align-items: center;
  height: calc(60px + env(safe-area-inset-bottom));
}

.bn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  padding: 8px 4px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 10px;
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.bn-item.active {
  color: var(--accent-blue);
}

.bn-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bn-icon svg {
  width: 20px;
  height: 20px;
}

.bn-label {
  font-size: 10px;
  font-weight: 500;
}

/* 底部中间凸起的记账按钮 */
.bn-item.bn-center {
  position: relative;
}

.bn-icon-center {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), #2563eb);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -20px;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
  border: 3px solid var(--bg-primary);
}

.bn-icon-center svg {
  width: 22px;
  height: 22px;
}

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

  .dashboard-bottom {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   移动端（768px 以下）
   ============================================ */
@media (max-width: 768px) {
  /* 隐藏桌面侧边栏，显示移动端组件 */
  .sidebar {
    display: none;
  }

  .mobile-topbar {
    display: flex;
  }

  .fab-btn {
    display: flex;
    /* 放在底部导航上方右侧 */
    bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .bottom-nav {
    display: flex;
  }

  /* 主内容区调整 */
  .main-content {
    margin-left: 0;
    padding: 12px 14px;
    padding-bottom: calc(180px + env(safe-area-inset-bottom));
  }

  /* NLP 输入栏 */
  .nlp-bar {
    flex-direction: row;
    gap: 8px;
  }

  .nlp-input {
    padding: 12px 14px;
    font-size: 14px;
    flex: 1;
    min-width: 0;
  }

  .nlp-btn {
    padding: 12px 16px;
    font-size: 13px;
  }

  #form-tx-btn {
    display: none; /* 移动端用 FAB 和底部导航替代 */
  }

  .nlp-hints {
    gap: 6px;
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .hint-item {
    flex-shrink: 0;
    font-size: 11px;
    padding: 5px 10px;
  }

  /* 月度统计栏 */
  .monthly-stats-bar {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
  }

  .msb-item {
    flex: 1 1 40%;
    min-width: 120px;
  }

  .msb-divider {
    display: none;
  }

  .msb-value {
    font-size: 17px;
  }

  /* 仪表盘卡片单列 */
  .dashboard-cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .dashboard-bottom {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .dash-card {
    padding: 14px;
  }

  .chart-container {
    height: 200px;
  }

  /* 交易行 */
  .tx-row {
    padding: 10px 8px;
    gap: 10px;
  }

  .tx-icon {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .tx-note {
    font-size: 13px;
  }

  .tx-amount {
    font-size: 14px;
  }

  .tx-date {
    font-size: 11px;
    width: auto;
  }

  /* 页面标题 */
  .page-header {
    flex-direction: row;
    align-items: center;
    margin-bottom: 16px;
  }

  .page-header h2 {
    font-size: 20px;
  }

  .page-header .btn-primary {
    padding: 8px 14px;
    font-size: 13px;
  }

  /* 账户管理 */
  .accounts-summary {
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
  }

  .as-item {
    flex: 1 1 40%;
    min-width: 100px;
  }

  .as-value {
    font-size: 16px;
  }

  .accounts-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .account-card {
    padding: 16px;
  }

  .ac-balance {
    font-size: 24px;
  }

  /* 交易筛选 */
  .tx-filters {
    flex-direction: column;
    gap: 8px;
  }

  .tx-filters select,
  .tx-filters input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
  }

  /* 定期存款 */
  .deposit-summary-bar {
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 16px;
  }

  .dsb-item {
    flex: 1 1 40%;
    min-width: 120px;
  }

  .dsb-value {
    font-size: 17px;
  }

  .deposit-cards {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .deposit-card {
    padding: 16px;
  }

  /* 模态框全屏化 */
  .modal-content {
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    animation: slideUp 0.25s ease;
  }

  .modal-content.modal-sm {
    max-width: 100%;
  }

  @keyframes slideUp {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
  }

  .modal-overlay {
    background: rgba(0, 0, 0, 0.5);
  }

  /* 表单触摸优化 */
  .form-group input,
  .form-group select {
    padding: 12px 14px;
    font-size: 16px; /* iOS 防止缩放 */
  }

  .type-btn {
    padding: 12px 8px;
    font-size: 13px;
  }

  /* 模态框底部按钮 */
  .modal-footer {
    position: sticky;
    bottom: 0;
    background: var(--bg-secondary);
    padding-top: 12px;
    margin-top: 12px;
  }

  .modal-footer .btn-primary,
  .modal-footer .btn-secondary,
  .modal-footer .btn-danger {
    flex: 1;
    padding: 12px;
  }

  /* 设置页 */
  .settings-section {
    padding: 16px;
  }

  .settings-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  .sr-info {
    flex: 1 1 30%;
    min-width: 80px;
    padding: 10px;
  }

  .sr-value {
    font-size: 18px;
  }

  .settings-actions {
    flex-direction: column;
  }

  .settings-actions button {
    width: 100%;
    padding: 12px;
  }

  /* Toast 上移避免被底部导航和 FAB 遮挡 */
  .toast {
    bottom: calc(180px + env(safe-area-inset-bottom));
    left: 16px;
    right: 16px;
    transform: translateY(100px);
    text-align: center;
  }

  .toast.active {
    transform: translateY(0);
  }
}

/* 超小屏（375px 以下）优化 */
@media (max-width: 375px) {
  .main-content {
    padding: 10px 10px;
    padding-bottom: calc(180px + env(safe-area-inset-bottom));
  }

  .mt-title {
    font-size: 15px;
  }

  .mt-total-value {
    font-size: 14px;
  }

  .nlp-input {
    font-size: 13px;
    padding: 10px 12px;
  }

  .nlp-btn {
    padding: 10px 12px;
    font-size: 12px;
  }

  .msb-item {
    flex: 1 1 100%;
  }

  .bn-label {
    font-size: 9px;
  }

  .bn-icon {
    font-size: 18px;
  }
}
