@font-face {
  font-family: "Smiley";
  src: url("fonts/SmileySans.woff2") format("woff2");
  font-weight: 400 900;
  font-style: oblique;
  font-display: swap;
}
:root {
  color-scheme: light;
  --clay: #bb5a38;
  --clay-deep: #8f4327;
  --clay-soft: #cb7351;
  --blue: #5b91ce;
  --pop: #f2a63e;
  --pop-deep: #e8902a;
  --putty: #efe3d0;
  --putty-line: #e2d2b8;
  --paper: #f5f6f7;
  --ink: #312820;
  --ink-soft: #6b5f52;
  --cream: #fbf3e6;
  --cream-readable: #fffefd;
  --r: 22px;
  --shadow-clay:
    0 22px 48px -16px rgba(60, 28, 12, 0.34), 0 6px 14px rgba(60, 28, 12, 0.14);
  --shadow-lift:
    0 34px 70px -18px rgba(60, 28, 12, 0.42), 0 10px 22px rgba(60, 28, 12, 0.18);
  --inh: inset 0 2px 0 rgba(255, 255, 255, 0.55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  font-family:
    -apple-system, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei",
    sans-serif;
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
[hidden] {
  display: none;
}
a {
  color: var(--clay-deep);
  text-underline-offset: 0.24em;
}
button,
input {
  font: inherit;
}
input {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 11px 15px;
  border: 1px solid var(--putty-line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--cream);
}
input::placeholder {
  color: var(--ink-soft);
  opacity: 1;
}
button {
  min-height: 48px;
  padding: 10px 22px;
  border: 0;
  border-radius: 12px;
  background: var(--pop);
  color: var(--ink);
  font-weight: 650;
  cursor: pointer;
  box-shadow: var(--inh);
  transition:
    transform 200ms var(--ease),
    box-shadow 200ms var(--ease),
    background 200ms var(--ease);
}
:focus-visible {
  outline: 3px solid var(--clay-deep);
  outline-offset: 4px;
}
::selection {
  color: var(--ink);
  background: var(--pop);
}
h1,
h2,
h3 {
  line-height: 1.4;
  text-wrap: balance;
}
h1 {
  font-family:
    "Smiley", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-style: oblique;
  font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 24px;
}
h2 {
  font-size: 1.3rem;
  margin: 36px 0 18px;
}
h3 {
  font-size: 1.05rem;
}
p {
  margin: 0 0 20px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.site-header {
  background: var(--clay);
  color: var(--cream);
}
.header-inner {
  max-width: 1240px;
  margin: auto;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--cream-readable);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
}
.brand-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: var(--ink);
  background: var(--pop);
  box-shadow: var(--inh);
  font-family: "Smiley", sans-serif;
  font-style: oblique;
  font-size: 1.25rem;
}
.header-logout {
  flex: none;
  color: var(--cream);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 9px;
  background: var(--clay-deep);
}
.site-header :focus-visible,
.lesson-header :focus-visible {
  outline-color: var(--cream);
}
.entry-page {
  background: var(--clay);
}
.entry-hero {
  color: var(--cream);
  background: var(--clay);
  padding: clamp(24px, 5vw, 60px) 32px clamp(48px, 8vw, 100px);
  min-height: calc(100vh - 72px);
  box-sizing: border-box;
}
.hero-inner {
  max-width: 1136px;
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  grid-template-areas: "copy mascot" "card mascot";
  gap: 26px 68px;
  align-items: start;
}
.hero-copy {
  grid-area: copy;
}
.hero-copy h1 {
  font-size: clamp(2.45rem, 5.5vw, 4.3rem);
  line-height: 1.2;
  margin: 24px 0 22px;
  letter-spacing: 0.01em;
}
.hero-kicker {
  display: inline-block;
  margin: 0;
  padding: 7px 15px;
  border-radius: 99px;
  color: var(--ink);
  background: var(--pop);
  box-shadow: var(--inh);
  font-weight: 650;
  font-size: 0.9rem;
}
.hero-intro {
  max-width: 32em;
  font-size: 1.08rem;
  line-height: 1.8;
  margin: 0;
  color: var(--cream-readable);
}
.hero-mascot {
  grid-area: mascot;
  align-self: center;
  justify-self: center;
  display: block;
  width: min(100%, 410px);
  height: auto;
  border-radius: var(--r);
  box-shadow: var(--shadow-clay);
}
.entry-card {
  grid-area: card;
  width: 100%;
  max-width: 520px;
  padding: 26px;
  color: var(--ink);
  background: var(--putty);
  border-radius: var(--r);
  box-shadow: var(--shadow-clay), var(--inh);
}
.entry-card p {
  margin-bottom: 14px;
  font-size: 0.95rem;
}
.entry-card form,
.gate form {
  display: grid;
  gap: 12px;
}
.entry-card button {
  width: 100%;
}
.notice {
  padding: 12px 0;
  margin: 0 0 12px;
  color: var(--clay-deep);
}
.notice.error,
.danger {
  color: #982d20;
}
.entry-card .notice,
.gate .notice {
  margin: 0;
  padding: 0;
}
.muted {
  color: var(--ink-soft);
}
.gate {
  width: min(100% - 40px, 450px);
  margin: 64px auto;
  padding: 32px;
  border-radius: var(--r);
  background: var(--putty);
  box-shadow: var(--shadow-clay), var(--inh);
}
.simple-page {
  max-width: 760px;
  margin: 64px auto;
  padding: 28px;
}
.lesson-header {
  background: var(--clay);
  color: var(--cream);
  padding: 25px 32px 44px;
}
.lesson-header-inner {
  max-width: 1176px;
  margin: auto;
}
.breadcrumbs {
  color: var(--cream-readable);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 24px;
  font-size: 0.95rem;
  font-weight: 650;
}
.breadcrumbs a {
  color: var(--cream-readable);
}
.lesson-kicker {
  display: inline-block;
  font-family: "Smiley", -apple-system, "PingFang SC", sans-serif;
  font-style: oblique;
  color: var(--ink);
  background: var(--pop);
  border-radius: 8px;
  padding: 3px 12px;
  margin: 0 0 16px;
}
.lesson-title h1 {
  max-width: 26em;
  font-size: clamp(1.9rem, 4vw, 3.25rem);
  line-height: 1.35;
  margin: 0;
}
.lesson-title a {
  color: inherit;
}
.manual-layout {
  max-width: 1176px;
  margin: auto;
  display: grid;
  grid-template-columns: 280px minmax(0, 760px);
  gap: 52px;
  padding: 0 24px;
}
.sidebar {
  width: 280px;
  align-self: start;
  position: sticky;
  top: 0;
  max-height: 100dvh;
  overflow: auto;
  padding: 32px 4px 40px 0;
}
.directory-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 20px;
}
.directory-group {
  margin: 0 0 26px;
}
.directory-group h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 650;
  line-height: 1.6;
  margin: 0 0 10px;
}
.directory-group :where(h3) img {
  width: 28px;
  height: 28px;
  flex: none;
  object-fit: cover;
  border-radius: 8px;
}
.directory-group ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.directory-group li {
  margin: 5px 0;
}
.directory-group a {
  display: block;
  padding: 9px 12px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.directory-group a[aria-current="page"] {
  color: var(--ink);
  background: var(--pop);
  font-weight: 650;
  box-shadow: var(--inh);
}
.reading-column {
  min-width: 0;
  width: 100%;
  max-width: 760px;
  padding: 38px 0 60px;
}
.prose {
  font-size: 17px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.prose p {
  text-wrap: pretty;
}
.prose h2 {
  position: relative;
  padding-left: 17px;
  margin-top: 40px;
}
.prose h2:first-child {
  margin-top: 0;
}
.prose h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.25em;
  width: 5px;
  height: 0.95em;
  border-radius: 3px;
  background: var(--pop);
}
.prose h3 {
  margin-top: 30px;
}
.prose ul,
.prose ol {
  padding-left: 1.5em;
}
.prose li {
  margin: 8px 0;
}
.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 26px auto;
  border-radius: 12px;
}
.prose blockquote {
  border-left: 2px solid var(--clay);
  background: var(--putty);
  padding: 20px 24px;
  margin: 28px 0;
  border-radius: 0 12px 12px 0;
}
.prose blockquote p:last-child {
  margin-bottom: 0;
}
.prose pre {
  max-width: 100%;
  overflow: auto;
  color: var(--cream);
  background: var(--ink);
  padding: 20px;
  border-radius: 12px;
}
.prose code {
  font-size: 0.9em;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.94rem;
}
th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--putty-line);
  vertical-align: top;
}
th {
  color: var(--ink);
  background: var(--putty);
  font-weight: 650;
}
.prose table {
  display: block;
  max-width: 100%;
  overflow: auto;
  margin: 24px 0;
}
.lesson-pagination {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 48px;
  border-top: 1px solid var(--putty-line);
  padding-top: 24px;
}
.lesson-pagination a {
  flex: 1;
  line-height: 1.8;
}
.lesson-pagination a:last-child {
  text-align: right;
}
.lesson-pagination span {
  display: block;
  font-size: 0.9rem;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}
