@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;700&family=Bodoni+Moda:opsz,wght@6..96,600;6..96,800&display=swap');

:root {
  /* ----------------------
     LIGHT THEME (Default)
     Vercel/Stripe Minimalist
  ----------------------- */
  --primary-color: #2563eb;    
  --primary-hover: #1d4ed8;
  --cta-color: #09090b;        

  --app-bg: #f4f4f5;
  --bg-color: #fafafa;         
  --container-bg: var(--bg-color);
  --card-bg: rgba(255, 255, 255, 0.95);
  
  --text-main: #09090b;        
  --text-muted: #71717a;       
  --border-color: #e4e4e7;     
  
  --danger-color: #ef4444;
  --danger-light: #fef2f2;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --info-color: #0ea5e9;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.02), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.04), 0 2px 4px rgba(0,0,0,0.02);
  --shadow-float: 0 12px 32px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.03);
  --shadow-neon: 0 0 12px rgba(37, 99, 235, 0.1);

  --gl-header-bg: rgba(255, 255, 255, 0.85);
  --gl-nav-bg: rgba(255, 255, 255, 0.85);
  --gl-sheet-bg: rgba(255, 255, 255, 0.96);
  --gl-input-bg: transparent;
  
  --border-radius: 12px;
  --spacing-sm: 8px;
  --spacing-md: 12px;
  --spacing-lg: 20px;
}

[data-theme="dark"] {
  /* ----------------------
     DARK THEME 
     Liquid Glass Luxury
  ----------------------- */
  --primary-color: #F59E0B;      
  --primary-hover: #FBBF24;
  --cta-color: #8B5CF6;          
  
  --app-bg: #0a0a0f;
  --bg-color: #0F172A;           
  --container-bg: radial-gradient(circle at 100% 0%, #1e1b4b 0%, var(--bg-color) 60%),
                  radial-gradient(circle at 0% 100%, #171120 0%, var(--bg-color) 60%);
  --card-bg: rgba(255, 255, 255, 0.03); 
  
  --text-main: #F8FAFC;          
  --text-muted: #94A3B8;         
  --border-color: rgba(255, 255, 255, 0.08); 
  
  --danger-color: #ef4444;       
  --danger-light: rgba(245, 158, 11, 0.15); /* Remapped to Gold in dark mode */
  --warning-color: #F59E0B;
  
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4), 0 0 16px rgba(139, 92, 246, 0.08);
  --shadow-float: 0 16px 40px rgba(0,0,0,0.6), 0 0 32px rgba(245, 158, 11, 0.05);
  --shadow-neon: 0 0 12px rgba(245, 158, 11, 0.4);

  --gl-header-bg: rgba(15, 23, 42, 0.6);
  --gl-nav-bg: rgba(15, 23, 42, 0.75);
  --gl-sheet-bg: rgba(15, 23, 42, 0.85);
  --gl-input-bg: rgba(255, 255, 255, 0.05);
  
  --border-radius: 16px;
}

body {
  margin: 0;
  /* Inter for English, Noto Sans SC for Chinese — best reading combo */
  font-family: 'Inter', 'Noto Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background-color: var(--app-bg); 
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.4s ease;
}

.mobile-app-container {
  width: 100%;
  max-width: 440px; 
  min-height: 100vh;
  background: var(--container-bg);
  box-shadow: 0 0 50px rgba(0,0,0,0.1); 
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  transition: background 0.4s ease;
}
[data-theme="dark"] .mobile-app-container {
  box-shadow: 0 0 50px rgba(0,0,0,0.6); 
}

/* Header & Search */
.app-header {
  background-color: var(--gl-header-bg); 
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
  transition: background 0.4s;
}

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

.app-title {
  font-family: 'Inter', 'Noto Sans SC', -apple-system, sans-serif;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text-main);
  margin: 0;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--gl-input-bg);
  border-radius: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.search-bar:focus-within {
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px var(--shadow-neon);
}
[data-theme="light"] .search-bar:focus-within { background: #fff; }

.search-icon { color: var(--text-muted); margin-right: 12px; }
.search-input {
  border: none;
  background: transparent;
  width: 100%;
  font-size: 15px;
  outline: none;
  color: var(--text-main);
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  font-weight: 400;
}
.search-input::placeholder { color: var(--text-muted); }

.content-area {
  padding: var(--spacing-lg);
  flex: 1;
  overflow-y: auto;
  padding-bottom: 110px;
}

/* UI Components & Micro-interactions */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border: none;
  width: 100%;
  font-family: 'Inter', 'Noto Sans SC', sans-serif;
  letter-spacing: 0.3px;
}
.btn:active { transform: scale(0.96); }
.btn-primary { 
  background: var(--cta-color); 
  color: #fff; 
  box-shadow: var(--shadow-md);
}
[data-theme="dark"] .btn-primary { 
  background: linear-gradient(135deg, var(--primary-color) 0%, #D97706 100%); 
}
.btn-outline { 
  background: rgba(255,255,255,0.03); 
  color: var(--primary-color); 
  border: 1px solid var(--border-color);
  padding: 10px 16px; 
  font-size: 14px; 
  width: auto; 
}
.btn-outline:hover { background: var(--bg-color); border-color: var(--primary-color); }

.form-group { margin-bottom: var(--spacing-lg); }
.form-label { display: block; font-size: 14px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; letter-spacing: 0.5px;}
.form-control { 
  width: 100%; padding: 16px 18px; 
  border: 1px solid var(--border-color); 
  background: var(--card-bg);
  color: var(--text-main);
  border-radius: 12px; font-size: 15px; box-sizing: border-box; 
  font-family: 'Inter', 'Noto Sans SC', inherit; font-weight: 400;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--shadow-neon);
}

