/* ═══════════════════════════════════════════════════
   CAPST · 车氏科学技术促进协会
   深邃藏青 × 电光蓝 × 银白 — 纯粹科技感
   ═══════════════════════════════════════════════════ */

:root {
  --bg: #070b16;
  --bg-2: #0b1120;
  --bg-3: #0e1528;
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.05);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.12);
  --text: #e8ecf8;
  --text-2: #b8c0d8;
  --muted: #7c86a3;
  --accent: #4f8ff7;
  --accent-2: #7aa8ff;
  --accent-3: #5ec8f2;
  --accent-4: #a78bfa;
  --glow: rgba(79, 143, 247, 0.25);
  --glow-2: rgba(94, 200, 242, 0.18);
  --radius: 20px;
  --radius-sm: 12px;
  --max-w: 1200px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: "Inter", "Noto Sans TC", -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(79, 143, 247, 0.35);
  color: #fff;
}

/* ── 滚动条 ── */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.18); }

/* ═══════════ 背景层 ═══════════ */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(79, 143, 247, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 110%, rgba(94, 200, 242, 0.05) 0%, transparent 60%),
    radial-gradient(ellipse 50% 35% at 10% 100%, rgba(167, 139, 250, 0.04) 0%, transparent 60%);
}

/* ═══════════ 导航栏 ═══════════ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 68px;
  background: rgba(7, 11, 22, 0.6);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid var(--border);
  transition: background 0.4s, border-color 0.4s;
}
.nav--scrolled {
  background: rgba(7, 11, 22, 0.85);
  border-bottom-color: var(--border-strong);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.nav__mark {
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.nav__word {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.nav__word strong {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.nav__word em {
  font-style: normal;
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.nav__links {
  display: flex;
  gap: 36px;
  list-style: none;
}
.nav__links a {
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color 0.25s;
  position: relative;
}
.nav__links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }

.nav__cta {
  padding: 9px 22px;
  border-radius: 100px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff !important;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
  box-shadow: 0 2px 16px rgba(79, 143, 247, 0.25);
}
.nav__cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(79, 143, 247, 0.4);
}

/* ═══════════ Hero ═══════════ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 100px;
  overflow: hidden;
}

.hero__inner {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
}

.hero__eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--accent-3);
  margin-bottom: 28px;
  opacity: 0.85;
}

.hero__title {
  font-family: "Noto Serif TC", "Noto Sans TC", serif;
  font-size: clamp(2.8rem, 7vw, 5.2rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: 0.02em;
  margin-bottom: 28px;
}
.hero__title span {
  display: block;
  background: linear-gradient(180deg, #fff 0%, #b8c8e8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__sub {
  font-size: 1.08rem;
  color: var(--text-2);
  line-height: 1.9;
  margin-bottom: 48px;
  font-weight: 300;
}

.hero__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── 轨道环装饰 ── */
.hero__orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 700px;
  pointer-events: none;
  z-index: 1;
}
.orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.ring--1 { width: 400px; height: 400px; }
.ring--2 { width: 550px; height: 550px; border-style: dashed; border-color: rgba(255,255,255,0.03); }
.ring--3 { width: 700px; height: 700px; }

.orbit-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.dot--1 { animation: orbit1 12s linear infinite; }
.dot--2 { animation: orbit2 18s linear infinite; background: var(--accent-3); box-shadow: 0 0 12px var(--accent-3); }
.dot--3 { animation: orbit3 24s linear infinite; background: var(--accent-4); box-shadow: 0 0 12px var(--accent-4); }

@keyframes orbit1 {
  from { transform: rotate(0deg) translateX(200px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(200px) rotate(-360deg); }
}
@keyframes orbit2 {
  from { transform: rotate(120deg) translateX(275px) rotate(-120deg); }
  to { transform: rotate(480deg) translateX(275px) rotate(-480deg); }
}
@keyframes orbit3 {
  from { transform: rotate(240deg) translateX(350px) rotate(-240deg); }
  to { transform: rotate(600deg) translateX(350px) rotate(-600deg); }
}

/* ── 滚动提示 ── */
.hero__scroll {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  z-index: 2;
}
.mouse {
  width: 24px;
  height: 38px;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  padding-top: 7px;
}
.wheel {
  width: 3px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent-3);
  animation: wheel 1.8s ease-in-out infinite;
}
@keyframes wheel {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(8px); opacity: 0.3; }
}
.hero__scroll-text {
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  color: var(--muted);
}

/* ═══════════ 通用 Section ═══════════ */
.section {
  position: relative;
  z-index: 1;
  padding: 120px 24px;
}

.section__head {
  text-align: center;
  margin-bottom: 72px;
}

.section__kicker {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: var(--accent-3);
  margin-bottom: 16px;
  text-transform: uppercase;
}

.section__title {
  font-family: "Noto Serif TC", "Noto Sans TC", serif;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}

.section__rule {
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  border-radius: 2px;
  margin: 0 auto;
}

.section__desc {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 20px;
}

/* ═══════════ 按钮 ═══════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s var(--ease);
  cursor: pointer;
  border: none;
  letter-spacing: 0.02em;
}
.btn--primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #fff;
  box-shadow: 0 4px 24px rgba(79, 143, 247, 0.3);
}
.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 36px rgba(79, 143, 247, 0.45);
}
.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn--ghost:hover {
  background: var(--surface-2);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* ═══════════ 协会宗旨 ═══════════ */
.about {
  background: linear-gradient(180deg, transparent 0%, var(--bg-2) 100%);
}

.about__grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 64px;
  align-items: center;
}

