/* まなびノート — 中学数学 学習ポータル */

:root {
  --paper: #f7f4ec;
  --paper-2: #efece2;
  --surface: #ffffff;
  --ink: #21332c;
  --ink-2: #4f6259;
  --muted: #7c8a83;
  --line: #e2ddd0;
  --green: #2f6b52;
  --green-dark: #234f3d;
  --green-soft: #e8f0e9;
  --amber: #c08a2e;
  --amber-soft: #fbf1dc;
  --shadow-sm: 0 1px 2px rgba(33, 51, 44, .04), 0 6px 18px rgba(33, 51, 44, .05);
  --shadow-md: 0 12px 32px rgba(33, 51, 44, .10);
  --serif: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "Times New Roman", serif;
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, system-ui, -apple-system, "Segoe UI", sans-serif;
  --header-h: 72px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.7;
  background:
    radial-gradient(1100px 520px at 8% -8%, #eef3e9 0%, rgba(238, 243, 233, 0) 62%),
    radial-gradient(900px 480px at 102% 2%, #f8efdf 0%, rgba(248, 239, 223, 0) 58%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea { font: inherit; }
img { display: block; max-width: 100%; }
svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
::selection { background: rgba(47, 107, 82, .22); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d8d3c6; border-radius: 10px; border: 2px solid var(--paper); }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 6px; }

.shell {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------- header ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 244, 236, .92);
  backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--green);
  color: var(--paper);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(47, 107, 82, .22);
}
.brand-mark svg { width: 23px; height: 23px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-family: var(--serif); font-size: 19px; letter-spacing: .04em; font-weight: 600; }
.brand-text small { font-size: 10.5px; color: var(--muted); letter-spacing: .12em; margin-top: 3px; }

.main-nav { display: flex; align-items: center; gap: 26px; margin-left: 8px; }
.main-nav a {
  position: relative;
  font-size: 13.5px;
  color: var(--ink-2);
  padding: 24px 0 22px;
  transition: color .15s ease;
}
.main-nav a:hover { color: var(--green); }
.main-nav a.active { color: var(--green); font-weight: 600; }
.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--green);
  border-radius: 2px;
}

.search-wrap { position: relative; margin-left: auto; flex: 1; max-width: 300px; }

.searchbox {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 6px 0 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.searchbox:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 107, 82, .10);
}
.search-icon { width: 17px; height: 17px; color: var(--muted); }
.searchbox input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: var(--ink);
}
.searchbox input::placeholder { color: var(--muted); }
.searchbox input::-webkit-search-cancel-button { display: none; }
.search-clear {
  display: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  place-items: center;
  color: var(--muted);
}
.search-clear:hover { background: var(--paper-2); color: var(--ink); }
.search-clear svg { width: 14px; height: 14px; }
.searchbox input:not(:placeholder-shown) ~ .search-clear { display: grid; }
.search-submit {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: var(--paper);
  transition: background .15s ease;
}
.search-submit:hover { background: var(--green-dark); }
.search-submit svg { width: 15px; height: 15px; }

/* suggestions */
.suggestions {
  position: absolute;
  top: 48px;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 6px;
  z-index: 200;
  overflow: hidden;
}
.suggestion {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border-radius: 10px;
  text-align: left;
  font-size: 13px;
  color: var(--ink-2);
}
.suggestion:hover, .suggestion.active { background: var(--green-soft); color: var(--ink); }
.suggestion svg { width: 15px; height: 15px; color: var(--muted); }
.suggestion b { color: var(--ink); font-weight: 700; }

/* ---------------- course bar ---------------- */

.course-bar {
  background: var(--green-soft);
  border-bottom: 1px solid #d8e4da;
}
.course-bar-inner {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--green-dark);
  overflow: hidden;
  white-space: nowrap;
}
.course-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
}
.course-label {
  flex: none;
  font-size: 10px;
  letter-spacing: .14em;
  color: var(--green);
  border: 1px solid rgba(47, 107, 82, .28);
  border-radius: 999px;
  padding: 1px 9px;
}
.course-bar strong {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------- layout ---------------- */

.view {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 24px 84px;
  outline: none;
}

.eyebrow {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--green);
  text-transform: uppercase;
}

