/* Homepage and tutorials */
:root {
  --header-height: 66px;
  --page-paper: #f5f7f4;
  --deep-ink: #1b392f;
  --paper-line: #cbd8cc;
  --reading-position: calc(var(--header-height) + 22px);
}

html { height: auto; }
.scroll-home {
  height: auto;
  min-height: 100vh;
  background: var(--page-paper);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}
.page-width { width: min(1200px, calc(100% - 2 * clamp(16px, 4.8vw, 70px))); margin-inline: auto; }
.scroll-home main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  /* The two flexible rows grow together if either feature needs more room. */
  grid-template-rows: [intro] auto [tutorial] auto [progress] 1fr [index] auto [records] 1fr;
}
.scroll-home main > section[id], .lesson { scroll-margin-top: var(--reading-position); }
.skip-link { position: fixed; top: 6px; left: 12px; z-index: 45; padding: 10px 14px; background: white; transform: translateY(-160%); }
.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 25;
  height: var(--header-height);
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.header-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 100%;
}
.site-brand {
  width: fit-content;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--deep-ink);
  font: 700 25px/1 Bahnschrift, "Microsoft YaHei", sans-serif;
  letter-spacing: -.055em;
}
.page-nav { display: flex; align-self: stretch; align-items: stretch; gap: clamp(20px, 3vw, 45px); }
.page-nav a {
  position: relative;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: #52665a;
  font-size: 14px;
}
.page-nav a::after {
  content: "";
  position: absolute;
  bottom: 11px;
  height: 2px;
  inset-inline: 0;
  background: var(--green);
  transform: scaleX(0);
  transition: transform .2s var(--ease);
}
.page-nav a:hover, .page-nav a[aria-current] { color: var(--green-dark); }
.page-nav a[aria-current]::after { transform: scaleX(1); }
.site-login {
  display: inline-flex;
  justify-self: end;
  align-items: center;
  min-height: 44px;
  gap: 10px;
  padding: 0 17px;
  border-radius: var(--radius);
  background: var(--green);
  color: white;
  font-weight: 600;
}
.site-login:hover { background: var(--green-dark); }
.index-toggle { display: none; }

.intro { padding-block: clamp(45px, 6vh, 73px) clamp(32px, 5.2vh, 62px); text-align: center; }
.intro h1 {
  margin: 0;
  font-size: clamp(39px, 4.8vw, 70px);
  line-height: 1.21;
  font-weight: 700;
  letter-spacing: -.07em;
  color: var(--deep-ink);
}
.intro h1 > span { display: inline-block; }
.intro em { position: relative; color: var(--green); font-style: normal; white-space: nowrap; }
.intro em::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  right: -.015em;
  bottom: .045em;
  height: .12em;
  border-radius: 60% 20% 55% 20%;
  background: #d8e8da;
  transform: rotate(-1.5deg);
}
.intro h1 { isolation: isolate; }
.intro p { margin: 16px auto 0; color: var(--muted); font-size: clamp(15px, 1.35vw, 18px); line-height: 1.75; text-wrap: balance; }

