/**
 * layout.css — 中创合科技公共布局样式
 * 供所有页面共享：Header / Footer / PageBanner / CTA / Stats / BackToTop
 * 由 <site-header> / <site-footer> Web Component 依赖
 */

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-sticky);
  height: var(--header-height);
  transition: all var(--transition-base);
  background: transparent;
}
.header--scrolled {
  background: var(--bg-overlay);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}
.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  z-index: 10;
}
.header__logo img { height: 32px; border-radius: var(--radius-sm); }
.header__logo-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header__nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
}
.header__nav a {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  padding: var(--space-sm) 0;
  position: relative;
  transition: color var(--transition-fast);
  letter-spacing: 0.01em;
}
.header__nav a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-base);
}
.header__nav a:hover,
.header__nav a.active { color: var(--text-primary); }
.header__nav a:hover::after,
.header__nav a.active::after { width: 100%; }
.header__actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.header__cta { padding: 8px 20px; font-size: var(--text-sm); }
.header__menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 10;
}
.header__menu-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

/* ===== Page Banner ===== */
.page-banner {
  position: relative;
  padding: 180px 0 100px;
  text-align: center;
  background: var(--bg-primary);
  overflow: hidden;
}
.page-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(108,92,231,0.18) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(0,210,255,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(108,92,231,0.06) 0%, transparent 50%);
}
.page-banner::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(108,92,231,0.3) 50%, transparent 100%);
}
.page-banner__content { position: relative; z-index: 1; }
.page-banner__title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--space-lg);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}
.page-banner__subtitle {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ===== CTA Section ===== */
.cta-section {
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
}
.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(108,92,231,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 50%, rgba(0,210,255,0.08) 0%, transparent 55%);
}
.cta-section .container { position: relative; z-index: 1; }
.cta-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: var(--space-5xl) var(--space-3xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--gradient-card-border);
  opacity: 0.6;
}
.cta-card::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at center, rgba(108,92,231,0.04) 0%, transparent 60%);
  animation: cta-pulse 8s ease-in-out infinite;
}
.cta-card > * { position: relative; z-index: 1; }
.cta-card__title {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 800;
  margin-bottom: var(--space-lg);
  letter-spacing: -0.02em;
}
.cta-card__desc {
  color: var(--text-secondary);
  font-size: var(--text-lg);
  margin-bottom: var(--space-2xl);
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.8;
}

@keyframes cta-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.1); opacity: 1; }
}

/* ===== Stats Banner ===== */
.stats-banner {
  padding: var(--space-4xl) 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}
.stats-row {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: var(--space-2xl);
}
.stats-item { text-align: center; }
.stats-item__number {
  font-size: var(--text-5xl);
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}
.stats-item__label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-sm);
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: var(--space-5xl) 0 var(--space-xl);
  position: relative;
}
.footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(108,92,231,0.3) 50%, transparent 100%);
}
.footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-3xl);
  margin-bottom: var(--space-3xl);
}
.footer__brand-desc {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.8;
  margin-top: var(--space-lg);
  max-width: 320px;
}
.footer__heading {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.footer__links { list-style: none; }
.footer__links li { margin-bottom: var(--space-md); white-space: nowrap; font-size: var(--text-sm); color: var(--text-secondary); display: flex; align-items: center; gap: var(--space-xs); }
.footer__links a {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
}
.footer__links a::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0;
  width: 0; height: 1px;
  background: var(--color-primary);
  transition: width var(--transition-base);
}
.footer__links a:hover {
  color: var(--color-primary-light);
}
.footer__links a:hover::after {
  width: 100%;
}
.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-2xl);
  border-top: 1px solid var(--border-color);
  font-size: var(--text-sm);
  color: var(--text-muted);
}
.footer__social {
  display: flex;
  gap: var(--space-md);
}
.footer__social a {
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-base);
  font-size: var(--text-sm);
}
.footer__social a:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-light);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-base);
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: center;
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
}
.back-to-top:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
}

/* ===== Filter Bar (cases.html) ===== */
.filter-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-2xl);
}
.filter-btn {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.filter-btn:hover,
.filter-btn.active {
  background: var(--gradient-primary);
  color: #fff;
  border-color: transparent;
}

/* ===== Responsive: 1024px ===== */
@media (max-width: 1024px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

/* ===== Responsive: 768px ===== */
@media (max-width: 768px) {
  :root { --header-height: 64px; }

  /* Header */
  .header__nav {
    position: fixed;
    top: 0; right: -100%;
    width: 280px; height: 100vh;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 100px var(--space-xl) var(--space-xl);
    gap: var(--space-lg);
    transition: right var(--transition-base);
    border-left: 1px solid var(--border-color);
    z-index: 9;
  }
  .header__nav--open { right: 0; }
  .header__nav a { font-size: var(--text-lg); }
  .header__menu-toggle { display: flex; }
  .header__cta { display: none; }

  /* Page Banner */
  .page-banner {
    padding: 120px 0 60px;
  }
  .page-banner__title {
    font-size: clamp(1.6rem, 6vw, 2.5rem);
  }

  /* Section */
  .section {
    padding: var(--space-4xl) 0;
  }
  .section__title {
    font-size: clamp(1.4rem, 5vw, 2rem);
  }
  .section__subtitle {
    font-size: var(--text-base);
  }

  /* CTA */
  .cta-card {
    padding: var(--space-3xl) var(--space-xl);
  }
  .cta-card__title {
    font-size: clamp(1.3rem, 4vw, 1.8rem);
  }

  /* Footer */
  .footer {
    padding: var(--space-3xl) 0 var(--space-xl);
  }
  .footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
    padding: 0 var(--space-sm);
  }
  .footer__links li {
    white-space: normal;
    word-break: break-all;
  }
  .footer__bottom {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }

  /* Back to Top */
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}

/* ===== Responsive: 480px ===== */
@media (max-width: 480px) {
  .page-banner {
    padding: 100px 0 48px;
  }
  .page-banner__title {
    font-size: clamp(1.3rem, 7vw, 1.8rem);
  }
  .page-banner__subtitle {
    font-size: var(--text-sm);
  }
  .section {
    padding: var(--space-3xl) 0;
  }
  .cta-card {
    padding: var(--space-2xl) var(--space-md);
  }
}
