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

:root {
  --primary: #3B82F6;
  --primary-dark: #2563EB;
  --primary-light: #60A5FA;
  --primary-bg: rgba(59, 130, 246, 0.08);
  --success: #10B981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning: #F59E0B;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger: #EF4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --bg: #F8FAFC;
  --bg-secondary: #F1F5F9;
  --white: #FFFFFF;
  --text: #0F172A;
  --text-secondary: #475569;
  --text-hint: #94A3B8;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

.page {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  max-width: 480px;
  margin: 0 auto;
}
.page.active { display: flex; flex-direction: column; }

@media (min-width: 481px) {
  body { background: var(--bg-secondary); }
  .page {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }
}

/* ===== Header ===== */
.header {
  background: linear-gradient(135deg, #3B82F6 0%, #2563EB 50%, #1D4ED8 100%);
  color: white;
  padding: calc(12px + var(--safe-top)) 20px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.header::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.header-left { position: relative; z-index: 1; }
.greeting { font-size: 14px; opacity: 0.85; font-weight: 400; margin-bottom: 4px; }
.user-name { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.header-right { display: flex; align-items: center; gap: 8px; position: relative; z-index: 1; }
.current-project {
  font-size: 12px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(10px);
  padding: 6px 12px;
  border-radius: 20px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.1);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 20px; border-radius: var(--radius); font-size: 14px;
  font-weight: 600; border: none; cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  font-family: var(--font-sans);
  letter-spacing: -0.2px;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.btn-primary:hover { box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4); }
.btn-primary:active { box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}

.btn-block { width: 100%; margin: 8px 0; }
.btn-small { padding: 10px 16px; font-size: 13px; border-radius: var(--radius-sm); }

.btn-text {
  background: none; border: none; color: var(--primary);
  cursor: pointer; font-size: 14px; padding: 6px 0;
  font-weight: 500; font-family: var(--font-sans);
}
.btn-text:hover { opacity: 0.8; }

.btn-icon {
  background: rgba(255,255,255,0.15);
  border: none;
  font-size: 20px;
  color: white;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}
.btn-icon:hover { background: rgba(255,255,255,0.25); }

.btn-back {
  background: none; border: none; color: var(--primary);
  cursor: pointer; font-size: 15px; padding: 6px 0;
  font-weight: 500; font-family: var(--font-sans);
  display: flex; align-items: center; gap: 4px;
}

/* ===== Cards ===== */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px;
  margin: 8px 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: box-shadow 0.2s;
}

/* ===== Voice Section ===== */
.voice-section { text-align: center; padding: 12px 20px !important; }
.voice-hint {
  color: var(--text-hint);
  font-size: 12px;
  margin-bottom: 10px;
  font-weight: 500;
}
.voice-btn-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.voice-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 50%, #2563EB 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35), 0 2px 6px rgba(59, 130, 246, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.voice-btn::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(59, 130, 246, 0.2);
  transition: all 0.3s;
}
.voice-btn:hover {
  box-shadow: 0 12px 32px rgba(59, 130, 246, 0.45), 0 4px 12px rgba(59, 130, 246, 0.25);
  transform: translateY(-2px);
}
.voice-btn:hover::before {
  inset: -8px;
  border-color: rgba(59, 130, 246, 0.15);
}
.voice-btn:active { transform: scale(0.95); }

.voice-btn.recording {
  background: linear-gradient(135deg, #F87171 0%, #EF4444 50%, #DC2626 100%);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4), 0 2px 8px rgba(239, 68, 68, 0.25);
  animation: pulse-ring 1.5s ease-in-out infinite;
}
.voice-btn.recording::before {
  border-color: rgba(239, 68, 68, 0.3);
  animation: pulse-ring-before 1.5s ease-in-out infinite;
}

.voice-btn.processing {
  background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 50%, #D97706 100%);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.4), 0 2px 8px rgba(245, 158, 11, 0.25);
}

@keyframes pulse-ring {
  0%, 100% { box-shadow: 0 8px 24px rgba(239, 68, 68, 0.4), 0 2px 8px rgba(239, 68, 68, 0.25); }
  50% { box-shadow: 0 12px 36px rgba(239, 68, 68, 0.55), 0 4px 16px rgba(239, 68, 68, 0.35); }
}
@keyframes pulse-ring-before {
  0%, 100% { inset: -4px; opacity: 1; }
  50% { inset: -16px; opacity: 0; }
}

.mic-icon { font-size: 28px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }
.voice-status {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.voice-timer {
  font-size: 16px;
  font-weight: 700;
  color: var(--danger);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

.voice-result {
  margin-top: 16px;
  padding: 16px;
  background: var(--primary-bg);
  border-radius: var(--radius);
  text-align: left;
  border: 1px solid rgba(59, 130, 246, 0.1);
}
.result-label { font-size: 12px; color: var(--text-hint); font-weight: 500; }
.result-text {
  font-size: 15px;
  font-weight: 500;
  margin: 8px 0;
  line-height: 1.6;
  color: var(--text);
}

.voice-actions {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.voice-result-fixed {
  margin: 0 16px 0;
  padding: 18px 20px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.voice-result-fixed .result-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  line-height: 1.6;
  width: 100%;
}
.voice-result-fixed .result-text.placeholder {
  color: var(--text-hint);
  font-weight: 400;
}

/* ===== Quick Actions ===== */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 0 16px;
  margin: 8px 0;
}
.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 8px 8px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow-sm);
}
.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}
.action-btn:active { transform: scale(0.97); }
.action-icon {
  font-size: 18px;
  margin-bottom: 4px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-bg);
  border-radius: var(--radius-sm);
}
.action-btn span:last-child {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ===== Sections ===== */
.section { padding: 0 16px; margin-bottom: 8px; flex-shrink: 0; }
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 0 2px;
}
.section-header h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
}
.section-header h3 {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--text);
}

