/* ============================================
   记账 - 全局设计系统
   ============================================ */

:root {
  /* 主色调 - 现代渐变紫蓝 */
  --color-primary: #6366F1;
  --color-primary-light: #818CF8;
  --color-primary-dark: #4F46E5;
  --color-primary-50: #EEF2FF;
  --color-primary-100: #E0E7FF;

  /* 状态色 */
  --color-success: #10B981;
  --color-success-light: #D1FAE5;
  --color-success-dark: #047857;
  --color-danger: #EF4444;
  --color-danger-light: #FEE2E2;
  --color-warning: #F59E0B;
  --color-warning-light: #FEF3C7;
  --color-info: #3B82F6;
  --color-info-light: #DBEAFE;
  --color-purple: #A855F7;
  --color-pink: #EC4899;
  --color-cyan: #06B6D4;

  /* 中性色 */
  --color-text: #111827;
  --color-text-secondary: #6B7280;
  --color-text-light: #9CA3AF;
  --color-bg: #F9FAFB;
  --color-bg-alt: #F3F4F6;
  --color-card: #FFFFFF;
  --color-border: #E5E7EB;
  --color-border-light: #F3F4F6;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 2px 6px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 28px rgba(0,0,0,0.10);
  --shadow-xl: 0 24px 48px rgba(0,0,0,0.12);

  /* 圆角 */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Cascadia Mono", "Menlo", Consolas, monospace;
  --font-ug: "Alkatip Basma Tom", "UKIJ Tuz Tom", "Microsoft Uighur", system-ui, sans-serif;

  /* 渐变 */
  --gradient-primary: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
  --gradient-warm: linear-gradient(135deg, #FA709A 0%, #FEE140 100%);
  --gradient-cool: linear-gradient(135deg, #4FACFE 0%, #00F2FE 100%);
  --gradient-success: linear-gradient(135deg, #43E97B 0%, #38F9D7 100%);
  --gradient-bg: linear-gradient(180deg, #F5F7FF 0%, #FFFFFF 100%);

  /* 布局 */
  --sidebar-width: 240px;
  --topbar-height: 64px;
  --tabbar-height: 64px;
}

[dir="rtl"] {
  --font-sans: "Alkatip Basma Tom", "UKIJ Tuz Tom", "Microsoft Uighur", system-ui, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  min-height: 100vh;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  font-size: inherit;
  color: inherit;
}

input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img, svg {
  display: block;
  max-width: 100%;
}

ul, ol {
  list-style: none;
}

/* ============================================
   登录 / 落地页
   ============================================ */
.landing {
  min-height: 100vh;
  background: linear-gradient(135deg, #667EEA 0%, #764BA2 50%, #F093FB 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.landing::before,
.landing::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  pointer-events: none;
}

.landing::before {
  width: 600px;
  height: 600px;
  top: -300px;
  inset-inline-end: -200px;
}

.landing::after {
  width: 400px;
  height: 400px;
  bottom: -200px;
  inset-inline-start: -100px;
}

.landing-card {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-2xl);
  padding: 56px 48px;
  box-shadow: var(--shadow-xl);
  max-width: 480px;
  width: 100%;
  position: relative;
  z-index: 1;
  text-align: center;
}

.landing-logo {
  width: 72px;
  height: 72px;
  background: var(--gradient-primary);
  border-radius: 20px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px rgba(102, 126, 234, 0.3);
}

.landing-logo svg {
  width: 40px;
  height: 40px;
  color: white;
}

.landing-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-subtitle {
  font-size: 16px;
  color: var(--color-text-secondary);
  margin-bottom: 40px;
}

.landing-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.landing-feature {
  padding: 12px;
  border-radius: var(--radius);
  background: var(--color-bg);
  text-align: center;
}

.landing-feature-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.landing-feature-label {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.btn-wechat {
  width: 100%;
  height: 52px;
  background: #07C160;
  color: white;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
  transition: all 0.2s;
}

.btn-wechat:hover {
  background: #06AE56;
  transform: translateY(-1px);
}

.btn-primary {
  width: 100%;
  height: 52px;
  background: var(--gradient-primary);
  color: white;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  width: 100%;
  height: 52px;
  background: var(--color-bg-alt);
  color: var(--color-text);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: var(--color-border);
}

.landing-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--color-text-light);
  font-size: 12px;
  margin: 20px 0;
}

.landing-divider::before,
.landing-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

.landing-lang {
  margin-top: 24px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.landing-lang a {
  color: var(--color-primary);
  font-weight: 500;
}

/* ============================================
   App 整体布局
   ============================================ */
.app {
  display: flex;
  min-height: 100vh;
  background: var(--color-bg);
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--color-card);
  border-inline-end: 1px solid var(--color-border);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 20px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--color-border-light);
}

.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-brand-icon svg {
  width: 20px;
  height: 20px;
  color: white;
}

.sidebar-brand-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
}

.sidebar-section {
  margin-bottom: 16px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 12px;
  margin-bottom: 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  cursor: pointer;
  margin-bottom: 2px;
}

.sidebar-link:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.sidebar-link.active {
  background: var(--color-primary-50);
  color: var(--color-primary-dark);
  font-weight: 600;
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--color-border-light);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}

