/* ============================================================
   高数 · 可视化笔记 —— 「黑板之夜」设计系统
   墨黑方格纸 + 深夜学术风；与视频同款配色（黄/青/蓝）
   ============================================================ */
:root {
  --bg: #070a12;
  --card: rgba(16, 21, 33, 0.72);
  --line: rgba(255, 255, 255, 0.08);
  --line-soft: rgba(255, 255, 255, 0.05);
  --text: #e9edf5;
  --grey: #93a0b4;
  --yellow: #f5c518;
  --teal: #5fd4d0;
  --blue: #6ea8fe;
  --red: #ff6b6b;
  --radius: 16px;
  --serif: Georgia, "Times New Roman", "Songti SC", "STSong", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  color-scheme: dark;
  background-color: var(--bg);
}
body {
  font-family: var(--sans);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  /* 方格纸：两层网格 + 顶部青色辉光 + 底部蓝色辉光 */
  background-image:
    radial-gradient(1200px 620px at 50% -8%, rgba(95, 212, 208, 0.07), transparent 62%),
    radial-gradient(1000px 600px at 85% 108%, rgba(110, 168, 254, 0.06), transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size:
    100% 100%, 100% 100%,
    120px 120px, 120px 120px,
    24px 24px, 24px 24px;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 32px; position: relative; z-index: 2; }

/* ---------- 顶栏 ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 30px 0;
}
.brand { display: flex; align-items: baseline; gap: 14px; }
.brand .logo { font-size: 21px; font-weight: 700; letter-spacing: 2px; }
.brand .logo em { color: var(--yellow); font-style: normal; }
.brand .tag {
  font-family: var(--serif); font-style: italic;
  color: var(--grey); font-size: 13px; letter-spacing: 1px;
}
.header-note { color: var(--grey); font-size: 13px; letter-spacing: 1px; }

/* ---------- 首页 hero ---------- */
.hero { position: relative; padding: 84px 0 72px; }
.hero .kicker {
  color: var(--teal); font-size: 13px; letter-spacing: 8px; margin-bottom: 26px;
  text-transform: uppercase;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 68px);
  font-weight: 500; line-height: 1.28; letter-spacing: 2px;
}
.hero h1 em {
  color: var(--yellow); font-style: normal; position: relative;
}
.hero h1 em::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 6px;
  height: 2px; background: linear-gradient(90deg, var(--yellow), transparent);
  opacity: .55;
}
.hero p {
  color: var(--grey); font-size: 17px; margin-top: 26px;
  max-width: 620px; line-height: 2;
}
.hero .stats {
  display: flex; gap: 44px; margin-top: 40px;
}
.hero .stat .n {
  font-family: var(--serif); font-size: 34px; color: var(--text);
}
.hero .stat .n i { font-style: normal; color: var(--teal); }
.hero .stat .l { color: var(--grey); font-size: 12px; letter-spacing: 3px; margin-top: 6px; }

/* hero 画布：割线 → 切线 */
.hero-stage {
  position: relative; margin-top: 54px;
  border: 1px solid var(--line); border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.008));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.05);
  overflow: hidden;
}
.hero-stage canvas { display: block; width: 100%; height: 420px; }
.hero-stage .caption {
  position: absolute; left: 28px; bottom: 22px;
  font-family: var(--serif); font-style: italic;
  color: var(--grey); font-size: 14px; letter-spacing: 1px;
}
.hero-stage .caption b { color: var(--teal); font-weight: 500; }

/* 悬浮数学符号水印 */
.float-sym {
  position: absolute; font-family: var(--serif); font-style: italic;
  color: rgba(255, 255, 255, 0.05); user-select: none; pointer-events: none;
  animation: floaty 9s ease-in-out infinite;
  z-index: 1;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50% { transform: translateY(-16px) rotate(var(--rot, 0deg)); }
}

/* ---------- 课程地图（教学大纲式） ---------- */
.syllabus-title {
  margin-top: 88px; margin-bottom: 8px;
  display: flex; align-items: baseline; gap: 18px;
}
.syllabus-title h2 {
  font-family: var(--serif); font-size: 30px; font-weight: 500; letter-spacing: 4px;
}
.syllabus-title span { color: var(--grey); font-size: 13px; letter-spacing: 2px; }

.chapter-block { margin-top: 52px; }
.chapter-name {
  display: flex; align-items: center; gap: 16px; margin-bottom: 22px;
}
.chapter-name .ch-no {
  font-family: var(--serif); font-style: italic;
  color: var(--yellow); font-size: 15px; letter-spacing: 2px; flex: none;
}
.chapter-name .ch-t { font-size: 17px; letter-spacing: 3px; flex: none; }
.chapter-name::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.ep-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 20px; padding-bottom: 12px;
}
.ep-card {
  position: relative; display: block; overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 26px 22px;
  backdrop-filter: blur(6px);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.ep-card::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(420px 200px at 20% 0%, rgba(95, 212, 208, 0.09), transparent 65%);
  opacity: 0; transition: opacity .3s ease;
}
a.ep-card:hover {
  transform: translateY(-5px);
  border-color: rgba(95, 212, 208, 0.5);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}
