/* ============================================================
   组件样式 Components
   ============================================================ */

/* ===== 导航栏 ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  transition: background var(--t-base) var(--ease-out), backdrop-filter var(--t-base) var(--ease-out), border-color var(--t-base);
  border-bottom: 1px solid transparent;
}

.navbar.is-scrolled {
  background: rgba(7, 11, 34, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
}

/* Logo */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark {
  font-size: 22px;
  color: var(--star-blue-light);
  text-shadow: var(--glow-blue);
  animation: brandSpin 12s linear infinite;
  display: inline-block;
}

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

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-cn {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-en {
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--text-3);
  text-transform: uppercase;
}

.brand-light .brand-cn { color: var(--text-1); }
.brand-light .brand-en { color: var(--text-3); }

/* 导航链接 */
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  position: relative;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  border-radius: var(--r-pill);
  transition: color var(--t-fast) var(--ease-out);
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 0;
  height: 2px;
  background: var(--grad-primary);
  border-radius: 2px;
  transition: width var(--t-base) var(--ease-out), left var(--t-base) var(--ease-out);
}

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

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

.nav-link.active::after,
.nav-link:hover::after {
  width: 60%;
  left: 20%;
}

/* 导航操作区 */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  transition: all var(--t-fast);
}

.lang-switch:hover {
  color: var(--text-1);
  border-color: var(--line-strong);
  background: rgba(43,108,255,0.08);
}

.lang-current { color: var(--star-blue-light); }
.lang-divider { opacity: 0.4; }
.lang-alt { opacity: 0.6; }

/* 移动端汉堡 */
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text-1);
  border-radius: 2px;
  transition: transform var(--t-base) var(--ease-out), opacity var(--t-fast);
}

body.menu-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
body.menu-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  border-radius: var(--r-pill);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-base) var(--ease-out), background var(--t-base);
}

.btn:active { transform: scale(0.97); }

.btn-sm { padding: 8px 18px; font-size: 13.5px; }
.btn-lg { padding: 15px 32px; font-size: 16px; }

.btn-primary {
  color: #fff;
  background: var(--grad-primary);
  box-shadow: 0 8px 24px -6px rgba(43,108,255,0.6), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-primary:hover {
  box-shadow: 0 12px 34px -6px rgba(43,108,255,0.75), inset 0 1px 0 rgba(255,255,255,0.25);
  transform: translateY(-2px);
}

.btn-primary .btn-arrow {
  transition: transform var(--t-base) var(--ease-out);
}

.btn-primary:hover .btn-arrow { transform: translateX(4px); }

.btn-ghost {
  color: var(--text-1);
  border: 1px solid var(--line-strong);
  background: rgba(255,255,255,0.02);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  border-color: var(--star-blue-light);
  background: rgba(43,108,255,0.1);
  transform: translateY(-2px);
}

/* ===== Hero 区块 ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-h) + 40px) 0 80px;
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  font-size: 13px;
  color: var(--text-2);
  background: rgba(43,108,255,0.08);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  margin-bottom: 28px;
  animation: fadeUp 0.8s var(--ease-out) both;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--star-cyan);
  box-shadow: 0 0 10px var(--star-cyan);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  font-size: clamp(34px, 7vw, 72px);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.hero-line {
  display: block;
  animation: fadeUp 0.8s var(--ease-out) both;
}

.hero-line:nth-child(2) { animation-delay: 0.12s; }

.hero-desc {
  margin-top: 24px;
  max-width: 560px;
  font-size: clamp(15px, 2vw, 18px);
  color: var(--text-2);
  animation: fadeUp 0.8s 0.24s var(--ease-out) both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 36px;
  animation: fadeUp 0.8s 0.36s var(--ease-out) both;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(32px, 6vw, 72px);
  margin-top: 64px;
  animation: fadeUp 0.8s 0.48s var(--ease-out) both;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat b {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.stat span {
  margin-top: 6px;
  font-size: 14px;
  color: var(--text-3);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

/* 滚动提示 */
.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid var(--line-strong);
  border-radius: var(--r-pill);
}