.mobile-menu {
  display: none;
}
.drawer {
  width: min(88vw, 340px);
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto 0 0;
  padding: 24px;
  border: 0;
  color: var(--ink);
  background: var(--paper);
}
.drawer::backdrop {
  background: rgba(49, 40, 32, 0.45);
}
.drawer .secondary {
  margin-bottom: 24px;
}
body:has(.drawer[open]) {
  overflow: hidden;
}
.admin-page {
  max-width: 1180px;
  margin: 38px auto;
  padding: 0 28px 48px;
}
.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}
.admin-page section {
  margin-top: 28px;
  padding: 28px;
  background: var(--putty);
  border-radius: var(--r);
  box-shadow:
    var(--inh),
    0 6px 18px -10px rgba(60, 28, 12, 0.3);
}
.admin-page section h2 {
  margin: 0 0 18px;
}
.inline-form {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 720px;
}
.inline-form input {
  flex: 1;
}
.inline-form button,
.add-form button {
  white-space: nowrap;
  flex-shrink: 0;
}
.add-form {
  display: flex;
  align-items: end;
  gap: 16px;
}
.add-form label {
  flex: 1;
  min-width: 0;
}
.add-form input {
  display: block;
}
.table-scroll {
  overflow: auto;
  margin-top: 24px;
}
.table-scroll table {
  min-width: 720px;
}
.table-scroll td {
  max-width: 240px;
  overflow-wrap: anywhere;
}
.delete-form {
  min-width: 140px;
}
.text-button {
  padding: 4px 8px;
  background: transparent;
  color: var(--clay-deep);
  box-shadow: none;
}
.text-button.danger {
  color: #982d20;
}
.entry-card {
  transition:
    transform 200ms var(--ease),
    box-shadow 200ms var(--ease);
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  button:hover {
    transform: translateY(-2px);
    background: var(--pop-deep);
  }
  .entry-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lift), var(--inh);
  }
}
@media (hover: hover) {
  a:hover {
    text-decoration-thickness: 2px;
  }
  .directory-group a:hover {
    background: var(--putty);
  }
  .directory-group a[aria-current="page"]:hover {
    background: var(--pop-deep);
  }
}
@media (max-width: 768px) {
  .header-inner {
    padding: 18px 20px;
    gap: 12px;
  }
  .brand {
    font-size: 1rem;
    gap: 9px;
  }
  .header-logout {
    font-size: 0.85rem;
    padding: 6px 9px;
  }
  .entry-hero {
    padding: 22px 20px 40px;
  }
  .hero-inner {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "copy" "card" "mascot";
    gap: 22px;
  }
  .hero-copy h1 {
    font-size: clamp(2.1rem, 8vw, 3.3rem);
    margin: 20px 0 16px;
  }
  .hero-intro {
    font-size: 1rem;
  }
  .hero-mascot {
    width: 150px;
    margin-top: 6px;
  }
  .entry-card {
    max-width: none;
    padding: 24px;
  }
  .lesson-header {
    padding: 20px 20px 30px;
  }
  .breadcrumbs {
    color: var(--cream-readable);
    font-size: 0.85rem;
    gap: 7px;
    margin-bottom: 20px;
  }
  .lesson-title h1 {
    font-size: clamp(1.7rem, 6vw, 2.5rem);
  }
  .manual-layout {
    display: block;
    padding: 0 20px;
  }
  .sidebar {
    display: none;
  }
  .mobile-menu {
    display: block;
    position: sticky;
    top: 0;
    z-index: 1;
    width: 100%;
    padding: 12px 20px;
    border-radius: 0;
    border-bottom: 1px solid var(--putty-line);
    color: var(--ink);
    background: var(--putty);
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;
    box-shadow: none;
  }
  .reading-column {
    padding-top: 28px;
  }
  .admin-page {
    margin-top: 28px;
    padding: 0 20px 32px;
  }
  .admin-page section {
    padding: 22px 18px;
  }
  .section-heading {
    gap: 12px;
  }
  .section-heading a {
    white-space: nowrap;
  }
  .add-form {
    flex-direction: column;
    align-items: stretch;
  }
  .inline-form {
    flex-wrap: wrap;
  }
  .inline-form input[type="file"] {
    flex-basis: 100%;
  }
  th,
  td {
    padding: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none;
  }
}
