:root {
  --paper: oklch(97.8% 0.012 88);
  --paper-deep: oklch(94.8% 0.018 86);
  --surface: oklch(99.2% 0.006 88);
  --ink: oklch(25% 0.048 252);
  --ink-soft: oklch(43% 0.033 250);
  --muted: oklch(52% 0.022 248);
  --line: oklch(86% 0.018 84);
  --red: oklch(43% 0.145 24);
  --red-dark: oklch(35% 0.12 24);
  --red-wash: oklch(93% 0.035 24);
  --navy: oklch(23% 0.054 250);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, monospace;
  --shell: 1180px;
  --gutter: clamp(20px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
.shell { width: min(100%, var(--shell)); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: 10px; left: 10px; z-index: 100; padding: 10px 14px; color: var(--surface); background: var(--ink); transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.hero { min-height: min(780px, calc(100vh - 72px)); display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, .55fr); align-items: center; gap: clamp(50px, 9vw, 130px); padding-block: clamp(76px, 12vw, 150px); }
.eyebrow { margin: 0 0 22px; color: var(--red); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .15em; }
.hero h1 { max-width: 820px; margin: 0; font-family: var(--serif); font-size: clamp(54px, 8vw, 98px); font-weight: 700; letter-spacing: -.055em; line-height: 1.05; text-wrap: balance; }
.hero-lead { max-width: 610px; margin: 30px 0 0; color: var(--ink-soft); font-size: clamp(17px, 2vw, 20px); line-height: 1.8; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; margin-top: 38px; }
.button { min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 20px; border: 1px solid transparent; font-size: 14px; font-weight: 650; transition: transform .18s ease, background .18s ease, color .18s ease; }
.button:hover { transform: translateY(-2px); }
.button-primary { color: var(--surface); background: var(--red); }
.button-primary:hover { background: var(--red-dark); }
.text-link { padding-block: 8px; border-bottom: 1px solid var(--ink); font-size: 14px; font-weight: 650; }
.text-link span { margin-left: 6px; color: var(--red); }
.hero-index { min-height: 360px; display: flex; flex-direction: column; justify-content: space-between; padding-left: clamp(24px, 4vw, 54px); border-left: 1px solid var(--line); }
.index-number { color: var(--red); font-family: var(--serif); font-size: clamp(100px, 14vw, 180px); font-weight: 700; letter-spacing: -.09em; line-height: .75; }
.index-number span { display: block; margin-left: 1em; color: var(--ink); font-size: .33em; letter-spacing: -.02em; }
.index-note { display: grid; gap: 5px; padding-top: 20px; border-top: 1px solid var(--ink); }
.index-note span { margin-bottom: 5px; color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.index-note strong { font-family: var(--serif); font-size: 18px; }

.library-section { padding-block: clamp(80px, 10vw, 130px); border-top: 1px solid var(--line); background: var(--surface); scroll-margin-top: 72px; }
.section-heading h2, .selector-copy h2 { margin: 0; font-family: var(--serif); font-size: clamp(42px, 6vw, 70px); line-height: 1.08; letter-spacing: -.045em; }
.selector-copy h2 { white-space: nowrap; }
.library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 64px; padding-block: 18px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.search-field { flex: 1; max-width: 430px; display: flex; align-items: center; gap: 10px; }
.search-field svg { width: 18px; fill: none; stroke: var(--muted); stroke-width: 1.6; }
.search-field input { width: 100%; padding: 8px 0; border: 0; outline: 0; color: var(--ink); background: transparent; }
.search-field:focus-within { outline: 2px solid var(--red); outline-offset: 4px; }
.search-field input::placeholder { color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filters button { padding: 7px 12px; border: 0; color: var(--muted); background: transparent; font-size: 13px; }
.filters button:hover { color: var(--ink); }
.filters button.is-active { color: var(--surface); background: var(--ink); }
.course-list { border-bottom: 1px solid var(--ink); }
.course-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 156px; gap: 32px; align-items: start; padding-block: clamp(38px, 5vw, 62px); border-bottom: 1px solid var(--line); }
.course-row:last-child { border-bottom: 0; }
.course-row[hidden] { display: none; }
.course-order { color: var(--red); font-family: var(--mono); font-size: 12px; letter-spacing: .1em; }
.course-kicker { display: flex; gap: 14px; color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.course-kicker span + span::before { content: "·"; margin-right: 14px; }
.course-main h3 { margin: 12px 0 0; font-family: var(--serif); font-size: clamp(30px, 4vw, 46px); line-height: 1.18; letter-spacing: -.025em; }
.course-main h3 a { transition: color .18s ease; }
.course-main h3 a:hover { color: var(--red); }
.course-main p { max-width: 720px; margin: 18px 0 0; color: var(--ink-soft); font-size: 16px; }
.topic-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 0; padding: 0; list-style: none; }
.topic-list li { padding: 5px 9px; color: var(--muted); border: 1px solid var(--line); font-size: 12px; }
.course-open { min-height: 56px; align-self: center; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 6px 2px 12px; border-bottom: 1px solid var(--ink); font-size: 17px; font-weight: 650; letter-spacing: .04em; }
.course-open span:last-child { color: var(--red); font-size: 26px; line-height: 1; transition: transform .2s ease; }
.course-open:hover span:last-child { transform: translate(3px, -3px); }
.results-note { margin: 16px 0 0; color: var(--muted); font-size: 12px; text-align: right; }
.empty-state { padding: 70px 20px; border-bottom: 1px solid var(--ink); text-align: center; }
.empty-state strong { font-family: var(--serif); font-size: 24px; }
.empty-state p { margin: 8px 0 0; color: var(--muted); }
.library-more { display: flex; align-items: center; justify-content: space-between; gap: 32px; margin-top: 42px; padding: 28px 0; }
.library-more > div { display: grid; gap: 4px; }
.library-more > div > span { color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.library-more strong { font-family: var(--serif); font-size: clamp(22px, 3vw, 30px); }
.library-hero { padding-block: clamp(90px, 12vw, 150px) clamp(72px, 9vw, 110px); }
.library-hero h1 { margin: 0; font-family: var(--serif); font-size: clamp(54px, 8vw, 92px); line-height: 1.04; letter-spacing: -.055em; }
.library-hero > p:last-child { max-width: 660px; margin: 30px 0 0; color: var(--ink-soft); font-size: 18px; }
.library-page-section { padding-top: clamp(64px, 8vw, 96px); }
.library-page-section .library-toolbar { margin-top: 0; }

.auth-page { min-height: 100vh; }
.auth-main { min-height: calc(100vh - 72px); display: grid; grid-template-columns: minmax(0, 1fr) 380px; align-items: center; gap: clamp(40px, 5vw, 64px); padding-block: clamp(70px, 10vw, 120px); }
.auth-intro h1 { margin: 0; font-family: var(--serif); font-size: clamp(48px, 7vw, 82px); line-height: 1.08; letter-spacing: -.05em; }
.auth-lead { max-width: 580px; margin: 28px 0 0; color: var(--ink-soft); font-size: 18px; line-height: 1.8; }
.selected-resource { max-width: 520px; display: grid; gap: 8px; margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--ink); }
.selected-resource span { color: var(--muted); font-size: 11px; letter-spacing: .1em; }
.selected-resource strong { font-family: var(--serif); font-size: 22px; }
.auth-panel { min-height: 500px; align-self: stretch; display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 5vw, 54px); border: 1px solid var(--line); background: var(--surface); }
.auth-panel [hidden] { display: none; }
.auth-panel h2 { margin: 0; font-family: var(--serif); font-size: 32px; }
.form-index { margin: 0 0 16px; color: var(--red); font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .14em; }
.form-help { margin: 12px 0 30px; color: var(--muted); font-size: 14px; }
.auth-field { display: grid; gap: 9px; }
.auth-field > label, .auth-field > span { color: var(--ink-soft); font-size: 12px; font-weight: 650; }
.auth-field input { width: 100%; height: 52px; padding: 0 14px; border: 1px solid var(--line); border-radius: 0; outline: 0; color: var(--ink); background: var(--paper); }
.auth-field input:focus { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.auth-email-control { display: flex; align-items: stretch; border: 1px solid var(--line); background: var(--paper); transition: border-color .16s ease, box-shadow .16s ease; }
.auth-email-control:focus-within { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.auth-email-control input { min-width: 0; flex: 1; border: 0; background: transparent; }
.auth-email-control input:focus { border-color: transparent; box-shadow: none; }
.auth-email-suffix { flex: none; padding: 0 34px 0 13px; border: 0; border-left: 1px solid var(--line); border-radius: 0; color: var(--ink-soft); background-color: color-mix(in oklch, var(--paper) 68%, var(--surface)); font: inherit; font-size: 12px; cursor: pointer; }
.auth-email-suffix:hover { color: var(--ink); background: var(--surface); }
.auth-field-help { min-height: 17px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.auth-submit { width: 100%; margin-top: 16px; }
.auth-submit:disabled { cursor: wait; opacity: .65; transform: none; }
.auth-text-button { margin-top: 18px; padding: 0; border: 0; border-bottom: 1px solid var(--ink); color: var(--ink); background: transparent; font-size: 12px; }
.form-message { min-height: 24px; margin: 20px 0 0; color: var(--muted); font-size: 13px; }
.form-message[data-tone="success"] { color: oklch(43% .09 150); }
.form-message[data-tone="error"] { color: var(--red); }
.privacy-note { margin: auto 0 0; padding-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.auth-status { color: var(--muted); text-align: center; }

.selector-section { overflow: hidden; padding-block: clamp(90px, 12vw, 150px); color: oklch(96% 0.01 88); background: var(--navy); }
.selector-layout { display: grid; grid-template-columns: minmax(0, .8fr) minmax(460px, 1.2fr); align-items: center; gap: clamp(60px, 10vw, 130px); }
.eyebrow-light { color: oklch(74% 0.12 25); }
.selector-copy p:not(.eyebrow) { max-width: 510px; margin: 26px 0 0; color: oklch(80% 0.018 248); font-size: 17px; white-space: nowrap; }
.button-light { margin-top: 36px; color: var(--navy); background: var(--paper); }
.button-light:hover { background: var(--surface); }
.schedule-preview { position: relative; padding: 24px; border: 1px solid oklch(40% 0.05 250); background: oklch(27% 0.052 250); transform: rotate(1.5deg); box-shadow: 28px 28px 0 oklch(20% 0.052 250); }
.preview-header, .preview-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; font-size: 12px; }
.preview-header span:first-child { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.preview-header span:last-child, .preview-footer span { color: oklch(73% 0.02 248); }
.preview-grid { display: grid; grid-template-columns: 58px repeat(6, 1fr); margin-block: 22px; border-top: 1px solid oklch(42% 0.04 250); border-left: 1px solid oklch(42% 0.04 250); }
.preview-grid > * { min-height: 54px; display: grid; place-items: center; margin: 0; padding: 5px; border-right: 1px solid oklch(42% 0.04 250); border-bottom: 1px solid oklch(42% 0.04 250); font-size: 10px; font-style: normal; font-weight: 400; text-align: center; }
.preview-grid b, .preview-grid em { color: oklch(73% 0.02 248); }
.preview-grid .slot { color: oklch(95% 0.02 88); background: color-mix(in oklch, var(--red) 60%, var(--navy)); }
.preview-grid .slot-weekend { background: oklch(38% 0.075 150); }
.preview-footer strong { color: oklch(80% 0.13 25); font-family: var(--serif); font-size: 20px; }

.site-footer { padding-block: 34px; color: var(--muted); background: var(--paper); border-top: 1px solid var(--line); font-size: 12px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.reveal { animation: reveal .72s cubic-bezier(.22, 1, .36, 1) both; }
.course-row:nth-child(2), .hero-index { animation-delay: .09s; }
@keyframes reveal { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1020px) {
  .auth-main { min-height: auto; grid-template-columns: minmax(0, 1fr); gap: 54px; }
  .auth-intro, .auth-panel { min-width: 0; }
  .auth-panel { min-height: 480px; }
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-index { min-height: 220px; padding: 32px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .index-number { font-size: 110px; }
  .selector-layout { grid-template-columns: 1fr; gap: 70px; }
  .schedule-preview { max-width: 620px; }
}

@media (min-width: 1021px) {
  .auth-intro h1 { white-space: nowrap; }
}

@media (max-width: 680px) {
  .hero { padding-block: 72px 86px; }
  .hero h1 { font-size: clamp(46px, 14vw, 68px); }
  .library-section { scroll-margin-top: 64px; }
  .library-toolbar { align-items: stretch; flex-direction: column; }
  .search-field { max-width: none; }
  .filters { overflow-x: auto; flex-wrap: nowrap; }
  .filters button { white-space: nowrap; }
  .library-more { align-items: stretch; flex-direction: column; }
  .library-more .button { width: 100%; }
  .library-hero { padding-block: 72px 64px; }
  .library-hero h1 { font-size: clamp(46px, 14vw, 68px); }
  .course-row { grid-template-columns: 38px 1fr; gap: 14px; }
  .course-open { grid-column: 2; width: min(100%, 180px); min-width: 0; margin-top: 14px; }
  .selector-layout { gap: 54px; }
  .selector-copy h2 { font-size: clamp(32px, 10vw, 42px); }
  .schedule-preview { margin-right: -90px; padding: 16px; transform: rotate(1deg); }
  .preview-grid { grid-template-columns: 48px repeat(6, 58px); overflow: hidden; }
  .site-footer { padding-block: 28px; }
  .auth-main { padding-block: 58px 80px; }
  .auth-intro h1 { font-size: clamp(42px, 13vw, 60px); }
  .auth-panel { min-height: 450px; padding: 28px 22px; }
  .auth-field input { min-width: 0; }
}

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