/* ============================================
   Grace Academy — 现代化教育平台样式
   单文件夹一体化 · 可直接上传至边缘节点
   ============================================ */

:root {
  --bg: #06070f;
  --bg-soft: #0c0e1a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.1);
  --text: #eef1ff;
  --text-dim: #9aa3c4;
  --accent: #7c5cff;
  --accent-2: #00d4ff;
  --accent-3: #ff5ca8;
  --green: #3ee6a0;
  --radius: 18px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "Noto Sans SC", "Space Grotesk", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- 动态背景画布 ---------- */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 70% -10%, rgba(124, 92, 255, 0.22), transparent 60%),
    radial-gradient(900px 500px at 10% 20%, rgba(0, 212, 255, 0.14), transparent 60%),
    var(--bg);
}

/* 内容层级 */
.nav, .hero, .section, .cta, .footer { position: relative; z-index: 2; }

/* ---------- 自定义光标 ---------- */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: screen;
}
.cursor-dot { width: 7px; height: 7px; background: var(--accent-2); transform: translate(-50%, -50%); }
.cursor-ring {
  width: 34px; height: 34px;
  border: 1.5px solid rgba(124, 92, 255, 0.7);
  transform: translate(-50%, -50%);
  transition: width .25s, height .25s, border-color .25s, background .25s;
}
.cursor-ring.is-hover {
  width: 54px; height: 54px;
  border-color: var(--accent-3);
  background: rgba(255, 92, 168, 0.08);
}
@media (hover: none) { .cursor-dot, .cursor-ring { display: none; } }

/* ---------- 按钮 ---------- */
.btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .3s, background .3s;
  white-space: nowrap;
}
.btn--solid {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 30px rgba(124, 92, 255, 0.4);
}
.btn--solid:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(124, 92, 255, 0.55); }
.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.btn--ghost:hover { background: var(--surface-2); transform: translateY(-2px); }
.btn--lg { padding: 0.95rem 2rem; font-size: 1.05rem; }
.btn--block { width: 100%; padding: 0.95rem; }

/* ---------- 导航 ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1rem, 4vw, 3rem);
  transition: background .3s, backdrop-filter .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(6, 7, 15, 0.7);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav__logo {
  display: flex; align-items: center; gap: 0.5rem;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700; font-size: 1.25rem; letter-spacing: .5px;
}
.nav__logo-mark {
  color: var(--accent-2);
  font-size: 1.4rem;
  filter: drop-shadow(0 0 8px var(--accent-2));
}
.accent { background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav__links { display: flex; gap: 1.8rem; }
.nav__links a {
  font-size: 0.95rem; color: var(--text-dim);
  position: relative; transition: color .25s;
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px;
  width: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .3s var(--ease);
}
.nav__links a:hover, .nav__links a.active { color: var(--text); }
.nav__links a.active::after, .nav__links a:hover::after { width: 100%; }
.nav__actions { display: flex; gap: 0.7rem; align-items: center; }

/* 语言切换按钮 */
.lang-toggle {
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 0.85rem; font-weight: 600; letter-spacing: .5px;
  padding: 0.5rem 0.9rem; border-radius: 999px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background .25s, border-color .25s, transform .2s var(--ease);
}
.lang-toggle:hover { background: var(--surface-2); border-color: var(--accent); transform: translateY(-2px); }

.nav__burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.nav__burger span { width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s; }
.nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.open span:nth-child(2) { opacity: 0; }
.nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 首屏 ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7rem 1.5rem 4rem;
  overflow: hidden;
}
.hero__glow {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: .55; z-index: 0;
  animation: float 9s ease-in-out infinite;
}
.hero__glow--1 { width: 420px; height: 420px; background: var(--accent); top: 12%; left: 8%; }
.hero__glow--2 { width: 360px; height: 360px; background: var(--accent-2); bottom: 8%; right: 10%; animation-delay: -4s; }
@keyframes float { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-30px) scale(1.08); } }

.hero__inner { position: relative; z-index: 3; max-width: 860px; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem 1rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.85rem; color: var(--text-dim); margin-bottom: 1.6rem;
  backdrop-filter: blur(8px);
}
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(62, 230, 160, .6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(62,230,160,.6);} 70% { box-shadow: 0 0 0 10px rgba(62,230,160,0);} 100% { box-shadow: 0 0 0 0 rgba(62,230,160,0);} }

