/* ============================================
   拾光记 · 主样式 v8 · Hermes 深色极简
   80% 相似 Hermes 官网：深蓝黑底 · 白字 · 大标题 · 无衬线 · 网格
   ============================================ */
@import url("tokens-v5.css");

/* —— 基础 —— */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--ink);
  background: #cfe9f7; /* 视频加载前的兜底浅蓝（柔和） */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* —— 蓝天白云视频幕布（摄影级真实视频，特效感） —— */
.sky-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: -3;
  pointer-events: none;
  filter: blur(1px) saturate(1.1) brightness(1);
  opacity: 0.92;
  transform: scale(1.02);
}

/* —— 花瓣季节特效（幕布层，明显清晰，不挡内容） —— */
.petal {
  position: fixed;
  top: -8vh;
  z-index: -1;
  pointer-events: none;
  line-height: 1;
  animation: petalFall linear infinite;
  filter: drop-shadow(0 2px 6px rgba(120, 160, 200, 0.3));
  user-select: none;
}
.petal-plum {
  color: #fff;
  text-shadow: 0 0 8px rgba(236, 111, 159, 0.6), 0 0 16px rgba(236, 111, 159, 0.35);
}
@keyframes petalFall {
  0%   { transform: translate3d(0, -10vh, 0) rotate(0deg); }
  20%  { transform: translate3d(3vw, 22vh, 0) rotate(70deg); }
  40%  { transform: translate3d(-3vw, 44vh, 0) rotate(140deg); }
  60%  { transform: translate3d(4vw, 66vh, 0) rotate(210deg); }
  80%  { transform: translate3d(-2vw, 88vh, 0) rotate(280deg); }
  100% { transform: translate3d(2vw, 115vh, 0) rotate(360deg); }
}

/* —— 光影插画：光束/光斑/光环（hero，粉蓝柔光） —— */
.light-beam {
  position: absolute;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(3px);
  opacity: 0.75;
  animation: beamSway 6s ease-in-out infinite alternate;
}
.light-beam--1 {
  width: 52vw;
  height: 78vh;
  top: -20vh;
  left: -14vw;
  background: linear-gradient(160deg, rgba(236, 111, 159, 0.22), transparent 72%);
  transform: rotate(-16deg);
}
.light-beam--2 {
  width: 44vw;
  height: 70vh;
  top: -14vh;
  right: -12vw;
  background: linear-gradient(200deg, rgba(90, 169, 214, 0.18), transparent 72%);
  transform: rotate(12deg);
  animation-delay: 1.5s;
}
.light-orb {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 111, 159, 0.24), transparent 70%);
  animation: orbPulse 5s ease-in-out infinite alternate;
}
.light-orb--1 { width: 34vw; height: 34vw; bottom: -10vw; left: 10vw; }
.light-orb--2 { width: 24vw; height: 24vw; top: 10vh; right: 6vw; animation-delay: 1.8s; }
/* 旋转光环 */
.light-ring {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  border: 1px solid rgba(236, 111, 159, 0.35);
  animation: ringSpin 14s linear infinite;
}
.light-ring--1 { width: 60vw; height: 60vw; top: -20vw; right: -18vw; border-color: rgba(236, 111, 159, 0.28); }
.light-ring--2 { width: 42vw; height: 42vw; bottom: -16vw; left: -10vw; border-color: rgba(90, 169, 214, 0.22); animation-direction: reverse; animation-duration: 18s; }
.light-ring--1::after,
.light-ring--2::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(236, 111, 159, 0.8);
  box-shadow: 0 0 12px rgba(236, 111, 159, 0.7);
}
@keyframes beamSway {
  from { transform: translateY(-10px) rotate(-16deg); }
  to { transform: translateY(18px) rotate(-11deg); }
}
@keyframes orbPulse {
  from { opacity: 0.55; transform: scale(1); }
  to { opacity: 1; transform: scale(1.18); }
}
@keyframes ringSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; transition: color 0.18s; }
a:hover { color: var(--accent); text-decoration: underline; }
ul, ol { padding-left: 1.4rem; }

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.3;
  margin-bottom: var(--sp-2);
  letter-spacing: -0.01em;
  color: var(--ink);
  font-weight: 800;
}