.sidebar-user:hover {
  background: var(--color-bg);
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 14px;
}

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

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-plan {
  font-size: 11px;
  color: var(--color-text-light);
}

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

.topbar {
  height: var(--topbar-height);
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
}

.topbar-spacer {
  flex: 1;
}

.topbar-store {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--color-bg);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.topbar-store:hover {
  background: var(--color-border);
}

.topbar-store-icon {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.topbar-store-icon svg {
  width: 12px;
  height: 12px;
}

.topbar-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  transition: all 0.15s;
  position: relative;
}

.topbar-icon-btn:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

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

.topbar-badge {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  width: 8px;
  height: 8px;
  background: var(--color-danger);
  border-radius: 50%;
  border: 2px solid var(--color-card);
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.content-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.content-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.content-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary);
}

/* ============================================
   通用组件
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  height: 38px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

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

.btn-secondary {
  background: var(--color-bg-alt);
  color: var(--color-text);
}

.btn-secondary:hover {
  background: var(--color-border);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

.btn-ghost:hover {
  background: var(--color-bg);
  color: var(--color-text);
}

.btn-danger {
  background: var(--color-danger);
  color: white;
}

.btn-danger:hover {
  background: #DC2626;
}

.btn-lg {
  height: 44px;
  padding: 0 20px;
  font-size: 15px;
}

.btn-sm {
  height: 30px;
  padding: 0 12px;
  font-size: 13px;
}

.card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
}

.card-padded {
  padding: 20px;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
}

.card-body {
  padding: 20px;
}

.card-actions {
  display: flex;
  gap: 8px;
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-border-light);
}

.stat-card.primary {
  background: var(--gradient-primary);
  color: white;
  border: none;
}

.stat-card.success {
  background: var(--color-success);
  color: white;
  border: none;
}

.stat-card.danger {
  background: var(--gradient-warm);
  color: white;
  border: none;
}

.stat-card.warning {
  background: var(--gradient-cool);
  color: white;
  border: none;
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

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

.stat-card:not(.primary):not(.success):not(.danger):not(.warning) .stat-card-icon {
  background: var(--color-primary-50);
}

.stat-card:not(.primary):not(.success):not(.danger):not(.warning) .stat-card-icon svg {
  color: var(--color-primary);
}

.stat-card-label {
  font-size: 13px;
  margin-bottom: 4px;
  opacity: 0.9;
}

.stat-card:not(.primary):not(.success):not(.danger):not(.warning) .stat-card-label {
  color: var(--color-text-secondary);
  opacity: 1;
}

.stat-card-value {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
  font-feature-settings: "tnum";
}

.stat-card-change {
  font-size: 12px;
  opacity: 0.85;
}

.stat-card-change.up {
  color: var(--color-success);
}

.stat-card-change.down {
  color: var(--color-danger);
}

.stat-card.primary .stat-card-change,
.stat-card.success .stat-card-change,
.stat-card.danger .stat-card-change,
.stat-card.warning .stat-card-change {
  color: white;
  opacity: 0.9;
}

/* 输入框 */
.input,
.select,
.textarea {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-card);
  transition: all 0.15s;
  font-size: 14px;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.textarea {
  height: auto;
  min-height: 80px;
  padding: 10px 14px;
  resize: vertical;
}

.input-group {
  margin-bottom: 16px;
}

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

.input-prefix {
  position: relative;
}

.input-prefix-icon {
  position: absolute;
  inset-inline-start: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-light);
  pointer-events: none;
  width: 18px;
  height: 18px;
}

.input-prefix .input {
  padding-inline-start: 42px;
}

.input-suffix {
  position: relative;
}

.input-suffix .input {
  padding-inline-end: 50px;
}

.input-suffix-text {
  position: absolute;
  inset-inline-end: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-light);
  font-size: 13px;
  pointer-events: none;
}

/* 徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.badge-primary {
  background: var(--color-primary-50);
  color: var(--color-primary-dark);
}

.badge-success {
  background: var(--color-success-light);
  color: var(--color-success-dark);
}

.badge-danger {
  background: var(--color-danger-light);
  color: #991B1B;
}

.badge-warning {
  background: var(--color-warning-light);
  color: #92400E;
}

.badge-info {
  background: var(--color-info-light);
  color: #1E40AF;
}

.badge-gray {
  background: var(--color-bg-alt);
  color: var(--color-text-secondary);
}

/* 表格 */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table th {
  text-align: start;
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.table td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
}