.hero__title {
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: clamp(2.2rem, 6vw, 4.4rem);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 1.4rem;
}
.gradient-text {
  background: linear-gradient(110deg, var(--accent-2), var(--accent), var(--accent-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  background-size: 200% auto; animation: shimmer 6s linear infinite;
}
@keyframes shimmer { to { background-position: 200% center; } }

.hero__sub { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--text-dim); max-width: 660px; margin: 0 auto 2.2rem; }
.hero__cta { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.play-icon { display: inline-block; font-size: .7rem; margin-right: .3rem; }

.hero__trust { margin-top: 2.8rem; }
.trust__logos { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; color: var(--text-dim); font-size: 0.9rem; }
.trust__logos .dot { opacity: .4; }

.hero__scroll { position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .6rem; color: var(--text-dim); font-size: .8rem; }
.scroll-line { width: 1px; height: 46px; background: linear-gradient(var(--accent-2), transparent); position: relative; overflow: hidden; }
.scroll-line::after { content: ""; position: absolute; top: -50%; left: 0; width: 100%; height: 50%; background: var(--accent-2); animation: scrollDown 2s infinite; }
@keyframes scrollDown { 0% { top: -50%; } 100% { top: 100%; } }

/* ---------- 通用区块 ---------- */
.section { padding: clamp(4rem, 9vw, 7rem) clamp(1rem, 4vw, 3rem); max-width: var(--maxw); margin: 0 auto; }
.section--dark { max-width: 100%; background: linear-gradient(180deg, transparent, rgba(124,92,255,.05), transparent); }
.section--dark > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }

.section__head { text-align: center; margin-bottom: 3.5rem; }
.section__tag {
  display: inline-block; font-size: .82rem; letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent-2); margin-bottom: .9rem; font-weight: 600;
}
.section__title { font-family: "Space Grotesk","Noto Sans SC",sans-serif; font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 700; line-height: 1.2; }
.section__desc { color: var(--text-dim); margin-top: 1rem; max-width: 560px; margin-left: auto; margin-right: auto; }

/* ---------- 卡片网格 ---------- */
.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.4rem; }
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.6rem;
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .35s, box-shadow .35s;
  backdrop-filter: blur(10px);
}
.card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(400px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--c) 22%, transparent), transparent 60%);
  opacity: 0; transition: opacity .35s;
}
.card:hover { transform: translateY(-8px); border-color: color-mix(in srgb, var(--c) 50%, transparent); box-shadow: 0 20px 50px rgba(0,0,0,.4); }
.card:hover::before { opacity: 1; }
.card__icon {
  width: 56px; height: 56px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.6rem;
  background: color-mix(in srgb, var(--c) 18%, transparent);
  color: var(--c); margin-bottom: 1.2rem;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 35%, transparent);
}
.card h3 { font-size: 1.25rem; margin-bottom: .6rem; }
.card p { color: var(--text-dim); font-size: .95rem; }

