/* ===== Design Tokens ===== */
:root {
  /* Refined amber/gold palette */
  --primary: #C2710C;
  --primary-dark: #92400E;
  --primary-light: #F59E0B;
  --primary-bg: #FEF9EE;
  --primary-bg-light: #FFFBF5;
  --accent: #EA580C;

  /* Backgrounds */
  --bg: #FBF8F3;
  --bg-gradient: linear-gradient(160deg, #FBF8F3 0%, #F5F0E8 50%, #FBF8F3 100%);
  --bg-card: #FFFFFF;

  /* Text */
  --text-primary: #1C1917;
  --text: #1C1917;
  --text-secondary: #57534E;
  --text-light: #57534E;
  --text-muted: #A8A29E;

  /* Borders */
  --border: #E7E5E4;
  --border-light: #F0EFEB;

  /* Status */
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
  --warning: #D97706;
  --warning-bg: #FFFBEB;
  --success: #65A30D;
  --income-color: #65A30D;
  --expense-color: #DC2626;
  --transfer-color: #EA580C;

  /* Radius */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --radius-pill: 20px;
  --radius-lg: 20px;

  /* Shadows - soft and warm */
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.08), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-primary: 0 4px 14px rgba(194,113,12,0.15);

  /* Typography */
  --fs-hero: 1.8rem;
  --fs-h1: 1.5rem;
  --fs-h2: 1.25rem;
  --fs-h3: 1.1rem;
  --fs-body: 0.95rem;
  --fs-secondary: 0.88rem;
  --fs-caption: 0.82rem;
  --fs-micro: 0.72rem;
  --font-numeric: 'SF Mono', 'Cascadia Code', 'Fira Code', 'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* Layout */
  --nav-height: 56px;
  --bottom-nav-height: 60px;

  /* Glass */
  --glass-bg: rgba(255,255,255,0.72);
  --glass-border: rgba(231,229,228,0.5);
  --glass-blur: blur(16px);
}

/* ===== Reset ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', 'PingFang SC', sans-serif;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.7;
  font-size: var(--fs-body);
  min-height: 100vh;
  font-variant-numeric: tabular-nums;
}

/* ===== Links ===== */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
a:hover { color: var(--primary-dark); text-decoration: underline; text-decoration-color: var(--primary-light); text-underline-offset: 2px; }

/* ===== Navbar (Desktop top) ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 24px;
  max-width: 100%;
  transition: background 0.3s ease;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary-dark);
  text-decoration: none;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.navbar-brand:hover { text-decoration: none; }

.navbar-brand svg {
  width: 30px;
  height: 30px;
  transition: transform 0.2s ease;
}

.navbar-brand:hover svg { transform: scale(1.05); }

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 32px;
  list-style: none;
}

.navbar-nav a {
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: var(--fs-secondary);
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
  position: relative;
}

.navbar-nav a:hover { background: var(--primary-bg); color: var(--primary-dark); }
.navbar-nav a.active {
  background: var(--primary-bg);
  color: var(--primary-dark);
  font-weight: 600;
}

.navbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 12px;
  border-radius: var(--radius-xs);
  transition: all 0.2s ease;
}

.navbar-user:hover { background: var(--primary-bg); color: var(--primary-dark); }

/* ===== Bottom Nav (Mobile) ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-border);
  height: var(--bottom-nav-height);
  display: none;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  padding: 6px 0;
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--fs-micro);
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.bottom-nav-item:hover { color: var(--text-secondary); }

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

.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--primary);
}

.bottom-nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.bottom-nav-item.active .bottom-nav-icon {
  background: var(--primary-bg);
}

.bottom-nav-icon svg { width: 22px; height: 22px; }
.bottom-nav-label { font-size: 0.68rem; }

/* body padding for bottom nav */
body.has-bottom-nav .main-content {
  padding-bottom: calc(60px + var(--bottom-nav-height));
}

