:root {
  --ink: #06202d;
  --deep: #071d2a;
  --deep-2: #0b2e3c;
  --water: #0b9db7;
  --water-soft: #bcebf1;
  --foam: #eef9f8;
  --sand: #f7f0e5;
  --coral: #ff735e;
  --line: rgba(6, 32, 45, .13);
  --muted: #60757d;
  --white: #fff;
  --shadow: 0 20px 60px rgba(5, 37, 50, .12);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: #f7fbfa;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: #f7fbfa; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 max(20px, calc((100vw - 1240px) / 2));
  color: var(--white);
  background: rgba(7, 29, 42, .94);
  backdrop-filter: blur(16px);
}

.brand { display: flex; gap: 10px; align-items: center; font-size: 14px; font-weight: 700; letter-spacing: .04em; }
.brand-mark { display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; color: var(--water-soft); }
.progress-pill { display: flex; align-items: center; gap: 9px; border: 0; color: var(--white); background: transparent; cursor: pointer; }
.progress-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 5px rgba(255,115,94,.15); }

main { overflow: hidden; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  gap: clamp(40px, 7vw, 100px);
  align-items: center;
  min-height: 650px;
  padding: 72px max(24px, calc((100vw - 1240px) / 2)) 84px;
  color: var(--white);
  background:
    radial-gradient(circle at 14% 18%, rgba(18, 176, 198, .22), transparent 32%),
    linear-gradient(135deg, var(--deep), #0a3342 72%, #0b5260);
}

.eyebrow { margin: 0 0 14px; color: #49c9d8; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.hero h1 { margin: 0; max-width: 720px; font-family: "STKaiti", "KaiTi", serif; font-size: clamp(50px, 6.5vw, 86px); font-weight: 500; line-height: 1.06; letter-spacing: -.04em; }
.hero h1 em { color: #aee9ee; font-style: normal; }
.hero-intro { max-width: 640px; margin: 28px 0 0; color: rgba(255,255,255,.72); font-size: 17px; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.primary-button, .ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.primary-button { border: 0; color: var(--deep); background: #9fe6eb; box-shadow: 0 10px 30px rgba(25, 185, 205, .2); }
.primary-button:hover { transform: translateY(-1px); background: #baf2f4; }
.ghost-button { border: 1px solid rgba(255,255,255,.28); color: var(--white); }
.hero-stats { display: flex; gap: clamp(24px, 5vw, 56px); margin: 44px 0 0; }
.hero-stats div { display: flex; gap: 9px; align-items: baseline; }
.hero-stats dt { color: #aee9ee; font: 700 26px/1 Georgia, serif; }
.hero-stats dd { margin: 0; color: rgba(255,255,255,.55); font-size: 12px; }

.hero-visual { position: relative; margin: 0; }
.hero-visual::before { position: absolute; inset: -18px 28px 18px -18px; content: ""; border: 1px solid rgba(158, 229, 235, .22); border-radius: 44% 56% 38% 62% / 49% 38% 62% 51%; }
.hero-visual img { position: relative; aspect-ratio: 4/5; object-fit: cover; border-radius: 48% 52% 40% 60% / 42% 40% 60% 58%; box-shadow: 0 35px 80px rgba(0,0,0,.3); }
.hero-visual figcaption { position: absolute; right: -16px; bottom: 30px; width: min(260px, 64%); padding: 18px 20px; border: 1px solid rgba(255,255,255,.2); border-radius: 16px; background: rgba(5,30,42,.82); backdrop-filter: blur(15px); }
.hero-visual figcaption span { display: block; margin-bottom: 7px; color: var(--coral); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.hero-visual figcaption strong { font: 500 19px/1.5 "STKaiti", "KaiTi", serif; }

.toolbar { position: relative; z-index: 2; padding: 28px max(24px, calc((100vw - 1240px) / 2)); border-bottom: 1px solid var(--line); background: var(--white); }
.search-wrap { position: relative; max-width: 620px; margin: 0 auto 18px; }
.search-wrap svg { position: absolute; top: 50%; left: 17px; width: 20px; fill: none; stroke: var(--muted); stroke-width: 1.8; transform: translateY(-50%); }
.search-wrap input { width: 100%; height: 50px; padding: 0 20px 0 48px; border: 1px solid var(--line); border-radius: 14px; outline: none; background: var(--foam); }
.search-wrap input:focus { border-color: var(--water); box-shadow: 0 0 0 4px rgba(11,157,183,.1); }
.filters { display: flex; gap: 8px; justify-content: center; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.filter-button { flex: 0 0 auto; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--white); font-size: 12px; cursor: pointer; }
.filter-button.active { border-color: var(--deep); color: var(--white); background: var(--deep); }

.course-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 42px; max-width: 1240px; margin: 0 auto; padding: 70px 24px 100px; }
.roadmap { align-self: start; position: sticky; top: 94px; }
.roadmap-title { margin: 0 0 16px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .14em; }
.roadmap a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-size: 13px; }
.roadmap a::before { width: 7px; height: 7px; content: ""; border: 1px solid currentColor; border-radius: 50%; }
.roadmap a:hover, .roadmap a.active { color: var(--deep); background: var(--water-soft); }
.lesson-area { min-width: 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 26px; }
.section-heading h2 { margin: 0; font: 500 clamp(32px, 4vw, 48px)/1.1 "STKaiti", "KaiTi", serif; }
.text-button { padding: 6px; border: 0; color: var(--muted); background: transparent; font-size: 12px; cursor: pointer; }
.text-button:hover { color: var(--coral); }
.lesson-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

.lesson-card {
  position: relative;
  overflow: hidden;
  min-height: 290px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 12px 40px rgba(6, 41, 51, .05);
  transition: transform .2s ease, box-shadow .2s ease;
}
.lesson-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.lesson-card-image { position: relative; height: 158px; overflow: hidden; background: var(--deep); cursor: pointer; }
.lesson-card-image img { height: 100%; object-fit: cover; transition: transform .4s ease; }
.lesson-card:hover .lesson-card-image img { transform: scale(1.025); }
.lesson-card-image::after { position: absolute; inset: 0; content: ""; background: linear-gradient(180deg, transparent 45%, rgba(5,29,39,.56)); }
.lesson-number { position: absolute; z-index: 1; top: 12px; left: 12px; padding: 5px 9px; border-radius: 999px; color: var(--white); background: rgba(6,32,45,.74); font: 700 11px/1.2 Georgia, serif; }
.lesson-duration { position: absolute; z-index: 1; right: 12px; bottom: 10px; color: var(--white); font-size: 11px; }
.lesson-complete {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 50%;
  color: transparent;
  background: rgba(6,32,45,.4);
  cursor: pointer;
}
.lesson-complete.checked { border-color: #9fe6eb; color: var(--deep); background: #9fe6eb; }
.lesson-card-body { padding: 17px 18px 18px; cursor: pointer; }
.lesson-category { margin: 0 0 7px; color: var(--water); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.lesson-card h3 { margin: 0; font-size: 17px; line-height: 1.45; }
.lesson-summary { display: -webkit-box; overflow: hidden; margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.empty-state { padding: 70px 20px; border: 1px dashed var(--line); border-radius: 18px; text-align: center; color: var(--muted); }
.empty-state button { margin-left: 10px; border: 0; color: var(--water); background: transparent; cursor: pointer; }
.practice-banner { display: flex; gap: 40px; align-items: end; justify-content: space-between; max-width: 1192px; margin: 0 auto 100px; padding: 48px 52px; border-radius: 28px; color: var(--white); background: var(--deep); }
.practice-banner h2 { margin: 0; font: 500 40px/1.2 "STKaiti", "KaiTi", serif; }
.practice-banner p:not(.eyebrow) { max-width: 700px; margin: 14px 0 0; color: rgba(255,255,255,.65); line-height: 1.8; }

footer { display: flex; gap: 30px; justify-content: space-between; padding: 36px max(24px, calc((100vw - 1240px) / 2)); border-top: 1px solid var(--line); color: var(--muted); background: var(--white); font-size: 12px; line-height: 1.7; }
footer p { margin: 0; }
footer a { flex: 0 0 auto; color: var(--water); font-weight: 700; }

.lesson-dialog { width: min(920px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; border-radius: 24px; color: var(--ink); background: var(--white); box-shadow: 0 40px 100px rgba(0,0,0,.35); }
.lesson-dialog::backdrop { background: rgba(4,20,28,.72); backdrop-filter: blur(5px); }
.dialog-shell { position: relative; }
.dialog-close { position: sticky; z-index: 3; top: 16px; float: right; width: 38px; height: 38px; margin: 16px 16px -54px 0; border: 0; border-radius: 50%; color: var(--white); background: rgba(6,32,45,.72); font-size: 26px; line-height: 1; cursor: pointer; }
.dialog-hero { position: relative; height: min(45vw, 390px); min-height: 260px; overflow: hidden; background: var(--deep); }
.dialog-hero img { height: 100%; object-fit: cover; }
.dialog-hero::after { position: absolute; inset: 0; content: ""; background: linear-gradient(180deg, transparent 30%, rgba(4,27,38,.88)); }
.dialog-title { position: absolute; z-index: 1; right: 32px; bottom: 28px; left: 32px; color: var(--white); }
.dialog-title p { margin: 0 0 8px; color: #9fe6eb; font-size: 11px; font-weight: 800; letter-spacing: .1em; }
.dialog-title h2 { margin: 0; font: 500 clamp(30px, 5vw, 50px)/1.15 "STKaiti", "KaiTi", serif; }
.dialog-body { padding: 34px 38px 42px; }
.dialog-lead { margin: 0; color: #35535d; font-size: 17px; line-height: 1.8; }
.note-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 30px; }
.note-panel { padding: 22px; border-radius: 15px; background: var(--foam); }
.note-panel.warning { background: #fff2ec; }
.note-panel h3 { margin: 0 0 12px; font-size: 14px; }
.note-panel ul { margin: 0; padding-left: 18px; color: #49646d; font-size: 13px; line-height: 1.8; }
.drill-panel { margin-top: 18px; padding: 22px; border-left: 4px solid var(--water); border-radius: 8px 15px 15px 8px; background: #e0f5f5; }
.drill-panel span { display: block; margin-bottom: 7px; color: var(--water); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.drill-panel p { margin: 0; line-height: 1.7; }
.frame-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 22px; }
.frame-strip a { display: block; }
.frame-strip figure { position: relative; margin: 0; overflow: hidden; border-radius: 10px; background: var(--deep); }
.frame-strip img { aspect-ratio: 16/9; object-fit: cover; }
.frame-strip figcaption { position: absolute; right: 6px; bottom: 6px; padding: 3px 6px; border-radius: 5px; color: var(--white); background: rgba(4,27,38,.72); font-size: 10px; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.dialog-actions a, .dialog-actions button { min-height: 44px; padding: 0 18px; border-radius: 999px; font-size: 13px; font-weight: 800; cursor: pointer; }
.watch-button { display: inline-flex; align-items: center; border: 0; color: var(--white); background: var(--coral); }
.complete-button { border: 1px solid var(--line); background: var(--white); }
.complete-button.checked { border-color: var(--water); color: var(--water); background: var(--foam); }
.player-wrap { display: none; overflow: hidden; margin-top: 22px; border-radius: 14px; background: var(--deep); aspect-ratio: 16/9; }
.player-wrap.open { display: block; }
.player-wrap iframe { width: 100%; height: 100%; border: 0; }
.toast { position: fixed; z-index: 50; right: 20px; bottom: 24px; padding: 12px 16px; border-radius: 10px; color: var(--white); background: var(--deep); font-size: 13px; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 56px; }
  .hero-copy { order: 1; }
  .hero-visual { order: 2; max-width: 560px; margin: 10px auto 0; }
  .hero-visual img { aspect-ratio: 4/3; border-radius: 28px; }
  .hero-visual::before { border-radius: 30px; }
  .course-layout { grid-template-columns: 1fr; }
  .roadmap { display: none; }
  .practice-banner { margin-right: 24px; margin-left: 24px; }
}

@media (max-width: 640px) {
  .topbar { height: 58px; padding: 0 16px; }
  .brand { font-size: 13px; }
  .hero { min-height: auto; padding: 46px 20px 64px; }
  .hero h1 { font-size: 48px; }
  .hero-intro { font-size: 15px; }
  .hero-stats { gap: 20px; }
  .hero-stats div { display: block; }
  .hero-stats dd { margin-top: 5px; }
  .hero-visual figcaption { right: 10px; bottom: 14px; }
  .toolbar { padding: 20px 16px; }
  .filters { justify-content: flex-start; }
  .course-layout { padding: 50px 16px 70px; }
  .lesson-grid { grid-template-columns: 1fr; }
  .lesson-card { min-height: 275px; }
  .practice-banner { display: block; margin: 0 16px 70px; padding: 34px 26px; }
  .practice-banner h2 { font-size: 34px; }
  .practice-banner button { width: 100%; margin-top: 24px; }
  footer { display: block; padding: 28px 20px; }
  footer a { display: inline-block; margin-top: 12px; }
  .dialog-body { padding: 28px 20px 34px; }
  .dialog-title { right: 20px; bottom: 20px; left: 20px; }
  .note-grid { grid-template-columns: 1fr; }
  .frame-strip { grid-template-columns: 1fr; }
  .frame-strip figure:nth-child(n+2) { display: none; }
  .dialog-actions a, .dialog-actions button { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
