:root {
  color-scheme: light;
  --ink: #192723;
  --muted: #52625c;
  --paper: #f7f8f3;
  --white: #fff;
  --line: #d6ded4;
  --green: #235a3b;
  --leaf: #e4eddb;
  --forest: #17332a;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
a { color: var(--green); text-underline-offset: .2em; }
a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible,
button:focus-visible, summary:focus-visible { outline: 3px solid #388356; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.23; overflow-wrap: anywhere; }
h1 { font-size: clamp(2.05rem, 5vw, 3.25rem); letter-spacing: -.035em; }
h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); }
h3 { font-size: 1.15rem; }
button, input, textarea, select { font: inherit; }
button, summary { cursor: pointer; }
.wrap { width: min(70rem, calc(100% - 3rem)); margin-inline: auto; }
.skip { position: absolute; top: .5rem; left: .5rem; z-index: 9; padding: .5rem 1rem; background: var(--white); transform: translateY(-180%); }
.skip:focus { transform: none; }
.site-header { border-bottom: 1px solid var(--line); background: #fbfcf8; }
.mast { min-height: 4.7rem; display: flex; align-items: center; justify-content: space-between; gap: .65rem 2rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; color: var(--ink); font-weight: 760; text-decoration: none; white-space: nowrap; }
.brand-icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: .55rem; color: #fff; background: var(--forest); font: 700 1rem ui-monospace, monospace; }
.brand small { display: block; color: var(--muted); font-size: .82rem; font-weight: 500; }
.navigation { display: flex; flex-wrap: wrap; gap: .125rem 1.65rem; align-items: center; }
.navigation a { display: inline-flex; min-height: 3rem; align-items: center; color: var(--muted); text-decoration: none; font-size: .93rem; }
.navigation a:hover, .navigation a[aria-current] { color: var(--green); text-decoration: underline; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 2.8rem; margin-block: 2.15rem 1.5rem; padding: clamp(1.4rem, 5vw, 3.1rem); border: 1px solid #d7e1cf; border-radius: 1.35rem; background: #e9f0e0; }
.hero h1 { font-size: clamp(2rem, 5.25vw, 4.05rem); }
.eyebrow { color: var(--green); font-weight: 700; font-size: .82rem; letter-spacing: .105em; margin-bottom: .7rem; }
.lede { color: var(--muted); font-size: clamp(1rem, 2vw, 1.15rem); margin-top: 1rem; max-width: 30rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.45rem; }
.button { min-height: 3rem; padding: .55rem 1rem; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: .52rem; font-weight: 700; text-decoration: none; line-height: 1.25; }
.primary { color: #fff; background: var(--green); }
.primary:hover { background: #16472c; }
.quiet { color: var(--green); background: #f9fbf6; border-color: #a7bbab; }
.quiet:hover { background: var(--leaf); }
.terminal { min-width: 0; border: 1px solid #2d5240; border-radius: .8rem; background: #192f28; color: #e6eee4; overflow: hidden; box-shadow: 0 16px 26px #1c37261d; }
.terminal-bar { display: flex; align-items: center; gap: .9rem; border-bottom: 1px solid #3c5146; padding: .7rem 1rem; color: #c5d7c7; font: .87rem ui-monospace, monospace; }
.terminal-bar span:first-child { color: #a4c48a; letter-spacing: .15em; font-size: .68rem; }
.terminal pre, .sample, .monospace { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.terminal pre { overflow: auto; padding: .75rem 1.1rem 1.2rem; font-size: clamp(.85rem, 2vw, 1rem); line-height: 1.8; margin: 0; }
.code-comment { color: #b9cabe; }
.code-key { color: #a6dfaa; }
.code-value { color: #f8d79b; }
.finder { display: block; background: var(--white); border: 1px solid var(--line); padding: 1.1rem 1.2rem; border-radius: .85rem; }
.finder.compact { max-width: 52rem; }
.finder label, .field label { display: block; font-weight: 650; margin-bottom: .35rem; }
.search-row { display: flex; gap: .55rem; }
input, textarea, select { width: 100%; min-width: 0; color: var(--ink); background: var(--white); border: 1px solid #798980; border-radius: .5rem; padding: .55rem .75rem; font-size: 1rem; }
input, select { min-height: 3rem; }
textarea { display: block; resize: vertical; }
.search-row button { flex: none; }
.block { margin-top: 2rem; scroll-margin-top: 1.4rem; }
.block h2 { margin: 0 0 .9rem; }
.route-grid, .card-grid, .catalog { display: grid; gap: .85rem; }
.route-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 0; list-style: none; counter-reset: none; margin: 0; }
.route-grid a { display: grid; gap: .2rem; height: 100%; text-decoration: none; background: #f0f4eb; color: var(--ink); border: 1px solid #d5dfd4; padding: 1rem; border-radius: .75rem; }
.route-grid a:hover { border-color: var(--green); }
.route-grid a span:last-child { color: var(--muted); font-size: .9rem; }
.route-number { color: var(--green); font: 700 .92rem ui-monospace, monospace; margin-bottom: .28rem; }
.card-grid, .catalog { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lesson-card { background: var(--white); border: 1px solid var(--line); border-radius: .75rem; padding: 1rem 1.1rem; }
.lesson-card h3 { margin-block: .35rem .45rem; }
.lesson-card h3 a { color: var(--ink); text-decoration: none; }
.lesson-card h3 a:hover { text-decoration: underline; color: var(--green); }
.lesson-card p { color: var(--muted); font-size: .94rem; }
.lesson-card .card-meta { color: var(--green); font-weight: 650; font-size: .85rem; }
.card-meta span { color: #697d70; }
.catalog a { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: .6rem; text-decoration: none; }
.catalog a:hover { background: var(--leaf); }
.catalog span { color: var(--muted); }
.page-footer { margin-top: 2.5rem; min-height: 4.6rem; padding: 1rem 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; color: var(--muted); font-size: .92rem; }
.page-head { margin-block: 1.8rem 1.2rem; }
.page-head h1 + p, .login h1 + p { color: var(--muted); margin-top: .55rem; }
.page-head .eyebrow { margin: .75rem 0 .3rem; }
.back { font-size: .95rem; display: inline-flex; min-height: 2rem; align-items: center; margin-bottom: .35rem; }
.filters { display: flex; flex-wrap: wrap; gap: .55rem; margin-block: 1.05rem; }
.filters a { text-decoration: none; border: 1px solid var(--line); border-radius: 2rem; padding: .4rem .85rem; }
.filters a[aria-current], .filters a:hover { background: var(--leaf); border-color: #b3c7b0; }
.reading { max-width: 51rem; margin-inline: auto; }
.copy, .related, .feedback, .login, .editor, .feedback-item { background: var(--white); border: 1px solid var(--line); border-radius: .85rem; padding: clamp(1rem, 3.5vw, 1.8rem); margin-bottom: 1rem; }
.copy h2, .related h2, .feedback h2 { margin-bottom: .7rem; }
.copy p + p, .feedback-item p + p { margin-top: .7rem; }
.copy > p + h2 { margin-top: 1.25rem; }
.sample { background: #192f28; color: #f0faee; overflow-x: auto; padding: 1rem; border-radius: .6rem; font-size: .94rem; line-height: 1.6; margin-bottom: 0; }
.solution { margin-top: .8rem; }
.solution summary { color: var(--green); font-weight: 700; min-height: 2.75rem; }
.related ul { margin-bottom: 0; padding-left: 1.3rem; }
.page-turn { display: flex; gap: 1rem; margin: 1rem 0; justify-content: space-between; }
.page-turn a { min-width: 0; overflow-wrap: anywhere; }
.page-turn small { display: block; color: var(--muted); }
.field { margin: .8rem 0; }
.notice { border-left: 3px solid #5a865f; background: var(--leaf); padding: .65rem .9rem; margin-block: .75rem; border-radius: .2rem; }
.notice.alert { background: #faede8; border-color: #9a452d; }
.trap { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.login { max-width: 28rem; margin: 3rem auto; }
.login .button { width: 100%; margin-top: .6rem; }
.admin-theme { --paper: #f2f5f2; }
.admin-nav { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-block: 1.15rem; border-bottom: 1px solid var(--line); padding-bottom: .8rem; }
.admin-nav nav { display: flex; flex-wrap: wrap; gap: .5rem 1.15rem; }
.admin-nav nav a, .row-actions a { text-decoration: none; }
.admin-nav nav a[aria-current], .admin-nav nav a:hover, .row-actions a:hover { text-decoration: underline; }
.admin-head { display: flex; justify-content: space-between; align-items: end; gap: .7rem; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin: 1rem 0; }
.stats div { background: var(--white); border: 1px solid var(--line); border-radius: .65rem; padding: .9rem; }
.stats div span { color: var(--muted); display: block; font-size: .95rem; }
.stats strong { font-size: 1.5rem; }
.admin-list { background: var(--white); border: 1px solid var(--line); border-radius: .85rem; }
.admin-list h2 { padding: .9rem 1rem; }
.admin-list ul { list-style: none; margin: 0; padding: 0; }
.admin-list li { display: grid; grid-template-columns: minmax(0, 2.2fr) 1fr .8fr minmax(6rem, 1fr); gap: .65rem; align-items: center; padding: .68rem 1rem; border-top: 1px solid var(--line); }
.content-title { color: var(--ink); font-weight: 650; text-decoration: none; overflow-wrap: anywhere; }
.content-title:hover { text-decoration: underline; }
.state { width: fit-content; font-size: .89rem; font-weight: 650; color: #405e47; background: #e8eee4; border-radius: 2rem; padding: .15rem .55rem; }
.state.pending { background: #f6edcf; color: #645018; }
.state.draft { background: #eeeeef; color: #44464a; }
.row-actions { display: flex; flex-wrap: wrap; gap: .3rem .6rem; justify-content: flex-end; }
.editor { max-width: 54rem; }
.edit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.help { color: var(--muted); font-size: .9rem; }
.feedback-title { display: flex; justify-content: space-between; gap: .65rem; }
.feedback-item { max-width: 54rem; }
.feedback-item form { margin-top: .75rem; }

@media (max-width: 53rem) {
  .mast { flex-wrap: wrap; padding-top: .65rem; gap: 0 1rem; }
  .mast .navigation { min-height: 2.9rem; gap: 0 1.2rem; }
  .hero { gap: 1.5rem; }
  .route-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 42rem) {
  .wrap { width: calc(100% - 1.5rem); }
  .hero { grid-template-columns: minmax(0, 1fr); margin-block: 1rem; }
  .card-grid, .catalog { grid-template-columns: minmax(0, 1fr); }
  .navigation a { min-height: 2.8rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-list li { grid-template-columns: 1fr auto; gap: .35rem .5rem; }
  .admin-list li > span:nth-child(2) { grid-row: 2; }
  .row-actions { grid-column: 2; grid-row: 2; }
  .edit-grid { grid-template-columns: 1fr; gap: 0; }
}
