/* ============================================
   家族数字方舟 - 高级贵重风格设计
   深藏青 + 金色配色方案
   ============================================ */

:root {
  /* Premium Color Palette */
  --navy-900: #0f1b2d;
  --navy-800: #1a2d4a;
  --navy-700: #2c5282;
  --gold-500: #c9a96e;
  --gold-400: #dfc9a0;
  --gold-300: #e8d5a8;
  --gold-200: #f5ecd5;
  --gold-100: #faf6ef;
  
  /* Functional Colors */
  --primary: var(--navy-800);
  --primary-light: var(--navy-700);
  --primary-dark: var(--navy-900);
  --accent: var(--gold-500);
  --accent-light: var(--gold-400);
  
  /* Neutral Colors */
  --bg-primary: #f8f7f4;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f5f3ef;
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --border-color: #e8e5df;
  --border-light: #f0ede7;
  
  /* Status Colors */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15, 27, 45, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 27, 45, 0.08);
  --shadow-lg: 0 8px 24px rgba(15, 27, 45, 0.1);
  --shadow-xl: 0 16px 48px rgba(15, 27, 45, 0.12);
  --shadow-gold: 0 4px 20px rgba(201, 169, 110, 0.15);
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { 
  font-size: 16px; 
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: var(--text-primary); 
  background: var(--bg-primary);
  line-height: 1.6; 
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

#app { 
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; }

/* ============================================
   Premium Animations
   ============================================ */

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

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

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 169, 110, 0.3); }
  50% { box-shadow: 0 0 0 12px rgba(201, 169, 110, 0); }
}

.animate-fade-in-up { animation: fadeInUp 0.5s var(--transition-slow) both; }
.animate-slide-in-right { animation: slideInRight 0.3s var(--transition-slow); }

/* ============================================
   Premium Cards
   ============================================ */

.card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: all var(--transition-normal);
  border: 1px solid var(--border-light);
}

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

.card-premium {
  position: relative;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.card-premium::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-500), var(--gold-400), var(--gold-500));
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.card-title {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--navy-800);
}

.card-title-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--gold-100) 0%, var(--gold-200) 100%);
  border: 1px solid var(--gold-300);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-500);
}

.card-content {
  padding: 20px 24px;
}

/* ============================================
   Premium Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s;
}

.btn:hover::after {
  transform: translateX(100%);
}

.btn-primary {
  background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-700) 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(26, 45, 74, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-800) 100%);
  box-shadow: 0 6px 20px rgba(26, 45, 74, 0.35);
  transform: translateY(-1px);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-400) 100%);
  color: var(--navy-900);
  box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-400) 0%, var(--gold-500) 100%);
  box-shadow: 0 6px 24px rgba(201, 169, 110, 0.3);
  transform: translateY(-1px);
}

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

.btn-outline:hover {
  background: var(--bg-tertiary);
  border-color: var(--gold-500);
  color: var(--gold-500);
}

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

.btn-ghost:hover {
  background: var(--bg-tertiary);
  color: var(--gold-500);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

/* ============================================
   Premium Inputs
   ============================================ */

.input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: all var(--transition-normal);
  outline: none;
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.input:focus {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(201, 169, 110, 0.1);
}

.input-with-icon {
  position: relative;
}

.input-with-icon .icon-left {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
}

.input-with-icon input {
  padding-left: 42px;
}

/* ============================================
   Premium Badges
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-gold {
  background: linear-gradient(135deg, var(--gold-100) 0%, var(--gold-200) 100%);
  color: var(--gold-500);
  border: 1px solid var(--gold-300);
}

.badge-navy {
  background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-700) 100%);
  color: #fff;
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

/* ============================================
   Navigation - Desktop
   ============================================ */

.top-nav {
  height: 64px;
  background: linear-gradient(90deg, var(--navy-900) 0%, var(--navy-800) 50%, var(--navy-900) 100%);
  border-bottom: 1px solid rgba(201, 169, 110, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(15, 27, 45, 0.2);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.nav-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-400) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(201, 169, 110, 0.3);
}

.nav-logo-text {
  display: flex;
  flex-direction: column;
}

.nav-logo-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.nav-logo-subtitle {
  font-size: 9px;
  color: var(--gold-500);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.8;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-normal);
  position: relative;
}

.nav-link:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: #fff;
  background: rgba(201, 169, 110, 0.1);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--gold-500);
  border-radius: 1px;
}