/* ===== Layout ===== */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.page-header { margin-bottom: 28px; }

.page-header h1 {
  font-size: var(--fs-h1);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.page-header p {
  color: var(--text-muted);
  font-size: var(--fs-secondary);
  margin-top: 2px;
}

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

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

.card-header h2 {
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}

.card-header h2 svg { width: 18px; height: 18px; color: var(--primary); }

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card .stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.stat-card .stat-icon svg { width: 20px; height: 20px; color: white; }

.stat-card .stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
}

.stat-card .stat-label {
  font-size: var(--fs-caption);
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== 总资产卡片 ===== */
.total-asset-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-primary);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

/* Subtle decorative pattern */
.total-asset-card::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  pointer-events: none;
}

.total-asset-card::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -5%;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  pointer-events: none;
}

.total-asset-card .asset-label {
  font-size: var(--fs-secondary);
  opacity: 0.85;
  margin-bottom: 8px;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.total-asset-card .asset-amount {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 20px;
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.total-asset-card .asset-sub {
  display: flex;
  gap: 28px;
  font-size: var(--fs-secondary);
  opacity: 0.9;
  position: relative;
  z-index: 1;
}

.total-asset-card .asset-sub-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.total-asset-card .asset-sub-label {
  font-size: var(--fs-micro);
  opacity: 0.7;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-secondary);
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1.4;
  position: relative;
  user-select: none;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 3px rgba(194,113,12,0.2);
}
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(194,113,12,0.25);
  text-decoration: none;
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 1px 3px rgba(194,113,12,0.2); }

.btn-secondary {
  background: var(--primary-bg);
  color: var(--primary-dark);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: #FDF3DC;
  border-color: var(--primary-light);
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #FECACA;
}
.btn-danger:hover {
  background: #FEE2E2;
  border-color: #FCA5A5;
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-sm { padding: 6px 14px; font-size: var(--fs-caption); }
.btn-group { display: flex; gap: 8px; flex-wrap: nowrap; }

/* ===== Forms ===== */
.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: var(--fs-secondary);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: var(--fs-body);
  color: var(--text);
  background: var(--bg-card);
  transition: all 0.2s ease;
  font-family: inherit;
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
  border-color: #D6D3D1;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(194,113,12,0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.form-group textarea { min-height: 80px; resize: vertical; }

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 16px;
}

/* ===== Table ===== */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 12px 0 16px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-light);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  font-size: var(--fs-secondary);
  white-space: nowrap;
}

.data-table th {
  background: var(--primary-bg);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1.5px solid var(--border);
  font-size: var(--fs-caption);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  transition: background 0.15s ease;
}

.data-table tr:hover td { background: var(--primary-bg-light); }
.data-table tr:last-child td { border-bottom: none; }

/* ===== Tags/Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-micro);
  font-weight: 500;
  transition: transform 0.15s ease;
}

.badge:hover { transform: scale(1.03); }

.badge-amber { background: var(--primary-bg); color: var(--primary-dark); }
.badge-green { background: #ECFDF5; color: #065F46; }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-gray { background: #F5F5F4; color: #78716C; }
.badge-blue { background: #EFF6FF; color: #1E40AF; }

/* ===== 金额颜色 & 数字排版 ===== */
.amount-income { color: var(--income-color); font-weight: 700; font-family: var(--font-numeric); }
.amount-expense { color: var(--expense-color); font-weight: 700; font-family: var(--font-numeric); }
.amount-transfer { color: var(--transfer-color); font-weight: 700; font-family: var(--font-numeric); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.35);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.25s ease;
}

