:root {
  --bg: oklch(1 0 0);
  --surface: oklch(0.965 0.012 113);
  --surface-strong: oklch(0.92 0.045 113);
  --ink: oklch(0.18 0.025 124);
  --muted: oklch(0.38 0.026 124);
  --primary: oklch(0.79 0.16 113);
  --primary-deep: oklch(0.32 0.085 118);
  --accent: oklch(0.68 0.18 36);
  --accent-soft: oklch(0.93 0.07 80);
  --line: oklch(0.84 0.02 113);
  --shadow: 0 8px 24px oklch(0.18 0.025 124 / 0.12);
  --max: 1180px;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  line-height: 1.65;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 10;
  transform: translateY(-150%);
  background: var(--ink);
  color: var(--bg);
  padding: .65rem .9rem;
  border-radius: 999px;
  text-decoration: none;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1rem clamp(1rem, 3vw, 2rem);
  background: oklch(1 0 0 / .88);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-width: max-content;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--primary);
  font-size: .82rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .25rem .9rem;
  color: var(--muted);
  font-size: .95rem;
}

.nav-links a {
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--ink);
}

.section {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 7rem) 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .92fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  min-height: auto;
  padding-top: clamp(2rem, 5vw, 4rem);
  padding-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.section-tag {
  margin: 0 0 .85rem;
  color: var(--primary-deep);
  font-weight: 800;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.08;
  text-wrap: balance;
}

h1 {
  max-width: 11ch;
  font-size: clamp(3rem, 8vw, 5.9rem);
}

h2 {
  max-width: 14ch;
  font-size: clamp(2rem, 4.6vw, 4.2rem);
}

h3 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.35;
}

p {
  text-wrap: pretty;
}

.hero-lede {
  max-width: 60ch;
  margin: 1.4rem 0 0;
  color: var(--muted);
  font-size: clamp(1.04rem, 1.4vw, 1.22rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: .75rem 1.05rem;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
}

.button-primary {
  background: var(--ink);
  color: var(--bg);
}

.button-secondary {
  background: var(--primary);
  color: var(--ink);
}

.hero-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  max-width: 560px;
  margin: 2rem 0 0;
}

.hero-facts div {
  padding-top: .8rem;
  border-top: 2px solid var(--line);
}

.hero-facts dt {
  color: var(--muted);
  font-size: .9rem;
}

.hero-facts dd {
  margin: .1rem 0 0;
  font-weight: 900;
}

.hero-visual {
  margin: 0;
}

.hero-visual img,
.work-visual img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-visual figcaption {
  max-width: 52ch;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: .95rem;
}

.section-heading {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-heading p:not(.section-tag) {
  max-width: 62ch;
  margin: 0;
  color: var(--muted);
}

.wide h2 {
  max-width: 16ch;
}

.value-grid,
.safety-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.value-grid article,
.safety-grid article,
.lesson-card,
.fit-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.value-grid article,
.safety-grid article {
  min-height: 190px;
  padding: 1.4rem;
}

.value-grid p,
.safety-grid p,
.lesson-card p {
  margin: .75rem 0 0;
  color: var(--muted);
}

.rhythm-section {
  padding-top: 0;
  padding-bottom: 0;
}

.rhythm-panel {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: 2rem;
  align-items: center;
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  padding: clamp(1.5rem, 4vw, 3rem);
}

.rhythm-panel .section-tag {
  color: var(--primary);
}

.rhythm-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rhythm-list li {
  min-height: 126px;
  padding: 1rem;
  border-radius: var(--radius);
  background: oklch(1 0 0 / .08);
}

.rhythm-list strong,
.rhythm-list span {
  display: block;
}

.rhythm-list strong {
  color: var(--primary);
  font-size: 1.45rem;
  line-height: 1.1;
}

.rhythm-list span {
  margin-top: .8rem;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: 1.3rem;
}

.filter-button,
.sample-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.filter-button {
  min-height: 2.65rem;
  padding: .55rem .95rem;
}

.filter-button.is-active,
.sample-button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 1rem;
}

.lesson-card {
  display: grid;
  align-content: start;
  min-height: 260px;
  padding: 1.2rem;
  cursor: pointer;
  position: relative;
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
}

.lesson-card[hidden] {
  display: none;
}

.lesson-card:hover {
  transform: translateY(-3px);
}