.nav-link svg {
  width: 18px;
  height: 18px;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 8px;
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.nav-user:hover {
  background: rgba(255, 255, 255, 0.05);
}

.nav-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-800) 100%);
  border: 2px solid var(--gold-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.nav-user-info {
  display: flex;
  flex-direction: column;
}

.nav-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.nav-user-role {
  font-size: 10px;
  color: var(--gold-500);
  opacity: 0.7;
}

/* ============================================
   Navigation - Mobile Top Bar
   ============================================ */

.mobile-top-bar {
  display: none;
  height: 52px;
  background: linear-gradient(90deg, var(--navy-900) 0%, var(--navy-800) 50%, var(--navy-900) 100%);
  border-bottom: 1px solid rgba(201, 169, 110, 0.1);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.mobile-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-400) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.mobile-logo-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.mobile-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-800) 100%);
  border: 1.5px solid var(--gold-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
}

.mobile-menu-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-btn svg {
  width: 22px;
  height: 22px;
}

/* ============================================
   Navigation - Mobile Bottom Tab Bar
   ============================================ */

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(180deg, rgba(15, 27, 45, 0.95) 0%, var(--navy-900) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(201, 169, 110, 0.1);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
  padding: 0 8px;
}

.mobile-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 48px;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.4);
  transition: all var(--transition-normal);
  position: relative;
}

.mobile-tab svg {
  width: 22px;
  height: 22px;
  transition: all var(--transition-normal);
}

.mobile-tab-label {
  font-size: 10px;
  font-weight: 500;
  margin-top: 4px;
  transition: all var(--transition-normal);
}

.mobile-tab.active {
  color: var(--gold-500);
}

.mobile-tab.active svg {
  filter: drop-shadow(0 0 6px rgba(201, 169, 110, 0.4));
  transform: scale(1.1);
}

.mobile-tab.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold-500);
}

.mobile-tab:active {
  transform: scale(0.95);
}

/* ============================================
   Mobile Slide Menu
   ============================================ */

.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.mobile-menu-overlay.active {
  display: block;
  opacity: 1;
}

.mobile-slide-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 100%);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
  z-index: 201;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  display: flex;
  flex-direction: column;
}

.mobile-slide-menu.active {
  transform: translateX(0);
}

.mobile-menu-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-menu-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-menu-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-800) 100%);
  border: 2px solid var(--gold-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
}

.mobile-menu-user-info {
  display: flex;
  flex-direction: column;
}

.mobile-menu-user-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.mobile-menu-user-role {
  font-size: 11px;
  color: var(--gold-500);
  opacity: 0.7;
  margin-top: 2px;
}

.mobile-menu-items {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 4px;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.mobile-menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.mobile-menu-item.active {
  background: rgba(201, 169, 110, 0.1);
  color: var(--gold-500);
}

.mobile-menu-item-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-menu-item svg {
  width: 20px;
  height: 20px;
}

.mobile-menu-item-label {
  font-size: 14px;
  font-weight: 500;
}

.mobile-menu-item-arrow {
  width: 16px;
  height: 16px;
  opacity: 0.4;
}

.mobile-menu-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-menu-footer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  transition: color var(--transition-normal);
}

.mobile-menu-footer-link:hover {
  color: rgba(255, 255, 255, 0.8);
}

.mobile-menu-footer-link svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   Main Content Area
   ============================================ */

.main-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 0;
}

/* Add padding for mobile bottom nav */
@media (max-width: 768px) {
  .main-content {
    padding-bottom: 60px;
  }
}

/* ============================================
   Hero Section
   ============================================ */

.hero-section {
  position: relative;
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 50%, var(--navy-900) 100%);
  color: #fff;
  overflow: hidden;
  padding: 60px 24px 80px;
}

.hero-bg-effects {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-bg-orb {
  position: absolute;
  border-radius: 50%;
  background: var(--gold-500);
  opacity: 0.05;
  filter: blur(80px);
  animation: float 8s ease-in-out infinite;
}

.hero-bg-orb:nth-child(1) {
  width: 400px;
  height: 400px;
  top: -100px;
  left: 20%;
}

.hero-bg-orb:nth-child(2) {
  width: 300px;
  height: 300px;
  bottom: -50px;
  right: 20%;
  animation-delay: 3s;
}

.hero-content {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 50px;
  background: rgba(201, 169, 110, 0.1);
  border: 1px solid rgba(201, 169, 110, 0.2);
  margin-bottom: 24px;
}

.hero-badge svg {
  width: 16px;
  height: 16px;
  color: var(--gold-500);
}

.hero-badge-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--gold-500);
  letter-spacing: 0.05em;
}

