/* ============================================
   SkyCetus 2.0 — 天空之城 · 主样式表
   Design System: 深空美学 + 双层架构
   Cell to Us · Sun keeps you
   ============================================ */

/* ── CSS Variables ── */
:root {
  /* Deep Space Palette */
  --space-abyss: #020208;
  --space-deep: #050510;
  --space-dark: #0a0a1a;
  --space: #0f0f25;
  --space-light: #1a1a3a;
  --space-lighter: #252550;
  --space-surface: #2a2a55;

  --gold: #d4af37;
  --gold-light: #e8c84a;
  --gold-dark: #b8941d;
  --gold-glow: rgba(212, 175, 55, 0.15);

  --purple: #8b7ad4;
  --purple-light: #a99de8;
  --purple-dark: #6b5ab4;
  --purple-glow: rgba(139, 122, 212, 0.12);

  --cyan: #4ecdc4;
  --cyan-glow: rgba(78, 205, 196, 0.1);

  --white: #f0f0f8;
  --white-90: rgba(240, 240, 248, 0.9);
  --white-70: rgba(240, 240, 248, 0.7);
  --white-60: rgba(240, 240, 248, 0.6);
  --white-50: rgba(240, 240, 248, 0.5);
  --white-40: rgba(240, 240, 248, 0.4);
  --white-30: rgba(240, 240, 248, 0.3);
  --white-20: rgba(240, 240, 248, 0.2);
  --white-15: rgba(240, 240, 248, 0.15);
  --white-10: rgba(240, 240, 248, 0.1);
  --white-08: rgba(240, 240, 248, 0.08);
  --white-05: rgba(240, 240, 248, 0.05);

  /* Functional */
  --accent: var(--gold);
  --accent-hover: var(--gold-light);
  --bg-primary: var(--space-deep);
  --bg-secondary: var(--space);
  --bg-card: rgba(26, 26, 58, 0.6);
  --bg-card-hover: rgba(26, 26, 58, 0.85);
  --text-primary: var(--white);
  --text-secondary: var(--white-70);
  --text-muted: var(--white-50);

  /* Borders */
  --border-subtle: var(--white-08);
  --border-light: var(--white-15);
  --border-glow: rgba(212, 175, 55, 0.25);
  --border-purple: rgba(139, 122, 212, 0.25);

  /* Typography */
  --font-serif: 'Noto Serif SC', Georgia, 'Times New Roman', serif;
  --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing */
  --section-padding: 7rem;
  --container-padding: 2rem;
  --max-width: 1200px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 0.2s ease;
  --t-base: 0.4s var(--ease-out);
  --t-slow: 0.8s var(--ease-out);
  --t-breath: 1.2s var(--ease-in-out);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 40px rgba(212, 175, 55, 0.15);
  --shadow-glow-purple: 0 0 40px rgba(139, 122, 212, 0.15);

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

/* ── Reset & Base ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--white-15) transparent;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--white-15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--white-30); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; }

::selection {
  background: rgba(212, 175, 55, 0.3);
  color: var(--white);
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2.5rem;
  z-index: 1000;
  transition: all var(--t-base);
}

.nav::before {
  content: '';
  position: absolute;
  inset: 0;
  background: transparent;
  backdrop-filter: blur(0px);
  transition: all var(--t-base);
  z-index: -1;
}

.nav.scrolled::before {
  background: rgba(5, 5, 16, 0.92);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav.scrolled {
  padding: 0.75rem 2.5rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  z-index: 1;
}

.brand-icon {
  font-size: 1.4rem;
  color: var(--gold);
  transition: transform var(--t-base);
}

.nav-brand:hover .brand-icon {
  transform: rotate(45deg);
}

.brand-text {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--white);
  letter-spacing: 0.08em;
}

.brand-sub {
  font-size: 0.7rem;
  color: var(--white-30);
  letter-spacing: 0.15em;
  margin-left: 0.5rem;
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

.nav-link {
  font-size: 0.88rem;
  color: var(--white-50);
  transition: color var(--t-fast);
  position: relative;
  padding: 0.25rem 0;
}

.nav-link:hover { color: var(--white); }

.nav-link.active {
  color: var(--gold);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
}

/* Nav Right */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-lux {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--gold);
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-full);
  background: var(--gold-glow);
}

.nav-lux-icon { font-size: 0.9rem; }

.nav-auth-btn {
  font-size: 0.85rem;
  color: var(--white-60);
  background: transparent;
  border: 1px solid var(--border-light);
  padding: 0.4rem 1.2rem;
  border-radius: var(--radius-full);
  transition: all var(--t-fast);
}