.hero-scroll span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 3px;
  height: 8px;
  margin-left: -1.5px;
  background: var(--star-blue-light);
  border-radius: 3px;
  animation: scrollWheel 1.6s ease-in-out infinite;
}

@keyframes scrollWheel {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(14px); }
}

/* ===== 课程卡片 ===== */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.course-grid-full {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.course-card {
  position: relative;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
  cursor: pointer;
}

.course-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-float);
}

.course-card .card-level {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--star-blue-light);
  text-transform: uppercase;
  margin-bottom: 16px;
}

.course-card .card-icon {
  font-size: 40px;
  margin-bottom: 18px;
  display: inline-block;
  width: 64px;
  height: 64px;
  line-height: 64px;
  text-align: center;
  border-radius: var(--r-md);
  background: rgba(43,108,255,0.08);
  border: 1px solid var(--line);
}

.course-card h3 {
  font-size: 21px;
  font-weight: 700;
  margin-bottom: 10px;
}

.course-card p {
  color: var(--text-2);
  font-size: 14.5px;
  flex: 1;
}

.course-card .card-meta {
  display: flex;
  gap: 16px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-3);
}

.course-card .card-meta b { color: var(--text-1); font-weight: 600; }

.course-card .card-link {
  margin-top: 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--star-blue-light);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap var(--t-base);
}

.course-card:hover .card-link { gap: 12px; }

/* ===== 特色卡片 ===== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 22px;
}

.feature-card {
  position: relative;
  padding: 32px 26px;
  text-align: left;
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
}

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

.feature-icon {
  font-size: 32px;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  background: rgba(34,211,238,0.06);
  border: 1px solid var(--line);
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-2);
  font-size: 14.5px;
}

/* ===== CTA 横幅 ===== */
.cta-band {
  position: relative;
  padding: clamp(56px, 8vw, 96px) 0;
  text-align: center;
  overflow: hidden;
}

.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(700px 300px at 50% 50%, rgba(43,108,255,0.16), transparent 70%);
}

.cta-inner {
  position: relative;
}

.cta-band h2 {
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 680px;
  margin: 0 auto;
}

.cta-band p {
  color: var(--text-2);
  margin: 14px 0 32px;
  font-size: 16px;
}

/* ===== 页脚 ===== */
.footer {
  position: relative;
  padding-top: 72px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(3,5,15,0.6));
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 48px;
  padding-bottom: 56px;
}

.footer-brand p {
  color: var(--text-3);
  font-size: 14px;
  margin-top: 16px;
  max-width: 280px;
}

.footer-author {
  font-size: 13px !important;
  color: var(--star-blue-light) !important;
  margin-top: 12px !important;
  letter-spacing: 0.02em;
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.footer-cols h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-1);
}

.footer-cols a {
  display: block;
  font-size: 14px;
  color: var(--text-3);
  margin-bottom: 10px;
  transition: color var(--t-fast);
}

.footer-cols a:hover { color: var(--star-blue-light); }

.footer-bottom {
  padding: 22px 0;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--star-cyan);
  border-radius: var(--r-md);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
  font-size: 14px;
  animation: toastIn 0.4s var(--ease-out);
}

.toast.is-leaving { animation: toastOut 0.3s var(--ease-in-out) forwards; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(40px); }
}

/* ===== 响应式 ===== */
@media (max-width: 820px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 24px;
    background: rgba(7,11,34,0.96);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
    gap: 4px;
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: all var(--t-base) var(--ease-out);
  }
  body.menu-open .nav-links {
    transform: none;
    opacity: 1;
    visibility: visible;
  }
  .nav-link { padding: 14px 16px; font-size: 16px; }
  .nav-toggle { display: flex; }
  .nav-cta { display: none; }
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
  .footer-cols { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}

@media (max-width: 480px) {
  .hero-stats { gap: 28px; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .toast-container { left: 16px; right: 16px; bottom: 16px; }
}