.hero-title {
  font-size: 48px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero-title-name {
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-300) 50%, var(--gold-500) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);
  max-width: 500px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.hero-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.hero-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.hero-feature svg {
  width: 16px;
  height: 16px;
  color: var(--gold-500);
}

.hero-feature-text {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}

.hero-bottom-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(to top, var(--bg-primary), transparent);
}

/* ============================================
   Container & Grid
   ============================================ */

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.page-content {
  padding: 32px 0;
}

.grid {
  display: grid;
  gap: 24px;
}

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

.grid-main-sidebar {
  grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
  .grid-main-sidebar {
    grid-template-columns: 2fr 1fr;
  }
}

/* ============================================
   Stats Cards
   ============================================ */

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

.stat-card {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 20px;
  color: #fff;
  overflow: hidden;
}

.stat-card-gold {
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-400) 100%);
  box-shadow: 0 8px 24px rgba(201, 169, 110, 0.25);
}

.stat-card-navy {
  background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-700) 100%);
  box-shadow: 0 8px 24px rgba(26, 45, 74, 0.25);
}

.stat-card-bg {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  filter: blur(20px);
}

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

.stat-card-icon {
  width: 20px;
  height: 20px;
  opacity: 0.9;
}

.stat-card-badge {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
  font-weight: 500;
}

.stat-card-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.stat-card-label {
  font-size: 11px;
  opacity: 0.8;
  font-weight: 500;
}

/* ============================================
   Quick Entry Grid
   ============================================ */

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

@media (min-width: 640px) {
  .quick-entry-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.quick-entry-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.quick-entry-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--gold-300);
}

.quick-entry-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-normal);
}

.quick-entry-item:hover .quick-entry-icon {
  transform: scale(1.1);
}

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

.quick-entry-icon-blue {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  color: #3b82f6;
}

.quick-entry-icon-emerald {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #a7f3d0;
  color: #10b981;
}

.quick-entry-icon-purple {
  background: linear-gradient(135deg, #faf5ff 0%, #ede9fe 100%);
  border: 1px solid #ddd6fe;
  color: #8b5cf6;
}

.quick-entry-icon-amber {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  color: #f59e0b;
}

.quick-entry-icon-slate {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  color: #64748b;
}

.quick-entry-icon-pink {
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
  border: 1px solid #fbcfe8;
  color: #ec4899;
}

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

.quick-entry-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
  transition: color var(--transition-normal);
}

.quick-entry-item:hover .quick-entry-title {
  color: var(--gold-500);
}

.quick-entry-desc {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   News Feed
   ============================================ */

.news-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-item {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  border: 1px solid transparent;
}

.news-item:hover {
  background: var(--gold-100);
  border-color: var(--gold-200);
}

.news-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.news-icon-blue {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  color: #3b82f6;
}

.news-icon-emerald {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border: 1px solid #a7f3d0;
  color: #10b981;
}

.news-icon-amber {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #fde68a;
  color: #f59e0b;
}

.news-icon-purple {
  background: linear-gradient(135deg, #faf5ff 0%, #ede9fe 100%);
  border: 1px solid #ddd6fe;
  color: #8b5cf6;
}

.news-icon-pink {
  background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
  border: 1px solid #fbcfe8;
  color: #ec4899;
}

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

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

.news-user {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  transition: color var(--transition-normal);
}

.news-item:hover .news-user {
  color: var(--gold-500);
}

.news-time {
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 20px;
}

.news-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============================================
   Leaderboard
   ============================================ */

.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
}

.leaderboard-item:hover {
  background: var(--gold-100);
}

.leaderboard-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.leaderboard-rank {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.leaderboard-rank-1 {
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-400) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(201, 169, 110, 0.3);
}

.leaderboard-rank-2 {
  background: linear-gradient(135deg, #94a3b8 0%, #cbd5e1 100%);
  color: #fff;
}

.leaderboard-rank-3 {
  background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
  color: #fff;
}

.leaderboard-rank-other {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.leaderboard-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-700) 0%, var(--navy-800) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  border: 2px solid #fff;
  box-shadow: var(--shadow-sm);
}

.leaderboard-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  transition: color var(--transition-normal);
}

.leaderboard-item:hover .leaderboard-name {
  color: var(--gold-500);
}

.leaderboard-score {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--gold-100);
  color: var(--gold-500);
  border: 1px solid var(--gold-200);
}

/* ============================================
   Premium CTA Card
   ============================================ */

.cta-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 100%);
  color: #fff;
  overflow: hidden;
  padding: 24px;
}