.nav-auth-btn:hover {
  color: var(--white);
  border-color: var(--white-40);
  background: var(--white-05);
}

.nav-auth-btn.primary {
  color: var(--gold);
  border-color: var(--border-glow);
  background: var(--gold-glow);
}

.nav-auth-btn.primary:hover {
  background: rgba(212, 175, 55, 0.25);
}

/* Mobile Menu */
.nav-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  z-index: 1;
}

.nav-menu-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--white-60);
  transition: all var(--t-fast);
  border-radius: 1px;
}

/* ── Section Titles ── */
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3.5vw, 2.8rem);
  font-weight: 300;
  text-align: center;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--white) 30%, var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  text-align: center;
  color: var(--white-40);
  font-size: 0.95rem;
  margin-bottom: 3.5rem;
  letter-spacing: 0.05em;
}

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all var(--t-base);
  backdrop-filter: blur(12px);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 400;
  transition: all var(--t-base);
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--space-deep);
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 30px rgba(212, 175, 55, 0.45);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: var(--white-70);
  border: 1px solid var(--border-light);
}

.btn-secondary:hover {
  color: var(--white);
  border-color: var(--white-40);
  background: var(--white-05);
}

.btn-ghost {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--border-glow);
}

.btn-ghost:hover {
  background: var(--gold-glow);
}

/* ── Tags ── */
.tag {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  font-size: 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  color: var(--white-50);
  background: var(--white-05);
}

.tag-gold {
  border-color: var(--border-glow);
  color: var(--gold);
  background: var(--gold-glow);
}

.tag-purple {
  border-color: var(--border-purple);
  color: var(--purple-light);
  background: var(--purple-glow);
}

/* ── Footer ── */
.footer {
  padding: 5rem var(--container-padding) 2rem;
  background: var(--space-abyss);
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer-content {
  max-width: 700px;
  margin: 0 auto;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--white-70);
}

.footer-tagline {
  color: var(--white-40);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.footer-sub {
  color: var(--white-20);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  margin-bottom: 2.5rem;
}

.footer-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.footer-nav a {
  color: var(--white-30);
  font-size: 0.85rem;
  transition: color var(--t-fast);
}

.footer-nav a:hover { color: var(--gold); }

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--white-05);
  color: var(--white-15);
  font-size: 0.75rem;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(15, 15, 37, 0.96);
  color: var(--gold);
  padding: 0.85rem 2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glow);
  font-size: 0.88rem;
  z-index: 10000;
  opacity: 0;
  transition: all var(--t-base);
  backdrop-filter: blur(16px);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 2, 8, 0.88);
  backdrop-filter: blur(8px);
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  position: relative;
  width: 92%;
  max-width: 480px;
  padding: 2.5rem;
  background: var(--space);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glow);
  animation: modalIn 0.4s var(--ease-out);
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(-24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--white-40);
  font-size: 1.4rem;
  cursor: pointer;
  transition: color var(--t-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover { color: var(--white); }

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--gold);
  margin-bottom: 1.5rem;
}

/* ── Form Elements ── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  color: var(--white-50);
  margin-bottom: 0.4rem;
  letter-spacing: 0.03em;
}

.form-input {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--white-05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all var(--t-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--gold);
  background: var(--white-08);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

.form-input::placeholder {
  color: var(--white-20);
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

/* ── Scroll Animations ── */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in {
  opacity: 0;
  transition: opacity 1s var(--ease-out);
}

.fade-in.visible {
  opacity: 1;
}

/* ── Identity Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.15rem 0.6rem;
  font-size: 0.7rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
}

.badge-traveler {
  background: var(--white-08);
  color: var(--white-50);
  border: 1px solid var(--white-10);
}

.badge-resident {
  background: var(--purple-glow);
  color: var(--purple-light);
  border: 1px solid var(--border-purple);
}

.badge-builder {
  background: var(--gold-glow);
  color: var(--gold);
  border: 1px solid var(--border-glow);
}

.badge-elder {
  background: rgba(78, 205, 196, 0.1);
  color: var(--cyan);
  border: 1px solid rgba(78, 205, 196, 0.25);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  :root {
    --section-padding: 4.5rem;
    --container-padding: 1.25rem;
  }

  .nav {
    padding: 0.75rem 1.25rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(5, 5, 16, 0.98);
    backdrop-filter: blur(24px);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-subtle);
    gap: 0.75rem;
  }

  .nav-links.open { display: flex; }
  .nav-menu-toggle { display: flex; }
  .nav-right { display: none; }

  .footer-nav { gap: 1rem; }
}

@media (max-width: 480px) {
  :root {
    --section-padding: 3.5rem;
    --container-padding: 1rem;
  }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
