/* 仰望星空 · 首页：地平线、右上柔光与课程生成。仅此页加载。 */

/* ---------- 外观令牌 ---------- */

:root[data-theme=night] {
  color-scheme: dark;
  --page: #070a1c;
  --page-deep: #05071a;
  --paper: #0b0e24;
  --ink: #e9e7f4;
  --muted: #c1c5d8;
  --faint: #8688a9;
  --line: rgb(233 231 244 / 14%);
  --line-strong: rgb(233 231 244 / 26%);
  --gold: #e3b25e;
  --gold-bright: #f2cd8a;
  --gold-ink: #2a2112;
  --cyan: #8fe0da;
  --panel: #0c1030;
  --panel-field: #0a0d28;
  --focus: #f2cd8a;
  background: #070a1c;
}
:root[data-theme=day] {
  color-scheme: light;
  --page: #f3eee4;
  --page-deep: #efe8da;
  --paper: #faf6ee;
  --ink: #27211a;
  --muted: #54493c;
  --faint: #857866;
  --line: rgb(48 36 22 / 16%);
  --line-strong: rgb(48 36 22 / 28%);
  --gold: #a9742b;
  --gold-bright: #8c5e1d;
  --gold-ink: #fffaf0;
  --cyan: #2f6f6a;
  --panel: #fffbf3;
  --panel-field: #fdf8ee;
  --focus: #8c5e1d;
  background: #f3eee4;
}