/* ---------- 课程 ---------- */
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.6rem; }
.course {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .35s var(--ease), box-shadow .35s, border-color .35s;
}
.course:hover { transform: translateY(-8px); border-color: var(--accent); box-shadow: 0 24px 60px rgba(124,92,255,.25); }
.course__media { height: 170px; position: relative; }
.course__media[data-img="ai"] { background: linear-gradient(135deg, #7c5cff, #00d4ff); }
.course__media[data-img="ml"] { background: linear-gradient(135deg, #ff5ca8, #7c5cff); }
.course__media[data-img="agent"] { background: linear-gradient(135deg, #00d4ff, #3ee6a0); }
.course__media::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.25) 1px, transparent 1px);
  background-size: 18px 18px; opacity: .5;
}
.course__body { padding: 1.5rem; }
.course__level { font-size: .78rem; color: var(--accent-2); font-weight: 600; letter-spacing: .5px; }
.course__body h3 { font-size: 1.3rem; margin: .5rem 0 .5rem; }
.course__body p { color: var(--text-dim); font-size: .92rem; margin-bottom: 1rem; }
.course__meta { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .82rem; color: var(--text-dim); border-top: 1px solid var(--border); padding-top: 1rem; }

/* ---------- 时间线 ---------- */
.timeline { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.timeline__item {
  position: relative; padding: 2rem 1.6rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); backdrop-filter: blur(10px);
  transition: transform .35s var(--ease), border-color .35s;
}
.timeline__item:hover { transform: translateY(-6px); border-color: var(--accent-2); }
.timeline__num {
  font-family: "Space Grotesk", sans-serif; font-size: 2.6rem; font-weight: 700;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: .8rem;
}
.timeline__item h3 { font-size: 1.2rem; margin-bottom: .5rem; }
.timeline__item p { color: var(--text-dim); font-size: .92rem; }

/* ---------- 数据统计 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem; text-align: center; }
.stat { padding: 2rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.stat__num { font-family: "Space Grotesk", sans-serif; font-size: clamp(2.4rem, 6vw, 3.6rem); font-weight: 700; background: linear-gradient(120deg, #fff, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat__label { color: var(--text-dim); margin-top: .4rem; letter-spacing: 1px; }

/* ---------- CTA ---------- */
.cta { padding: clamp(4rem, 9vw, 7rem) 1.5rem; text-align: center; overflow: hidden; }
.cta__glow { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 700px; height: 400px; background: radial-gradient(circle, rgba(124,92,255,.4), transparent 65%); filter: blur(80px); z-index: 0; }
.cta__inner { position: relative; z-index: 2; max-width: 720px; margin: 0 auto; }
.cta__inner h2 { font-family: "Space Grotesk","Noto Sans SC",sans-serif; font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 700; margin-bottom: 1rem; }
.cta__inner p { color: var(--text-dim); margin-bottom: 2rem; font-size: 1.05rem; }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--border); padding: 4rem clamp(1rem,4vw,3rem) 2rem; background: var(--bg-soft); }
.footer__main { max-width: var(--maxw); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 3rem; justify-content: space-between; }
.footer__brand { max-width: 320px; }
.footer__brand p { color: var(--text-dim); margin-top: 1rem; font-size: .92rem; }
.footer__cols { display: flex; gap: 3rem; flex-wrap: wrap; }
.footer__cols h4 { font-size: .95rem; margin-bottom: 1rem; }
.footer__cols a { display: block; color: var(--text-dim); font-size: .9rem; margin-bottom: .6rem; transition: color .25s; }
.footer__cols a:hover { color: var(--accent-2); }
.footer__bottom { max-width: var(--maxw); margin: 3rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: space-between; flex-wrap: wrap; gap: .6rem; color: var(--text-dim); font-size: .85rem; }

/* ---------- 模态框 ---------- */
.modal { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 1.5rem; }
.modal.open { display: flex; }
.modal__overlay { position: absolute; inset: 0; background: rgba(3, 4, 10, .7); backdrop-filter: blur(6px); animation: fade .3s; }
.modal__panel {
  position: relative; z-index: 2; width: 100%; max-width: 420px;
  background: linear-gradient(160deg, #11131f, #0a0b14);
  border: 1px solid var(--border); border-radius: 22px; padding: 2.4rem;
  box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: pop .35s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.96); } }
.modal__close { position: absolute; top: 1rem; right: 1.2rem; background: none; border: none; color: var(--text-dim); font-size: 1.6rem; cursor: pointer; transition: color .25s; }
.modal__close:hover { color: var(--text); }
.modal__title { font-size: 1.5rem; margin-bottom: .4rem; }
.modal__sub { color: var(--text-dim); font-size: .92rem; margin-bottom: 1.6rem; }
.modal__form { display: flex; flex-direction: column; gap: 1rem; }
.modal__form input, .modal__form select {
  font-family: inherit; font-size: .95rem; padding: .85rem 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); outline: none; transition: border-color .25s, box-shadow .25s;
}
.modal__form input:focus, .modal__form select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124,92,255,.2); }
.modal__form option { background: #11131f; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%) translateY(120%);
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff; padding: .9rem 1.6rem; border-radius: 999px; font-size: .92rem; font-weight: 600;
  z-index: 2000; box-shadow: 0 12px 40px rgba(124,92,255,.5); transition: transform .4s var(--ease); pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ---------- 滚动揭示动画 ---------- */
.reveal { opacity: 0; transform: translateY(34px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 820px) {
  .nav__links { position: fixed; top: 64px; right: 0; height: calc(100vh - 64px); width: 70%; max-width: 300px; flex-direction: column; gap: 1.4rem; padding: 2rem; background: rgba(10,11,20,.95); backdrop-filter: blur(16px); border-left: 1px solid var(--border); transform: translateX(110%); transition: transform .35s var(--ease); }
  .nav__links.open { transform: translateX(0); }
  .nav__actions .btn { display: none; }
  .nav__actions { gap: .5rem; }
  .nav__burger { display: flex; }
}