/* Alert Card / Accounts Card (Glass Cards) */
.alert-card, .account-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
  animation: glideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) backwards; 
}

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

.alert-card:hover, .account-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-color);
}

.alert-card.unread {
  border-left: 3px solid var(--primary-color); 
}
.alert-card.read {
  opacity: 0.5;
  background: transparent;
  border-left: 1px solid var(--border-color);
  box-shadow: none;
}

.new-badge {
  background: var(--danger-light); 
  color: var(--primary-color);
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 12px;
  font-weight: 700; border: 1px solid var(--border-color);
  margin-left: auto; text-transform: uppercase;
}

.alert-header { display: flex; align-items: center; font-size: 17px; font-weight: 700; margin-bottom: 14px; color: var(--text-main); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; margin-right: 12px; box-shadow: 0 0 8px currentColor;} 
.alert-row { display: flex; font-size: 14px; line-height: 1.8; margin-bottom: 6px; }
.alert-label { color: var(--text-muted); font-weight: 500; min-width: 90px; }
.alert-value { margin-left: 4px; color: var(--text-main); font-weight: 500;}

/* Details Section */
.detail-section {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.detail-section-title {
  padding: 16px 20px;
  background: rgba(0,0,0,0.03);
  border-bottom: 1px solid var(--border-color);
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted);
  display: flex; align-items: center; gap: 10px;
}
[data-theme="dark"] .detail-section-title { background: rgba(0,0,0,0.2); }
.detail-section-content { padding: 24px; }
.kv-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed var(--border-color); font-size: 15px; }
.kv-row:last-child { border-bottom: none; padding-bottom: 0; }
.kv-label { color: var(--text-muted); font-weight: 500; }
.kv-val { font-weight: 500; font-family: 'Inter', 'Noto Sans SC', sans-serif; font-size:15px; color: var(--text-main); }

/* Keep Bodoni only for large hero numbers on Stats page */
.number-serif { font-family: 'Inter', 'Noto Sans SC', sans-serif; }
/* Standard readable number format */
.number-tabular { font-family: 'Inter', 'Noto Sans SC', sans-serif; font-feature-settings: 'tnum'; }

/* Bottom Nav */
.bottom-nav {
  position: fixed; bottom: 0; width: 100%; max-width: 440px;
  background: var(--gl-nav-bg); 
  backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%);
  border-top: 1px solid var(--border-color);
  display: flex; justify-content: space-around;
  padding: 16px 0; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 100;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center;
  color: var(--text-muted); text-decoration: none; font-size: 11px; font-weight: 600; flex: 1; cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); position: relative;
}
.nav-item:active { transform: scale(0.9); }
.nav-item.active { color: var(--primary-color); text-shadow: 0 0 12px rgba(245, 158, 11, 0.2); }
.nav-item.active::after {
  content: ''; position: absolute; top: -16px; width: 22px; height: 3px;
  background: var(--primary-color); border-radius: 0 0 4px 4px; box-shadow: var(--shadow-neon);
}
.nav-icon { margin-bottom: 6px; transition: stroke-width 0.4s; }
.nav-item.active .nav-icon { stroke-width: 2.5px; }

.fixed-bottom-bar {
  position: fixed; bottom: 0; width: 100%; max-width: 440px;
  background: var(--gl-nav-bg); backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-color); padding: 20px 24px; box-sizing: border-box; z-index: 100;
}

/* Dashboard Grid */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 28px; }
.stat-box { 
  background: var(--card-bg); backdrop-filter: blur(12px);
  border-radius: var(--border-radius); padding: 24px 20px; 
  border: 1px solid var(--border-color); text-align: center; 
  box-shadow: var(--shadow-sm); transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.stat-box:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--primary-color);}