.home-page {
  --serif: "Xingkong Serif Home", "Songti SC", "STSong", serif;
  timeline-scope: --courses-sky, --closing-sky;
  isolation: isolate;
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.home-page ::selection { background: #3c3568; color: #f6f1ff; }
:root[data-theme=day] .home-page ::selection { background: #e6d8bb; color: #27211a; }
.home-page ::-webkit-scrollbar { width: 10px; height: 10px; }
.home-page ::-webkit-scrollbar-thumb { background: #39406e; border-radius: 8px; border: 2px solid var(--page); }
.home-page ::-webkit-scrollbar-track { background: var(--page); }
:root[data-theme=day] .home-page ::-webkit-scrollbar-thumb { background: #c0b19a; }

.home-page :is(a, button, textarea):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}
.home-page a { color: inherit; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.shell {
  width: min(1200px, 100% - 96px);
  margin-inline: auto;
}
@media (max-width: 900px) { .shell { width: calc(100% - 44px); } }

/* ---------- 顶栏 ---------- */

.home-page .site-header {
  position: absolute; inset: 0 0 auto;
  height: 84px;
  background: transparent;
  border: 0;
  z-index: 6;
}
.home-page .site-nav { padding-inline: 48px; }
.home-page .site-nav { max-width: none; padding: 0 48px; gap: 32px; }
.home-page .site-brand {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: .16em;
  color: var(--ink);
}
.home-page .site-brand > svg { width: 18px; height: 18px; fill: var(--gold); }
.home-page .nav-links { gap: 30px; font-size: 14px; }
.home-page .nav-links > a { color: var(--muted); }
.home-page .nav-links > a::after { display: none; }
.home-page .nav-links > a:hover,
.home-page .nav-links > a:focus-visible { color: var(--ink); }
.home-page .nav-links .nav-login { color: var(--ink); }
.home-page .nav-links .nav-login svg { width: 15px; height: 15px; }
.home-page .theme-toggle {
  flex: none;
  width: 44px; height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 0;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.home-page .theme-toggle::after {
  content: "";
  display: block;
  width: 16px; height: 16px;
  margin: auto;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M16.5 11.5A7 7 0 0 1 8.5 3.5a7 7 0 1 0 8 8Z' fill='none' stroke='black' stroke-width='1.3' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
:root[data-theme=day] .home-page .theme-toggle::after {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='black' stroke-width='1.3' stroke-linecap='round'%3E%3Ccircle cx='10' cy='10' r='3.5'/%3E%3Cpath d='M10 1v2m0 14v2M1 10h2m14 0h2M3.6 3.6 5 5m10 10 1.4 1.4M3.6 16.4 5 15M15 5l1.4-1.4'/%3E%3C/g%3E%3C/svg%3E");
}
.home-page .theme-toggle:hover { color: var(--ink); border-color: var(--line-strong); }

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-stage {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.hero-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgb(7 10 28 / 30%), rgb(7 10 28 / 62%) 18%, transparent 45%), url('/assets/home-train-night-v1.webp') center bottom / cover no-repeat;
}
:root[data-theme=day] .hero-stage::before { inset: 0; background: url('/assets/home-dawn-mountains-v2.webp') center bottom / cover no-repeat; }
.home-page #intent-submit[disabled] { cursor: progress; }
.continuation-sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  background: #05101f url('/assets/home-night-clouds-v2.webp') center / cover no-repeat;
}
.continuation-sky::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgb(7 10 28 / 28%);
}
:root[data-theme=day] .continuation-sky { background-image: url('/home-morning-v1.webp'); }
:root[data-theme=day] .continuation-sky::after { background: transparent; }
.sky-courses { background-image: url('/assets/home-night-open-sky-v2.webp'); }
.sky-closing { background-image: url('/assets/home-night-dawn-valley-v2.webp'); }
:root[data-theme=day] .sky-courses { background-image: url('/assets/home-day-high-sky-v1.webp'); }
:root[data-theme=day] .sky-closing { background-image: url('/assets/home-day-cloud-horizon-v1.webp'); }
.sky-courses::after { background: rgb(7 10 28 / 36%); }
:root[data-theme=day] .sky-courses::after { background: rgb(255 250 240 / 12%); }
.courses { view-timeline: --courses-sky block; view-timeline-inset: 0; }
.close-band { view-timeline: --closing-sky block; view-timeline-inset: 0; }
/* ponytail: older browsers retain the first scene; no scroll listener or animation library. */
@supports (animation-timeline: scroll(root block)) {
  .continuation-sky {
    /* Opacity only: preserve scene changes under the site's reduced-motion reset. */
    animation: sky-arrive 1s linear both !important;
    animation-timeline: scroll(root block) !important;
    animation-range: 0px 85svh !important;
  }
  .sky-courses {
    animation-timeline: --courses-sky !important;
    animation-range: entry 25% entry 100% !important;
  }
  .sky-closing {
    animation-timeline: --closing-sky !important;
    animation-range: entry 25% entry 100% !important;
  }
}
@keyframes sky-arrive { from { opacity: 0; } to { opacity: 1; } }
.hero-beam {
  position: absolute;
  inset: -12% -8% -18%;
  pointer-events: none;
  background: conic-gradient(from 204deg at 92% 2%, transparent 0deg, rgb(246 224 188 / 2%) 3deg, rgb(246 224 188 / 13%) 9deg, rgb(246 224 188 / 24%) 13deg, rgb(246 224 188 / 8%) 18deg, transparent 25deg);
  mask-image: radial-gradient(ellipse 100% 120% at 92% 2%, #000 6%, rgb(0 0 0 / 75%) 32%, transparent 85%);
  filter: blur(14px);
}
:root[data-theme=day] .hero-beam {
  background: conic-gradient(from 204deg at 92% 2%, transparent 0deg, rgb(255 248 219 / 5%) 3deg, rgb(255 248 219 / 50%) 9deg, rgb(255 248 219 / 80%) 13deg, rgb(255 248 219 / 32%) 18deg, transparent 25deg);
}
.hero-veil {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, rgb(7 10 28 / 64%), rgb(7 10 28 / 48%) 55%, rgb(7 10 28 / 32%));
}
:root[data-theme=day] .hero-veil {
  background: radial-gradient(ellipse at 50% 47%, rgb(255 250 240 / 45%), transparent 80%);
}

.hero-inner {
  position: relative; z-index: 2;
  padding: 112px 0 108px;
  text-align: center;
}
.hero-inner > * { margin-inline: auto; }

h1#home-title {
  margin: 0 auto;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(42px, 4.7vw, 72px);
  line-height: 1.15;
  letter-spacing: .02em;
  color: var(--ink);
}
.title-line { display: inline; }

.hero-lead {
  margin: 26px auto 0;
  max-width: 37em;
  font-size: 18px;
  line-height: 1.8;
  color: var(--muted);
}

.home-page .intent-space { margin: 64px auto 0; width: 100%; max-width: 840px; }
.home-page .intent-form {
  width: 100%;
  margin: 0;
  padding: 24px 28px 20px;
  background: var(--panel);
  border: 1px solid color-mix(in srgb, var(--ink) 32%, transparent);
  border-radius: 16px;
  text-align: left;
  transition: border-color .25s, box-shadow .25s;
}
.home-page .intent-form:focus-within {
  border-color: var(--gold);
  box-shadow: 0 18px 48px -30px rgb(0 0 0 / 70%);
}
.home-page .intent-form label {
  display: block;
  font-size: 14px;
  letter-spacing: .04em;
  color: var(--muted);
}
.home-page .intent-form label svg { display: none; }
.home-page .intent-entry { display: block; margin-top: 6px; }
.home-page .intent-entry textarea {
  display: block;
  width: 100%;
  min-height: 96px;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  caret-color: var(--gold-bright);
  font-size: 18px;
  line-height: 1.8;
  resize: none;
}
.home-page .intent-entry textarea::placeholder { color: var(--muted); }
.home-page .intent-entry textarea:focus-visible { outline: none; }
.home-page .intent-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 0;
}
.home-page .intent-toolbar > span { flex: 1 1 auto; min-width: 0; max-width: none; font-size: 12px; color: var(--muted); }
.home-page .intent-entry button {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid var(--action);
  border-radius: 8px;
  background: var(--action);
  color: var(--gold-ink);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}
.home-page .intent-entry button:hover { background: var(--gold-bright); border-color: var(--gold-bright); }
.home-page .intent-entry button:disabled { opacity: .55; }
.home-page .intent-entry button svg { width: 16px; height: 16px; }
.home-page .intent-error { margin: 10px 0 0; font-size: 13px; color: #ffb9a9; }
:root[data-theme=day] .home-page .intent-error { color: #9a2f18; }

.course-prompts {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: center;
  gap: 4px 18px;
  margin-top: 22px;
  font-size: 13px;
  color: var(--muted);
}
.course-prompts button {
  padding: 4px 0;
  min-height: 44px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline dotted var(--line-strong);
  text-underline-offset: 5px;
  cursor: pointer;
}
.course-prompts button:hover { color: var(--ink); text-decoration-color: var(--gold); }

/* ---------- 正文带 ---------- */

.home-continuation {
  position: relative;
  isolation: isolate;
  overflow: clip;
}
:root[data-theme=night] .home-continuation { --muted: #e0e4f2; --gold-bright: #f6dda9; }
:root[data-theme=day] .home-continuation { --muted: #54493c; --gold-bright: #795018; }
.band { position: relative; padding: 112px 0; }
.band > .shell { position: relative; z-index: 1; }
.band + .band { padding-top: 80px; }
:root[data-theme=day] .close-band {
  --muted: #40362c;
}

.band h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.3;
  letter-spacing: .02em;
  color: var(--ink);
}
.band h2 + p,
.band p.intro {
  margin: 20px 0 0;
  max-width: 32em;
  font-size: 16px;
  line-height: 1.9;
  color: var(--muted);
}


/* 路线 */
.route-grid { display: grid; grid-template-columns: 5fr 6fr; gap: 72px; align-items: start; }
.route-intro { align-self: center; text-align: center; }
.route-intro > p { margin-inline: auto; }
.stops { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.stops li { position: relative; padding: 26px 0 26px 36px; border-bottom: 1px solid var(--line); }
.stops li:first-child { padding-top: 6px; }
.stops li:last-child { border-bottom: 0; }
.stops li::before {
  content: "";
  position: absolute; left: -3.5px; top: 38px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
}
.stops li:first-child::before { top: 18px; }
.stops h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: .03em;
  color: var(--ink);
}
.stops p { margin: 8px 0 0; font-size: 15px; line-height: 1.9; color: var(--muted); }

/* 课程账册 */
.courses-head { max-width: 760px; }
.home-page .programming-entry {
  display: flex; align-items: center; justify-content: space-between; gap: 32px;
  max-width: none;
  margin: 40px 0 0;
  padding: 22px 2px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-inline: 0;
  border-radius: 0;
  background: transparent;
  text-decoration: none;
  transition: border-color .3s;
}
.programming-entry:hover { border-color: var(--line-strong); }
.programming-entry strong {
  font-family: var(--serif);
  font-size: 21px; font-weight: 400; letter-spacing: .02em;
  color: var(--ink);
}
.programming-entry p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.programming-entry small { display: inline-flex; align-items: center; gap: 8px; flex: none; font-size: 13px; color: var(--gold-bright); }
.programming-entry small svg { width: 16px; height: 16px; }

.ledger {
  width: 100%;
  margin-top: 40px;
  border-collapse: collapse;
  font-size: 15px;
}
.ledger thead th {
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line-strong);
  font-size: 12px; font-weight: 400; letter-spacing: .08em;
  color: var(--muted);
  text-align: left;
}
.ledger thead .n { text-align: right; }
.ledger .ticks-head span { padding-left: 28px; }
.ledger tbody tr { border-bottom: 1px solid var(--line); }
.ledger tbody th {
  padding: 18px 0;
  font-family: var(--serif);
  font-size: 21px; font-weight: 400; letter-spacing: .03em;
  text-align: left;
  color: var(--ink);
}
.ledger td { padding: 18px 0; vertical-align: middle; }
.ledger .n {
  width: 72px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.ledger .ticks { width: 54%; padding-left: 28px; }
.ledger .ticks i {
  display: block;
  height: 14px;
  width: calc(var(--n) * 6.4px);
  max-width: 100%;
  background: repeating-linear-gradient(90deg, var(--gold) 0 2px, transparent 2px 6.4px);
  opacity: .75;
}

/* 收束 */
.close-band { padding-bottom: 148px; }
.close-grid { display: grid; grid-template-columns: 6fr 5fr; gap: 80px; align-items: start; }
.close-links { border-top: 1px solid var(--line); }
.close-links a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 24px;
  padding: 20px 2px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.close-links span { font-family: var(--serif); font-size: 20px; letter-spacing: .03em; color: var(--ink); }
.close-links small { font-size: 13px; color: var(--muted); text-align: right; }
.close-links a:hover span { color: var(--gold-bright); }
:root[data-theme=day] .close-links a:hover span { color: var(--gold); }
.close-links .close-cta span { color: var(--ink); }

/* 页脚 */
.home-page .site-footer { background: transparent; border-top: 0; }
:root[data-theme=day] .home-page .site-footer { --faint: #6d5e4e; }
.home-page .footer-inner { max-width: 1200px; padding: 36px 0 22px; color: var(--muted); }
.home-page .footer-inner > .footer-eyebrow {
  margin: 0;
  font-size: 10px;
  line-height: 1.8;
  letter-spacing: .16em;
  color: var(--muted);
}
.home-page .footer-title {
  margin: 10px 0;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 400;
  letter-spacing: .04em;
  color: var(--ink);
}
.home-page .service-note { max-width: 54ch; font-size: 12px; line-height: 1.9; }
.home-page .footer-bottom { margin-top: 24px; border-color: var(--line); color: var(--muted); }

/* ---------- 窄屏 ---------- */
.home-mobile-menu { display: none; }

@media (max-width: 980px) {
  .route-grid, .close-grid { grid-template-columns: 1fr; gap: 40px; }
  .ledger .ticks { width: 34%; }
  .hero-inner > * { max-width: 100%; }
}

@media (max-width: 760px) {
  .title-line { display: block; }
  .home-page .site-header { height: 64px; }
  .home-page .site-nav { padding: 0 20px; gap: 12px; flex-wrap: wrap; row-gap: 0; }
  .home-page .site-brand { font-size: 16px; letter-spacing: .12em; }
  .home-page .nav-links { display: none; }
  .home-page .site-brand { margin-right: auto; }
  .home-page .theme-toggle { margin-left: 0; }
  .home-mobile-menu { display: block; }
  .home-mobile-menu > summary { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 10px; font-size: 14px; color: var(--muted); cursor: pointer; list-style: none; }
  .home-mobile-menu > summary::-webkit-details-marker { display: none; }
  .mobile-nav-links { position: absolute; top: 64px; right: 20px; left: 20px; padding: 8px 20px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 16px 40px -20px rgb(0 0 0 / 35%); }
  .mobile-nav-links a { display: flex; align-items: center; min-height: 48px; font-size: 15px; color: var(--ink); text-decoration: none; }
  .mobile-nav-links a + a { border-top: 1px solid var(--line); }
  .hero-inner { padding: 96px 0 104px; }
  .home-page .intent-space { margin-top: 48px; }
  .hero-lead { font-size: 16px; }
  .home-page .intent-form { padding: 20px 20px 16px; }
  .home-page .intent-entry textarea { font-size: 16px; min-height: 96px; }
  .home-page .intent-toolbar { flex-direction: column; align-items: stretch; gap: 12px; }
  .home-page .intent-entry button { justify-content: center; width: 100%; }
  .course-prompts { gap: 2px 14px; }
  .band { padding: 92px 0; }
  .band + .band { padding-top: 56px; }
  .programming-entry { flex-direction: column; align-items: flex-start; gap: 10px; }
  .ledger .ticks, .ledger .ticks-head { display: none; }
  .ledger tbody th { font-size: 18px; }
  .close-band { padding-bottom: 96px; }
  .close-links a { flex-direction: column; gap: 4px; }
  .close-links small { text-align: left; }
  .stops li { padding-left: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .home-page html { scroll-behavior: auto; }
}

@media (max-width: 600px) { .home-page .intent-space { margin-top: 44px; } }
@media (max-height: 760px) and (min-width: 761px) {
  .hero-inner { padding-block: 96px 84px; }
}
@media (max-height: 740px) and (max-width: 760px) {
  .hero-inner { padding-block: 88px 84px; }
  .hero-lead { margin-top: 20px; font-size: 15px; }
  .home-page .intent-form { padding: 16px; }
  .home-page .intent-entry textarea { min-height: 96px; }
  .home-page .intent-toolbar { margin-top: 4px; padding-top: 8px; }
  .home-page .intent-toolbar > span { display: none; }
  .course-prompts { margin-top: 14px; gap: 0 12px; }
  .course-prompts > span { display: none; }
}
@media (max-height: 740px) and (max-width: 360px) {
  .hero-inner { padding-block: 80px 68px; }
  h1#home-title { font-size: 36px; }
  .hero-lead { margin-top: 16px; font-size: 14px; }
  .home-page .intent-space { margin-top: 36px; }
  .course-prompts { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
  .course-prompts button { min-width: 0; font-size: 12px; line-height: 1.5; text-wrap: balance; }
}
