:root {
  font: 16px/1.55 "Microsoft YaHei UI", "Segoe UI", system-ui, sans-serif;
  color: #172e2b;
  background: #f0f6f3;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: #0a6150; text-underline-offset: .2em; }
button, input { font: inherit; }
:focus-visible { outline: 3px solid #a75621; outline-offset: 3px; }

main { width: min(100% - 2rem, 70rem); margin: auto; padding: clamp(1.5rem, 5vw, 4rem) 0; }
header { padding-bottom: 1.4rem; border-bottom: 1px solid #bdd1c9; }
.home-link { display: inline-block; margin-bottom: 1.1rem; }
h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.45rem); line-height: 1.12; letter-spacing: -.035em; }
header p { color: #47615a; margin: .6rem 0 0; }

.tree-tools { display: flex; flex-wrap: wrap; gap: .55rem .75rem; align-items: center; margin: 1.1rem 0; }
.tree-tools label { font-weight: 700; }
.tree-tools input { flex: 1 1 16rem; min-width: 0; padding: .5rem .7rem; border: 1px solid #789f93; border-radius: .5rem; background: #fff; }
.tree-actions { display: flex; gap: .5rem; }
.tree-actions button { min-height: 2.45rem; padding: .25rem .7rem; border: 1px solid #90b4a9; border-radius: .5rem; color: #075c4b; background: #fff; cursor: pointer; }
.tree-actions button:disabled { opacity: .5; cursor: default; }
.tree-status { margin: .2rem 0 1rem; color: #47615a; }
.tree-status:empty { margin: 0; }

.knowledge-tree { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 1rem; margin-top: 1rem; }
.tree-group { border: 1px solid #bfd6ce; border-radius: .8rem; background: #fff; padding: .55rem .85rem .8rem; min-width: 0; }
.knowledge-tree summary { display: flex; gap: .55rem; align-items: baseline; min-height: 2.5rem; padding: .45rem .45rem; cursor: pointer; list-style: none; overflow-wrap: anywhere; }
.knowledge-tree summary::-webkit-details-marker { display: none; }
.knowledge-tree summary::before { content: '+' / ''; display: inline-grid; place-items: center; flex: 0 0 1.15rem; width: 1.15rem; height: 1.15rem; border-radius: .2rem; color: #0a6150; background: #e6f3ed; line-height: 1; font-weight: 700; }
.knowledge-tree details[open] > summary::before { content: '−' / ''; }
.tree-group > summary { font-weight: 750; font-size: 1.15rem; }
.knowledge-tree small { flex: none; margin-inline-start: auto; font-size: .875rem; font-weight: 400; color: #47615a; }
.tree-courses, .tree-leaves { list-style: none; margin: .12rem 0 .25rem .95rem; padding: 0 0 0 .85rem; border-inline-start: 1px solid #aecbc1; }
.tree-courses > li, .tree-leaves > li { position: relative; }
.tree-courses > li::before, .tree-leaves > li::before { content: ''; position: absolute; inset-inline-start: -.85rem; top: 1.1rem; width: .85rem; border-top: 1px solid #aecbc1; }
.tree-course > summary { font-weight: 650; }
.tree-node > summary:hover, .tree-course > summary:hover { background: #f2f8f5; border-radius: .4rem; }
.tree-node > summary[aria-current] { background: #dfefe7; border-radius: .4rem; color: #084537; font-weight: 700; }
.node-content { margin: 0 0 .6rem .4rem; padding: .5rem .65rem; border: 1px solid #c9ddd5; border-radius: .45rem; background: #f7fbf9; overflow-wrap: anywhere; }
.lesson-link { display: inline-block; font-weight: 700; }
.node-routes { list-style: none; padding: 0; margin: .35rem 0 0; }
.node-routes li + li { margin-top: .3rem; }
.node-routes span { display: inline-block; margin-inline-end: .25rem; color: #47615a; font-size: .875rem; }

@media (max-width: 46rem) {
  .knowledge-tree { grid-template-columns: 1fr; }
}