::selection { background: var(--accent-soft); }

/* 课程章节编号 */
body { counter-reset: section; }

/* —— 容器 —— */
.container { max-width: 1160px; margin: 0 auto; padding: 0 var(--sp-3); }

/* —— 导航（Hermes 式极简） —— */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-brand {
  font-family: var(--font-art);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.04em;
}
.nav-brand:hover { text-decoration: none; }
.nav-brand span { color: var(--link); }
.nav-links { display: flex; gap: var(--sp-3); list-style: none; }
.nav-links a {
  color: var(--ink-soft);
  font-size: 1.25rem;
  font-weight: 500;
  transition: color 0.2s;
  padding: 0.3rem 0;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); font-weight: 600; text-decoration: none; }
.nav-links a.active { color: var(--accent); }

/* —— Hero（Hermes 式大标题居中） —— */
.hero {
  position: relative;
  min-height: 76vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    linear-gradient(rgba(10, 14, 23, 0.55), rgba(10, 14, 23, 0.55)),
    var(--hero-img, url("/shiguangji/img/hero.webp")) center/cover no-repeat;
  padding: var(--sp-6) var(--sp-3);
  border-bottom: 1px solid var(--line);
}
.hero > div:last-child { position: relative; z-index: 1; }
.hero .hero-kicker {
  font-size: 1.05rem;
  letter-spacing: 0.3em;
  color: #ffffff;
  margin-bottom: var(--sp-2);
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.65), 0 0 4px rgba(0, 0, 0, 0.4);
  font-weight: 600;
}
.hero h1 {
  font-size: var(--fs-hero);
  margin-bottom: var(--sp-3);
  letter-spacing: 0.04em;
  color: #fff;
  font-family: var(--font-art);
  font-weight: 700;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5), 0 0 60px rgba(236, 111, 159, 0.35);
}
.hero p {
  font-size: 1.22rem;
  color: #ffffff;
  max-width: 640px;
  margin: 0 auto var(--sp-4);
  line-height: 1.9;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.6), 0 0 4px rgba(0, 0, 0, 0.35);
  font-weight: 500;
}
.hero .btn-group { display: flex; justify-content: center; gap: var(--sp-2); flex-wrap: wrap; }