.about__lead {
  font-size: 1.15rem;
  color: var(--text-2);
  line-height: 2;
  font-weight: 300;
}
.about__lead strong {
  color: var(--text);
  font-weight: 700;
}

.about__stats {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.stat {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.3s, transform 0.3s var(--ease);
}
.stat:hover {
  border-color: rgba(79, 143, 247, 0.25);
  transform: translateX(4px);
}
.stat__num {
  font-size: 2.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-3) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  min-width: 48px;
}
.stat__label {
  font-size: 0.88rem;
  color: var(--muted);
}

/* ═══════════ 旗下组织总览 ═══════════ */
.orgs__grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.org-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 40px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  overflow: hidden;
  transition: border-color 0.4s, box-shadow 0.4s;
  will-change: transform;
}
.org-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.4s;
}
.org-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--accent-soft) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}
.org-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.org-card:hover::before { opacity: 1; }
.org-card:hover::after { opacity: 1; }

.org-card__index {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.org-card__name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.org-card__tag {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.org-card__desc {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
  flex: 1;
  position: relative;
  z-index: 1;
}

.org-card__arrow {
  margin-top: 24px;
  font-size: 1.2rem;
  color: var(--accent);
  transition: transform 0.3s var(--ease);
  position: relative;
  z-index: 1;
}
.org-card:hover .org-card__arrow { transform: translateX(6px); }

/* ═══════════ 组织详情 ═══════════ */
.org-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  max-width: var(--max-w);
  margin: 0 auto;
}
.org-detail--alt .org-detail__visual { order: 2; }
.org-detail--alt .org-detail__body { order: 1; }

.org-detail__visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
}

.org-detail__visual svg {
  width: 100%;
  max-width: 420px;
  height: auto;
}

.org-detail__badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 6px 16px;
  border-radius: 100px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.06em;
}

.org-detail__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.org-detail__lead {
  font-size: 1.05rem;
  color: var(--text-2);
  line-height: 1.9;
  margin-bottom: 32px;
  font-weight: 300;
}

.org-detail__points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 40px;
}
.org-detail__points li {
  position: relative;
  padding-left: 28px;
  color: var(--text-2);
  font-size: 0.92rem;
}
.org-detail__points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 12px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* ── ecold 分子动画 ── */
.molecule .node {
  animation: node-pulse 3s ease-in-out infinite;
}
.molecule .node--core {
  animation: node-pulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 8px rgba(94, 200, 242, 0.6));
}
.molecule .node--sm { animation-delay: 0.5s; }

@keyframes node-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.ring-spin {
  transform-box: fill-box;
  transform-origin: center;
  animation: spin 20s linear infinite;
}
.ring-spin--rev {
  transform-box: fill-box;
  transform-origin: center;
  animation: spin-rev 30s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes spin-rev {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

/* ── twings 气流动画 ── */
.flow {
  stroke-dasharray: 30 30;
  animation: flow-dash 2.5s linear infinite;
}
.flow:nth-child(2) { animation-delay: 0.2s; }
.flow:nth-child(3) { animation-delay: 0.4s; }
.flow:nth-child(4) { animation-delay: 0.6s; }
.flow:nth-child(5) { animation-delay: 0.8s; }

@keyframes flow-dash {
  from { stroke-dashoffset: 60; }
  to { stroke-dashoffset: 0; }
}

.wing-shape {
  animation: wing-float 4s ease-in-out infinite;
}
@keyframes wing-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ── Repubai 神经网络动画 ── */
.n-node {
  animation: node-pulse 2.5s ease-in-out infinite;
}
.n-node--core {
  animation: node-pulse 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 10px rgba(167, 139, 250, 0.6));
}

.pulse-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: pulse-ring 3s ease-out infinite;
}
.pulse-ring--2 { animation-delay: 1.5s; }

@keyframes pulse-ring {
  0% { transform: scale(0.6); opacity: 0.5; }
  100% { transform: scale(1.4); opacity: 0; }
}

/* ═══════════ 页脚 ═══════════ */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  padding: 56px 32px 32px;
}

.footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 32px;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 16px;
}
.footer__brand .nav__mark { color: var(--accent); }
.footer__brand strong {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  display: block;
}
.footer__brand p {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 4px;
}

.footer__links {
  display: flex;
  gap: 28px;
  list-style: none;
}
.footer__links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.25s;
}
.footer__links a:hover { color: var(--text); }

.footer__base {
  max-width: var(--max-w);
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.footer__base p {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ═══════════ 滚动显现动画 ═══════════ */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal.d1 { transition-delay: 0.1s; }
.reveal.d2 { transition-delay: 0.2s; }
.reveal.d3 { transition-delay: 0.3s; }
.reveal.d4 { transition-delay: 0.4s; }

/* ═══════════ 响应式 ═══════════ */
@media (max-width: 1024px) {
  .orgs__grid { grid-template-columns: 1fr; max-width: 560px; }
  .org-detail { grid-template-columns: 1fr; gap: 48px; }
  .org-detail--alt .org-detail__visual { order: 0; }
  .org-detail--alt .org-detail__body { order: 1; }
  .about__grid { grid-template-columns: 1fr; gap: 40px; }
}

@media (max-width: 768px) {
  .nav { padding: 0 20px; }
  .nav__links { display: none; }
  .hero { padding: 100px 20px 80px; }
  .hero__orbit { width: 400px; height: 400px; }
  .ring--1 { width: 250px; height: 250px; }
  .ring--2 { width: 350px; height: 350px; }
  .ring--3 { width: 400px; height: 400px; }
  .section { padding: 80px 20px; }
  .footer__inner { flex-direction: column; text-align: center; }
}

/* ═══════════ 减少动画偏好 ═══════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
