/* ============================================
   Common Styles — 鸿链数科 Honchain
   Navbar, Footer, Animations, Shared Components
   ============================================ */

/* ========================================
   1. NAVBAR
   ======================================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-8);
  transition: all var(--transition-base);
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  background: transparent;
}

.navbar.scrolled {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.navbar-brand img {
  height: 40px;
  width: auto;
}

.navbar-brand-text {
  font-size: var(--text-lg);
  font-weight: 700;
  font-family: var(--font-en);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: var(--tracking-tight);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.navbar-nav a {
  position: relative;
  display: flex;
  align-items: center;
  padding: var(--space-2) var(--space-4);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: all var(--transition-base);
}

.navbar-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 20px;
  height: 2px;
  background: var(--accent-cyan);
  border-radius: var(--radius-full);
  transition: transform var(--transition-base);
}

.navbar-nav a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.navbar-nav a:hover::after,
.navbar-nav a.active::after {
  transform: translateX(-50%) scaleX(1);
}

.navbar-nav a.active {
  color: var(--accent-cyan);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Language Toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--transition-base);
}

.lang-toggle:hover {
  border-color: var(--border-glow);
  color: var(--text-primary);
}

.lang-toggle span {
  padding: 2px 6px;
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
}

.lang-toggle span.active {
  background: var(--gradient-primary);
  color: #fff;
}

/* Mobile Menu Button */
.navbar-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  cursor: pointer;
}

.navbar-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: all var(--transition-base);
  transform-origin: center;
}

.navbar-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.navbar-toggle.active span:nth-child(2) {
  opacity: 0;
}

.navbar-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  z-index: 999;
  padding: var(--space-8);
  flex-direction: column;
  gap: var(--space-4);
  overflow-y: auto;
}

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

.mobile-menu a {
  display: block;
  padding: var(--space-4) var(--space-6);
  color: var(--text-secondary);
  font-size: var(--text-lg);
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  transition: all var(--transition-base);
}

.mobile-menu a:hover,
.mobile-menu a.active {
  color: var(--accent-cyan);
  border-color: var(--border-glow);
  background: var(--bg-card);
}

/* ========================================
   2. PAGE BANNER
   ======================================== */

.page-banner {
  position: relative;
  padding: calc(var(--navbar-height) + var(--space-16)) var(--space-8) var(--space-16);
  text-align: center;
  overflow: hidden;
  background: var(--bg-deep);
}

.page-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.page-banner::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-glow), transparent);
  opacity: 0.5;
}

.page-banner-title {
  font-size: var(--text-5xl);
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-4);
  position: relative;
  z-index: 1;
}

.page-banner-subtitle {
  font-size: var(--text-lg);
  color: var(--text-tertiary);
  position: relative;
  z-index: 1;
  max-width: 600px;
  margin: 0 auto;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.breadcrumb a {
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--accent-cyan);
}

.breadcrumb .separator {
  color: var(--text-muted);
}

.breadcrumb .current {
  color: var(--accent-cyan);
}

/* ========================================
   3. SECTION COMMONS
   ======================================== */

.section {
  padding: var(--space-24) var(--space-8);
  position: relative;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-16);
}

.section-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.1);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid rgba(34, 211, 238, 0.2);
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: var(--text-4xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
}

.section-title .highlight {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-desc {
  font-size: var(--text-lg);
  color: var(--text-tertiary);
  max-width: 640px;
  margin: 0 auto var(--space-8);
}

/* ========================================
   4. CONTAINER
   ======================================== */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.container-narrow {
  max-width: var(--max-width-narrow);
}

/* ========================================
   5. GLASS CARD
   ======================================== */

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  padding: var(--space-8);
  transition: all var(--transition-base);
}

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

.glass-card-glow {
  position: relative;
  overflow: hidden;
}

.glass-card-glow::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
  transition: left 0.8s ease;
}

.glass-card-glow:hover::before {
  left: 100%;
}

/* ========================================
   6. BUTTONS
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  letter-spacing: var(--tracking-normal);
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  box-shadow: var(--shadow-glow-strong);
  transform: translateY(-1px);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.btn-outline:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(34, 211, 238, 0.05);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

/* ========================================
   7. BADGE / TAG
   ======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-cyan {
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(34, 211, 238, 0.2);
}

.badge-purple {
  background: rgba(167, 139, 250, 0.1);
  color: var(--accent-purple);
  border: 1px solid rgba(167, 139, 250, 0.2);
}

.badge-blue {
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

/* ========================================
   8. ANIMATIONS
   ======================================== */

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

/* Fade In */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* Pulse Glow */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
  50% { box-shadow: 0 0 40px rgba(99, 102, 241, 0.6), 0 0 80px rgba(6, 182, 212, 0.3); }
}

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

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

/* Border Glow Scan */
@keyframes borderGlowScan {
  0% { border-image-source: linear-gradient(0deg, var(--accent-cyan), var(--accent-purple)); }
  100% { border-image-source: linear-gradient(360deg, var(--accent-cyan), var(--accent-purple)); }
}

/* Reveal elements on scroll */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ========================================
   9. FOOTER
   ======================================== */

.footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--border-subtle);
  padding: var(--space-16) var(--space-8) var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-12);
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.footer-brand img {
  height: 76px;
  width: auto;
  max-width: none;
}

.footer-brand p {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  margin-bottom: 0;
}

.footer-col-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-6);
  letter-spacing: var(--tracking-wide);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-links a {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
}

.footer-links a:hover {
  color: var(--accent-cyan);
  padding-left: var(--space-2);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: var(--space-12) auto 0;
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: var(--text-xs);
  margin-bottom: 0;
}

/* ========================================
   10. BACK TO TOP
   ======================================== */

.back-to-top {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-8);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition-base);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: var(--shadow-glow);
}

.back-to-top svg {
  width: 20px;
  height: 20px;
}

/* ========================================
   11. PARTICLE CANVAS
   ======================================== */

#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
}

/* ========================================
   12. LIGHTBOX
   ======================================== */

.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  position: relative;
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  text-align: center;
  animation: scaleIn 0.3s ease;
}

.lightbox-content img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.lightbox-caption {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-top: var(--space-4);
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
  z-index: 1;
  line-height: 1;
}

.lightbox-close:hover {
  color: var(--text-primary);
}

/* Honor Hint */
.honor-hint {
  display: block;
  font-size: var(--text-xs);
  color: var(--accent-cyan);
  margin-top: var(--space-3);
  opacity: 1;
  cursor: pointer;
}

/* Honor Card Link */
.honor-card-link {
  cursor: pointer;
}

@media (max-width: 768px) {
  .lightbox {
    padding: var(--space-4);
  }
  .lightbox-close {
    top: -36px;
    right: 4px;
  }
}

/* ========================================
   13. RESPONSIVE — NAVBAR & GENERAL
   ======================================== */

@media (max-width: 1024px) {
  .navbar-nav {
    display: none;
  }

  .navbar-toggle {
    display: flex;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}

@media (max-width: 768px) {
  :root {
    --navbar-height: 64px;
  }

  .navbar {
    padding: 0 var(--space-6);
  }

  .navbar-brand img {
    height: 32px;
  }

  .section {
    padding: var(--space-16) var(--space-6);
  }

  .section-title {
    font-size: var(--text-3xl);
  }

  .page-banner-title {
    font-size: var(--text-3xl);
  }

  .page-banner {
    padding: calc(var(--navbar-height) + var(--space-12)) var(--space-6) var(--space-12);
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .back-to-top {
    bottom: var(--space-6);
    right: var(--space-6);
    width: 40px;
    height: 40px;
  }
}