/* ===== Expense List ===== */
.expense-list {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.expense-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}
.expense-item:last-child { border-bottom: none; }
.expense-item:hover { background: var(--bg-secondary); }

.expense-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 60%;
  width: 60%;
}
.expense-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
}
.expense-info { min-width: 0; flex: 1; }
.expense-desc {
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
  letter-spacing: -0.2px;
}
.expense-date {
  font-size: 12px;
  color: var(--text-hint);
  margin-top: 2px;
}

.expense-right {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.expense-amount {
  font-size: 14px;
  font-weight: 600;
  color: var(--danger);
  flex-shrink: 0;
  margin-right: 2px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
}

.btn-edit, .btn-delete {
  font-size: 12px;
  background: transparent;
  border: none;
  padding: 4px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  font-family: var(--font-sans);
  transition: all 0.15s;
}
.btn-edit { color: var(--primary); }
.btn-edit:hover { background: var(--primary-bg); }
.btn-delete { color: var(--danger); }
.btn-delete:hover { background: var(--danger-bg); }

/* ===== Forms ===== */
.form { padding: 16px; flex: 1; overflow-y: auto; }
.form-group { margin-bottom: 12px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: -0.1px;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--white);
  color: var(--text);
  -webkit-appearance: none;
  appearance: none;
  font-family: var(--font-sans);
  transition: all 0.2s;
  font-weight: 500;
}
.form-group input::placeholder { color: var(--text-hint); font-weight: 400; }

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  background: var(--white);
}
.form-group input:invalid { border-color: var(--danger); }

.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ===== Category Grid ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.category-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 6px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
}
.category-btn:hover {
  border-color: var(--primary-light);
  background: var(--primary-bg);
  transform: translateY(-1px);
}
.category-btn:active { transform: scale(0.96); }
.category-btn.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}
.category-btn .cat-icon {
  font-size: 22px;
  margin-bottom: 4px;
}
.category-btn .cat-name {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}
.category-btn.selected .cat-name { color: var(--primary); font-weight: 600; }

