:root {
  color-scheme: light;
  --paper: #f7f6ef;
  --white: #fffefa;
  --ink: #192d26;
  --muted: #475b51;
  --line: #cbd4c8;
  --green: #205c47;
  --deep-green: #153d30;
  --pale-green: #e6efe4;
  --title: "Noto Serif CJK SC", "Songti SC", SimSun, serif;
  --body: system-ui, -apple-system, "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.7 var(--body); }
a { color: var(--green); text-underline-offset: .21em; text-decoration-thickness: .08em; }
a:hover { color: var(--deep-green); }
a:focus-visible, [tabindex]:focus-visible { outline: 3px solid #8a4e13; outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
p, h1, h2, h3, ul, ol, figure { margin-top: 0; }
h1, h2, h3 { line-height: 1.35; }
h1, .front h2, .category-section > h2, .section-view h2, .reading h2 { font-family: var(--title); }
h1 { margin-bottom: 1.2rem; font-size: clamp(2rem, 4.9vw, 3.65rem); font-weight: 750; }
h2 { font-size: 1.42rem; }
p { margin-bottom: 1.1rem; }
.wrap { width: min(72rem, calc(100% - 4rem)); margin-inline: auto; }
.skip { position: fixed; z-index: 2; left: 1rem; top: 1rem; padding: .6rem 1rem; background: var(--white); transform: translateY(-200%); }
.skip:focus { transform: translateY(0); }

.site-header { border-top: .32rem solid var(--deep-green); border-bottom: 1px solid var(--line); background: var(--white); }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem 2rem; padding-block: .85rem; }
.brand { color: var(--ink); font: 750 1.35rem/1.15 var(--title); text-decoration: none; white-space: nowrap; }
.site-nav { display: flex; flex-wrap: wrap; gap: .2rem; }
.site-nav a { display: grid; align-items: center; padding: .55rem .68rem; min-height: 2.75rem; text-align: center; color: var(--ink); font-size: .93rem; font-weight: 600; text-decoration: none; border-radius: .45rem; }
.site-nav a:hover, .site-nav .current { background: var(--pale-green); color: var(--deep-green); }
.site-nav .current { box-shadow: inset 0 -2px var(--green); }

.front { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; margin-block: 3.6rem 3rem; }
.front-intro { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: clamp(1.5rem, 4vw, 3.2rem); border-radius: 1rem; background: var(--deep-green); color: var(--white); }
.front-intro p { color: #e4eee5; font-size: 1.04rem; max-width: 29ch; }
.button { display: inline-flex; align-items: center; justify-content: center; margin-top: .6rem; min-height: 3rem; padding: .45rem 1.2rem; border-radius: .4rem; color: var(--ink); background: #f1dda7; text-decoration: none; font-weight: 750; }
.button:hover { background: #f9eabc; }
.button:focus-visible { outline-color: #f1dda7; }
.feature { color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 1rem; overflow: hidden; text-decoration: none; }
.feature:hover h2 { text-decoration: underline; text-underline-offset: .2em; }
.feature-image { padding: clamp(.55rem, 2vw, 1.2rem); background: var(--pale-green); }
.feature-image img { width: 100%; border-radius: .36rem; border: 1px solid var(--line); }
.feature-caption { padding: 1.15rem 1.35rem; }
.feature-caption h2 { margin-bottom: .35rem; font-size: 1.6rem; }
.feature-caption p, .category-card p, .article-row p { color: var(--muted); margin: 0; }

.category-section { margin-bottom: 4rem; }
.category-section > h2 { margin-bottom: 1rem; font-size: 1.7rem; }
.category-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.category-card { display: block; min-width: 0; padding: 1.05rem 1.2rem; border: 1px solid var(--line); border-radius: .75rem; background: var(--white); color: var(--ink); text-decoration: none; }
.category-card h3 { margin: 0 0 .35rem; font-size: 1.08rem; }
.category-card p { font-size: .95rem; }
.category-card:hover { border-color: var(--green); }
.category-card:hover h3, .article-row:hover h2 { text-decoration: underline; text-underline-offset: .2em; }

.section-view, .reading { max-width: 52rem; margin: 3.25rem auto 4rem; }
.article-list { border-top: 1px solid var(--line); margin: 1.5rem 0 0; padding: 0; list-style: none; }
.article-row { display: block; color: var(--ink); text-decoration: none; padding: 1.25rem .25rem; border-bottom: 1px solid var(--line); }
.article-row h2 { margin-bottom: .4rem; font-size: 1.3rem; }
.reading h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
.back-link { display: inline-block; margin-bottom: .85rem; font-size: .95rem; font-weight: 650; }
.prose { overflow-wrap: anywhere; }
.prose li { margin-bottom: .45rem; }
.prose ul, .prose ol { padding-inline-start: 1.6em; }
.prose h2 { margin-top: 1.8em; margin-bottom: .6em; }
.prose h3 { margin-top: 1.5em; }
.prose .table-wrap, .prose .table-scroll { overflow-x: auto; margin-block: 1.2rem; border: 1px solid var(--line); border-radius: .45rem; }
.prose table { width: 100%; border-collapse: collapse; background: var(--white); }
.prose .wide-table { min-width: 34rem; }
.prose th, .prose td { text-align: left; padding: .65rem .65rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--pale-green); }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose blockquote { margin-inline: 0; padding-inline-start: 1em; border-inline-start: .2rem solid var(--green); }
.room-figure { margin: 1.3rem 0 1.5rem; }
.room-figure img { width: 100%; background: white; border: 1px solid var(--line); border-radius: .55rem; }
.room-figure figcaption { margin-top: .45rem; color: var(--muted); font-size: .9rem; }
.site-footer { padding-block: 1.1rem; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }
.footer-inner a { font-size: .93rem; }

@media (max-width: 50rem) {
  .wrap { width: calc(100% - 2.25rem); }
  .header-inner { display: block; padding-block: .75rem .55rem; }
  .brand { display: inline-block; margin-bottom: .45rem; }
  .site-nav { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .15rem; }
  .site-nav a { padding-inline: .2rem; }
  .front { margin-top: 2rem; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 36rem) {
  .wrap { width: calc(100% - 1.75rem); }
  .site-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-nav a { background: var(--paper); font-size: .9rem; }
  .front { grid-template-columns: 1fr; gap: .75rem; margin-block: 1.25rem 2rem; }
  .front-intro { padding: 1.35rem 1.2rem; }
  .front-intro h1 { margin-bottom: .65rem; }
  .feature-caption { padding: .9rem 1rem; }
  .category-section { margin-bottom: 2.5rem; }
  .category-card { padding: .78rem .68rem; }
  .section-view, .reading { margin-block: 1.6rem 2.7rem; }
  .prose th, .prose td { padding-inline: .45rem; }
  .prose table:not(.wide-table) th:first-child { width: 32%; }
  .prose table.three-columns th:first-child { width: 23%; }
}
