/* ============================================
   Modern Design System - VLink
   ============================================ */

:root {
  /* Primary - Indigo Violet */
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --primary-900: #312e81;
  
  /* Semantic */
  --brand: #6366f1;
  --brand-hover: #4f46e5;
  --brand-soft: #eef2ff;
  
  /* Neutral - Cool Gray */
  --ink-950: #0f172a;
  --ink-900: #1e293b;
  --ink-800: #334155;
  --ink-700: #475569;
  --ink-600: #64748b;
  --ink-500: #94a3b8;
  --ink-400: #cbd5e1;
  --ink-300: #e2e8f0;
  --ink-200: #f1f5f9;
  --ink-100: #f8fafc;
  --ink-50: #fafbff;
  
  /* Status */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  
  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.08), 0 4px 8px rgba(15, 23, 42, 0.04);
  --shadow-glow: 0 0 40px -10px rgba(99, 102, 241, 0.35);
  
  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  
  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Base Styles
   ============================================ */

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

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  background: var(--ink-50);
  font-size: 14px;
  line-height: 1.5;
}

#app {
  min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-400); }

/* ============================================
   Layout Components
   ============================================ */

.page-wrapper {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.container-narrow {
  max-width: 560px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

/* ============================================
   Card
   ============================================ */

.card {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s var(--ease-in-out), transform 0.3s var(--ease-in-out);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-flat {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
}

/* ============================================
   Navigation Button (Home page)
   ============================================ */

.nav-btn {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  width: 100%;
  padding: 1.125rem 1rem;
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  color: var(--ink-900);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: all 0.25s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.nav-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--primary-500), var(--primary-400));
  opacity: 0;
  transition: opacity 0.25s var(--ease-out);
}

.nav-btn:hover {
  border-color: var(--primary-300);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transform: translateY(-2px);
}

.nav-btn:hover::before {
  opacity: 1;
}

.nav-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.nav-btn-icon {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink-100);
  color: var(--ink-600);
  font-size: 1.25rem;
  transition: all 0.3s var(--ease-out);
}

.nav-btn:hover .nav-btn-icon {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-400));
  color: #fff;
  box-shadow: 0 4px 14px -4px rgba(99, 102, 241, 0.5);
  transform: scale(1.05);
}

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

.nav-btn-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-btn-desc {
  font-size: 0.8125rem;
  color: var(--ink-500);
  margin-top: 0.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-btn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  background: var(--primary-100);
  color: var(--primary-700);
  font-size: 0.625rem;
  font-weight: 700;
  margin-left: 0.375rem;
}

.nav-btn-arrow {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-400);
  background: var(--ink-50);
  transition: all 0.25s var(--ease-out);
}

.nav-btn:hover .nav-btn-arrow {
  background: var(--primary-50);
  color: var(--primary-600);
  transform: translate(3px, -3px);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.2s var(--ease-out);
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
  color: #fff;
  box-shadow: 0 2px 8px -2px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 4px 16px -2px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

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

.btn-ghost {
  background: transparent;
  color: var(--ink-600);
}

.btn-ghost:hover {
  background: var(--ink-100);
  color: var(--ink-900);
}

.btn-outline {
  background: #fff;
  border: 1px solid var(--ink-300);
  color: var(--ink-700);
}

.btn-outline:hover {
  border-color: var(--primary-400);
  color: var(--primary-600);
  background: var(--primary-50);
}

/* ============================================
   Header / Brand
   ============================================ */

.brand-logo {
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-400) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow);
  position: relative;
}

.brand-logo::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 1.25rem;
  background: linear-gradient(135deg, var(--primary-400), var(--primary-300));
  opacity: 0.25;
  filter: blur(12px);
  z-index: -1;
}

.brand-logo-icon {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.brand-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.875rem;
  color: var(--ink-500);
  line-height: 1.6;
}

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

/* ============================================
   Backgrounds
   ============================================ */

.bg-app {
  background-color: var(--ink-50);
}

.bg-aurora {
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse 60% 50% at 80% 100%, rgba(129, 140, 248, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(165, 180, 252, 0.03) 0%, transparent 50%);
}

.bg-grid {
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

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

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

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

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

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

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

.animate-fade-in {
  animation: fadeIn 0.5s var(--ease-out) forwards;
  opacity: 0;
}

.animate-slide-up {
  animation: slideUp 0.6s var(--ease-out) forwards;
  opacity: 0;
}

.animate-float {
  animation: float 4s ease-in-out infinite;
}

/* Staggered animations */
.stagger > * {
  opacity: 0;
  animation: slideUp 0.5s var(--ease-out) forwards;
}
.stagger > *:nth-child(1) { animation-delay: 0.05s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.15s; }
.stagger > *:nth-child(4) { animation-delay: 0.2s; }
.stagger > *:nth-child(5) { animation-delay: 0.25s; }
.stagger > *:nth-child(6) { animation-delay: 0.3s; }
.stagger > *:nth-child(7) { animation-delay: 0.35s; }
.stagger > *:nth-child(8) { animation-delay: 0.4s; }

/* ============================================
   Form Elements
   ============================================ */

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

/* ============================================
   Admin Sidebar
   ============================================ */

.sidebar {
  background: #fff;
  border-right: 1px solid var(--ink-200);
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-600);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.sidebar-nav-item:hover {
  background: var(--ink-100);
  color: var(--ink-900);
}

.sidebar-nav-item.active {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-500));
  color: #fff;
  box-shadow: 0 4px 12px -2px rgba(99, 102, 241, 0.4);
}

.sidebar-nav-icon {
  font-size: 1.125rem;
  width: 1.25rem;
  text-align: center;
}

/* ============================================
   Badges / Tags
   ============================================ */

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
}

.tag-primary {
  background: var(--primary-100);
  color: var(--primary-700);
}

.tag-neutral {
  background: var(--ink-100);
  color: var(--ink-600);
}

/* ============================================
   Divider
   ============================================ */

.divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--ink-300), transparent);
  margin: 0.5rem 0;
}

/* ============================================
   Status Dot
   ============================================ */

.status-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: var(--success);
  margin-right: 0.375rem;
}

.status-dot.inactive {
  background: var(--ink-300);
}

/* ============================================
   Utility
   ============================================ */

.text-center { text-align: center; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.relative { position: relative; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }

/* Background overlay */
.bg-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Glow effect */
.glow {
  box-shadow: var(--shadow-glow);
}

/* Focus ring */
.focus-ring:focus-visible {
  outline: 2px solid var(--primary-400);
  outline-offset: 2px;
}