.page-head { margin: 6px 0 26px; }
.page-head h1 {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
  letter-spacing: .01em;
  margin: 8px 0 6px;
  line-height: 1.35;
}
.page-head p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---------------- hero ---------------- */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 44px;
  align-items: center;
  padding: 54px 56px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  width: 420px; height: 420px;
  right: -170px; top: -210px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 107, 82, .10), rgba(47, 107, 82, 0) 68%);
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; }
.hero h1 {
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1.32;
  font-weight: 600;
  letter-spacing: .005em;
  margin: 14px 0 18px;
}
.hero h1 .hero-sub {
  display: block;
  font-size: 24px;
  color: var(--green);
  margin-top: 6px;
}
.hero-lead {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 2;
  max-width: 500px;
}
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--green);
  color: var(--paper);
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(47, 107, 82, .22);
  transition: background .15s ease, transform .05s ease;
}
.btn-primary:hover { background: var(--green-dark); }
.btn-primary:active { transform: scale(.985); }
.btn-primary svg { width: 17px; height: 17px; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13.5px;
  background: var(--paper);
  transition: border-color .15s ease, color .15s ease;
}
.btn-ghost:hover { border-color: var(--green); color: var(--green); }

.hero-meta {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 26px;
  font-size: 11.5px;
  color: var(--muted);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 18px; }
.hero-meta span + span::before {
  content: "";
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--line);
}

.hero-visual { position: relative; display: grid; place-items: center; }
.formula-card {
  position: relative;
  width: 100%;
  max-width: 330px;
  background: #fffdf7;
  border: 1px solid #e7e0d0;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(33, 51, 44, .12);
  transform: rotate(-2deg);
  padding: 18px 22px 24px;
}
.formula-head { display: flex; align-items: center; gap: 6px; padding-bottom: 14px; border-bottom: 1px dashed #e3dccb; }
.fdot { width: 7px; height: 7px; border-radius: 50%; background: #d9d2c1; }
.fdot:nth-child(2) { background: #cdbf9f; }
.fdot:nth-child(3) { background: #b9d2c1; }
.formula-title { margin-left: auto; font-size: 9px; letter-spacing: .22em; color: var(--muted); }
.formula-body { padding-top: 18px; display: grid; gap: 16px; }
.f-line {
  font-family: var(--serif);
  font-size: 17px;
  color: var(--ink);
  letter-spacing: .02em;
}
.f-line.small { font-size: 12.5px; color: var(--ink-2); }
.f-note { font-size: 10px; letter-spacing: .12em; color: var(--muted); margin-top: 6px; }
.formula-badge {
  position: absolute;
  right: -16px;
  bottom: -16px;
  width: 74px; height: 74px;
  border-radius: 50%;
  background: var(--green);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1;
  box-shadow: 0 8px 20px rgba(47, 107, 82, .28);
}
.formula-badge span { font-family: var(--sans); font-size: 9px; letter-spacing: .12em; margin-top: 4px; }

/* ---------------- chips ---------------- */

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .45);
  color: var(--ink-2);
  font-size: 12.5px;
  white-space: nowrap;
  transition: all .15s ease;
}
.chip:hover { border-color: #c9c2b1; color: var(--ink); background: var(--surface); }
.chip.active {
  background: var(--green);
  border-color: var(--green);
  color: var(--paper);
  font-weight: 600;
}

/* ---------------- section head ---------------- */

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 42px 0 20px;
}
.section-head h2 {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  margin: 6px 0 0;
  line-height: 1.3;
}
.section-head > a {
  font-size: 12.5px;
  color: var(--green);
  border-bottom: 1px solid rgba(47, 107, 82, .35);
  padding-bottom: 2px;
}
.section-head > a:hover { border-color: var(--green); }

/* ---------------- lesson grid ---------------- */

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px 24px;
  align-items: start;
}

.lesson-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.lesson-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: #d5cdba;
}