/* —— 按钮（Hermes 式白色主按钮） —— */
.btn {
  display: inline-block;
  padding: 0.95rem 2.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.02em;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-primary {
  background: var(--accent);
  color: #0a0e17;
  box-shadow: var(--shadow-accent);
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid var(--line-strong);
  backdrop-filter: blur(4px);
}
.btn-ghost-dark {
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: var(--surface);
}

/* —— 区块 —— */
.section { padding: var(--sp-6) 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head {
  max-width: 720px;
  margin: 0 auto var(--sp-5);
  text-align: center;
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-lg);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}
.section-head .en {
  font-size: 0.95rem;
  letter-spacing: 0.35em;
  color: var(--accent-strong);
  text-transform: uppercase;
  text-shadow: none;
}
.section-head h2 { margin-top: var(--sp-1); font-size: var(--fs-h2); }
.section-head h2 { color: var(--ink); text-shadow: none; }
.section-head p { color: var(--ink-soft); margin-top: var(--sp-1); text-shadow: none; }

/* —— 卡片网格（Hermes 式深色卡片+细边框） —— */
.grid { display: grid; gap: var(--sp-3); grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  transition: transform 0.25s, border-color 0.25s, background 0.25s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  background: var(--surface-alt);
}
.card img { aspect-ratio: 4/3; object-fit: cover; width: 100%; border-bottom: 1px solid var(--line); }
.card-body { padding: var(--sp-3) var(--sp-3) var(--sp-4); position: relative; }
.card-num {
  position: absolute;
  top: -1.4rem;
  right: var(--sp-3);
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 800;
  line-height: 1;
  color: rgba(236, 111, 159, 0.28);
  -webkit-text-stroke: 1.5px rgba(236, 111, 159, 0.85);
  pointer-events: none;
}
.card:hover .card-num { -webkit-text-stroke: 1.5px var(--accent-strong); color: rgba(236, 111, 159, 0.4); }
.card-body h3 { margin-bottom: var(--sp-1); font-size: var(--fs-h3); color: var(--ink); font-weight: 800; }
.card-body p { color: var(--ink-soft); font-size: 1.05rem; line-height: 1.8; }

/* —— 徽章 —— */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  margin-bottom: var(--sp-1);
  border: 1px solid transparent;
}
.badge-newbie { background: rgba(138, 180, 248, 0.12); color: var(--link); border-color: rgba(138, 180, 248, 0.3); }
.badge-scene { background: rgba(94, 234, 180, 0.1); color: #5eeab4; border-color: rgba(94, 234, 180, 0.28); }
.badge-adv { background: rgba(196, 181, 253, 0.1); color: #c4b5fd; border-color: rgba(196, 181, 253, 0.28); }

/* —— 页脚 —— */
.footer {
  border-top: 1px solid var(--line);
  padding: var(--sp-5) 0 var(--sp-4);
  text-align: center;
  color: rgba(255, 255, 255, 0.92);
  font-size: var(--fs-small);
  text-shadow: 0 1px 6px rgba(60, 110, 150, 0.35);
}
.footer .brand { font-size: 1.2rem; color: #fff; letter-spacing: 0.08em; font-weight: 800; }

/* —— 课程详情页 —— */
.lesson-header {
  position: relative;
  padding: var(--sp-4) var(--sp-3);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  margin-bottom: var(--sp-4);
}
.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  color: var(--ink-soft);
  font-size: var(--fs-small);
  margin-bottom: var(--sp-2);
}
.lesson-header h1 { font-size: var(--fs-h1); margin: var(--sp-1) 0; letter-spacing: -0.01em; }
.lesson-goal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--link);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-small);
  color: var(--ink-soft);
  max-width: 760px;
  line-height: 1.9;
}
.lesson-goal strong { color: var(--ink); }

/* 课程正文：Hermes 式深色文章 */
.lesson-section {
  position: relative;
  padding: var(--sp-3) var(--sp-3) var(--sp-3);
  margin-bottom: var(--sp-3);
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.lesson-section:last-of-type { border-bottom: none; }
.lesson-section h2 {
  font-size: var(--fs-h3);
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
  color: var(--ink);
  font-weight: 800;
}
.lesson-section h2::before {
  content: counter(section, decimal-leading-zero);
  counter-increment: section;
  font-size: 0.85em;
  font-weight: 800;
  color: transparent;
  -webkit-text-stroke: 1px rgba(236, 111, 159, 0.55);
  min-width: 2.2em;
}
.lesson-section h3 {
  font-size: 1.1rem;
  margin-top: var(--sp-3);
  color: var(--ink);
  font-weight: 700;
}
.lesson-section p, .lesson-section li { color: var(--ink-soft); line-height: 2; font-size: var(--fs-body); }
.lesson-section .why {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--link);
  border-radius: var(--radius-sm);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-small);
  margin-top: var(--sp-2);
  line-height: 1.9;
  color: var(--ink-soft);
}
.lesson-section .why strong { color: var(--ink); }
.lesson-img {
  border-radius: var(--radius);
  margin: var(--sp-3) auto;
  display: block;
  max-width: 100%;
  max-height: 66vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background: var(--surface-alt);
  border: 1px solid var(--line);
}
.lesson-img[src*="comp-lines"] { max-height: 78vh; }

.lesson-section table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.lesson-section table th, .lesson-section table td { padding: var(--sp-1) var(--sp-2); text-align: left; }
.lesson-section table th { border-bottom: 1px solid var(--line-strong); font-weight: 600; color: var(--ink); }
.lesson-section table tr:nth-child(even) { background: var(--surface); }
@media (max-width: 640px) {
  .lesson-section table { display: block; overflow-x: auto; white-space: nowrap; }
}

.practice-card {
  background: var(--surface);
  border: 1px solid rgba(138, 180, 248, 0.3);
  border-radius: var(--radius);
  padding: var(--sp-2) var(--sp-3);
  margin-top: var(--sp-2);
}
.practice-card h4 { color: var(--link); margin-bottom: var(--sp-1); }
.practice-card p { color: var(--ink-soft); line-height: 1.9; }

