:root {
  --ink: #173330;
  --ink-soft: #526865;
  --green: #1f514b;
  --green-deep: #123c38;
  --mint: #dce9e4;
  --cream: #f6f3eb;
  --paper: #fffdfa;
  --line: #dedfd7;
  --coral: #e56f52;
  --coral-dark: #c9553c;
  --gold: #d4a84f;
  --shadow: 0 18px 55px rgba(26, 55, 51, 0.09);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-serif: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { color: inherit; }

:focus-visible {
  outline: 3px solid rgba(229, 111, 82, 0.35);
  outline-offset: 3px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-on-dark { color: #fff; }

.brand-mark {
  position: relative;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 46% 54%;
  background: var(--coral);
  transform: rotate(-7deg);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  content: "";
  position: absolute;
  bottom: 6px;
  width: 3px;
  background: currentColor;
  border-radius: 3px 3px 0 0;
  color: #fff;
  transform-origin: bottom;
}

.brand-mark::before { height: 14px; transform: rotate(-28deg); left: 10px; }
.brand-mark::after { height: 16px; transform: rotate(26deg); right: 9px; }
.brand-mark span { height: 18px; left: 14px; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--coral-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow-light { color: #efb09d; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 22px;
  cursor: pointer;
  font-weight: 760;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:disabled { cursor: wait; opacity: 0.65; transform: none; }
.button-primary { color: #fff; background: var(--coral); box-shadow: 0 11px 25px rgba(213, 86, 57, 0.24); }
.button-primary:hover { background: var(--coral-dark); }
.button-secondary { min-height: 40px; color: #fff; background: var(--green); padding: 0 18px; }
.button-full { width: 100%; justify-content: space-between; }

/* Login */

.login-body {
  min-height: 100vh;
  background: var(--paper);
}

.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(430px, 0.92fr);
}

.login-story {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  overflow: hidden;
  padding: 46px clamp(36px, 6vw, 92px) 52px;
  color: #fff;
  background:
    radial-gradient(circle at 82% 22%, rgba(231, 136, 101, 0.3), transparent 22%),
    radial-gradient(circle at 15% 85%, rgba(103, 166, 148, 0.25), transparent 26%),
    linear-gradient(145deg, #163f3b, #0d2e2c 68%, #143735);
}

.login-story::before {
  content: "";
  position: absolute;
  width: min(43vw, 620px);
  height: min(43vw, 620px);
  top: 18%;
  right: -23%;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(255,255,255,0.02), 0 0 0 140px rgba(255,255,255,0.015);
}

.login-story::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 300px;
  left: -78px;
  top: 37%;
  border-radius: 50%;
  border: 35px solid rgba(229, 111, 82, 0.18);
  transform: rotate(24deg);
}

.login-story > * { position: relative; z-index: 1; }

.login-story-copy { max-width: 720px; margin: auto 0; padding: 90px 0; }
.login-story-copy h1 {
  margin: 0 0 28px;
  max-width: 720px;
  font-family: var(--font-serif);
  font-size: clamp(2.9rem, 5.2vw, 5.5rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.045em;
}
.login-story-copy > p:last-child { max-width: 620px; margin: 0; color: rgba(255,255,255,0.72); font-size: 1.04rem; line-height: 1.9; }

.login-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  border-top: 1px solid rgba(255,255,255,0.14);
  padding-top: 26px;
}
.login-features div { display: grid; grid-template-columns: auto 1fr; column-gap: 13px; align-items: center; }
.login-features span { grid-row: 1 / 3; color: #ef9b82; font-family: var(--font-serif); font-size: 1.25rem; }
.login-features strong { color: #fff; font-size: 0.9rem; }
.login-features small { color: rgba(255,255,255,0.52); font-size: 0.72rem; }

.login-panel {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 50px clamp(28px, 6vw, 92px);
  background:
    linear-gradient(rgba(27, 63, 59, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 63, 59, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}

.login-card { width: min(100%, 460px); padding: 34px 0; }
.login-card h2 { margin: 0; font-family: var(--font-serif); font-size: clamp(2rem, 4vw, 3rem); line-height: 1.2; }
.login-intro { margin: 14px 0 34px; color: var(--ink-soft); }
.login-card label { display: block; margin: 19px 0 8px; font-size: 0.86rem; font-weight: 750; }
.input-shell {
  display: flex;
  align-items: center;
  min-height: 56px;
  border: 1px solid #d7dbd5;
  border-radius: 14px;
  background: rgba(255,255,255,0.88);
  transition: border 160ms ease, box-shadow 160ms ease;
}
.input-shell:focus-within { border-color: var(--green); box-shadow: 0 0 0 4px rgba(31, 81, 75, 0.09); }
.input-shell > span { width: 49px; color: #91a09d; font-size: 0.77rem; text-align: center; }
.input-shell input { min-width: 0; flex: 1; height: 54px; border: 0; outline: 0; background: transparent; color: var(--ink); }
.password-toggle { margin-right: 10px; border: 0; background: transparent; color: var(--green); cursor: pointer; font-size: 0.8rem; font-weight: 760; }
.form-error { min-height: 25px; margin: 9px 0 4px; color: #b33f32; font-size: 0.82rem; }
.demo-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 24px;
  padding: 15px 17px;
  border-radius: 14px;
  background: var(--mint);
}
.demo-account[hidden] { display: none; }
.demo-account div { display: flex; flex-direction: column; }
.demo-account strong { font-size: 0.78rem; }
.demo-account span { color: var(--ink-soft); font-size: 0.76rem; }
.demo-account button { border: 0; background: transparent; color: var(--green); cursor: pointer; font-size: 0.78rem; font-weight: 800; white-space: nowrap; }
.security-note { display: flex; justify-content: center; gap: 7px; margin: 20px 0 0; color: #81908d; font-size: 0.73rem; }

/* Shared header */

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  min-height: 76px;
  padding: 0 clamp(22px, 4vw, 68px);
  border-bottom: 1px solid rgba(31, 70, 65, 0.1);
  background: rgba(250, 248, 242, 0.93);
  backdrop-filter: blur(18px);
}

.header-nav { display: flex; align-items: center; gap: 8px; margin-left: clamp(34px, 6vw, 90px); color: #80908d; font-size: 0.83rem; overflow: hidden; white-space: nowrap; }
.header-nav a { position: relative; padding: 26px 4px 24px; color: var(--ink-soft); text-decoration: none; font-weight: 720; }
.header-nav a.active::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--coral); }
.header-nav span:last-child { overflow: hidden; text-overflow: ellipsis; }
.user-area { display: flex; align-items: center; gap: 10px; }
.user-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: #fff; background: var(--green); font-family: var(--font-serif); font-size: 0.86rem; }
.user-copy { display: flex; min-width: 76px; flex-direction: column; line-height: 1.2; }
.user-copy strong { font-size: 0.8rem; }
.user-copy small { margin-top: 3px; color: #889592; font-size: 0.67rem; }
.ghost-button { margin-left: 6px; border: 0; border-left: 1px solid var(--line); padding: 5px 0 5px 17px; color: var(--ink-soft); background: transparent; cursor: pointer; font-size: 0.76rem; }

/* Catalog */

.catalog-main { min-height: calc(100vh - 76px); }
.catalog-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 40px;
  padding: clamp(56px, 8vw, 110px) clamp(24px, 6vw, 92px) clamp(52px, 7vw, 88px);
  color: #fff;
  background:
    radial-gradient(circle at 88% 22%, rgba(229,111,82,0.28), transparent 22%),
    linear-gradient(135deg, #123c38, #1d4d47 58%, #173d3a);
}
.catalog-hero h1 { margin: 0; font-family: var(--font-serif); font-size: clamp(2.5rem, 5vw, 5rem); line-height: 1.08; letter-spacing: -0.05em; }
.catalog-hero > div > p:last-child { margin: 20px 0 0; color: rgba(255,255,255,0.68); }
.summary-cards { display: grid; grid-template-columns: repeat(4, minmax(80px, 120px)); border: 1px solid rgba(255,255,255,0.14); border-radius: 18px; background: rgba(255,255,255,0.06); backdrop-filter: blur(12px); }
.summary-cards div { display: flex; min-height: 96px; flex-direction: column; align-items: center; justify-content: center; border-left: 1px solid rgba(255,255,255,0.12); }
.summary-cards div:first-child { border-left: 0; }
.summary-cards strong { font-family: var(--font-serif); font-size: 1.9rem; line-height: 1.1; }
.summary-cards span { color: rgba(255,255,255,0.58); font-size: 0.68rem; }

.archive-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  max-width: 1320px;
  margin: 28px auto 0;
  padding: 18px 24px;
  border: 1px solid rgba(29, 74, 68, 0.14);
  border-radius: 16px;
  background: #f3f0e8;
  color: #4b5f5b;
}
.archive-notice strong { color: var(--green-deep); font-size: 0.78rem; white-space: nowrap; }
.archive-notice p { margin: 0; font-size: 0.76rem; line-height: 1.75; }

.course-library { max-width: 1500px; margin: 0 auto; padding: clamp(50px, 7vw, 90px) clamp(24px, 5vw, 80px) 100px; }
.library-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.library-heading h2 { margin: 0; font-family: var(--font-serif); font-size: clamp(1.8rem, 3.5vw, 3rem); line-height: 1.2; }
.search-field { display: flex; align-items: center; width: min(100%, 340px); height: 48px; border: 1px solid #d7dad4; border-radius: 999px; background: var(--paper); }
.search-field span { width: 46px; color: #738581; font-size: 1.2rem; text-align: center; }
.search-field input { flex: 1; min-width: 0; height: 46px; padding: 0 18px 0 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.filter-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 34px; }
.filter-button { min-height: 36px; padding: 0 17px; border: 1px solid #d8ddd8; border-radius: 999px; background: transparent; cursor: pointer; color: var(--ink-soft); font-size: 0.77rem; font-weight: 680; }
.filter-button.active { border-color: var(--green); color: #fff; background: var(--green); }
.result-count { min-height: 25px; margin: 20px 0 15px; color: #80908d; font-size: 0.76rem; }

.course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 25px; }
.course-card { display: flex; min-width: 0; flex-direction: column; overflow: hidden; border: 1px solid rgba(29, 74, 68, 0.1); border-radius: var(--radius-md); background: var(--paper); box-shadow: 0 4px 24px rgba(28, 57, 53, 0.035); transition: transform 180ms ease, box-shadow 180ms ease, border 180ms ease; }
.course-card:hover { transform: translateY(-4px); border-color: rgba(29, 74, 68, 0.2); box-shadow: var(--shadow); }
.course-card-cover { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; color: #fff; background: linear-gradient(140deg, #174641, #2d6a60); text-decoration: none; }
.course-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 350ms ease; }
.course-card:hover .course-card-cover img { transform: scale(1.025); }
.course-card-cover.no-image::before { content: ""; position: absolute; width: 230px; height: 230px; right: -74px; top: -90px; border-radius: 50%; border: 34px solid rgba(255,255,255,0.08); }
.course-card-cover.no-image::after { content: ""; position: absolute; width: 150px; height: 150px; left: -50px; bottom: -80px; border-radius: 50%; background: rgba(229,111,82,0.2); }
.course-card-cover .cover-code { position: absolute; z-index: 2; left: 20px; top: 17px; padding: 5px 10px; border: 1px solid rgba(255,255,255,0.3); border-radius: 999px; background: rgba(10, 35, 32, 0.42); backdrop-filter: blur(7px); font-size: 0.68rem; font-weight: 750; }
.course-card-cover .cover-symbol { position: absolute; z-index: 1; left: 24px; bottom: 23px; font-family: var(--font-serif); font-size: clamp(1.5rem, 2.4vw, 2.35rem); letter-spacing: 0.06em; }
.cover-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 42%, rgba(10,31,29,0.62)); }
.play-pill { position: absolute; z-index: 2; right: 17px; bottom: 17px; display: flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px; background: rgba(255,255,255,0.92); color: var(--green-deep); font-size: 0.68rem; font-weight: 800; }
.course-card-content { display: flex; flex: 1; flex-direction: column; padding: 20px 20px 18px; }
.course-meta { display: flex; align-items: center; gap: 8px; color: #7c8c89; font-size: 0.68rem; }
.course-meta span + span::before { content: "·"; margin-right: 8px; }
.course-card h3 { margin: 11px 0 8px; font-family: var(--font-serif); font-size: 1.2rem; line-height: 1.42; }
.course-card h3 a { text-decoration: none; }
.course-card p { display: -webkit-box; margin: 0; overflow: hidden; color: var(--ink-soft); font-size: 0.78rem; line-height: 1.75; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.course-card-footer { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 14px; margin-top: auto; padding-top: 22px; }
.card-progress-label { display: flex; justify-content: space-between; margin-bottom: 7px; color: #768783; font-size: 0.66rem; }
.card-progress-track { height: 4px; overflow: hidden; border-radius: 4px; background: #e3e6df; }
.card-progress-fill { display: block; height: 100%; border-radius: inherit; background: var(--coral); }
.notes-ready { padding: 4px 8px; border-radius: 999px; color: #2c675d; background: #e4eee9; font-size: 0.62rem; font-weight: 750; white-space: nowrap; }
.notes-drafting { color: #8d806b; background: #f1eadc; }
.empty-state { padding: 90px 20px; text-align: center; color: var(--ink-soft); }
.empty-state > span { display: inline-grid; place-items: center; width: 70px; height: 70px; border-radius: 50%; background: var(--mint); color: var(--green); font-size: 2rem; }
.empty-state h3 { margin: 18px 0 4px; color: var(--ink); font-family: var(--font-serif); font-size: 1.4rem; }
.empty-state p { margin: 0; font-size: 0.84rem; }
.site-footer { display: flex; justify-content: space-between; gap: 20px; padding: 27px clamp(24px, 5vw, 80px); border-top: 1px solid var(--line); color: #80908d; font-size: 0.7rem; }

/* Course page */

.course-main { max-width: 1540px; margin: 0 auto; padding: 38px clamp(22px, 4vw, 64px) 100px; }
.back-link { display: inline-block; margin-bottom: 24px; color: var(--ink-soft); text-decoration: none; font-size: 0.77rem; font-weight: 680; }
.course-heading { padding-bottom: 34px; }
.course-heading-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 40px; }
.course-kicker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.course-kicker span { padding: 5px 10px; border-radius: 999px; color: var(--green); background: #e1ebe7; font-size: 0.66rem; font-weight: 760; }
.course-kicker span:first-child { color: #a44b37; background: #f4dfd8; }
.course-heading h1 { max-width: 1020px; margin: 0; font-family: var(--font-serif); font-size: clamp(2rem, 4vw, 4rem); line-height: 1.18; letter-spacing: -0.035em; }
.course-heading p { max-width: 920px; margin: 17px 0 0; color: var(--ink-soft); font-size: 0.92rem; line-height: 1.85; }
.heading-progress { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 100px; }
.heading-progress > span { color: #758682; font-size: 0.69rem; }
.progress-ring { --progress: 0deg; display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: conic-gradient(var(--coral) var(--progress), #e0e4de 0); }
.progress-ring::before { content: ""; grid-area: 1 / 1; width: 60px; height: 60px; border-radius: 50%; background: var(--cream); }
.progress-ring strong { z-index: 1; grid-area: 1 / 1; font-family: var(--font-serif); font-size: 1rem; }

.learning-grid { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(300px, 0.85fr); gap: 24px; align-items: stretch; }
.player-column { min-width: 0; }
.video-shell { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 20px; background: #0d1817; box-shadow: 0 22px 45px rgba(12, 35, 32, 0.18); }
.video-shell video { display: block; width: 100%; height: 100%; background: #0a0e0e; }
.video-unavailable { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; padding: 30px; color: rgba(255,255,255,0.72); text-align: center; }
.video-unavailable[hidden] { display: none; }
.video-unavailable > span { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 18px; border: 1px solid rgba(255,255,255,0.25); border-radius: 50%; color: var(--coral); font-size: 1.3rem; }
.video-unavailable strong { color: #fff; font-size: 1rem; }
.video-unavailable p { margin: 5px 0 0; font-size: 0.76rem; }

.chapter-timeline { margin-top: 15px; padding: 15px 18px 14px; border: 1px solid #d9ddd7; border-radius: 15px; background: var(--paper); }
.timeline-meta { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 12px; color: var(--ink-soft); font-size: 0.68rem; }
.timeline-meta strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.timeline-track { position: relative; height: 16px; cursor: pointer; touch-action: none; }
.timeline-track::before { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 4px; border-radius: 4px; background: #dfe4de; }
.timeline-progress { position: absolute; z-index: 1; left: 0; top: 6px; width: 0; height: 4px; border-radius: 4px; background: var(--coral); pointer-events: none; }
.timeline-markers { position: absolute; inset: 0; }
.timeline-marker { position: absolute; z-index: 3; top: 2px; width: 12px; height: 12px; margin-left: -6px; border: 2px solid var(--paper); border-radius: 50%; padding: 0; background: var(--green); box-shadow: 0 0 0 1px rgba(20,61,57,0.25); cursor: pointer; transition: transform 150ms ease, background 150ms ease; }
.timeline-marker:hover, .timeline-marker.active { transform: scale(1.45); background: var(--coral); }
.timeline-hint { margin: 8px 0 0; color: #8a9794; font-size: 0.63rem; }
.timeline-hint span { color: var(--green); font-size: 0.55rem; }

.chapter-panel { display: flex; min-height: 100%; max-height: min(720px, calc(100vh - 150px)); flex-direction: column; overflow: hidden; border: 1px solid #d9ddd7; border-radius: 20px; background: var(--paper); }
.panel-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; padding: 22px 22px 18px; border-bottom: 1px solid #e4e5df; }
.panel-heading h2, .section-heading h2 { margin: 0; font-family: var(--font-serif); font-size: 1.35rem; line-height: 1.2; }
.panel-heading > span { color: #7b8b87; font-size: 0.7rem; }
.chapter-list { margin: 0; padding: 6px 0 10px; overflow: auto; list-style: none; counter-reset: chapter; }
.chapter-list li { counter-increment: chapter; }
.chapter-button { display: grid; width: 100%; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: start; gap: 10px; padding: 14px 18px; border: 0; border-left: 3px solid transparent; background: transparent; text-align: left; cursor: pointer; transition: background 150ms ease, border 150ms ease; }
.chapter-button:hover { background: #f1f5f2; }
.chapter-button.active { border-left-color: var(--coral); background: #eef4f1; }
.chapter-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--green); background: #e1ece7; font-size: 0.7rem; font-weight: 800; }
.chapter-button.active .chapter-number { color: #fff; background: var(--coral); }
.chapter-copy { min-width: 0; }
.chapter-copy strong { display: block; font-size: 0.78rem; line-height: 1.45; }
.chapter-copy small { display: -webkit-box; margin-top: 3px; overflow: hidden; color: #778783; font-size: 0.65rem; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.chapter-time { color: #84928f; font-size: 0.65rem; font-variant-numeric: tabular-nums; }

.content-grid { display: grid; grid-template-columns: minmax(0, 2.15fr) minmax(300px, 0.85fr); gap: 24px; align-items: start; margin-top: 30px; }
.learning-notes, .personal-note-card { border: 1px solid #d9ddd7; border-radius: 20px; background: var(--paper); }
.learning-notes { min-width: 0; padding: clamp(25px, 4vw, 52px); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 32px; padding-bottom: 22px; border-bottom: 1px solid #e3e4de; }
.status-badge { padding: 5px 10px; border-radius: 999px; color: var(--green); background: #e3eee9; font-size: 0.67rem; font-weight: 760; white-space: nowrap; }
.status-badge.drafting { color: #876d45; background: #f3ebda; }
.notes-article { max-width: 860px; margin: 0 auto; color: #2c403e; font-family: var(--font-serif); font-size: 1rem; line-height: 1.98; }
.notes-article > p:first-child { margin-top: 0; color: var(--ink); font-size: clamp(1.65rem, 3vw, 2.5rem); line-height: 1.35; }
.notes-article p { margin: 1.15em 0; }
.notes-article strong { color: var(--ink); }
.notes-article img { display: block; width: 100%; height: auto; max-height: 620px; margin: 30px auto 10px; border-radius: 13px; object-fit: contain; background: #eef0eb; box-shadow: 0 12px 35px rgba(18,55,51,0.09); cursor: zoom-in; }
.notes-article ul, .notes-article ol { padding-left: 1.5em; }
.notes-article blockquote { margin: 24px 0; border-left: 4px solid var(--coral); padding: 10px 20px; color: var(--ink-soft); background: #f8f2eb; }
.notes-placeholder { display: grid; place-items: center; min-height: 420px; padding: 45px; text-align: center; }
.notes-placeholder > span { display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; color: #fff; background: var(--green); font-family: var(--font-serif); font-size: 1.5rem; }
.notes-placeholder h3 { margin: 20px 0 5px; font-family: var(--font-serif); font-size: 1.35rem; }
.notes-placeholder p { max-width: 480px; margin: 0; color: var(--ink-soft); font-size: 0.8rem; }

.personal-note-card { position: sticky; top: 100px; padding: 24px; }
.section-heading.small { margin-bottom: 17px; padding-bottom: 17px; }
.section-heading.small h2 { font-size: 1.22rem; }
.save-status { color: #748681; font-size: 0.65rem; }
.personal-note-card > p { margin: 0 0 16px; color: var(--ink-soft); font-size: 0.74rem; }
.personal-note-card textarea { width: 100%; min-height: 240px; resize: vertical; border: 1px solid #d5dad4; border-radius: 13px; padding: 14px; outline: 0; background: #fbfaf6; color: var(--ink); font-size: 0.8rem; line-height: 1.75; }
.personal-note-card textarea:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(31,81,75,0.08); }
.note-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.note-footer > span { color: #8a9693; font-size: 0.65rem; }
.note-prompt { margin-top: 24px; border-radius: 14px; padding: 16px 17px; background: #eef3ef; }
.note-prompt strong { font-size: 0.73rem; }
.note-prompt ul { margin: 8px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: 0.7rem; }

.toast { position: fixed; z-index: 60; left: 50%; bottom: 25px; transform: translate(-50%, 20px); padding: 10px 17px; border-radius: 999px; color: #fff; background: rgba(18,49,46,0.93); box-shadow: 0 10px 30px rgba(10,31,29,0.2); font-size: 0.75rem; opacity: 0; pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.image-lightbox { width: min(92vw, 1180px); max-height: 90vh; border: 0; border-radius: 18px; padding: 18px; color: #fff; background: #12211f; box-shadow: 0 30px 80px rgba(0,0,0,0.4); }
.image-lightbox::backdrop { background: rgba(5,15,14,0.78); backdrop-filter: blur(5px); }
.image-lightbox img { display: block; max-width: 100%; max-height: calc(90vh - 80px); margin: 0 auto; object-fit: contain; }
.image-lightbox button { position: absolute; top: 8px; right: 10px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; color: #fff; background: rgba(0,0,0,0.56); cursor: pointer; font-size: 1.5rem; }
.image-lightbox p { margin: 9px 10px 0; color: rgba(255,255,255,0.7); font-size: 0.72rem; text-align: center; }

@media (max-width: 1120px) {
  .login-layout { grid-template-columns: 1fr 440px; }
  .login-story { padding-left: 45px; padding-right: 45px; }
  .login-features small { display: none; }
  .catalog-hero { grid-template-columns: 1fr; align-items: start; }
  .summary-cards { width: min(100%, 520px); }
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .learning-grid, .content-grid { grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr); }
  .user-copy { display: none; }
}

@media (max-width: 840px) {
  .login-layout { display: block; }
  .login-story { min-height: auto; padding: 35px 28px 44px; }
  .login-story-copy { padding: 80px 0 70px; }
  .login-story-copy h1 { font-size: clamp(2.5rem, 10vw, 4.3rem); }
  .login-features { gap: 12px; }
  .login-features div { grid-template-columns: auto 1fr; }
  .login-panel { min-height: auto; padding: 55px 28px 75px; }
  .site-header { grid-template-columns: auto 1fr auto; min-height: 68px; padding: 0 20px; }
  .header-nav { justify-content: center; margin-left: 12px; }
  .header-nav a { padding: 22px 4px 20px; }
  .user-avatar { width: 32px; height: 32px; }
  .ghost-button { padding-left: 10px; }
  .catalog-hero { padding-top: 65px; }
  .learning-grid, .content-grid { grid-template-columns: 1fr; }
  .chapter-panel { max-height: none; }
  .personal-note-card { position: static; }
  .course-heading-row { grid-template-columns: 1fr; }
  .heading-progress { flex-direction: row; justify-content: flex-start; }
  .progress-ring { width: 62px; height: 62px; }
  .progress-ring::before { width: 49px; height: 49px; }
}

@media (max-width: 600px) {
  .login-story-copy { padding: 68px 0 56px; }
  .login-features { grid-template-columns: 1fr; }
  .login-features div { min-height: 40px; }
  .site-header .brand > span:last-child { display: none; }
  .header-nav { justify-content: flex-start; overflow: hidden; }
  .compact-header .header-nav span { display: none; }
  .ghost-button { border-left: 0; padding-left: 4px; }
  .catalog-hero { padding: 55px 23px 48px; }
  .catalog-hero h1 { font-size: 2.65rem; }
  .summary-cards { grid-template-columns: repeat(2, 1fr); }
  .summary-cards div { min-height: 78px; }
  .summary-cards div:nth-child(3) { border-top: 1px solid rgba(255,255,255,0.12); border-left: 0; }
  .summary-cards div:nth-child(4) { border-top: 1px solid rgba(255,255,255,0.12); }
  .course-library { padding-left: 18px; padding-right: 18px; }
  .archive-notice { grid-template-columns: 1fr; gap: 7px; margin: 18px 18px 0; padding: 16px 17px; }
  .library-heading { align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .course-grid { grid-template-columns: 1fr; }
  .course-card h3 { font-size: 1.3rem; }
  .site-footer { flex-direction: column; }
  .course-main { padding: 25px 14px 70px; }
  .course-heading { padding-left: 7px; padding-right: 7px; }
  .course-heading h1 { font-size: 2.05rem; }
  .course-heading p { font-size: 0.82rem; }
  .video-shell { border-radius: 13px; }
  .chapter-timeline { padding-left: 13px; padding-right: 13px; }
  .timeline-hint { display: none; }
  .chapter-panel, .learning-notes, .personal-note-card { border-radius: 15px; }
  .learning-notes { padding: 24px 18px; }
  .section-heading { align-items: flex-start; }
  .notes-article { font-size: 0.95rem; line-height: 1.9; }
  .notes-article img { margin-top: 23px; border-radius: 9px; }
}

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

/* Public preview */

.header-login { min-height: 38px; padding: 0 17px; font-size: 0.72rem; text-decoration: none; }
.notes-nav-link { margin-left: 18px; }
.guest-card-footer { align-items: center; }
.guest-course-note { color: #738581; font-size: 0.66rem; line-height: 1.45; }
.preview-badge { position: absolute; z-index: 4; top: 14px; right: 14px; padding: 6px 11px; border: 1px solid rgba(255,255,255,0.22); border-radius: 999px; color: #fff; background: rgba(10,31,29,0.72); backdrop-filter: blur(8px); font-size: 0.68rem; font-weight: 800; }
.chapter-button.locked { cursor: not-allowed; opacity: 0.58; }
.chapter-button.locked:hover { background: transparent; }
.chapter-button.locked .chapter-number { color: #879490; background: #eceee9; }
.chapter-button.locked .chapter-time { color: #a45d4d; font-size: 0.6rem; font-weight: 760; white-space: nowrap; }
.guest-unlock { display: flex; align-items: center; justify-content: space-between; gap: 34px; margin-top: 30px; border: 1px solid rgba(29,74,68,0.12); border-radius: 20px; padding: clamp(25px, 4vw, 42px); background: var(--paper); box-shadow: 0 10px 35px rgba(18,55,51,0.06); }
.guest-unlock h2 { margin: 0; font-family: var(--font-serif); font-size: clamp(1.5rem, 3vw, 2.25rem); line-height: 1.25; }
.guest-unlock p:last-child { max-width: 820px; margin: 11px 0 0; color: var(--ink-soft); font-size: 0.82rem; }
.guest-unlock .button { flex: none; text-decoration: none; }

@media (max-width: 840px) {
  .guest-unlock { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 600px) {
  .header-login { min-height: 34px; padding: 0 13px; font-size: 0.68rem; }
  .notes-nav-link { display: none; }
  .guest-unlock { margin-top: 20px; border-radius: 15px; padding: 24px 20px; }
  .guest-unlock .button { width: 100%; }
  .guest-card-footer { grid-template-columns: minmax(0, 1fr) auto; }
}

/* My notes */

.my-notes-main { min-height: calc(100vh - 76px); }
.my-notes-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(30px, 6vw, 80px);
  padding: clamp(52px, 7vw, 94px) clamp(24px, 6vw, 92px) clamp(48px, 6vw, 72px);
  color: #fff;
  background:
    radial-gradient(circle at 84% 24%, rgba(229, 111, 82, 0.3), transparent 21%),
    radial-gradient(circle at 8% 110%, rgba(103, 166, 148, 0.24), transparent 31%),
    linear-gradient(135deg, #123c38, #1d4d47 62%, #173d3a);
}
.my-notes-hero h1 { max-width: 900px; margin: 0; font-family: var(--font-serif); font-size: clamp(2.35rem, 4.8vw, 4.8rem); line-height: 1.1; letter-spacing: -0.05em; }
.my-notes-hero > div > p:last-child { max-width: 760px; margin: 20px 0 0; color: rgba(255, 255, 255, 0.68); font-size: 0.92rem; }
.my-notes-summary { display: flex; min-width: 180px; min-height: 112px; flex-direction: column; align-items: center; justify-content: center; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 20px; background: rgba(255, 255, 255, 0.07); backdrop-filter: blur(12px); }
.my-notes-summary strong { font-family: var(--font-serif); font-size: 2.35rem; line-height: 1.1; }
.my-notes-summary span { margin-top: 7px; color: rgba(255, 255, 255, 0.62); font-size: 0.7rem; }

.my-notes-library { width: min(100%, 1180px); margin: 0 auto; padding: clamp(48px, 6vw, 80px) clamp(20px, 5vw, 64px) 100px; }
.my-notes-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.my-notes-heading h2 { margin: 0; font-family: var(--font-serif); font-size: clamp(1.8rem, 3.5vw, 3rem); line-height: 1.2; }
.my-notes-heading > p { margin: 0 0 5px; color: #7b8b87; font-size: 0.74rem; }
.my-notes-list { display: grid; gap: 18px; }
.my-notes-list[aria-busy="true"] { min-height: 260px; }

.my-note-card { overflow: hidden; border: 1px solid rgba(29, 74, 68, 0.12); border-radius: 20px; background: var(--paper); box-shadow: 0 5px 26px rgba(28, 57, 53, 0.04); }
.my-note-card-header { display: flex; align-items: start; justify-content: space-between; gap: 28px; padding: 25px 28px 20px; border-bottom: 1px solid #e6e6df; }
.my-note-heading-group { min-width: 0; }
.my-note-meta { display: flex; flex-wrap: wrap; gap: 8px; color: #738581; font-size: 0.67rem; }
.my-note-meta span + span::before { content: "·"; margin-right: 8px; }
.my-note-card h3 { margin: 8px 0 0; font-family: var(--font-serif); font-size: clamp(1.15rem, 2.3vw, 1.52rem); line-height: 1.42; }
.my-note-card h3 a { text-decoration: none; }
.my-note-card h3 a:hover { color: var(--coral-dark); }
.my-note-updated { flex: none; padding-top: 2px; color: #879491; font-size: 0.68rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.my-note-content { min-height: 70px; margin: 0; padding: 24px 28px 28px; color: #314744; font-family: var(--font-serif); font-size: 0.94rem; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.my-note-card-footer { display: grid; grid-template-columns: minmax(190px, 360px) auto; align-items: center; justify-content: space-between; gap: 30px; padding: 17px 28px 19px; background: #f4f5ef; }
.my-note-progress-copy { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 7px; color: #71817e; font-size: 0.66rem; }
.my-note-progress-copy strong { color: var(--ink); }
.my-note-progress-track { height: 5px; overflow: hidden; border-radius: 5px; background: #dfe4de; }
.my-note-progress-fill { display: block; height: 100%; border-radius: inherit; background: var(--coral); }
.my-note-continue { display: inline-flex; align-items: center; gap: 9px; color: var(--green); font-size: 0.76rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.my-note-continue span { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; background: var(--green); transition: transform 160ms ease, background 160ms ease; }
.my-note-continue:hover span { transform: translateX(2px); background: var(--coral); }

.my-notes-empty, .my-notes-error { padding: 76px 22px; border: 1px solid rgba(29, 74, 68, 0.1); border-radius: 20px; background: var(--paper); text-align: center; }
.my-notes-empty > span, .my-notes-error > span { display: inline-grid; place-items: center; width: 70px; height: 70px; border-radius: 50%; color: #fff; background: var(--green); font-family: var(--font-serif); font-size: 1.5rem; }
.my-notes-empty h3, .my-notes-error h3 { margin: 19px 0 5px; font-family: var(--font-serif); font-size: 1.4rem; }
.my-notes-empty p, .my-notes-error p { max-width: 520px; margin: 0 auto; color: var(--ink-soft); font-size: 0.8rem; }
.my-notes-empty .button { margin-top: 22px; text-decoration: none; }
.my-notes-error > span { background: var(--coral); }

@media (max-width: 840px) {
  .my-notes-hero { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .my-notes-summary { min-width: 0; width: min(100%, 210px); }
}

@media (max-width: 600px) {
  .my-notes-body .site-header { padding-left: 14px; padding-right: 14px; }
  .my-notes-body .header-nav { gap: 12px; margin-left: 15px; font-size: 0.74rem; }
  .my-notes-body .header-nav a { padding-left: 0; padding-right: 0; }
  .my-notes-body .user-avatar { display: none; }
  .my-notes-hero { padding: 51px 22px 45px; }
  .my-notes-hero h1 { font-size: 2.55rem; }
  .my-notes-summary { min-height: 96px; }
  .my-notes-library { padding: 44px 14px 70px; }
  .my-notes-heading { align-items: start; flex-direction: column; gap: 9px; padding: 0 7px; }
  .my-notes-heading > p { margin: 0; }
  .my-note-card { border-radius: 15px; }
  .my-note-card-header { align-items: start; flex-direction: column; gap: 10px; padding: 21px 20px 17px; }
  .my-note-updated { white-space: normal; }
  .my-note-content { padding: 20px; font-size: 0.91rem; line-height: 1.85; }
  .my-note-card-footer { grid-template-columns: 1fr; gap: 18px; padding: 17px 20px 19px; }
  .my-note-continue { justify-self: start; }
  .my-notes-empty, .my-notes-error { padding: 60px 20px; border-radius: 15px; }
}