.lesson-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  padding: 16px 20px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(120% 120% at 100% 100%, color-mix(in srgb, var(--accent) 16%, transparent) 0%, transparent 55%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, #fff) 0%, #fff 65%);
}
.lesson-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(to bottom, transparent 0 25px, rgba(33, 51, 44, .055) 25px 26px);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  pointer-events: none;
}
.cover-kicker {
  position: relative;
  z-index: 1;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .24em;
  color: color-mix(in srgb, var(--accent) 82%, #4a4a4a);
}
.cover-no {
  position: relative;
  z-index: 1;
  display: block;
  font-family: var(--serif);
  font-size: 46px;
  line-height: 1;
  margin-top: 8px;
  letter-spacing: .02em;
  color: var(--accent);
}
.cover-mark {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-56%);
  font-family: var(--serif);
  font-size: 58px;
  line-height: 1;
  color: var(--accent);
  opacity: .10;
  letter-spacing: -.02em;
  white-space: nowrap;
  pointer-events: none;
}
.cover-play {
  position: absolute;
  right: 16px;
  bottom: 14px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--accent) 32%, transparent);
  transition: transform .18s ease;
}
.lesson-card:hover .cover-play { transform: scale(1.07); }
.cover-play svg { width: 15px; height: 15px; margin-left: 2px; }
.lesson-dur {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(33, 51, 44, .08);
  color: var(--ink-2);
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .03em;
}

.lesson-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px 15px;
}
.lesson-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .05em;
  white-space: nowrap;
}
.lesson-state { color: var(--muted); font-size: 10.5px; letter-spacing: .06em; white-space: nowrap; }

/* ---------------- breadcrumb ---------------- */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 16px;
}
.breadcrumb a:hover { color: var(--green); }
.breadcrumb .sep { color: #c8c2b4; }
.breadcrumb .now { color: var(--ink-2); }

/* ---------------- watch ---------------- */

.watch-page { max-width: 960px; margin: 0 auto; }

.player-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 10px;
  box-shadow: var(--shadow-sm);
}
/* --- custom player --- */

.player-shell {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0e1a15;
  border-radius: 14px;
  overflow: hidden;
  isolation: isolate;
}
.lesson-video,
#lessonVideo {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  object-fit: contain;
  z-index: 1;
}