.lesson-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.lesson-nav a {
  font-size: var(--fs-small);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: all .2s;
  font-weight: 500;
}
.lesson-nav a:hover { border-color: var(--link); color: var(--link); transform: translateY(-2px); }

/* —— 版本号（footer 小灰字） —— */
.site-version { font-size: 0.85rem; color: var(--ink-faint); }

/* —— 关于页（白卡片正文，便于阅读） —— */
.about-card {
  max-width: 720px;
  margin: 0 auto;
  line-height: 2;
  background: rgba(255, 255, 255, 0.94);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-4);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  font-size: var(--fs-body);
  color: var(--ink);
}
.about-card p { color: var(--ink-soft); line-height: 2; }
.about-card h3 { color: var(--ink); margin-bottom: var(--sp-1); }

/* —— 课程目录（Index-First） —— */
.catalog-list { max-width: 900px; margin: 0 auto; }
.catalog-group { margin-bottom: var(--sp-4); background: rgba(255, 255, 255, 0.92); border-radius: var(--radius-lg); padding: var(--sp-3) var(--sp-3); box-shadow: var(--shadow); }
.catalog-group h2 {
  font-size: var(--fs-h2);
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid var(--line-strong);
  margin-bottom: var(--sp-2);
  color: var(--ink);
  text-shadow: none;
}
.catalog-row {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-2);
  border-bottom: 1px solid var(--line);
  transition: background 0.2s;
}
.catalog-row:hover { background: var(--surface-alt); border-radius: var(--radius-sm); }
.catalog-row .catalog-num {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent-strong);
  min-width: 2.5em;
}
.catalog-row a { flex: 1; display: flex; justify-content: space-between; gap: var(--sp-2); align-items: baseline; text-decoration: none; color: var(--ink); }
.catalog-row a:hover { color: var(--link); }
.catalog-row .catalog-title { font-size: 1.3rem; font-weight: 700; }
.catalog-row .catalog-desc { color: var(--ink-faint); font-size: var(--fs-small); }
.catalog-row .catalog-time { color: var(--ink-faint); font-size: var(--fs-tiny); white-space: nowrap; }

/* —— 移动端底部导航 —— */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--line);
  z-index: 100;
}
.bottom-nav a { flex: 1; text-align: center; padding: 0.6rem 0; font-size: 0.75rem; color: var(--ink-soft); }
.bottom-nav a.active { color: var(--link); font-weight: 600; }

/* —— 滚动动效（reveal 渐入，克制：位移小、时长短） —— */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease-out, transform 0.45s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: none;
}
/* 卡片 stagger 延迟（40ms，总延迟有上限） */
.card.reveal { transition-delay: calc(var(--i, 0) * 40ms); }

/* hero 内容渐入 */
.hero-fade {
  opacity: 0;
  transform: translateY(20px);
  animation: heroFadeIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-fade:nth-child(1) { animation-delay: 0.1s; }
.hero-fade:nth-child(2) { animation-delay: 0.25s; }
.hero-fade:nth-child(3) { animation-delay: 0.4s; }
.hero-fade:nth-child(4) { animation-delay: 0.55s; }
@keyframes heroFadeIn {
  to { opacity: 1; transform: none; }
}

/* 卡片 hover 微交互增强 */
.card { transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.3s, background 0.3s, box-shadow 0.35s; }
.card:hover { box-shadow: var(--shadow-hover); }
.card:hover img { transform: scale(1.05); }

/* 链接 hover 动效 */
.nav-links a { transition: color 0.2s, transform 0.2s; }
.nav-links a:hover { transform: translateY(-1px); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-fade { animation: none; opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* —— 响应式 —— */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  body { padding-bottom: 56px; }
  .bottom-nav { display: flex; }
  .btn-group .btn { display: block; margin: var(--sp-1) auto; }
  .section { padding: var(--sp-5) 0; }
  .lesson-section h2::before { min-width: 1.6em; font-size: 0.8em; }
  .catalog-row { flex-wrap: wrap; gap: var(--sp-1); }
  .catalog-row a { flex-wrap: wrap; }
}