@keyframes modalSlideUp {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h2 {
  font-size: var(--fs-h3);
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  font-size: 20px;
  line-height: 1;
  border-radius: var(--radius-xs);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.modal-close:hover { background: var(--primary-bg); color: var(--primary-dark); }

.modal-body { padding: 24px; overflow-x: hidden; }

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

/* ===== Auth Pages ===== */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(160deg, #FEF9EE 0%, #FDF3DC 40%, #FEF3C7 100%);
  position: relative;
  overflow: hidden;
}

/* Geometric decorations */
.auth-container::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(194,113,12,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.auth-container::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,158,11,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.auth-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  position: relative;
  z-index: 1;
  animation: authCardIn 0.4s ease;
}

@keyframes authCardIn {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo .logo-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  box-shadow: 0 4px 12px rgba(194,113,12,0.2);
  position: relative;
}

.auth-logo .logo-icon svg {
  width: 32px;
  height: 32px;
  color: white;
}

.auth-logo .logo-icon::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  z-index: -1;
  opacity: 0.15;
  filter: blur(4px);
}

.auth-logo h1 {
  font-size: var(--fs-h1);
  color: var(--primary-dark);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-logo p {
  color: var(--text-muted);
  font-size: var(--fs-secondary);
  margin-top: 6px;
  font-weight: 400;
}

.auth-card .form-group { margin-bottom: 20px; }

.auth-card .form-group input {
  padding: 13px 16px;
  font-size: var(--fs-body);
  border-radius: var(--radius-xs);
}

.auth-card .btn-primary {
  width: 100%;
  justify-content: center;
  padding: 13px;
  font-size: var(--fs-body);
  font-weight: 600;
  margin-top: 4px;
  border-radius: var(--radius-sm);
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: var(--fs-secondary);
  color: var(--text-muted);
}

/* ===== Agreement Checkbox ===== */
.agreement-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: var(--fs-secondary);
  color: var(--text-muted);
  margin-bottom: 18px;
  cursor: pointer;
  line-height: 1.6;
}

.agreement-check input[type="checkbox"] {
  margin-top: 4px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--primary);
}

.agreement-check a { color: var(--primary); font-weight: 500; text-decoration: none; }
.agreement-check a:hover { text-decoration: underline; }

.auth-error {
  display: none;
  background: #FEF2F2;
  color: #DC2626;
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  font-size: var(--fs-secondary);
  margin-bottom: 18px;
  border: 1px solid #FECACA;
  font-weight: 500;
}

.auth-footer a { color: var(--primary-dark); font-weight: 500; }

/* ===== Login/Register Tabs ===== */
.auth-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 24px;
  gap: 4px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 12px;
  font-weight: 600;
  font-size: var(--fs-secondary);
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
}

.auth-tab:hover { color: var(--text-secondary); }

.auth-tab.active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
}

/* ===== Account Cards ===== */
.account-card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
  cursor: default;
  transition: all 0.25s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.account-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.account-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 480px) {
  .account-card-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .account-card-balance {
    text-align: left;
  }
}

.account-card-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.account-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.account-card-name {
  font-weight: 600;
  color: var(--text);
  font-size: var(--fs-body);
}

.account-card-type {
  font-size: var(--fs-micro);
  color: var(--text-muted);
  margin-top: 1px;
}

.account-card-balance {
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--text);
  text-align: right;
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
}

.account-card-currency {
  font-size: var(--fs-micro);
  color: var(--text-muted);
}

/* ===== Transaction Cards ===== */
.tx-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 8px;
  transition: all 0.25s ease;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tx-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-bg);
  transform: translateY(-1px);
}

.tx-card-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.tx-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tx-card-icon svg { width: 18px; height: 18px; }

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

.tx-card-desc {
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tx-card-meta {
  font-size: var(--fs-micro);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.tx-card-right {
  text-align: right;
  flex-shrink: 0;
  margin-left: 12px;
}

.tx-card-amount {
  font-size: var(--fs-body);
  font-weight: 700;
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
}

.tx-card-date {
  font-size: var(--fs-micro);
  color: var(--text-muted);
  margin-top: 1px;
}

/* ===== FAB ===== */
.fab {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  transition: all 0.25s ease;
}

.fab:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 20px rgba(194,113,12,0.25);
}

.fab:active { transform: translateY(0) scale(1); }
.fab svg { width: 24px; height: 24px; }

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 360px;
}

