/* ============================================================
   Elysian (快乐分手) Design System
   Version: 1.0.0
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Noto+Sans+SC:wght@300;400;500;600;700&display=swap');

/* ============================================================
   CSS Custom Properties (Design Tokens)
   ============================================================ */
:root {
  /* --- Colors --- */
  --primary: #6C5CE7;
  --primary-light: #A29BFE;
  --primary-dark: #4A3DB5;
  --primary-gradient: linear-gradient(135deg, #6C5CE7 0%, #A29BFE 100%);
  --primary-glow: rgba(108, 92, 231, 0.3);

  --accent-warm: #FDA085;
  --accent-coral: #F8A5C2;
  --accent-teal: #55E6C1;
  --accent-gold: #FECA57;
  --accent-blue: #48DBFB;

  --bg-primary: #0F0E17;
  --bg-secondary: #1A1929;
  --bg-tertiary: #232238;
  --bg-card: rgba(255, 255, 255, 0.06);
  --bg-card-hover: rgba(255, 255, 255, 0.1);
  --bg-glass: rgba(255, 255, 255, 0.08);
  --bg-overlay: rgba(15, 14, 23, 0.85);

  --text-primary: #FFFFFE;
  --text-secondary: rgba(255, 255, 255, 0.6);
  --text-tertiary: rgba(255, 255, 255, 0.35);
  --text-inverse: #0F0E17;

  --border-default: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(108, 92, 231, 0.5);

  --danger: #FF6B6B;
  --danger-bg: rgba(255, 107, 107, 0.15);
  --success: #51CF66;
  --success-bg: rgba(81, 207, 102, 0.15);
  --warning: #FECA57;
  --warning-bg: rgba(254, 202, 87, 0.15);

  /* --- Typography --- */
  --font-primary: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Inter', sans-serif;

  --fs-display: 32px;
  --fs-h1: 28px;
  --fs-h2: 22px;
  --fs-h3: 18px;
  --fs-body: 15px;
  --fs-caption: 13px;
  --fs-small: 12px;
  --fs-tiny: 10px;

  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  --lh-tight: 1.2;
  --lh-normal: 1.5;
  --lh-relaxed: 1.7;

  /* --- Spacing --- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 28px;
  --sp-8: 32px;
  --sp-9: 36px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* --- Border Radius --- */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px var(--primary-glow);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.2);

  /* --- Transitions --- */
  --ease-default: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;

  /* --- Z-index --- */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal-backdrop: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-sos: 600;

  /* --- Layout --- */
  --tab-bar-height: 64px;
  --nav-bar-height: 56px;
  --safe-area-bottom: env(safe-area-inset-bottom, 20px);
  --safe-area-top: env(safe-area-inset-top, 44px);
  --content-max-width: 428px;
}

/* ============================================================
   CSS Reset & Base Styles
   ============================================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
}

a {
  color: var(--primary-light);
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: var(--font-primary);
  border: none;
  cursor: pointer;
  background: transparent;
  color: inherit;
  font-size: inherit;
}

input, textarea, select {
  font-family: var(--font-primary);
  font-size: var(--fs-body);
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
}

ul, ol {
  list-style: none;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* ============================================================
   Typography
   ============================================================ */
.text-display { font-size: var(--fs-display); font-weight: var(--fw-extrabold); line-height: var(--lh-tight); }
.text-h1 { font-size: var(--fs-h1); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
.text-h2 { font-size: var(--fs-h2); font-weight: var(--fw-semibold); line-height: var(--lh-tight); }
.text-h3 { font-size: var(--fs-h3); font-weight: var(--fw-semibold); line-height: var(--lh-normal); }
.text-body { font-size: var(--fs-body); font-weight: var(--fw-regular); line-height: var(--lh-normal); }
.text-caption { font-size: var(--fs-caption); font-weight: var(--fw-regular); line-height: var(--lh-normal); }
.text-small { font-size: var(--fs-small); font-weight: var(--fw-regular); line-height: var(--lh-normal); }
.text-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   Layout Utilities
   ============================================================ */
.app-container {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}

.page {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  display: none;
}

.page.active {
  display: block;
}

.page-content {
  padding: var(--sp-4);
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-area-bottom) + var(--sp-6));
}

.page-content.with-nav {
  padding-top: var(--sp-4);
}

.page-content.full-screen {
  padding: 0;
  padding-bottom: 0;
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-start { display: flex; align-items: flex-start; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-6 { gap: var(--sp-6); }
.gap-8 { gap: var(--sp-8); }

/* Spacing utilities */
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.mb-8 { margin-bottom: var(--sp-8); }
.p-3 { padding: var(--sp-3); }
.p-4 { padding: var(--sp-4); }
.p-5 { padding: var(--sp-5); }
.p-6 { padding: var(--sp-6); }
.px-4 { padding-left: var(--sp-4); padding-right: var(--sp-4); }
.py-3 { padding-top: var(--sp-3); padding-bottom: var(--sp-3); }
.py-4 { padding-top: var(--sp-4); padding-bottom: var(--sp-4); }

/* Text utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-primary-color { color: var(--primary-light); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ============================================================
   Glassmorphism Card Base
   ============================================================ */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

.glass-strong {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
}

/* ============================================================
   Animations (Keyframes)
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
}

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

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

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

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Animation utility classes */
.animate-fade-in { animation: fadeIn var(--duration-normal) var(--ease-default) forwards; }
.animate-fade-in-up { animation: fadeInUp var(--duration-slow) var(--ease-default) forwards; }
.animate-scale-in { animation: scaleIn var(--duration-normal) var(--ease-default) forwards; }
.animate-pulse { animation: pulse 2s var(--ease-smooth) infinite; }
.animate-breathe { animation: breathe 4s var(--ease-smooth) infinite; }
.animate-float { animation: float 3s var(--ease-smooth) infinite; }

/* Stagger delays */
.delay-1 { animation-delay: 100ms; }
.delay-2 { animation-delay: 200ms; }
.delay-3 { animation-delay: 300ms; }
.delay-4 { animation-delay: 400ms; }
.delay-5 { animation-delay: 500ms; }

/* ============================================================
   Background Effects
   ============================================================ */
.bg-gradient-primary {
  background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1240 50%, var(--bg-primary) 100%);
}

.bg-gradient-warm {
  background: linear-gradient(135deg, #1a1240 0%, #2d1b4e 50%, #1a1240 100%);
}

.bg-ambient-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.15;
  z-index: -1;
}

.bg-ambient-orb--purple {
  width: 300px;
  height: 300px;
  background: var(--primary);
  top: -100px;
  right: -50px;
}

.bg-ambient-orb--coral {
  width: 250px;
  height: 250px;
  background: var(--accent-coral);
  bottom: 100px;
  left: -80px;
}

/* ============================================================
   Responsive (Desktop)
   ============================================================ */
@media (min-width: 480px) {
  .app-container {
    max-width: 480px;
    margin: 0 auto;
  }
}