.tutorial {
  --chapter-paper: var(--page-paper);
  --stage-top: var(--reading-position);
  --stage-heading-space: 55px;
  --demo-frame-height: clamp(350px, calc(91svh - var(--stage-top) - var(--stage-heading-space)), 784px);
  background-color: var(--chapter-paper);
  transition: background-color .42s ease;
}
.tutorial[data-chapter="request"] { --chapter-paper: #e8f1e9; }
.tutorial[data-chapter="share"] { --chapter-paper: #fbfaf5; }
.tutorial-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 1fr);
  align-items: start;
  column-gap: clamp(34px, 5.4vw, 78px);
  padding-bottom: clamp(48px, 7vh, 82px);
}
.shelf-stage { position: sticky; top: var(--stage-top); min-width: 0; align-self: start; }
.stage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 11px;
}
.stage-head h2 { display: inline-flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 650; letter-spacing: -.035em; }
.stage-head h2 svg { color: var(--green); }
.chapter-nav { display: flex; align-items: center; gap: 3px; }
.chapter-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding-inline: 9px;
  color: #596d60;
  font-size: 13px;
  position: relative;
}
.chapter-nav a::before { content: ""; width: 5px; height: 5px; margin-right: 7px; border: 1px solid #8a9c90; border-radius: 50%; }
.chapter-nav a[aria-current], .chapter-nav a:hover { color: var(--green-dark); }
.chapter-nav a[aria-current] { font-weight: 650; }
.chapter-nav a[aria-current]::before { background: var(--green); border-color: var(--green); }
#demo-shelf { min-width: 0; }
.lesson-list { min-width: 0; }
.lesson {
  min-height: max(460px, calc(100svh - var(--stage-top)));
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-block: clamp(63px, 10vh, 108px) 38px;
}
.lesson + .lesson { border-top: 1px solid var(--paper-line); }
.lesson-body { min-width: 0; }
.lesson-counter {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0 0 16px;
  color: var(--green-dark);
  font: 600 13px/1.4 Consolas, "Microsoft YaHei", monospace;
}
.lesson-counter::before { content: ""; width: 23px; height: 2px; align-self: center; margin-right: 3px; background: var(--green); }
.lesson-counter span:first-child { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; font-weight: 550; }
.lesson-counter span:last-child { color: var(--muted); font-weight: 400; }
.lesson h3 { color: var(--deep-ink); font-size: clamp(26px, 2.4vw, 36px); font-weight: 680; line-height: 1.24; letter-spacing: -.055em; text-wrap: balance; }
.lesson-copy { margin: 12px 0 0; color: #52665a; font-size: 15px; line-height: 1.82; }
.lesson figure { margin: 24px 0 12px; }
.lesson figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-weight: 650; }
.lesson figcaption small { color: var(--muted); font-size: 12px; font-weight: 400; }
.volume-note ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 8px 0 0;
  padding: 0 0 5px;
  border-bottom: 2px solid #a6b6a6;
  list-style: none;
}
.volume-note li {
  border: 1px solid #a9beac;
  border-left: 5px double #839e8b;
  border-radius: 2px 3px 2px 2px;
  padding: 9px 8px;
  background: #e4ecdf;
}
.volume-note b { display: block; font: 600 18px/1.3 "Songti SC", SimSun, serif; color: var(--deep-ink); }
.volume-note li small { display: block; margin-top: 4px; font-size: 11px; color: #455e4d; }
.volume-note .open-volume { border: 1px dashed #a08058; border-left-width: 2px; background: transparent; }
.open-volume small { color: #805d31 !important; }
.ticket-note, .share-note { padding: 13px 17px; background: #fff; border: 1px solid var(--paper-line); border-radius: 3px; box-shadow: 2px 3px 0 #49624f0b; }
.ticket-note figcaption { border-bottom: 1px dashed #b6c6b8; padding-bottom: 10px; }
.ticket-note figcaption small { color: #74562d; }
.ticket-note dl, .ticket-note dd, .share-note ul { margin: 0; }
.ticket-note dl { padding-top: 6px; }
.ticket-note dl div, .share-note li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 13px; }
.ticket-note dt, .share-note li span { color: var(--muted); }
.ticket-note dd { min-width: 0; text-align: end; overflow-wrap: anywhere; }
.share-note { border-top: 3px solid var(--green); }
.share-note figcaption { padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.share-note ul { list-style: none; padding: 4px 0 0; }
.try-action { gap: 10px; min-height: 44px; padding: 0; color: var(--green-dark); font-weight: 650; background: transparent; }
.try-action [aria-hidden], .to-top span { font: 18px/1 Arial, sans-serif; }
.try-action:hover { text-decoration: underline; text-underline-offset: 4px; }
.try-action:hover [aria-hidden] { transform: translateX(3px); }
.try-action [aria-hidden] { transition: transform .16s var(--ease); }
.mobile-slot:empty { display: none; }

.site-footer { padding-block: 25px 34px; color: var(--muted); background: #fff; border-top: 1px solid var(--line); }
.footer-heading, .footer-meta { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.footer-heading { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.footer-heading .site-brand { font-size: 22px; }
.to-top { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--green-dark); }
.footer-meta { padding-top: 14px; font-size: 12px; line-height: 1.8; }
.footer-meta p { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 18px; }
.footer-meta a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: .15em; }

@media (min-width: 901px) and (max-height: 600px) {
  .tutorial { --stage-top: var(--header-height); }
}
@media (max-width: 900px) {
  :root { --header-height: 60px; --reading-position: calc(var(--header-height) + 10px); }
  .intro { padding-block: 33px 27px; }
  .intro h1 { font-size: clamp(34px, 6.3vw, 53px); }
  .intro p { margin-top: 11px; }
  .tutorial { --demo-frame-height: clamp(350px, calc(85svh - var(--header-height)), 580px); }
  .tutorial-layout { display: block; }
  .shelf-stage { display: contents; }
  .desktop-slot:empty { display: none; }
  .stage-head {
    position: sticky;
    top: var(--header-height);
    z-index: 8;
    background: var(--chapter-paper);
    margin: 0;
    border-block: 1px solid var(--paper-line);
    transition: background-color .42s ease;
  }
  .stage-head h2 { font-size: 16px; }
  .stage-head h2 svg { width: 17px; }
  .lesson { scroll-margin-top: calc(var(--header-height) + 54px); min-height: auto; padding: 30px 0; }
  .lesson + .lesson { border-top-color: var(--paper-line); }
  .lesson-counter { margin-bottom: 9px; }
  .lesson h3 { font-size: 28px; }
  .lesson-copy { margin-top: 7px; max-width: 38em; }
  .lesson figure { max-width: 330px; margin-block: 12px 2px; }
  .mobile-slot { padding-top: 9px; scroll-margin-top: calc(var(--header-height) + 52px); }
}
@media (max-width: 650px) {
  :root { --header-height: 58px; }
  .header-row { grid-template-columns: 1fr auto auto; gap: 12px; }
  .site-brand { font-size: 22px; gap: 7px; }
  .site-brand img { width: 29px; height: 29px; }
  .site-login { padding-inline: 13px; gap: 7px; }
  .index-toggle { display: inline-flex; min-height: 44px; padding: 0; gap: 5px; font-size: 13px; background: transparent; color: var(--ink); }
  .menu-chevron { width: 6px; height: 6px; transform: rotate(45deg) translateY(-2px); border: solid currentColor; border-width: 0 1px 1px 0; }
  .index-toggle[aria-expanded="true"] .menu-chevron { transform: rotate(225deg); }
  .page-nav { display: none; position: absolute; top: calc(100% - 1px); right: 0; min-width: 150px; padding: 5px 11px; background: white; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 6px 18px #18342116; }
  .index-toggle[aria-expanded="true"] + .page-nav { display: grid; gap: 0; }
  .page-nav a { padding: 0 8px; }
  .page-nav a[aria-current] { font-weight: 600; background: var(--tint); }
  .page-nav a::after { display: none; }
  .intro { padding-block: 28px 24px; }
  .intro h1 { font-size: clamp(30px, 7.4vw, 44px); }
  .intro p { font-size: 14px; }
  .stage-head { gap: 1px 7px; }
  .stage-head h2 { font-size: 14px; gap: 5px; }
  .chapter-nav { gap: 0; }
  .chapter-nav a { font-size: 12px; padding-inline: 6px; }
  .chapter-nav a::before { width: 4px; height: 4px; margin-right: 4px; }
  .lesson { padding-block: 22px 28px; }
  .lesson-body { display: grid; grid-template-columns: minmax(0, 1fr); }
  .lesson-counter { font-size: 12px; }
  .lesson h3 { font-size: 25px; }
  .lesson-copy { font-size: 14px; line-height: 1.65; }
  .lesson figure { width: min(100%, 282px); }
  .lesson:has(.mobile-slot:not(:empty)) figure { display: none; }
  .try-action { justify-self: start; }
  .footer-meta { flex-direction: column; align-items: flex-start; gap: 4px; }
}
@media (max-width: 360px) {
  .header-row { gap: 9px; }
  .stage-head h2 svg { display: none; }
  .chapter-nav a { padding-inline: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .scroll-home *, .scroll-home *::before, .scroll-home *::after {
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* Trial bookshelf */
#demo-shelf {
  min-width: 0;
  container: demo-shelf / inline-size;
}

#demo-shelf [hidden] {
  display: none !important;
}

.demo-frame {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: var(--demo-frame-height);
  overflow: hidden;
  border: 1px solid #d4dfd5;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 42px -28px #203d3166;
  color: var(--ink);
}

.demo-frame-bar,
.demo-frame-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-inline: 17px;
}

.demo-frame-bar {
  min-height: 53px;
  border-bottom: 1px solid var(--line);
}

.demo-frame-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.demo-frame-label strong { font: 650 17px/1 Bahnschrift, "Microsoft YaHei", sans-serif; letter-spacing: -.04em; }

.demo-frame .demo-reset {
  min-height: 44px;
  padding-inline: 4px;
  color: var(--muted);
  white-space: nowrap;
}

.demo-reset svg { width: 15px; height: 15px; }
.demo-frame .demo-reset:hover { color: var(--green); }

.demo-frame-body {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
}

.demo-sidebar {
  overflow: auto;
  padding: 13px 10px;
  border-right: 1px solid var(--line);
  background: #f3f6f3;
}

.demo-sidebar .demo-nav-button {
  min-height: 31px;
  margin: 0;
  padding: 4px 7px;
  gap: 7px;
  font-size: 12px;
}

.demo-sidebar .demo-nav-button:hover { color: var(--green-dark); }
.demo-sidebar .demo-nav-button .count { font-size: 11px; }
.demo-sidebar .demo-nav-button .dot { margin: 0 5.5px; }

.demo-sidebar-group {
  margin-top: 9px;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}

.demo-sidebar .nav-heading {
  margin: 0 0 4px;
  padding: 0 7px;
  font-size: 11px;
}

.demo-mobile-nav { display: none; }
.demo-main,
.demo-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.demo-list {
  flex: 1;
  padding: 19px 20px 8px;
}

.demo-list [data-part="results"] {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
}

.demo-list-header,
.demo-tools,
.demo-drawer-head,
.demo-drawer-actions { flex: none; }

.demo-list-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.demo-list-header h2,
.demo-drawer-head h2 {
  color: var(--ink);
  font-size: 20px;
  font-weight: 680;
  line-height: 1.35;
  letter-spacing: -.02em;
}

.demo-list-header .link-button { flex: none; min-height: 32px; }

.demo-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.demo-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 11px;
}

.demo-search {
  display: flex;
  align-items: center;
  width: min(270px, 100%);
  min-width: 0;
  gap: 7px;
  padding-inline: 10px;
  border: 1px solid #c9d5ca;
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
}

.demo-search:focus-within { border-color: var(--green); }

.demo-search input {
  width: 100%;
  min-width: 0;
  min-height: 35px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.demo-search input:focus-visible { outline: none; }
.demo-search input::placeholder { color: var(--muted); opacity: 1; }
.demo-search input::-webkit-search-cancel-button { display: none; }
.demo-search .demo-icon-button { flex: none; margin-inline-end: -7px; }
.demo-request-link { flex: none; min-height: 36px; }

.demo-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.demo-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  height: 34px;
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  background: #f5f8f5;
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.demo-table th:nth-child(2) { width: 23%; }
.demo-table th:nth-child(3) { width: 20%; }

.demo-table td {
  height: 58px;
  padding: 4px 8px;
  border-bottom: 1px solid #e8eee8;
}

.demo-table tr:last-child td { border-bottom: 0; }

.demo-frame .demo-book-link {
  gap: 9px;
  min-height: 48px;
  scroll-margin-top: 36px;
}

.demo-book-link > span:last-child { min-width: 0; }
.demo-book-link .book-title { display: block; font-size: 14px; overflow-wrap: anywhere; }

.demo-book-link small,
.demo-ticket-list small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.demo-cover-mark {
  display: grid;
  width: 27px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #e3ebe2;
  border-radius: 4px;
  background: #ecf3ec;
  color: #44765e;
}

.demo-cover-mark svg { width: 15px; height: 15px; }

.demo-progress {
  display: inline-flex;
  flex-direction: column;
  align-items: start;
  gap: 4px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.demo-ratio { color: #747f76; font-size: 12px; font-weight: 450; }
.demo-progress-rail { display: flex; width: 36px; gap: 3px; }
.demo-progress-rail i { height: 3px; flex: 1; border-radius: 3px; background: #dae4db; }
.demo-progress-rail .is-owned { background: var(--green); }

.demo-status {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 560;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.demo-yes { color: var(--green-dark); background: var(--tint); }
.demo-pending { color: #795120; background: #f8eee0; }
.demo-neutral { color: #4d5e53; background: #eef2ef; }
.demo-yes-text { color: var(--green-dark); }

.demo-index-list,
.demo-ticket-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.demo-index-list li,
.demo-ticket-list li { border-bottom: 1px solid #e8eee8; }

.demo-index-list button,
.demo-ticket-list li {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  gap: 9px;
  padding: 6px 8px;
  background: transparent;
  text-align: left;
}

.demo-index-list button:hover { color: var(--green); background: #f5f8f5; }
.demo-index-list button span { margin-left: auto; color: var(--muted); font-size: 11px; }
.demo-ticket-list li { justify-content: space-between; }
.demo-ticket-list li > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.demo-ticket-list .demo-status { flex: none; }
.demo-empty { padding: 30px 8px; color: var(--muted); text-align: center; font-size: 13px; }

.demo-frame-footer {
  flex-wrap: wrap;
  min-height: 37px;
  gap: 3px 10px;
  padding-block: 7px;
  border-top: 1px solid var(--line);
  background: #fcfdfb;
  font-size: 11px;
}

.demo-foot-note { margin-left: auto; color: var(--muted); }
.demo-live { color: var(--green-dark); }

.demo-drawer {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #fff;
}

.demo-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 13px 7px 20px;
  border-bottom: 1px solid var(--line);
}

.demo-icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
}

.demo-icon-button:hover { background: var(--tint); color: var(--green-dark); }
.demo-drawer-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 13px 20px;
}
.demo-drawer-content > .demo-subtitle { margin: 0 0 12px; }
.demo-drawer-content h3 { margin: 0 0 9px; font-size: 14px; font-weight: 650; }

.demo-volumes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.demo-volume {
  display: grid;
  min-height: 53px;
  justify-content: start;
  gap: 1px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  text-align: left;
}

.demo-volume[aria-pressed="true"] { border-color: var(--green); background: #f0f7f0; }
.demo-volume small { color: var(--muted); font-size: 11px; }
.demo-volume .demo-yes-text { color: var(--green-dark); }

.demo-edition {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.demo-edition strong,
.demo-edition small { display: block; }
.demo-edition small { color: var(--muted); font-size: 11px; }

.demo-drawer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  min-height: 55px;
  gap: 8px;
  padding: 7px 20px;
  border-top: 1px solid var(--line);
  background: #fafcf9;
}

.demo-request-form { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.demo-request-form .field { max-width: none; margin-bottom: 10px; }
.demo-request-form .field:last-child { margin-bottom: 0; }
.demo-request-form .field textarea { min-height: 54px; resize: vertical; }

.demo-share {
  display: grid;
  grid-template-columns: minmax(0, .7fr) minmax(0, 1fr);
  align-content: start;
  gap: 14px;
}

.demo-share fieldset {
  min-width: 0;
  margin: 0;
  padding: 5px 0 0;
  border: 0;
}

.demo-share legend { padding: 0; font-size: 13px; font-weight: 650; }
.demo-share label { display: flex; align-items: center; gap: 6px; min-height: 37px; font-size: 13px; }
.demo-share input { width: 16px; height: 16px; }
.demo-export-paper { min-width: 0; }

.demo-export-paper canvas {
  display: block;
  width: 100%;
  max-width: 248px;
  height: auto;
  border: 1px solid #e0ebe1;
  background: #f4f7f3;
}

.demo-export-alert { color: var(--muted); font-size: 13px; }

@media (pointer: coarse) {
  .demo-sidebar .demo-nav-button, .demo-list-header .link-button, .demo-request-link,
  .demo-drawer-actions .button, .demo-share label, .demo-search input { min-height: 44px; }
  .demo-icon-button { width: 44px; height: 44px; }
}

@container demo-shelf (max-width: 555px) {
  .demo-frame-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  .demo-sidebar { display: none; }

  .demo-mobile-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 13px;
    border-bottom: 1px solid var(--line);
    background: #f3f6f3;
    color: var(--muted);
    font-size: 12px;
  }

  .demo-mobile-nav select {
    width: min(145px, 65%);
    min-height: 44px;
    padding-inline: 8px;
    border: 1px solid #cbd6cd;
    border-radius: var(--radius);
    background: #fff;
    color: var(--ink);
    font-size: 16px;
  }

  .demo-frame-bar,
  .demo-frame-footer { padding-inline: 13px; }
  .demo-list { padding: 14px 12px 7px; }
  .demo-list-header { margin-bottom: 9px; }
  .demo-list-header h2, .demo-drawer-head h2 { font-size: 18px; }
  .demo-list-header .link-button, .demo-request-link { min-height: 44px; }
  .demo-search { padding-inline: 8px; }
  .demo-search input { min-height: 44px; font-size: 16px; }
  .demo-table th, .demo-table td { padding-inline: 5px; }
  .demo-table th:nth-child(2) { width: 24%; }
  .demo-table th:nth-child(3) { width: 23%; }
  .demo-table td { height: 52px; }
  .demo-frame .demo-book-link { min-height: 44px; gap: 5px; }
  .demo-cover-mark { display: none; }
  .demo-book-link .book-title { font-size: 13px; }
  .demo-status { padding-inline: 4px; }
  .demo-drawer-head { padding: 4px 10px 4px 13px; }
  .demo-icon-button { width: 44px; height: 44px; }
  .demo-drawer-content, .demo-drawer-actions { padding-inline: 13px; }
  .demo-drawer-actions .button { min-height: 44px; }
  .demo-request-form .field input, .demo-request-form .field textarea { min-height: 44px; font-size: 16px; }
  .demo-share label { min-height: 44px; }
}

/* Feature sections */
.feature-section {
  display: grid;
  align-items: center;
}

.progress-feature,
.record-feature {
  min-height: 66svh;
  padding-block: clamp(20px, 4svh, 52px);
}

.scroll-home main > section.feature-section[id] {
  scroll-margin-top: var(--header-height);
}

.feature-intro h2 {
  margin: 0;
  font-size: clamp(32px, 4.1vw, 58px);
  font-weight: 690;
  letter-spacing: -.055em;
  line-height: 1.16;
}

.feature-label {
  margin: 0 0 16px;
  color: var(--green);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .14em;
}

.feature-description {
  max-width: 32ch;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 1.4vw, 17px);
  line-height: 1.84;
  text-wrap: pretty;
}

.progress-feature {
  --shelf-text: #ebf3e9;
  --shelf-muted: #afc4b6;
  background: radial-gradient(ellipse at 73% 14%, #244f3e 0%, transparent 59%), #17392e;
  color: var(--shelf-text);
}

.progress-feature-layout,
.record-feature-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(34px, 6.5vw, 103px);
  align-items: center;
}

@media (min-width: 841px) {
  .progress-feature-layout {
    grid-template-columns: minmax(240px, .72fr) minmax(0, 1.28fr);
  }
  .record-feature-layout {
    grid-template-columns: minmax(0, 1.28fr) minmax(240px, .72fr);
  }
  .record-slip { order: -1; }
}

.progress-feature .feature-label,
.progress-feature .feature-description {
  color: var(--shelf-muted);
}

.progress-figure {
  min-width: 0;
  margin: 0;
}

.progress-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ffffff38;
}

.progress-caption p {
  margin: 0;
}

.progress-caption p:first-child strong {
  padding-inline-end: 5px;
  font-size: clamp(22px, 2.1vw, 30px);
  font-weight: 680;
  letter-spacing: .04em;
}

.progress-caption span {
  color: var(--shelf-muted);
  font-size: 13px;
}

.progress-caption-count {
  white-space: nowrap;
}

.progress-caption-count strong {
  font-size: 27px;
  font-variant-numeric: tabular-nums;
  font-weight: 590;
}

.progress-spines {
  --spine-extra-height: clamp(0px, calc(18svh - 120px), 48px);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: clamp(5px, .8vw, 13px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.progress-spine {
  display: grid;
  grid-template-rows: auto 1fr auto;
  justify-items: center;
  align-items: center;
  height: clamp(
    160px,
    calc(19vw + var(--spine-extra-height)),
    calc(var(--spine-height, 270px) + var(--spine-extra-height))
  );
  padding: clamp(9px, 1vw, 15px) 2px;
  border: 1px solid #ffffff35;
  border-radius: 3px 5px 1px 1px;
  background: linear-gradient(90deg, #0000002c, transparent 10%, #ffffff15 13%, transparent 18%, #00000011);
  color: #1c3728;
  box-shadow: inset 2px 0 0 #00000018, 3px 6px 15px #0d281c66;
}

.spine-number {
  display: grid;
  min-width: min(26px, 88%);
  min-height: 23px;
  place-items: center;
  border-block: 1px solid currentColor;
  font: 600 clamp(11px, 1vw, 14px)/1 Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.progress-spine > strong {
  font-family: "Noto Serif CJK SC", "Songti SC", "SimSun", serif;
  font-size: clamp(15px, 1.9vw, 26px);
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1.1;
  writing-mode: vertical-rl;
}

.spine-status {
  font-size: clamp(11px, 1vw, 12px);
  font-weight: 650;
  white-space: nowrap;
}

.spine-cream {
  --spine-height: 242px;
  background-color: #e5d6a3;
}

.spine-green {
  --spine-height: 270px;
  background-color: #789a75;
  color: #132d23;
}

.spine-mint {
  --spine-height: 257px;
  background-color: #c1d9bd;
}

.spine-transit {
  --spine-height: 242px;
  border-color: #aabd9f8c;
  background: repeating-linear-gradient(135deg, #9bb19b30 0 1px, transparent 1px 7px), #325244;
  color: #e3ede0;
}

.spine-missing {
  --spine-height: 255px;
  border-color: #8ba69b9c;
  border-style: dashed;
  background: #183a2f77;
  color: #b5c9be;
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  .progress-spine {
    transition: transform .2s var(--ease), filter .2s ease, border-color .2s ease;
  }
  .progress-spines > li:hover .progress-spine {
    transform: translateY(-7px);
    filter: brightness(1.12);
    border-color: #d4e5cf;
  }
}

@media (prefers-reduced-motion: reduce) {
  .progress-spines > li:hover .progress-spine { transform: none; }
}

.progress-spines + .progress-key {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px clamp(11px, 2vw, 23px);
  margin: 0;
  padding: 15px 0 0;
  border-top: 2px solid #b3c8b788;
  color: var(--shelf-muted);
  font-size: 12px;
  list-style: none;
}

.progress-key li {
  display: flex;
  align-items: center;
  gap: 5px;
}

.progress-key b {
  padding-inline-start: 2px;
  color: var(--shelf-text);
  font-variant-numeric: tabular-nums;
}

.progress-key-swatch {
  width: 12px;
  height: 12px;
  margin-inline-end: 2px;
  border: 1px solid #a5bcac;
  border-radius: 2px;
}

.key-owned {
  border-color: #c1d9bd;
  background: #c1d9bd;
}

.key-transit {
  background: repeating-linear-gradient(135deg, #a5bcac 0 1px, transparent 1px 4px);
}

.key-missing {
  border-style: dashed;
}

.catalog-feature {
  min-height: 100svh;
  padding-block: clamp(65px, 8.4vw, 126px);
  background: #fbfaf6;
}

.catalog-feature-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.33fr) minmax(0, .67fr);
  gap: clamp(15px, 5vw, 80px);
  align-items: end;
  margin-bottom: clamp(26px, 4.5vw, 64px);
}

.catalog-feature-intro .feature-description {
  margin-top: 0;
}

.catalog-sheet {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) repeat(2, minmax(0, 1fr));
  gap: clamp(18px, 2.6vw, 42px);
  padding-block: clamp(20px, 3vw, 36px);
  border-block: 1px solid #b5c3b7;
}

.catalog-column + .catalog-column {
  padding-inline-start: clamp(16px, 2.6vw, 40px);
  border-inline-start: 1px solid #c7d4ca;
}

.catalog-column h3 {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .09em;
}

.catalog-column dl, .catalog-column dd { margin: 0; }
.catalog-column dl > div + div { border-top: 1px solid #e0e6dd; }
.catalog-column dl > div { padding: 12px 0; }
.catalog-column dl > div:last-child { padding-bottom: 0; }

.catalog-column dt {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--deep-ink);
}

.catalog-column dt strong {
  font-size: clamp(18px, 1.5vw, 23px);
  font-weight: 650;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.catalog-authors dt strong {
  font-family: "Noto Serif CJK SC", "Songti SC", SimSun, serif;
  font-size: clamp(23px, 2.15vw, 32px);
  letter-spacing: .025em;
}

.catalog-authors dl > div:first-child strong {
  font-size: clamp(46px, 5vw, 72px);
  line-height: 1.05;
  letter-spacing: .06em;
}

.catalog-column dt small {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.catalog-column dd {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 3px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.record-feature {
  background: #eaf0e9;
}

.record-slip {
  position: relative;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: clamp(19px, 3vw, 39px);
  border: 1px solid #cbd8cb;
  border-top: 4px solid #38664e;
  background: #fffdf7;
  color: #273c31;
  box-shadow: 0 7px 0 -3px #dae6d9, 0 20px 36px -22px #15392b6e;
}

.record-slip-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 7px 13px;
  padding-bottom: 13px;
  border-bottom: 1px solid #acbfaf;
}

.record-slip-heading p {
  margin: 0 0 6px;
  color: #4d6a55;
  font-size: 11px;
  letter-spacing: .12em;
}

.record-slip-heading strong {
  font-family: "Noto Serif CJK SC", "Songti SC", "SimSun", serif;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: .1em;
  line-height: 1.1;
}

.record-slip-heading > span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.record-location {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 20px;
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid #d7e3d5;
}

.record-location dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
}

.record-location dd {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}

.record-owned {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--green-dark);
}

.record-owned span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.record-events {
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}

.record-events li {
  display: grid;
  grid-template-columns: minmax(78px, .65fr) minmax(0, 1.35fr);
  align-items: baseline;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #e0e7dc;
}

.record-events li:last-child {
  border: 0;
  padding-bottom: 0;
}

.record-events time {
  color: #516857;
  font: 12px/1.5 Consolas, monospace;
}

.record-events p {
  display: grid;
  grid-template-columns: minmax(40px, .55fr) minmax(0, 1fr);
  align-items: baseline;
  gap: 1px 12px;
  margin: 0;
}

.record-events p strong {
  font-size: 13px;
}

.record-events p span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 840px) {
  .progress-feature-layout,
  .record-feature-layout {
    row-gap: clamp(18px, 4vw, 34px);
  }

  .progress-caption {
    margin-bottom: 17px;
  }

  .progress-spine {
    height: clamp(154px, min(46vw, 28svh), var(--spine-height, 270px));
  }

}

@media (max-width: 600px) {
  .catalog-feature {
    padding-block: 58px;
  }

  .feature-label {
    margin-bottom: 11px;
  }

  .feature-description {
    margin-top: 14px;
  }

  .progress-caption span {
    font-size: 11px;
  }

  .progress-caption-count strong {
    font-size: 22px;
  }

  .progress-spine > strong {
    font-size: clamp(16px, 4vw, 22px);
  }

  .catalog-feature-intro,
  .catalog-sheet {
    grid-template-columns: minmax(0, 1fr);
  }

  .catalog-sheet {
    gap: 0;
    padding-block: 0;
  }

  .catalog-column { padding: 18px 0; }
  .catalog-column + .catalog-column {
    border-inline-start: 0;
    border-top: 1px solid #b5c3b7;
    padding-inline-start: 0;
  }
  .catalog-column h3 { margin-bottom: 4px; }
  .catalog-column dl > div { padding-block: 9px; }
  .catalog-column dd { margin-top: 4px; }
}
