:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
  color: #192e3c;
  background: #eef4f6;
  line-height: 1.7;
  --ink: #192e3c;
  --navy: #102737;
  --teal: #006760;
  --sub: #4d6470;
  --line: #d7e4e9;
  --paper: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--teal); text-underline-offset: .2em; }
input { font: inherit; }
:focus-visible { outline: 3px solid #118880; outline-offset: 3px; }
.top {
  position: sticky;
  z-index: 5;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: .75rem max(1.25rem, calc((100% - 80rem) / 2));
  border-bottom: 1px solid #245062;
}
.brand { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; color: inherit; line-height: 1.28; }
.brand img { border-radius: .8rem; width: 44px; height: 44px; }
.brand strong { display: block; font-size: 1.16rem; letter-spacing: .025em; }
.brand small { display: block; color: #b7d7db; margin-top: .23rem; font-size: .85rem; }
.layout {
  max-width: 82.5rem;
  margin: auto;
  padding: 1.7rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: minmax(14.5rem, 17.75rem) minmax(0, 1fr);
  align-items: start;
  gap: 1.35rem;
}
aside, main { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 1rem; }
aside { padding: 1.1rem; position: sticky; top: 5.9rem; max-height: calc(100dvh - 7rem); overflow: auto; }
aside label, .sidebar-directory > summary { display: block; font-weight: 720; font-size: .95rem; }
.sidebar-directory > summary { display: list-item; cursor: pointer; padding: .45rem 0; }
#search {
  width: 100%; min-height: 45px; margin: .4rem 0 .8rem;
  border: 1px solid #9db4bc; border-radius: .55rem;
  padding: .45rem .7rem; color: var(--ink); background: #f7fafb;
}
#search::placeholder { color: #526976; }
nav ul { list-style: none; padding: 0; margin: .15rem 0; }
nav ul ul { padding-left: .55rem; margin-left: .55rem; border-left: 1px solid var(--line); }
nav a {
  min-height: 42px; display: flex; align-items: center; padding: .45rem .6rem;
  border-radius: .45rem; color: var(--ink); text-decoration: none;
  overflow-wrap: anywhere; font-size: .92rem; line-height: 1.42;
}
nav a:hover, nav a[aria-current=page] { background: #dff2ee; color: #004e49; }
nav a[aria-current=page] { font-weight: 720; }
main { padding: clamp(1rem, 3vw, 2.3rem); min-height: 32rem; scroll-margin-top: 5.4rem; }
h1,h2,h3,h4 { overflow-wrap: anywhere; line-height: 1.28; }
h1 { margin: 0; font-size: clamp(1.74rem, 3.6vw, 2.75rem); font-weight: 780; letter-spacing: -.025em; }
h2 { font-size: clamp(1.2rem, 2vw, 1.52rem); }
.quiet,.crumbs { color: var(--sub); font-size: .91rem; }
.workshop-heading {
  padding: clamp(1.4rem, 4.2vw, 3.5rem) clamp(1.15rem, 4.5vw, 3.1rem);
  border-radius: .85rem;
  color: #fff;
  background:
    radial-gradient(ellipse at 92% 30%, #275164 0%, transparent 52%),
    linear-gradient(115deg, #142b3d 15%, #163949 100%);
  border-bottom: 3px solid #43b7a8;
}
.workshop-heading h1 { max-width: 25ch; }
.chapter-heading { margin-bottom: 1.55rem; padding-bottom: 1.35rem; border-bottom: 1px solid var(--line); }
.crumbs { margin-bottom: .7rem; }
.chapter-index { margin: 1.75rem 0 2.1rem; }
.chapter-index h2 { margin: 0 0 .75rem; }
.cards {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: .72rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.5rem), 1fr));
}
.cards li { min-width: 0; }
.cards a {
  display: grid; align-content: center; min-height: 4rem; height: 100%;
  padding: .85rem .9rem; border: 1px solid var(--line); border-radius: .6rem;
  border-left: 3px solid #70b6aa; background: #f8fbfc; color: #174c4b;
  font-weight: 680; line-height: 1.42; overflow-wrap: anywhere; text-decoration: none;
}
.cards a:hover { border-color: var(--teal); background: #e9f5f2; }
.cards small { display: block; margin-top: .42rem; color: var(--sub); font-size: .875rem; font-weight: 400; }
.note { overflow-wrap: anywhere; font-size: 1rem; line-height: 1.8; }
.note :is(h2,h3,h4) { scroll-margin-top: 5.65rem; }
.note h2 { margin: 1.85rem 0 .72rem; color: #154652; }
.note h3 { margin: 1.35rem 0 .55rem; font-size: 1.16rem; }
.note h4 { margin: 1.05rem 0 .4rem; font-size: 1.02rem; }
.note p { margin: .62rem 0 .92rem; }
.note img,.note video { max-width: 100%; height: auto; border-radius: .45rem; }
.note figure { margin: 1.15rem 0; }
.table-frame { overflow-x: auto; margin: 1.05rem 0 1.45rem; border: 1px solid var(--line); border-radius: .6rem; }
.note table { width: 100%; min-width: 30rem; border-collapse: collapse; font-size: .93rem; line-height: 1.55; }
.note th,.note td { padding: .6rem .8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.note tr:last-child > * { border-bottom: 0; }
.note th { background: #e5f2f1; color: #163e47; }
.note tr:nth-child(2n+3) td { background: #f5f9fa; }
.note pre { white-space: pre-wrap; background: #edf3f5; padding: .75rem; border-radius: .55rem; }
.note blockquote { margin: 1rem 0; padding: .1rem 0 .1rem 1rem; border-left: 3px solid #70aaa8; color: #355462; }
.note details { padding: .5rem .8rem; border: 1px solid var(--line); border-radius: .55rem; background: #f8fbfc; }
.note summary { cursor: pointer; font-weight: 700; }
.note .chapter-toc { margin: 0 0 1.25rem; }
.note .chapter-toc a { text-decoration-thickness: .07em; }
.note .callout { padding: .65rem 1rem; background: #edf7f6; border-left: 3px solid #238880; border-radius: .55rem; margin-block: .9rem; }
.note .callout p { margin: .25rem 0; }
.note .notion-property { color: var(--sub); font-size: .91rem; }
.note li + li { margin-top: .26rem; }
.note hr { border: 0; border-top: 1px solid var(--line); margin-block: 1.45rem; }
#status:empty { display: none; }
#status { background: #eaf6f4; padding: .65rem .8rem; border-radius: .5rem; margin: 0 0 1rem; }
#status[data-error] { background: #fff0e7; color: #7b3719; }
@media (max-width: 740px) {
  .top { padding: .55rem .9rem; }
  .brand img { width: 38px; height: 38px; }
  .layout { grid-template-columns: minmax(0,1fr); padding: .75rem .65rem 1.45rem; gap: .65rem; }
  aside { position: static; max-height: none; padding: .75rem .85rem .45rem; }
  aside nav { max-height: min(17rem, 42dvh); overflow: auto; }
  .sidebar-directory > summary { min-height: 44px; }
  #search { margin-bottom: .28rem; }
  main { min-height: 0; }
  .chapter-index { margin-block: 1.3rem 1.65rem; }
  .chapter-index .cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); }
  .note table { min-width: 26rem; }
}