.stat-box.danger { border-top: 2px solid var(--danger-color); } 
.stat-box.success { border-top: 2px solid var(--success-color); }
.stat-box.warning { border-top: 2px solid var(--warning-color); }
[data-theme="dark"] .stat-box.danger { border-top-color: var(--cta-color); box-shadow: inset 0 20px 40px -20px rgba(139, 92, 246, 0.15); } 
[data-theme="dark"] .stat-box.success { box-shadow: inset 0 20px 40px -20px rgba(16, 185, 129, 0.15); }
[data-theme="dark"] .stat-box.warning { border-top-color: var(--primary-color); box-shadow: inset 0 20px 40px -20px rgba(245, 158, 11, 0.15); }

.box-val { font-family: 'Inter', 'Noto Sans SC', sans-serif; font-size: 34px; font-weight: 800; margin: 16px 0 6px; color: var(--text-main); font-feature-settings: 'tnum'; letter-spacing: -1px; }
.box-lbl { font-size: 11px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }

/* Settings List */
.setting-section { margin-bottom: 36px; }
.setting-title { 
  font-size: 11px; color: var(--text-muted); margin: 0 0 16px 20px; 
  text-transform: uppercase; font-weight: 800; letter-spacing: 1px; 
}
[data-theme="dark"] .setting-title { color: var(--primary-color); }
.setting-list { 
  background: var(--card-bg); border: 1px solid var(--border-color); 
  border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); backdrop-filter: blur(12px);
}
.setting-item { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border-color); transition: background 0.4s; }
.setting-item:last-child { border-bottom: none; }
.setting-item:active { background: rgba(0,0,0,0.03); }
[data-theme="dark"] .setting-item:active { background: rgba(255,255,255,0.06); }
.setting-left { display: flex; align-items: center; gap: 16px; color: var(--text-main); font-size: 16px; font-weight: 500; }
.setting-icon { color: var(--text-muted); }

/* Toggle Switch */
.toggle-switch { position: relative; width: 50px; height: 28px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(120,120,120,0.2); transition: .4s; border-radius: 28px; border: 1px solid rgba(120,120,120,0.2);}
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 3px; background-color: #fff; transition: .4s cubic-bezier(0.16,1,0.3,1); border-radius: 50%; box-shadow:0 2px 4px rgba(0,0,0,0.2);}
input:checked + .slider { background-color: var(--success-color); border-color: transparent; }
[data-theme="dark"] input:checked + .slider { background-color: var(--primary-color); box-shadow: var(--shadow-neon); }
input:checked + .slider:before { transform: translateX(20px); }

/* Accounts Badge Extensions */
.account-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px dashed var(--border-color); }
.account-id { font-size: 20px; font-weight: 700; font-family: 'Inter', 'Noto Sans SC', sans-serif; color: var(--text-main); letter-spacing: -0.3px; }
.account-badge { font-size: 10px; padding: 6px 10px; border-radius: 8px; background: rgba(0,0,0,0.04); color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;}
.account-badge.primary { background: rgba(37, 99, 235, 0.1); color: #2563eb; }
.account-badge.success { background: rgba(16, 185, 129, 0.1); color: #10b981; }

[data-theme="dark"] .account-badge { background: rgba(255,255,255,0.05); color: var(--text-main); }
[data-theme="dark"] .account-badge.primary { background: rgba(139, 92, 246, 0.15); color: #C4B5FD; border: 1px solid rgba(139, 92, 246, 0.3);}
[data-theme="dark"] .account-badge.success { background: rgba(16, 185, 129, 0.15); color: #6EE7B7; border: 1px solid rgba(16, 185, 129, 0.3);}

/* Bottom Sheet */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.3); backdrop-filter: blur(4px); z-index: 999; display: none; opacity: 0; transition: opacity 0.5s; justify-content: center; align-items: flex-end; }
[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); }
.modal-overlay.active { display: flex; opacity: 1; }
.bottom-sheet { 
  width: 100%; max-width: 440px; background: var(--gl-sheet-bg); 
  backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--border-color); border-top-left-radius: 32px; border-top-right-radius: 32px; 
  padding: 36px 24px 24px; box-sizing: border-box; 
  transform: translateY(100%); transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: var(--shadow-float);
}
.modal-overlay.active .bottom-sheet { transform: translateY(0); }
.sheet-title { font-size: 20px; font-weight: 700; margin-bottom: 24px; color: var(--text-main); text-align: center; font-family: 'Inter', 'Noto Sans SC', sans-serif; letter-spacing: -0.3px;}
.sheet-option { padding: 20px 16px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; font-size: 16px; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: all 0.4s; border-radius: 12px;}
.sheet-option:last-child { border-bottom: none; }
.sheet-option:active { background: rgba(100,100,100,0.05); }
.sheet-option.selected { color: var(--primary-color); font-weight: 600; background: rgba(100,100,100,0.03);}