.lesson-card::after {
  content: "进入本课";
  align-self: end;
  justify-self: start;
  display: inline-flex;
  margin-top: 1rem;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink);
  padding: .35rem .7rem;
  font-size: .88rem;
  font-weight: 900;
}

.lesson-card.is-selected {
  border-color: var(--primary-deep);
  background: oklch(0.94 0.05 113);
}

.lesson-card.is-selected::after {
  background: var(--ink);
  color: var(--bg);
  content: "正在学习";
}

.lesson-number {
  display: inline-grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 1.1rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--ink);
  font-weight: 900;
}

.lesson-card strong {
  align-self: end;
  display: block;
  margin-top: 1.1rem;
  color: var(--primary-deep);
}

.lesson-reader {
  margin-top: clamp(2rem, 5vw, 4rem);
  border-radius: 12px;
  background: var(--ink);
  color: var(--bg);
  padding: clamp(1.2rem, 4vw, 2.5rem);
  scroll-margin-top: 7rem;
}

.reader-intro {
  display: grid;
  gap: .8rem;
  max-width: 820px;
  margin-bottom: 1.5rem;
}

.reader-intro .section-tag,
.lesson-reader .section-tag {
  color: var(--primary);
}

.reader-intro h2 {
  color: var(--bg);
  max-width: 16ch;
}

.reader-intro p:not(.section-tag) {
  margin: 0;
  color: oklch(0.86 0.01 113);
}

.reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .68fr);
  gap: 1rem;
  align-items: start;
}

.reader-main,
.reader-side > div {
  border-radius: var(--radius);
  background: oklch(1 0 0 / .08);
  padding: 1.2rem;
}

.reader-main h3,
.reader-side h3 {
  color: var(--primary);
}

.reader-main h3 + ul,
.reader-main h3 + ol,
.reader-side p,
.reader-side ul {
  margin-top: .7rem;
}

.reader-main h3:not(:first-child) {
  margin-top: 1.6rem;
}

.reader-main li + li,
.reader-side li + li {
  margin-top: .5rem;
}

.reader-side {
  display: grid;
  gap: 1rem;
}

.prompt-box {
  background: var(--accent-soft) !important;
  color: var(--ink);
}

.prompt-box h3 {
  color: var(--ink);
}

.task-box {
  background: var(--primary) !important;
  color: var(--ink);
}

.task-box h3 {
  color: var(--ink);
}

.works-section {
  border-top: 1px solid var(--line);
}

.works-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, .72fr);
  align-items: start;
  gap: clamp(1.4rem, 4vw, 3rem);
}

.work-visual {
  margin: 0;
}

.sample-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}

.sample-button {
  min-height: 2.55rem;
  padding: .5rem .85rem;
}

.sample-output {
  flex-basis: 100%;
  margin-top: .7rem;
  border-radius: var(--radius);
  background: var(--accent-soft);
  padding: 1.35rem;
}

.sample-output p {
  margin: .75rem 0 0;
  color: var(--muted);
}

.safety-section {
  background: var(--surface);
  width: 100%;
  max-width: none;
  padding-left: max(1rem, calc((100% - var(--max)) / 2));
  padding-right: max(1rem, calc((100% - var(--max)) / 2));
}

.safety-grid article {
  background: var(--bg);
}

.fit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.fit-card {
  padding: clamp(1.2rem, 3vw, 2rem);
}

.fit-card.quiet {
  background: var(--ink);
  color: var(--bg);
}

.fit-card ul {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
}