/* ===== Project List ===== */
.project-list { padding: 16px; flex: 1; overflow-y: auto; }
.project-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border: 1px solid var(--border-light);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.project-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.project-card:active { transform: scale(0.98); }

.project-name { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; }
.project-info {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}
.project-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.status-planned { background: var(--primary-bg); color: var(--primary); }
.status-ongoing { background: var(--success-bg); color: var(--success); }
.status-completed { background: var(--warning-bg); color: var(--warning); }

.project-budget { margin-top: 10px; font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.progress-bar {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Stats ===== */
.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px 16px;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}
.stat-label {
  font-size: 12px;
  color: var(--text-hint);
  margin-top: 4px;
  font-weight: 500;
}

/* ===== Report ===== */
.report-content { flex: 1; overflow-y: auto; padding-bottom: 24px; }
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--white);
}
.summary-icon {
  font-size: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  flex-shrink: 0;
}
.summary-info { flex: 1; }
.summary-info .summary-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}
.summary-info .summary-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.time-range {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px;
  background: var(--white);
}
.range-item { text-align: center; }
.range-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}
.range-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-top: 6px;
}
.range-arrow {
  font-size: 20px;
  color: var(--border);
  font-weight: 300;
}

/* ===== Page Header ===== */
.page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.page-header h2 {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  text-align: center;
  margin-right: 40px;
}

/* ===== Settings ===== */
.settings-content { padding: 0 16px; }
.settings-group { margin-bottom: 24px; }
.settings-label {
  font-size: 12px;
  color: var(--text-hint);
  padding: 0 4px 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.settings-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--white);
  font-size: 15px;
  font-weight: 500;
}
.settings-item:first-of-type { border-radius: var(--radius-md) var(--radius-md) 0 0; }
.settings-item:last-of-type { border-radius: 0 0 var(--radius-md) var(--radius-md); }
.settings-item:only-of-type { border-radius: var(--radius-md); }
.settings-item + .settings-item { border-top: 1px solid var(--border-light); }
.settings-value { color: var(--text-hint); font-size: 14px; }
.settings-arrow { color: var(--text-hint); font-size: 18px; font-weight: 300; }
.settings-select {
  background: none;
  border: none;
  font-size: 14px;
  color: var(--primary);
  text-align: right;
  padding: 0;
  -webkit-appearance: none;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
}
.settings-item.clickable {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.settings-item.clickable:active { background: var(--bg-secondary); }
.text-danger { color: var(--danger); font-weight: 600; }

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-hint);
  font-size: 14px;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: calc(80px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(10px);
  color: white;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  white-space: nowrap;
  max-width: 85vw;
  text-align: center;
  box-shadow: var(--shadow-lg);
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.1);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: rgba(16, 185, 129, 0.92); }
.toast.warning { background: rgba(245, 158, 11, 0.92); }
.toast.error { background: rgba(239, 68, 68, 0.92); }
.toast.info { background: rgba(59, 130, 246, 0.92); }

/* ===== Scrollbar ===== */
.page::-webkit-scrollbar { width: 4px; }
.page::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5);
  border-radius: 4px;
}
.page::-webkit-scrollbar-track { background: transparent; }