a.ep-card:hover::before { opacity: 1; }
.ep-card .num {
  position: absolute; right: 14px; top: 2px;
  font-family: var(--serif); font-style: italic;
  font-size: 74px; line-height: 1;
  color: rgba(255, 255, 255, 0.055);
  transition: color .3s ease;
}
a.ep-card:hover .num { color: rgba(245, 197, 24, 0.14); }
.ep-card .no { color: var(--teal); font-size: 12px; letter-spacing: 3px; position: relative; }
.ep-card h3 {
  font-size: 20px; margin-top: 12px; line-height: 1.55; font-weight: 600;
  position: relative;
}
.ep-card .desc {
  color: var(--grey); font-size: 13.5px; margin-top: 12px; line-height: 1.8;
  position: relative;
}
.ep-card .meta {
  display: flex; gap: 16px; margin-top: 18px; color: var(--grey);
  font-size: 12.5px; position: relative; letter-spacing: 1px;
}
.ep-card .meta .dur { color: var(--yellow); font-variant-numeric: tabular-nums; }
.ep-card.soon { opacity: .42; }
.ep-card.soon:hover { transform: none; }

.badge {
  margin-left: 10px; padding: 2px 10px; border-radius: 999px; font-size: 11px;
  letter-spacing: 1.5px; vertical-align: 1px;
}
.badge.ok { color: var(--teal); border: 1px solid rgba(95, 212, 208, 0.45); }
.badge.wip { color: var(--yellow); border: 1px solid rgba(245, 197, 24, 0.45); }
.badge.todo { color: var(--grey); border: 1px solid var(--line); }

/* 入场动画 */
.reveal { opacity: 0; transform: translateY(22px); animation: rise .8s cubic-bezier(.2,.7,.2,1) forwards; animation-delay: var(--d, 0s); }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

/* ---------- 播放页 ---------- */
.back {
  color: var(--grey); font-size: 13px; letter-spacing: 1px;
  transition: color .2s ease;
}
.back:hover { color: var(--teal); }
.ep-header { padding: 34px 0 30px; }
.ep-header .ep-no {
  font-family: var(--serif); font-style: italic;
  color: var(--yellow); font-size: 15px; letter-spacing: 3px;
}
.ep-header h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(28px, 4vw, 40px); margin-top: 14px; letter-spacing: 2px; line-height: 1.4;
}
.ep-header .sub { color: var(--grey); margin-top: 12px; font-size: 14px; letter-spacing: 1px; }

.player-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 26px;
  align-items: start; padding-bottom: 34px;
}
.video-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(95, 212, 208, 0.06);
}
.video-card video {
  width: 100%; aspect-ratio: 16 / 9; border-radius: 12px;
  background: #000; display: block;
}

.side-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 24px; backdrop-filter: blur(6px);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.4);
}
.side-card h2 {
  font-size: 13px; color: var(--grey); letter-spacing: 4px;
  margin-bottom: 16px; font-weight: 500;
  display: flex; align-items: center; gap: 12px;
}
.side-card h2::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

.chapter {
  display: flex; gap: 14px; width: 100%; text-align: left; cursor: pointer;
  background: none; border: none; color: var(--text);
  padding: 10px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.55;
  font-family: inherit; align-items: baseline;
  transition: background .2s ease;
  border-left: 2px solid transparent;
}
.chapter:hover { background: rgba(255, 255, 255, 0.05); }
.chapter.active {
  background: rgba(95, 212, 208, 0.09);
  border-left-color: var(--teal); border-radius: 0 10px 10px 0;
}
.chapter.active .t { color: var(--teal); }
.chapter .t {
  color: var(--yellow); font-size: 12.5px; flex: none;
  font-family: var(--serif); font-variant-numeric: tabular-nums;
}

.notes { padding: 8px 0 96px; }
.notes .side-card { padding: 30px 34px; }
.notes h2 { font-size: 17px; margin-bottom: 16px; color: var(--text); letter-spacing: 2px; }
.notes h2::after { display: none; }
.points { list-style: none; }
.points li {
  color: var(--grey); font-size: 14.5px; line-height: 1.95;
  padding-left: 22px; position: relative;
}
.points li::before {
  content: "∴"; position: absolute; left: 0; top: 0;
  color: var(--teal); font-family: var(--serif);
}
.points li b { color: var(--text); font-weight: 600; }

.notes .formula {
  display: block; margin-top: 22px; padding: 18px 24px;
  border: 1px solid rgba(245, 197, 24, 0.35);
  border-left: 3px solid var(--yellow);
  border-radius: 10px;
  background: rgba(245, 197, 24, 0.05);
  color: var(--yellow);
  font-family: var(--serif); font-size: 18px; letter-spacing: 1px;
}
.notes .next-line { color: var(--grey); margin-top: 20px; font-size: 14px; letter-spacing: 1px; }
.notes .next-line a { color: var(--teal); }
.notes .next-line a:hover { text-decoration: underline; }

.footer {
  border-top: 1px solid var(--line); padding: 30px 0 44px;
  color: var(--grey); font-size: 12.5px; letter-spacing: 1px;
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
}
.footer .f-serif { font-family: var(--serif); font-style: italic; }

@media (max-width: 900px) {
  .player-layout { grid-template-columns: 1fr; }
  .hero { padding: 56px 0 48px; }
  .hero-stage canvas { height: 300px; }
  .hero .stats { gap: 28px; }
  .float-sym { display: none; }
}