.cta-card-bg {
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--gold-500);
  opacity: 0.1;
  filter: blur(40px);
}

.cta-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  position: relative;
}

.cta-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(201, 169, 110, 0.1);
  border: 1px solid rgba(201, 169, 110, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cta-card-icon svg {
  width: 20px;
  height: 20px;
  color: var(--gold-500);
}

.cta-card-title {
  font-size: 17px;
  font-weight: 700;
}

.cta-card-desc {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  margin-bottom: 20px;
  position: relative;
}

.cta-card-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(201, 169, 110, 0.1);
  border: 1px solid rgba(201, 169, 110, 0.2);
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
}

.cta-card-btn:hover {
  background: rgba(201, 169, 110, 0.2);
}

.cta-card-btn-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-500);
}

.cta-card-btn-arrow {
  width: 16px;
  height: 16px;
  color: var(--gold-500);
  transition: transform var(--transition-normal);
}

.cta-card-btn:hover .cta-card-btn-arrow {
  transform: translateX(4px);
}

/* ============================================
   Login Page
   ============================================ */

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 50%, var(--navy-900) 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.login-bg-effects {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.login-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.1;
}

.login-bg-orb:nth-child(1) {
  width: 500px;
  height: 500px;
  top: -20%;
  left: -10%;
  background: var(--gold-500);
}

.login-bg-orb:nth-child(2) {
  width: 400px;
  height: 400px;
  bottom: -20%;
  right: -10%;
  background: var(--navy-700);
}

.login-card {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  position: relative;
  z-index: 10;
  overflow: hidden;
}

.login-card-header {
  padding: 40px 32px 32px;
  text-align: center;
}

.login-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--navy-800) 0%, var(--navy-700) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  box-shadow: 0 8px 24px rgba(26, 45, 74, 0.3);
}

.login-logo-icon {
  font-size: 32px;
}

.login-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--navy-800);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

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

.login-card-content {
  padding: 0 32px 32px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.login-form-footer {
  padding: 20px 32px;
  background: var(--bg-tertiary);
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
}

.login-form-footer a {
  color: var(--gold-500);
  font-weight: 600;
  transition: color var(--transition-normal);
}

.login-form-footer a:hover {
  color: var(--gold-400);
}

/* ============================================
   Responsive Design
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
  .hero-title {
    font-size: 40px;
  }
  
  .grid-main-sidebar {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 768px) {
  /* Hide desktop nav, show mobile nav */
  .top-nav {
    display: none;
  }
  
  .mobile-top-bar {
    display: flex;
  }
  
  .mobile-bottom-nav {
    display: block;
  }
  
  /* Hero adjustments */
  .hero-section {
    padding: 40px 20px 60px;
  }
  
  .hero-title {
    font-size: 32px;
  }
  
  .hero-subtitle {
    font-size: 14px;
  }
  
  .hero-features {
    flex-direction: column;
    align-items: center;
  }
  
  /* Container */
  .container {
    padding: 0 16px;
  }
  
  /* Grids */
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .stat-card {
    padding: 16px;
  }
  
  .stat-card-value {
    font-size: 22px;
  }
  
  /* Cards */
  .card-header {
    padding: 16px 20px;
  }
  
  .card-content {
    padding: 16px 20px;
  }
  
  /* Quick entry */
  .quick-entry-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .quick-entry-item {
    padding: 12px;
  }
  
  .quick-entry-icon {
    width: 36px;
    height: 36px;
  }
  
  .quick-entry-icon svg {
    width: 18px;
    height: 18px;
  }
  
  /* Login */
  .login-card-header {
    padding: 32px 24px 24px;
  }
  
  .login-card-content {
    padding: 0 24px 24px;
  }
  
  .login-title {
    font-size: 24px;
  }
}

/* Small Mobile */
@media (max-width: 380px) {
  .hero-title {
    font-size: 28px;
  }
  
  .quick-entry-grid {
    grid-template-columns: 1fr;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Utilities
   ============================================ */

.text-gold-gradient {
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-300) 50%, var(--gold-500) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.divider-gold {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-300), transparent);
}

.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 60ms; }
.stagger-children > *:nth-child(3) { animation-delay: 120ms; }
.stagger-children > *:nth-child(4) { animation-delay: 180ms; }
.stagger-children > *:nth-child(5) { animation-delay: 240ms; }
.stagger-children > *:nth-child(6) { animation-delay: 300ms; }