/* ===== Safe Area ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .page { padding-bottom: env(safe-area-inset-bottom); }
}

/* ===== Loading Spinner ===== */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Animations ===== */
.fade-in { animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.slide-up { animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.stagger-children > * {
  opacity: 0;
  animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }

/* ===== Expense List Page ===== */
.expense-list-content {
  padding: 16px;
  padding-bottom: calc(80px + var(--safe-bottom));
}
.list-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
  margin: 0 0 20px;
}
.summary-item {
  text-align: center;
  background: var(--white);
  padding: 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.summary-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.summary-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.expense-list-container {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

/* ===== Pagination ===== */
.pagination {
  margin-top: 20px;
  display: flex;
  justify-content: center;
}
.pagination-inner {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
  font-family: var(--font-sans);
}
.page-btn:hover:not(.disabled):not(.active) {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}
.page-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
}
.page-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.page-ellipsis {
  padding: 0 6px;
  color: var(--text-hint);
  font-size: 13px;
}

/* ===== Category Item (clickable) ===== */
.category-item {
  cursor: pointer;
  transition: background 0.15s;
}
.category-item:hover {
  background: var(--bg-secondary);
}
.category-item:active {
  background: var(--border-light);
}

/* ===== EUR Bill Entry (home) ===== */
.eur-bill-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(59, 130, 246, 0.06) 100%);
  border: 1px solid rgba(16, 185, 129, 0.15);
}
.eur-bill-entry:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: rgba(16, 185, 129, 0.3);
}
.eur-bill-entry:active { transform: scale(0.99); }
.eur-bill-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border-radius: var(--radius);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.eur-bill-info { flex: 1; min-width: 0; }
.eur-bill-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}
.eur-bill-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  font-weight: 500;
}
.eur-bill-arrow {
  font-size: 22px;
  color: var(--text-hint);
  font-weight: 300;
  flex-shrink: 0;
}

/* ===== EUR Bill Page ===== */
.bill-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: calc(80px + var(--safe-bottom));
}

.bill-summary {
  padding: 14px;
  margin: 0 0 16px;
}
.bill-summary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}
.bill-summary-row:last-child { margin-bottom: 0; }
.bill-summary-item {
  text-align: center;
  padding: 8px 6px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
}
.bill-total-row .bill-summary-item {
  background: var(--primary-bg);
}
.bill-total-row .bill-summary-item .summary-label { color: var(--primary); }
.bill-total-row .bill-summary-item .summary-value { color: var(--primary-dark); }
.bill-summary-item .summary-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 4px;
}
.bill-summary-item .summary-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}
.bill-date-row .bill-summary-item .summary-value {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
}

.bill-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.bill-actions .btn {
  font-size: 12px;
  padding: 9px 8px;
  letter-spacing: 0;
}
.btn-danger-outline {
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}
.btn-danger-outline:hover {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
}

.bill-list {
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.bill-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}
.bill-item:last-child { border-bottom: none; }
.bill-item:hover { background: var(--bg-secondary); }
.bill-item:active { background: var(--border-light); }

.bill-item.reconciled {
  background: var(--success-bg);
}
.bill-item.reconciled:hover {
  background: rgba(16, 185, 129, 0.15);
}
.bill-item.reconciled .bill-item-desc {
  text-decoration: line-through;
  color: var(--text-hint);
}
.bill-item.reconciled .bill-item-amount {
  color: var(--text-hint);
}

.bill-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.bill-check {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  background: var(--white);
  transition: all 0.2s;
}
.bill-item.reconciled .bill-check {
  background: var(--success);
  border-color: var(--success);
}

.bill-item-info {
  flex: 1;
  min-width: 0;
}
.bill-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.bill-item-seq {
  font-size: 11px;
  color: var(--text-hint);
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.bill-item.reconciled .bill-item-seq {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
}
.bill-item-date {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.bill-item-desc {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 2px;
  letter-spacing: -0.2px;
}
.bill-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}
.bill-item-cat {
  font-size: 11px;
  color: var(--text-hint);
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}

.bill-item-right {
  text-align: right;
  flex-shrink: 0;
  margin-left: 8px;
}
.bill-item-amount {
  font-size: 15px;
  font-weight: 700;
  color: var(--danger);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
  white-space: nowrap;
}
.bill-item-eur {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-hint);
  margin-left: 4px;
}
.bill-item.reconciled .bill-item-eur {
  color: var(--text-hint);
  opacity: 0.7;
}
.bill-item-cumulative {
  font-size: 11px;
  color: var(--text-hint);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  white-space: nowrap;
}

/* 汇率说明 */
.bill-rate-info {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(59, 130, 246, 0.06);
  border-left: 3px solid var(--primary);
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.6;
}
.bill-rate-info .rate-label {
  color: var(--primary);
  font-weight: 600;
}
.bill-rate-info .rate-desc {
  color: var(--text-secondary);
  display: block;
  margin-top: 2px;
}