.table tbody tr:hover {
  background: var(--color-bg);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* 列表项 */
.list {
  display: flex;
  flex-direction: column;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border-light);
  cursor: pointer;
  transition: all 0.15s;
}

.list-item:last-child {
  border-bottom: none;
}

.list-item:hover {
  background: var(--color-bg);
}

.list-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

.list-item-content {
  flex: 1;
  min-width: 0;
}

.list-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-item-subtitle {
  font-size: 12px;
  color: var(--color-text-light);
}

.list-item-amount {
  font-size: 15px;
  font-weight: 600;
  text-align: end;
  font-feature-settings: "tnum";
}

.amount-income {
  color: var(--color-success);
}

.amount-expense {
  color: var(--color-danger);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

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

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

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s;
}

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

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

.modal {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.2s;
  box-shadow: var(--shadow-xl);
}

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

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

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-secondary);
  transition: all 0.15s;
}

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

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

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

/* 抽屉 */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  animation: fadeIn 0.15s;
}

.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-end: 0;
  width: 100%;
  max-width: 420px;
  background: var(--color-card);
  box-shadow: var(--shadow-xl);
  z-index: 101;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.25s;
}

@keyframes slideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

[dir="rtl"] .drawer {
  animation: slideInRtl 0.25s;
}

@keyframes slideInRtl {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

/* 空状态 */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-secondary);
}

.empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
}

.empty-icon svg {
  width: 40px;
  height: 40px;
}

.empty-title {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--color-text);
}

.empty-text {
  font-size: 14px;
  margin-bottom: 16px;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  inset-inline-end: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--color-card);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 240px;
  max-width: 360px;
  pointer-events: auto;
  animation: slideInRight 0.2s;
  border-inline-start: 4px solid var(--color-primary);
}

[dir="rtl"] .toast {
  animation: slideInLeft 0.2s;
}

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

@keyframes slideInLeft {
  from { transform: translateX(-100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success {
  border-inline-start-color: var(--color-success);
}

.toast.danger {
  border-inline-start-color: var(--color-danger);
}

.toast.warning {
  border-inline-start-color: var(--color-warning);
}

.toast-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--color-primary);
}

.toast.success .toast-icon {
  color: var(--color-success);
}

.toast.danger .toast-icon {
  color: var(--color-danger);
}

.toast.warning .toast-icon {
  color: var(--color-warning);
}

.toast-content {
  flex: 1;
  font-size: 14px;
}

/* 加载 */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* 进度条 */
.progress {
  height: 6px;
  background: var(--color-bg-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.3s;
}

/* 网格 */
.grid {
  display: grid;
  gap: 16px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Flex 工具 */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.flex-1 { flex: 1; }

/* 间距 */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }

/* 文本 */
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 18px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 30px; }
.text-muted { color: var(--color-text-secondary); }
.text-light { color: var(--color-text-light); }
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.text-center { text-align: center; }
.text-end { text-align: end; }

/* ============================================
   Dashboard 仪表盘
   ============================================ */
.dashboard-hero {
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  color: white;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.dashboard-hero::before {
  content: '';
  position: absolute;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  top: -150px;
  inset-inline-end: -100px;
}

.dashboard-hero-greeting {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 4px;
  position: relative;
}

.dashboard-hero-date {
  font-size: 13px;
  opacity: 0.75;
  margin-bottom: 20px;
  position: relative;
}

.dashboard-hero-balance {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 8px;
  position: relative;
}

.dashboard-hero-amount {
  font-size: 36px;
  font-weight: 700;
  font-feature-settings: "tnum";
  margin-bottom: 16px;
  position: relative;
}

.dashboard-hero-stats {
  display: flex;
  gap: 32px;
  position: relative;
}

.dashboard-hero-stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.dashboard-hero-stat-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dashboard-hero-stat-icon svg {
  width: 16px;
  height: 16px;
}

.dashboard-hero-stat-label {
  opacity: 0.9;
}

.dashboard-hero-stat-value {
  font-weight: 600;
  font-feature-settings: "tnum";
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.quick-action {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  border: 1px solid var(--color-border-light);
  transition: all 0.15s;
  cursor: pointer;
}

.quick-action:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.quick-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-action-icon.income {
  background: var(--color-success-light);
  color: var(--color-success-dark);
}

.quick-action-icon.expense {
  background: var(--color-danger-light);
  color: #B91C1C;
}

.quick-action-icon.transfer {
  background: var(--color-info-light);
  color: var(--color-info);
}

.quick-action-icon.other {
  background: var(--color-primary-50);
  color: var(--color-primary-dark);
}

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

.quick-action-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
}

/* 图表 */
.chart-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border-light);
  margin-bottom: 24px;
}

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