/* Safe area for mobile */
.safe-area-bottom {
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Hide scrollbar but keep functionality */
.no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

/* ============================================
   Family Tree Page Styles
   ============================================ */

.ft-header {
  background: linear-gradient(135deg, #1a2d4a 0%, #2c5282 100%);
  color: white;
  padding: 16px 24px;
  border-bottom: 2px solid var(--gold-500);
}

.ft-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.ft-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ft-header-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--gold-400) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(201, 169, 110, 0.3);
}

.ft-header-icon svg {
  width: 28px;
  height: 28px;
}

.ft-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}

.ft-subtitle {
  font-size: 13px;
  opacity: 0.8;
  margin-top: 2px;
}

.ft-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ft-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  backdrop-filter: blur(8px);
}

.ft-stat-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-400);
}

.ft-stat-label {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 2px;
}

.ft-divider {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 8px;
}

.ft-ctrl {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ft-ctrl:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--gold-400);
}

.ft-ctrl svg {
  width: 18px;
  height: 18px;
}

.ft-container {
  width: 100%;
  height: calc(100vh - 200px);
  min-height: 500px;
  overflow: hidden;
  background: linear-gradient(135deg, #f8f7f4 0%, #ffffff 100%);
  cursor: grab;
  position: relative;
}

.ft-container:active {
  cursor: grabbing;
}

.ft-container svg {
  width: 100%;
  height: 100%;
  user-select: none;
}

.tree-node-g {
  transition: transform 0.2s;
}

.tree-node-g:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 12px rgba(201, 169, 110, 0.3));
}

.ft-legend {
  background: white;
  border-top: 1px solid var(--border-color);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-secondary);
}

.ft-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ft-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.ft-dot-blue {
  background: #3b82f6;
}

.ft-dot-pink {
  background: #ec4899;
}

.ft-dot-gray {
  background: #94a3b8;
  opacity: 0.6;
}

.ft-line {
  width: 24px;
  height: 2px;
}

.ft-line-gold {
  background: var(--gold-500);
}

.ft-line-pink {
  background: #ec4899;
  background-image: repeating-linear-gradient(90deg, #ec4899 0, #ec4899 4px, transparent 4px, transparent 8px);
}

.ft-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  margin-left: 8px;
}

/* Member Detail Modal */
.ft-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.ft-modal.active {
  display: flex;
}

.ft-modal-card {
  background: white;
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: fadeInUp 0.3s ease;
}

.ft-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  border-radius: 50%;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.ft-modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
}

.ft-detail-header {
  padding: 32px 24px 24px;
  text-align: center;
  border-bottom: 3px solid;
  background: linear-gradient(135deg, #faf6ef 0%, #ffffff 100%);
}

.ft-detail-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 40px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ft-detail-name {
  font-size: 24px;
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: 8px;
}

.ft-detail-gen {
  font-size: 14px;
  color: var(--gold-500);
  font-weight: 600;
}

.ft-detail-body {
  padding: 24px;
}

.ft-detail-dates {
  display: flex;
  gap: 16px;
  justify-content: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-light);
}

.ft-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}

.ft-detail-label {
  color: var(--text-muted);
  font-weight: 600;
}

.ft-detail-section {
  margin-top: 20px;
}

.ft-detail-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy-800);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--gold-500);
  display: inline-block;
}

.ft-detail-section p {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.ft-detail-quote {
  font-style: italic;
  color: var(--gold-500) !important;
  padding: 12px 16px;
  background: var(--gold-100);
  border-radius: 8px;
  border-left: 3px solid var(--gold-500);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .ft-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .ft-header-right {
    width: 100%;
    justify-content: space-between;
  }

  .ft-stat {
    flex: 1;
    min-width: 80px;
  }

  .ft-divider {
    display: none;
  }

  .ft-container {
    height: calc(100vh - 280px);
  }

  .ft-legend {
    font-size: 11px;
    gap: 12px;
    padding: 10px 16px;
  }

  .ft-hint {
    display: none;
  }

  .ft-modal-card {
    max-height: 90vh;
  }

  .ft-detail-header {
    padding: 24px 16px 20px;
  }

  .ft-detail-body {
    padding: 16px;
  }
}

/* ============================================
   Toast Notifications
   ============================================ */

.toast {
  padding: 12px 20px;
  margin-bottom: 10px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transform: translateX(400px);
  transition: all 0.3s var(--transition-slow);
  min-width: 280px;
  max-width: 400px;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-info {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-left: 4px solid var(--info);
}

.toast-success {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-left: 4px solid var(--success);
}

.toast-error {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-left: 4px solid var(--danger);
}

.toast-warning {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-left: 4px solid var(--warning);
}