.fit-card li + li {
  margin-top: .55rem;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .rhythm-panel,
  .works-layout,
  .reader-layout,
  .fit-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  h1 {
    max-width: 12ch;
  }

  .rhythm-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .section {
    width: min(100% - 1.25rem, var(--max));
    padding: 2.7rem 0;
  }

  .site-header {
    align-items: center;
    flex-direction: row;
    gap: .6rem;
    padding: .55rem .65rem;
    overflow-x: auto;
  }

  .nav-links {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: .7rem;
    width: auto;
    font-size: .84rem;
    white-space: nowrap;
  }

  .brand {
    gap: .45rem;
    font-size: .9rem;
  }

  .brand-mark {
    width: 1.95rem;
    height: 1.95rem;
    font-size: .72rem;
  }

  .hero {
    gap: 1.4rem;
    padding-top: 1.8rem;
    padding-bottom: 2rem;
  }

  .section-tag {
    margin-bottom: .55rem;
    font-size: .9rem;
  }

  h1 {
    max-width: 13ch;
    font-size: clamp(2.3rem, 11vw, 3rem);
    line-height: 1.05;
  }

  h2 {
    max-width: 15ch;
    font-size: clamp(1.8rem, 9vw, 2.45rem);
    line-height: 1.08;
  }

  h3 {
    font-size: 1rem;
  }

  .hero-lede {
    margin-top: .9rem;
    font-size: 1rem;
  }

  .hero-actions {
    gap: .55rem;
    margin-top: 1.1rem;
  }

  .hero-actions .button {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    min-height: 2.8rem;
    padding-inline: .7rem;
    font-size: .92rem;
  }

  .hero-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .45rem;
    margin-top: 1.2rem;
  }

  .hero-facts div {
    padding-top: .55rem;
  }

  .hero-facts dt {
    font-size: .78rem;
  }

  .hero-facts dd {
    font-size: .9rem;
  }

  .hero-visual figcaption {
    margin-top: .65rem;
    font-size: .86rem;
  }

  .section-heading {
    gap: .65rem;
    margin-bottom: 1.25rem;
  }

  .value-grid,
  .safety-grid {
    gap: .65rem;
  }

  .value-grid article,
  .safety-grid article {
    min-height: auto;
    padding: 1rem;
  }

  .rhythm-panel {
    gap: 1.1rem;
    padding: 1rem;
  }

  .rhythm-list {
    grid-template-columns: 1fr;
    gap: .55rem;
  }

  .rhythm-list li {
    min-height: auto;
    padding: .85rem;
  }

  .rhythm-list strong {
    font-size: 1.18rem;
  }

  .filter-bar {
    flex-wrap: nowrap;
    gap: .45rem;
    margin-inline: -.625rem;
    padding-inline: .625rem;
    padding-bottom: .25rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .filter-bar::-webkit-scrollbar {
    display: none;
  }

  .filter-button {
    flex: 0 0 auto;
    width: auto;
    min-height: 2.25rem;
    padding: .38rem .58rem;
    font-size: .82rem;
  }

  .sample-button {
    flex: 0 0 auto;
    width: auto;
    min-height: 2.35rem;
    padding: .45rem .82rem;
    font-size: .9rem;
  }

  .course-grid {
    gap: .65rem;
  }

  .lesson-card {
    grid-template-columns: 2.55rem minmax(0, 1fr);
    gap: .15rem .75rem;
    min-height: auto;
    padding: .85rem;
  }

  .lesson-card:hover {
    transform: none;
  }

  .lesson-number {
    grid-row: 1 / 5;
    width: 2.35rem;
    height: 2.35rem;
    margin: 0;
    font-size: .85rem;
  }

  .lesson-card h3,
  .lesson-card p,
  .lesson-card strong,
  .lesson-card::after {
    grid-column: 2;
  }

  .lesson-card p {
    margin-top: .35rem;
    font-size: .88rem;
    line-height: 1.5;
  }

  .lesson-card strong {
    margin-top: .45rem;
    font-size: .86rem;
    line-height: 1.45;
  }

  .lesson-card::after {
    margin-top: .5rem;
    padding: .28rem .58rem;
    font-size: .78rem;
  }

  .lesson-reader {
    margin-top: .65rem;
    margin-bottom: .65rem;
    border-radius: var(--radius);
    padding: 1rem;
    scroll-margin-top: 4.6rem;
  }

  .reader-intro {
    gap: .55rem;
    margin-bottom: .9rem;
  }

  .reader-intro h2 {
    max-width: 13ch;
    font-size: clamp(1.75rem, 8vw, 2.2rem);
  }

  .reader-main,
  .reader-side > div {
    padding: .9rem;
  }

  .reader-main ul,
  .reader-main ol,
  .reader-side ul {
    padding-left: 1.1rem;
  }

  .reader-main li,
  .reader-side li,
  .reader-side p,
  .reader-main {
    font-size: .92rem;
  }

  .works-layout {
    gap: 1rem;
  }

  .sample-switcher {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
  }

  .sample-button {
    width: 100%;
  }

  .sample-output {
    grid-column: 1 / -1;
    margin-top: .25rem;
    padding: 1rem;
  }

  .fit-card {
    padding: 1rem;
  }

  .site-footer {
    width: min(100% - 1.25rem, var(--max));
    padding: 1.2rem 0 2rem;
    font-size: .88rem;
  }
}

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