.toast {
  position: relative;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-secondary);
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  animation: toastIn 0.3s ease;
  text-align: center;
  pointer-events: auto;
  white-space: nowrap;
}

.toast-success { background: #FEF9EE; color: #92400E; border: 1px solid #FDE68A; }
.toast-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.toast-warning { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.toast-info { background: #FEF9EE; color: #78350F; border: 1px solid #FDE68A; }

@keyframes toastIn {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 52px 24px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  color: var(--border);
}

.empty-state h3 {
  font-size: var(--fs-h3);
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: var(--fs-secondary);
  margin-bottom: 20px;
}

/* ===== Dropdown ===== */
.dropdown { position: relative; }

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  z-index: 150;
  padding: 6px;
  display: none;
  animation: dropdownIn 0.15s ease;
}

@keyframes dropdownIn {
  from { transform: translateY(-4px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.dropdown-menu.show { display: block; }

.dropdown-menu a,
.dropdown-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  text-align: left;
  font-size: var(--fs-secondary);
  color: var(--text);
  border-radius: var(--radius-xs);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
  background: var(--primary-bg);
  color: var(--primary-dark);
}

/* ===== Loading ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Search ===== */
.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.search-bar input {
  flex: 1;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: var(--fs-secondary);
  background: var(--bg-card);
  transition: all 0.2s ease;
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(194,113,12,0.12);
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border-light);
  overflow-x: auto;
}

.tab {
  padding: 10px 18px;
  font-size: var(--fs-secondary);
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab:hover { color: var(--primary-dark); }
.tab.active { color: var(--primary-dark); border-bottom-color: var(--primary); font-weight: 600; }

/* ===== Type Selector (Income/Expense/Transfer) ===== */
.type-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.type-btn {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: var(--fs-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.type-btn:hover { border-color: var(--primary); transform: translateY(-1px); }

.type-btn.active-expense {
  border-color: var(--expense-color);
  background: var(--danger-bg);
  color: var(--expense-color);
}

.type-btn.active-income {
  border-color: var(--income-color);
  background: #ECFDF5;
  color: var(--income-color);
}

.type-btn.active-transfer {
  border-color: var(--transfer-color);
  background: #EFF6FF;
  color: var(--transfer-color);
}

.type-btn.active-balance {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary-dark);
}

@media (max-width: 400px) {
  .type-selector { flex-wrap: wrap; }
  .type-btn { flex: 1 1 calc(50% - 4px); min-width: 0; }
}

/* ===== Chart ===== */
.chart-container {
  width: 100%;
  min-height: 280px;
  position: relative;
}

/* ===== Stats Summary ===== */
.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stats-summary-item {
  text-align: center;
  padding: 18px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: all 0.25s ease;
}

.stats-summary-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.stats-summary-item .summary-label {
  font-size: var(--fs-caption);
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}

.stats-summary-item .summary-value {
  font-size: var(--fs-h2);
  font-weight: 700;
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.pagination button {
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination button:hover { border-color: var(--primary); color: var(--primary-dark); transform: translateY(-1px); }
.pagination button.active { background: var(--primary); color: white; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* ===== Category Grid ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.category-item {
  text-align: center;
  padding: 16px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  transition: all 0.25s ease;
}

.category-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-bg);
  transform: translateY(-1px);
}

.category-item .cat-name {
  font-size: var(--fs-caption);
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.category-item .cat-amount {
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
}

.category-item .cat-count {
  font-size: var(--fs-micro);
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== Progress bar (for category ranking) ===== */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}

/* ===== Autocomplete ===== */
.autocomplete-dropdown {
  position: absolute;
  z-index: 160;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-xs) var(--radius-xs);
  max-height: 200px;
  overflow-y: auto;
  display: none;
  box-shadow: var(--shadow-md);
  width: 100%;
}

/* ===== Upload Area ===== */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-muted);
  margin-top: 12px;
}

.upload-area:hover {
  border-color: var(--primary);
  background: var(--primary-bg-light);
}

/* ===== Divider ===== */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: 16px 0;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .navbar { padding: 0 16px; }
  .navbar .desktop-nav { display: none; }
  .navbar-brand-text { font-size: 1rem; }
  .navbar-brand svg { width: 28px; height: 28px; }
  .mobile-nav-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--fs-h3);
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
  }

  .bottom-nav { display: flex; }

  .main-content { padding: 18px 14px 40px; }
  body.has-bottom-nav .main-content { padding-bottom: calc(40px + var(--bottom-nav-height)); }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 16px 12px; }
  .stat-card .stat-value { font-size: 1.3rem; }
  .modal-overlay { padding: 20px; }
  .modal { max-height: 92vh; max-width: 100%; border-radius: var(--radius); }
  .modal-body { padding: 18px; }
  .modal-header { padding: 18px; }
  .modal-footer { padding: 14px 18px; }
  .auth-card { padding: 28px 24px; }
  .form-row { grid-template-columns: 1fr; }

  .fab { bottom: calc(var(--bottom-nav-height) + 20px); }

  .stats-summary { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stats-summary-item { padding: 14px 8px; }
  .stats-summary-item .summary-value { font-size: 1.1rem; }

  .total-asset-card { padding: 26px 22px; }
  .total-asset-card .asset-amount { font-size: 1.8rem; }
  .total-asset-card .asset-sub { gap: 18px; font-size: var(--fs-caption); }

  .category-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
}

@media (min-width: 769px) {
  .bottom-nav { display: none !important; }
}

/* Form hint */
.form-hint { font-size: var(--fs-caption); color: var(--text-muted); margin-top: 6px; }

/* ===== 密码强度条 (three segments) ===== */
.pwd-strength-bar { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pwd-strength-track {
  flex: 1;
  height: 6px;
  display: flex;
  gap: 4px;
}
.pwd-strength-seg {
  flex: 1;
  height: 100%;
  border-radius: 3px;
  background: var(--border-light);
  transition: background 0.3s ease;
}
.pwd-strength-seg.active-weak { background: #EF4444; }
.pwd-strength-seg.active-medium { background: #F59E0B; }
.pwd-strength-seg.active-strong { background: #22C55E; }
.pwd-strength-text { font-size: var(--fs-caption); white-space: nowrap; font-weight: 500; }
.pwd-hint { font-size: var(--fs-caption); padding: 1px 0; transition: color 0.2s; }

/* ===== Privacy/Terms pages ===== */
.legal-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px;
}

.legal-content h1 {
  font-size: var(--fs-h1);
  color: var(--text);
  margin-bottom: 8px;
}

.legal-content .legal-date {
  color: var(--text-muted);
  font-size: var(--fs-secondary);
  margin-bottom: 24px;
}

.legal-content h2 {
  font-size: var(--fs-h2);
  color: var(--text);
  margin-top: 24px;
  margin-bottom: 12px;
}

.legal-content p {
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-size: var(--fs-body);
}

.legal-content ul {
  color: var(--text-secondary);
  margin: 8px 0 16px 20px;
  font-size: var(--fs-body);
}

.legal-content li { margin-bottom: 6px; }

/* ===== Monthly trend bar ===== */
.monthly-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 200px;
  padding: 0 4px;
  margin-top: 12px;
}

.monthly-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.monthly-bar-fill {
  width: 100%;
  max-width: 32px;
  border-radius: 4px 4px 0 0;
  transition: height 0.3s;
  min-height: 2px;
}

.monthly-bar-label {
  font-size: var(--fs-micro);
  color: var(--text-muted);
  white-space: nowrap;
}

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

/* ===== Selection ===== */
::selection { background: rgba(194,113,12,0.15); color: var(--text); }