.chart-title {
  font-size: 16px;
  font-weight: 600;
}

.chart-legend {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

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

.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 200px;
  padding: 0 8px;
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

.chart-bar {
  flex: 1;
  margin: 0 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.chart-bar-stack {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  width: 28px;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
}

.chart-bar-segment {
  width: 100%;
}

.chart-bar-segment.income {
  background: var(--color-success);
}

.chart-bar-segment.expense {
  background: var(--color-danger);
}

.chart-bar-label {
  font-size: 11px;
  color: var(--color-text-light);
  margin-top: 6px;
}

/* Pie chart (using SVG) */
.pie-chart {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  display: block;
}

.pie-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-top: 16px;
  font-size: 13px;
}

.pie-legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pie-legend-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pie-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.pie-legend-label {
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pie-legend-value {
  font-weight: 600;
  font-feature-settings: "tnum";
}

/* 通知卡片 */
.notice-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.notice-card.warning {
  background: var(--color-warning-light);
  color: #92400E;
}

.notice-card.danger {
  background: var(--color-danger-light);
  color: #991B1B;
}

.notice-card.info {
  background: var(--color-info-light);
  color: #1E40AF;
}

.notice-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notice-icon svg {
  width: 16px;
  height: 16px;
}

.notice-content {
  flex: 1;
}

.notice-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.notice-text {
  font-size: 13px;
  opacity: 0.85;
}

/* ============================================
   移动端 Tab Bar
   ============================================ */
.tabbar {
  display: none;
  position: fixed;
  bottom: 0;
  inset-inline-start: 0;
  inset-inline-end: 0;
  height: var(--tabbar-height);
  background: var(--color-card);
  border-top: 1px solid var(--color-border);
  z-index: 50;
}

.tabbar-inner {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 100%;
}

.tabbar-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--color-text-secondary);
  font-size: 11px;
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
}

.tabbar-link svg {
  width: 22px;
  height: 22px;
}

.tabbar-link.active {
  color: var(--color-primary);
}

.tabbar-fab {
  position: absolute;
  top: -28px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 56px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

.tabbar-fab svg {
  width: 28px;
  height: 28px;
}

/* 浮动按钮 */
.fab {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  width: 56px;
  height: 56px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
  cursor: pointer;
  transition: all 0.2s;
  z-index: 40;
}

.fab:hover {
  transform: translateY(-2px) scale(1.05);
}

.fab svg {
  width: 28px;
  height: 28px;
}

/* ============================================
   管理后台
   ============================================ */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 220px;
  background: #1F2937;
  color: white;
  padding: 16px 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-sidebar-brand {
  padding: 8px 20px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 16px;
}

.admin-sidebar-brand-icon {
  width: 32px;
  height: 32px;
  background: var(--gradient-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-sidebar-brand-icon svg {
  width: 18px;
  height: 18px;
  color: white;
}

.admin-sidebar-brand-name {
  font-size: 16px;
  font-weight: 700;
}

.admin-sidebar-section-title {
  padding: 0 20px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 12px 0 8px;
}

.admin-sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  border-inline-start: 3px solid transparent;
}

.admin-sidebar-link:hover {
  background: rgba(255,255,255,0.05);
  color: white;
}

.admin-sidebar-link.active {
  background: rgba(99, 102, 241, 0.15);
  color: white;
  border-inline-start-color: var(--color-primary);
}

.admin-sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  min-width: 0;
}

.admin-topbar {
  height: 60px;
  background: var(--color-card);
  border-bottom: 1px solid var(--color-border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.admin-breadcrumb-current {
  color: var(--color-text);
  font-weight: 500;
}

.admin-content {
  padding: 24px;
  flex: 1;
}

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

  .quick-actions {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .app {
    padding-bottom: var(--tabbar-height);
  }

  .tabbar {
    display: block;
  }

  .fab {
    display: flex;
    bottom: 80px;
  }

  .topbar {
    padding: 0 16px;
  }

  .content {
    padding: 16px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .quick-actions {
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }

  .quick-action {
    padding: 14px 8px;
  }

  .quick-action-label {
    font-size: 11px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card-value {
    font-size: 22px;
  }

  .dashboard-hero {
    padding: 20px;
  }

  .dashboard-hero-amount {
    font-size: 28px;
  }

  .admin-sidebar {
    display: none;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .quick-actions {
    grid-template-columns: repeat(4, 1fr);
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .landing-card {
    padding: 40px 24px;
  }
}

/* ============================================
   Utility - 隐藏
   ============================================ */
.hidden { display: none !important; }
.invisible { visibility: hidden; }