/* curtain: hides the YouTube thumbnail until the lesson starts */
.player-curtain {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 24px;
  text-align: center;
  color: #eaf1ea;
  background:
    radial-gradient(90% 120% at 50% 0%, rgba(60, 120, 90, .28), transparent 60%),
    linear-gradient(160deg, #14251d 0%, #0d1712 100%);
  transition: opacity .35s ease, visibility .35s ease;
}
.player-curtain::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 38px 38px;
  -webkit-mask-image: radial-gradient(circle at center, #000 20%, transparent 78%);
  mask-image: radial-gradient(circle at center, #000 20%, transparent 78%);
  pointer-events: none;
}
.player-curtain.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.curtain-watermark {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -54%);
  font-family: var(--serif);
  font-size: 220px;
  line-height: 1;
  color: rgba(143, 208, 174, .07);
  pointer-events: none;
  user-select: none;
}
.curtain-kicker {
  position: relative;
  font-size: 9.5px;
  letter-spacing: .26em;
  color: #8fc0a5;
}
.curtain-title {
  position: relative;
  font-family: var(--serif);
  font-size: 31px;
  font-weight: 600;
  letter-spacing: .04em;
  margin: 0;
}
.curtain-subject {
  position: relative;
  font-size: 10.5px;
  padding: 3px 11px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  color: #cfe0d5;
}
.curtain-play {
  position: relative;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  background: #e7f2ea;
  color: #173f2e;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .35);
  transition: transform .15s ease, background .15s ease;
}
.curtain-play:hover { background: #fff; transform: translateY(-1px); }
.curtain-play:disabled { opacity: .6; cursor: default; }
.curtain-play svg { width: 16px; height: 16px; }
.curtain-resume {
  position: relative;
  font-size: 11.5px;
  color: #b9d2c3;
  border-bottom: 1px solid rgba(185, 210, 195, .35);
  padding-bottom: 2px;
}
.curtain-resume b { color: #eaf1ea; font-weight: 600; margin-left: 4px; }
.curtain-resume:hover { color: #fff; }
.curtain-note {
  position: relative;
  font-size: 10px;
  color: rgba(207, 224, 213, .55);
  letter-spacing: .04em;
}
.curtain-error {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.curtain-error p { margin: 0; font-size: 12px; color: #ffd9d2; }
.curtain-retry {
  font-size: 11.5px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px;
  padding: 6px 14px;
}
.curtain-retry:hover { background: rgba(255, 255, 255, .1); }

/* controls overlay */
.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.pc-top {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 18px 34px;
  background: linear-gradient(to bottom, rgba(8, 16, 12, .9), rgba(8, 16, 12, .42) 55%, transparent);
  opacity: 1;
  transition: opacity .22s ease;
}
.pc-lesson {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .2em;
  color: #cfe0d5;
}
.pc-subject {
  font-size: 10px;
  color: #eaf1ea;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(8, 16, 12, .62);
  border: 1px solid rgba(255, 255, 255, .18);
}
.player-bigplay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(231, 242, 234, .94);
  color: #173f2e;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  opacity: 1;
  transition: opacity .18s ease, transform .18s ease;
}
.player-bigplay:hover { transform: translate(-50%, -50%) scale(1.05); background: #fff; }
.player-bigplay svg { width: 28px; height: 28px; margin-left: 3px; }
.player-shell.is-playing .player-bigplay { opacity: 0; pointer-events: none; }
.player-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
}
.spinner {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .22);
  border-top-color: #e7f2ea;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pc-bottom {
  padding: 46px 16px 10px;
  background: linear-gradient(to top, rgba(8, 16, 12, .94), rgba(8, 16, 12, .58) 55%, transparent);
  opacity: 1;
  transition: opacity .22s ease;
}
.pc-progress {
  position: relative;
  height: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.pc-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, .22);
  border-radius: 999px;
  overflow: hidden;
  transition: height .15s ease;
}
.pc-progress:hover .pc-track { height: 6px; }
.pc-buffer {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: rgba(255, 255, 255, .34);
}
.pc-played {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: #8fd0ae;
}
#seek {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 16px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
}
#seek::-webkit-slider-runnable-track { height: 4px; background: transparent; }
#seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  margin-top: -4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}
#seek::-moz-range-track { height: 4px; background: transparent; }
#seek::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; }
.pc-row { display: flex; align-items: center; gap: 4px; margin-top: 2px; }
.pc-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #eef5f0;
  border-radius: 8px;
}
.pc-btn:hover { background: rgba(255, 255, 255, .13); }
.pc-btn svg { width: 18px; height: 18px; }
.pc-skip {
  height: 30px;
  padding: 0 7px;
  border-radius: 7px;
  font-size: 10px;
  font-weight: 600;
  color: #d8e5dc;
  letter-spacing: .02em;
}
.pc-skip:hover { background: rgba(255, 255, 255, .13); color: #fff; }
.pc-time {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 5px;
  font-size: 10.5px;
  color: #d8e5dc;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pc-sep { color: rgba(216, 229, 220, .45); }
.pc-right { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.pc-volume { width: 58px; height: 3px; accent-color: #8fd0ae; cursor: pointer; }
.pc-textbtn {
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  color: #eef5f0;
}
.pc-textbtn:hover { background: rgba(255, 255, 255, .13); }
.pc-speed-wrap { position: relative; }
.pc-speed-menu {
  position: absolute;
  right: 0;
  bottom: 36px;
  z-index: 8;
  min-width: 86px;
  padding: 5px;
  background: rgba(17, 30, 24, .97);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .4);
}
.pc-speed-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 9px;
  border-radius: 6px;
  font-size: 11px;
  color: #d8e5dc;
}
.pc-speed-menu button:hover,
.pc-speed-menu button.active { background: rgba(143, 208, 174, .16); color: #fff; }

.player-shell.ui-hidden { cursor: none; }
.player-shell.ui-hidden .pc-top,
.player-shell.ui-hidden .pc-bottom { opacity: 0; pointer-events: none; }
.player-shell.ui-hidden .player-bigplay { opacity: 0; pointer-events: none; }
.player-shell.is-loading .player-bigplay { opacity: 0; pointer-events: none; }

.player-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  border-radius: 0;
  background: #000;
}
.player-shell:fullscreen .pc-bottom { padding: 70px 28px 24px; }
.player-shell:fullscreen .pc-top { padding: 22px 28px 44px; }

.lecture-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding: 24px 4px 20px;
}
.lecture-head h1 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  margin: 8px 0 6px;
  line-height: 1.3;
}
.lecture-lead { margin: 0; color: var(--muted); font-size: 13px; }
.lecture-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: all .15s ease;
}
.btn:hover { border-color: var(--green); color: var(--green); }
.btn svg { width: 16px; height: 16px; }
.btn.active { background: var(--green-soft); border-color: #cddfd2; color: var(--green-dark); }
.btn.icon-only { width: 38px; padding: 0; justify-content: center; }

/* note panel */
.note-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 24px 18px;
  box-shadow: var(--shadow-sm);
}
.note-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.note-head h2 {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  margin: 0;
}
.note-head span { font-size: 10.5px; color: var(--muted); letter-spacing: .05em; }
.note-panel textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfbf7;
  padding: 13px 15px;
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.9;
  outline: 0;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.note-panel textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 107, 82, .10);
}
.note-panel textarea::placeholder { color: #a9b3ad; }

.related-section { margin-top: 46px; }

/* ---------------- empty / error ---------------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 72px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed #dcd5c6;
  border-radius: 20px;
}
.empty-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}
.empty-icon svg { width: 28px; height: 28px; }
.empty h2 { font-family: var(--serif); font-size: 20px; color: var(--ink); margin: 0; font-weight: 600; }
.empty p { margin: 0; font-size: 13px; max-width: 420px; }

.error-box {
  max-width: 560px;
  margin: 32px auto;
  padding: 32px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.error-box h2 { font-family: var(--serif); font-size: 20px; margin: 0 0 8px; font-weight: 600; }
.error-box p { color: var(--muted); font-size: 13px; word-break: break-word; }

/* ---------------- skeleton ---------------- */

.skel {
  position: relative;
  overflow: hidden;
  background: #e9e5da;
  border-radius: 10px;
}
.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.skel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.skel-thumb { aspect-ratio: 16 / 9; border-radius: 0; }
.skel-body { padding: 14px 16px 16px; display: flex; align-items: center; justify-content: space-between; }
.skel-line { height: 12px; width: 42%; border-radius: 6px; }
.skel-line.short { width: 22%; }

.sentinel { height: 1px; }

/* ---------------- footer ---------------- */

.site-footer {
  background: #1f352c;
  color: #e9e4d6;
  padding: 38px 0 40px;
  margin-top: auto;
}
.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.footer-brand strong {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: .05em;
  font-weight: 600;
}
.footer-brand p {
  margin: 8px 0 0;
  max-width: 420px;
  font-size: 11.5px;
  line-height: 1.9;
  color: rgba(233, 228, 214, .62);
}
.footer-links { display: flex; gap: 22px; flex-wrap: wrap; }
.footer-links a {
  font-size: 11.5px;
  color: rgba(233, 228, 214, .78);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.footer-links a:hover { color: #fff; border-color: rgba(255, 255, 255, .5); }

/* ---------------- toasts ---------------- */

.toasts {
  position: fixed;
  left: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 300;
  pointer-events: none;
}
.toast {
  background: var(--green-dark);
  color: var(--paper);
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 10px 28px rgba(20, 40, 32, .28);
  animation: toast-in .18s ease;
  max-width: 360px;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------------- bottom bar ---------------- */

.bottombar { display: none; }

/* ---------------- responsive ---------------- */

@media (max-width: 1020px) {
  .main-nav { gap: 18px; }
  .hero { padding: 42px 40px; gap: 30px; }
  .hero h1 { font-size: 34px; }
  .hero h1 .hero-sub { font-size: 21px; }
  .lesson-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 880px) {
  .main-nav { display: none; }
  .search-wrap { max-width: 340px; }
  .hero { grid-template-columns: 1fr; }
  .hero-visual { display: none; }
  .hero h1 { font-size: 33px; }
}

@media (max-width: 660px) {
  :root { --header-h: 62px; }
  .shell { padding: 0 16px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 11px; }
  .brand-mark svg { width: 20px; height: 20px; }
  .brand-text strong { font-size: 16.5px; }
  .brand-text small { font-size: 9px; }
  .topbar-inner { gap: 12px; }
  .search-wrap { max-width: none; }
  .searchbox { height: 38px; }
  .course-bar-inner { height: 36px; gap: 8px; font-size: 10.5px; }
  .course-label { display: none; }
  .view { padding: 22px 16px 92px; }
  .hero { padding: 28px 22px; border-radius: 20px; }
  .hero h1 { font-size: 27px; }
  .hero h1 .hero-sub { font-size: 18px; }
  .hero-lead { font-size: 13px; line-height: 1.9; }
  .hero-actions { margin-top: 22px; }
  .btn-primary, .btn-ghost { height: 44px; font-size: 12.5px; }
  .hero-meta { gap: 12px; flex-wrap: wrap; font-size: 10.5px; }
  .section-head { margin: 32px 0 16px; }
  .section-head h2 { font-size: 21px; }
  .lesson-grid { grid-template-columns: 1fr; gap: 18px; }
  .page-head h1 { font-size: 26px; }
  .lesson-body { padding: 12px 14px 14px; }
  .watch-page { max-width: none; }
  .player-card { padding: 6px; border-radius: 16px; }
  .player-shell { border-radius: 11px; }
  .pc-top { padding: 10px 12px 26px; }
  .pc-bottom { padding: 34px 8px 6px; }
  .pc-skip { display: none; }
  .pc-volume { display: none; }
  .pc-time { font-size: 9.5px; margin-left: 2px; }
  .pc-btn { width: 30px; height: 30px; }
  .pc-btn svg { width: 16px; height: 16px; }
  .curtain-title { font-size: 24px; }
  .curtain-watermark { font-size: 150px; }
  .curtain-play { height: 44px; font-size: 12px; }
  .curtain-note { font-size: 9.5px; }
  .player-bigplay { width: 58px; height: 58px; }
  .player-bigplay svg { width: 22px; height: 22px; }
  .lecture-head { padding: 18px 2px 16px; }
  .lecture-head h1 { font-size: 23px; }
  .lecture-actions { width: 100%; }
  .btn { height: 36px; font-size: 11.5px; padding: 0 12px; }
  .note-panel { padding: 18px 16px 14px; }
  .note-panel textarea { min-height: 110px; }
  .footer-inner { flex-direction: column; gap: 22px; }
  .site-footer { padding: 30px 0 88px; }
  .toasts { left: 14px; right: 14px; bottom: 74px; }
  .bottombar {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 58px;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    z-index: 120;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottombar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--muted);
    font-size: 9.5px;
    letter-spacing: .04em;
  }
  .bottombar a svg { width: 20px; height: 20px; }
  .bottombar a.active { color: var(--green); }
  .suggestions { top: 46px; }
}

@media (max-width: 420px) {
  .searchbox input { font-size: 12px; }
  .hero h1 { font-size: 24px; }
  .hero h1 .hero-sub { font-size: 16.5px; }
}

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

/* ---------------- simplified layout ---------------- */

[hidden] { display: none !important; }

:root { --header-h: 64px; }

body {
  background: var(--paper);
}

.topbar-inner { gap: 28px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; }
.brand-mark svg { width: 21px; height: 21px; }
.brand-text strong { font-size: 18px; }
.brand-text small { display: none; }

.course-bar {
  background: transparent;
}
.course-bar-inner {
  height: 34px;
  font-size: 11.5px;
  color: var(--muted);
}
.course-dot { width: 5px; height: 5px; }
.course-bar strong { font-weight: 500; }

.view { padding: 28px 24px 64px; }

.page-head { margin: 0 0 22px; }
.page-head h1 {
  font-size: 27px;
  margin: 0 0 4px;
  line-height: 1.35;
}
.page-head p { font-size: 13px; }
.page-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.chips {
  gap: 4px;
  padding: 0 0 14px;
}
.chip {
  padding: 6px 11px;
  border: 0;
  background: transparent;
  font-size: 12px;
}
.chip:hover { background: var(--paper-2); color: var(--ink); }
.chip.active { background: var(--green-soft); color: var(--green-dark); }

.lesson-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
}
.lesson-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border-radius: 12px;
  box-shadow: none;
}
.lesson-card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--green);
}
.lesson-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.lesson-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .01em;
}
.lesson-meta {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lesson-play {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  display: grid;
  place-items: center;
  flex: none;
  transition: background .15s ease, color .15s ease;
}
.lesson-play svg { width: 13px; height: 13px; margin-left: 2px; }
.lesson-card:hover .lesson-play { background: var(--green); color: #fff; }

.skel-card {
  height: 63px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 13px 14px;
  border-radius: 12px;
}
.skel-line { height: 9px; width: 34%; }
.skel-line.short { width: 22%; }

.watch-page { max-width: 880px; }
.player-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.player-shell { border-radius: 12px; }
.player-curtain {
  background: #14211b;
  gap: 12px;
}
.player-curtain::before { display: none; }
.curtain-title { font-size: 25px; }
.curtain-play { height: 44px; padding: 0 20px; }
.player-overlay { justify-content: flex-end; }

.lecture-head {
  align-items: center;
  padding: 16px 2px 14px;
}
.lecture-title { min-width: 0; }
.lecture-title h1 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}
.lecture-meta {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}
.lecture-actions { gap: 6px; }
.lecture-actions .btn { height: 34px; font-size: 11.5px; }

.note-panel {
  padding: 16px 18px 14px;
  border-radius: 12px;
  box-shadow: none;
}
.note-head { margin-bottom: 8px; }
.note-head h2 {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
}
.note-head span { font-size: 10px; }
.note-panel textarea {
  min-height: 96px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
}

.related-section { margin-top: 32px; }
.related-head { margin-bottom: 12px; }
.related-head h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.empty { padding: 56px 20px; border-radius: 12px; }

.site-footer {
  margin-top: auto;
  padding: 22px 0 28px;
  background: transparent;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.footer-inner {
  align-items: center;
  gap: 18px;
}
.footer-inner > strong {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink-2);
}
.footer-links { gap: 18px; }
.footer-links a {
  font-size: 11.5px;
  color: var(--muted);
}
.footer-links a:hover {
  color: var(--green);
  border-color: transparent;
}

@media (max-width: 660px) {
  :root { --header-h: 60px; }
  .view { padding: 20px 16px 88px; }
  .page-head { margin-bottom: 18px; }
  .page-head h1 { font-size: 23px; }
  .page-head p { font-size: 12.5px; }
  .page-head-row { align-items: flex-start; gap: 12px; }
  .lesson-grid { grid-template-columns: 1fr; gap: 7px; }
  .lesson-card { padding: 12px; }
  .player-card { padding: 0; }
  .lecture-head { padding: 14px 0 12px; }
  .lecture-title h1 { font-size: 21px; }
  .lecture-actions { width: 100%; }
  .note-panel { padding: 14px; }
  .related-section { margin-top: 28px; }
  .site-footer { padding: 20px 0 84px; }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .footer-links { gap: 14px; }
  .course-bar-inner { height: 32px; font-size: 10.5px; }
  .curtain-title { font-size: 22px; }
}
