/* ==================== Base Styles ==================== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #60a5fa;
  --accent: #06b6d4;
  --dark: #0f172a;
  --dark-light: #1e293b;
  --gray: #64748b;
  --light: #f8fafc;
  --white: #ffffff;
  --gradient-start: #2563eb;
  --gradient-end: #06b6d4;
  --font-display: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  --font-body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--dark);
  background: var(--white);
  overflow-x: hidden;
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ==================== Modal Styles ==================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--white);
  border-radius: 1rem;
  padding: 2rem;
  max-width: 400px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-xl);
}

.modal-large {
  max-width: 800px;
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray);
  transition: var(--transition);
}

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

.auth-form h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.auth-subtitle {
  color: var(--gray);
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--dark);
}

.form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: var(--transition);
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-full {
  width: 100%;
}

.form-footer {
  margin-top: 1rem;
  text-align: center;
}

.form-footer p {
  margin: 0.5rem 0;
  color: var(--gray);
}

.form-footer a {
  color: var(--primary);
  text-decoration: none;
}

.form-footer a:hover {
  text-decoration: underline;
}

/* User Avatar in Nav */
.nav-user-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--dark);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
}

/* Dashboard Styles */
.dashboard-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.dashboard-card {
  background: var(--light);
  padding: 1.5rem;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
}

.dashboard-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--dark);
}

.dashboard-card p {
  color: var(--gray);
  margin-bottom: 1rem;
}

.badge-pro {
  background: var(--primary);
  color: white;
}

.download-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.download-buttons .btn {
  justify-content: center;
}

.download-buttons .btn-secondary {
  color: var(--dark);
  border-color: #e2e8f0;
}

.download-buttons .btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ==================== Navigation ==================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  z-index: 1000;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.nav-container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.15rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--dark);
  text-decoration: none;
}

.logo-icon {
  color: var(--primary);
  font-size: 1.8rem;
  animation: pulse 2s infinite;
}

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

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--gray);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.05rem;
  transition: var(--transition);
  position: relative;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
}

.nav-links a:hover::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--dark);
}

/* ==================== Mobile Menu ==================== */
.mobile-menu {
  display: none;
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  background: var(--white);
  padding: 1rem;
  box-shadow: var(--shadow-lg);
  z-index: 999;
}

.mobile-menu.active {
  display: block;
}

.mobile-menu a {
  display: block;
  padding: 1rem;
  color: var(--dark);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* ==================== Hero Section ==================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
  color: var(--white);
  overflow: hidden;
  padding-top: 70px;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(37, 99, 235, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 980px;
  padding: 2.75rem;
  text-align: center;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 5.2rem;
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 1.25rem;
}

.title-line {
  display: block;
  font-size: 0.46em;
  font-weight: 400;
  color: var(--gray);
}

.title-highlight {
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.65rem;
  color: var(--gray);
  margin-bottom: 2rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.badge {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.55rem 1.1rem;
  border-radius: 9999px;
  font-size: 1.05rem;
  color: var(--light);
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
}

.btn {
  padding: 0.9rem 2.4rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  display: inline-block;
  border: none;
  cursor: pointer;
  font-size: 1.15rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: var(--white);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--gray);
}

.btn-secondary:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 3.25rem;
}

.stat {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 3.35rem;
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--accent);
}

.stat-label {
  font-size: 1.05rem;
  color: var(--gray);
}

.hero-visual {
  position: absolute;
  right: 10%;
  top: 50%;
  transform: translateY(-50%);
  display: none;
}

@media (min-width: 1024px) {
  .hero-visual {
    display: block;
  }
}

.diamond-container {
  position: relative;
  width: 300px;
  height: 300px;
}

.diamond {
  font-size: 8rem;
  color: var(--primary);
  text-shadow: 0 0 20px var(--primary), 0 0 40px var(--accent);
  animation: rotate 10s linear infinite;
  position: relative;
  z-index: 2;
}

.diamond-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.5;
  animation: pulse 3s infinite;
}

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

/* ==================== Section Styles ==================== */
.section-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--dark);
}

.section-subtitle {
  text-align: center;
  color: var(--gray);
  margin-bottom: 3rem;
  font-size: 1.1rem;
}

