:root {
  /* HSL Color Palette - Dark Mode Premium */
  --bg-main: 220 20% 10%;
  --bg-card: 220 20% 15%;
  --bg-card-hover: 220 20% 18%;
  
  --brand-primary: 250 80% 65%;
  --brand-secondary: 280 80% 60%;
  --brand-gradient: linear-gradient(135deg, hsl(var(--brand-primary)), hsl(var(--brand-secondary)));
  
  --text-main: 220 10% 95%;
  --text-muted: 220 10% 60%;
  
  --success: 150 60% 50%;
  --danger: 0 70% 60%;
  --warning: 35 100% 50%;

  --border-color: 220 20% 25%;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.3);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: hsl(var(--bg-main));
  color: hsl(var(--text-main));
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Base Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 600px; /* Mobile first constrained width for the platform feel */
  margin: 0 auto;
  background-color: hsl(var(--bg-main));
  position: relative;
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
}

.content-area {
  flex: 1;
  padding: 20px;
  padding-bottom: 80px; /* Space for bottom nav */
  animation: fadeIn 0.3s ease-out;
}

/* Typography elements */
h1, h2, h3, h4 {
  color: hsl(var(--text-main));
  font-weight: 600;
  margin-bottom: 12px;
}

p {
  color: hsl(var(--text-muted));
  line-height: 1.5;
}

.text-gradient {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Glassmorphism Cards */
.card {
  background: hsl(var(--bg-card));
  border: 1px solid hsl(var(--border-color));
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  background: hsl(var(--bg-card-hover));
}

/* Forms & Inputs */
.input-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.input-label {
  font-size: 0.875rem;
  color: hsl(var(--text-muted));
  margin-bottom: 6px;
}

.input-field {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid hsl(var(--border-color));
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: hsl(var(--text-main));
  font-size: 1rem;
  transition: all 0.2s;
  outline: none;
}

.input-field:focus {
  border-color: hsl(var(--brand-primary));
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
  background: rgba(255, 255, 255, 0.1);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-size: 1rem;
  gap: 8px;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--brand-gradient);
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  opacity: 0.9;
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: hsl(var(--text-main));
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-muted {
  background: transparent;
  color: hsl(var(--text-muted));
  border: 1px solid hsl(var(--border-color));
}

.btn-muted:hover {
  color: hsl(var(--text-main));
  border-color: hsl(var(--text-muted));
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-pinduoduo { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.badge-taobao { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.badge-douyin { background: rgba(0, 0, 0, 0.4); color: #fff; border: 1px solid rgba(255,255,255,0.2); }
.badge-success { background: rgba(16, 185, 129, 0.2); color: #10b981; }

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 600px;
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid hsl(var(--border-color));
  display: flex;
  justify-content: space-around;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  z-index: 50;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: hsl(var(--text-muted));
  text-decoration: none;
  font-size: 0.75rem;
  gap: 4px;
  transition: color 0.2s;
}

.nav-item.active {
  color: hsl(var(--brand-primary));
}

.nav-item svg {
  width: 24px;
  height: 24px;
}

/* Utilities */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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