/* ==================== Features Section ==================== */
.features {
  padding: 5rem 0;
  background: var(--light);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: var(--white);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  transform: scaleX(0);
  transform-origin: left;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.feature-card:hover::before {
  transform: scaleX(1);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.feature-card p {
  color: var(--gray);
  margin-bottom: 1rem;
}

.feature-detail {
  display: none;
  background: var(--light);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
}

.feature-card.active .feature-detail {
  display: block;
}

.feature-detail ul {
  list-style: none;
  padding-left: 0;
}

.feature-detail li {
  padding: 0.25rem 0;
  color: var(--dark);
  position: relative;
  padding-left: 1.5rem;
}

.feature-detail li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

/* ==================== Architecture Section ==================== */
.architecture {
  padding: 5rem 0;
  background: var(--white);
}

.architecture-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: center;
}

.arch-diagram {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
}

.layer {
  padding: 1rem;
  border-radius: 0.5rem;
  text-align: center;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
}

.layer:hover {
  transform: translateX(10px);
}

.layer-1 {
  background: #fee2e2;
  color: #991b1b;
}

.layer-2 {
  background: #fef3c7;
  color: #92400e;
}

.layer-3 {
  background: #d1fae5;
  color: #065f46;
}

.layer-4 {
  background: #e0e7ff;
  color: #3730a3;
}

.layer-5 {
  background: #f3e8ff;
  color: #6b21a8;
}

.layer-6 {
  background: #cffafe;
  color: #0e7490;
}

.arch-item {
  margin-bottom: 2rem;
  padding-left: 1.5rem;
  border-left: 3px solid var(--primary);
}

.arch-item h4 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 0.5rem;
}

.arch-item p {
  color: var(--gray);
}

/* ==================== Screenshots Section ==================== */
.screenshots {
  padding: 5rem 0;
  background: var(--light);
}

.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.screenshot-card {
  background: var(--white);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.screenshot-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.screenshot-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  cursor: zoom-in;
  overflow: hidden;
}

.screenshot-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.screenshot-fallback {
  position: absolute;
  inset: 0;
  color: var(--white);
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  font-size: 1.25rem;
  padding: 2rem;
}

.screenshot-media.is-missing .screenshot-image {
  display: none;
}

.screenshot-media.is-missing .screenshot-fallback {
  display: flex;
}

.screenshot-card p {
  padding: 1rem;
  text-align: center;
  color: var(--gray);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox.active {
  display: flex;
}

.lightbox-img {
  max-width: min(1200px, 95vw);
  max-height: 90vh;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-xl);
  background: var(--white);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: var(--white);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(0, 0, 0, 0.55);
}

/* ==================== Download Section ==================== */
.download {
  padding: 5rem 0;
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
  color: var(--white);
}

.download .section-title {
  color: var(--white);
}

.download .section-subtitle {
  color: var(--gray);
}

.download-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.download-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
}

.download-card:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-5px);
}

.download-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.download-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.download-card > p {
  color: var(--gray);
  margin-bottom: 1.5rem;
}

.download-details {
  list-style: none;
  text-align: left;
  margin-bottom: 2rem;
}

.download-details li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--light);
}

.download-details li:last-child {
  border-bottom: none;
}

.btn-download {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: var(--white);
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.btn-download:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.download-note {
  text-align: center;
  color: var(--gray);
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==================== Community Section ==================== */
.community {
  padding: 5rem 0;
  background: var(--white);
}

.community-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.community-card {
  background: var(--light);
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.community-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.community-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--dark);
}

.community-card p {
  color: var(--gray);
  margin-bottom: 1.5rem;
}

.community-card .btn-secondary {
  color: var(--dark);
  border-color: #cbd5e1;
}

.community-card .btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ==================== Footer ==================== */
.footer {
  background: var(--dark);
  color: var(--gray);
  padding: 3rem 0 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.footer-logo .logo-icon {
  color: var(--primary-light);
}

.footer-logo .logo-text {
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 700;
}

.footer-links h4,
.footer-info h4 {
  color: var(--white);
  margin-bottom: 1rem;
}

.footer-links ul {
  list-style: none;
}

.footer-links a {
  color: var(--gray);
  text-decoration: none;
  transition: var(--transition);
  display: block;
  padding: 0.25rem 0;
}

.footer-links a:hover {
  color: var(--primary-light);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .hero-title {
    font-size: 3.2rem;
  }
  
  .hero-stats {
    gap: 1.5rem;
  }
  
  .stat-number {
    font-size: 2rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .architecture-content {
    grid-template-columns: 1fr;
  }
  
  .screenshots-grid {
    grid-template-columns: 1fr;
  }
  
  .download-options {
    grid-template-columns: 1fr;
  }

  .community-grid {
    grid-template-columns: 1fr;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .modal-content {
    max-width: 95%;
    padding: 1.5rem;
  }
  
  .modal-large {
    max-width: 95%;
  }
  
  .dashboard-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2.2rem;
  }
  
  .hero-subtitle {
    font-size: 1rem;
  }
  
  .hero-buttons {
    flex-direction: column;
  }
  
  .section-title {
    font-size: 2rem;
  }
  
  .hero-badges {
    flex-direction: column;
    align-items: center;
  }
  
  .hero-stats {
    flex-direction: column;
    gap: 1rem;
  }
  
  .price {
    font-size: 2.5rem;
  }
}

/* ==================== Animations ==================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fadeInUp {
  animation: fadeInUp 0.6s ease-out;
}

/* Smooth scroll offset for fixed header */
section[id] {
  scroll-margin-top: 70px;
}

/* Loading state */
.loading {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.loaded {
  opacity: 1;
}
