:root {
  color-scheme: light;
  --paper: #f8f5ed;
  --ink: #41443b;
  --muted: #838477;
  --leaf: #8eaa83;
  --soft: #cbd8bc;
  font-family: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; -webkit-tap-highlight-color: transparent; }
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 8; opacity: .045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.77' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23796a4f' filter='url(%23p)' opacity='.65' d='M0 0h180v180H0z'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
button, a, textarea { font: inherit; }
button { cursor: pointer; color: inherit; }
button:focus-visible, a:focus-visible { outline: 2px dashed #737c65; outline-offset: 4px; }
#garden { min-height: 100svh; padding: 70px 42px 80px; }
.knowledge-map { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 30px; width: min(1540px, 100%); margin: 0 auto; align-items: start; }
.domain-tree { margin: 0; min-width: 0; }
.domain-node { position: relative; display: block; width: 100%; padding: 17px 14px 19px; border: 1px solid color-mix(in srgb, var(--leaf) 50%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--soft) 36%, var(--paper)); text-align: left; font-size: 14px; line-height: 1.7; font-weight: 500; }
.domain-node:hover { background: color-mix(in srgb, var(--soft) 55%, var(--paper)); }
.domain-progress { display: block; height: 3px; margin-top: 12px; border-radius: 3px; background: linear-gradient(to right, var(--leaf) var(--progress, 0%), color-mix(in srgb, var(--leaf) 15%, transparent) var(--progress, 0%)); }
.module-branches { margin: 0 0 0 10px; padding: 24px 0 0 16px; border-left: 1px solid #d7d8cb; }
.module-branch { position: relative; padding: 0 0 23px; }
.module-branch:last-child { padding-bottom: 0; }
.module-branch::before { content: ''; position: absolute; top: 17px; left: -17px; width: 15px; border-top: 1px solid #d7d8cb; }
.module-node { display: flex; align-items: center; gap: 7px; width: 100%; min-height: 36px; padding: 5px 0; border: 0; background: transparent; text-align: left; font-size: 12px; font-weight: 500; line-height: 1.75; }
.module-node:hover { color: color-mix(in srgb, var(--leaf) 65%, #30382b); }
.module-marker { flex: 0 0 6px; width: 6px; height: 6px; border: 1px solid var(--leaf); border-radius: 2px; background: linear-gradient(to top, var(--leaf) var(--progress, 0%), transparent var(--progress, 0%)); }
.topic-branches { padding-left: 13px; margin: 3px 0 0 3px; border-left: 1px solid #dedfd3; }
.knowledge-node { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 7px; min-height: 44px; width: 100%; margin: 3px 0; padding: 8px 7px 8px 9px; border: 1px solid transparent; border-radius: 7px; background: transparent; text-align: left; font-size: 11px; line-height: 1.85; transition: background 180ms, border-color 180ms; }
.knowledge-node::before { content: ''; position: absolute; top: 50%; left: -14px; width: 12px; border-top: 1px solid #dedfd3; }
.knowledge-node:hover { background: #f0eee4; border-color: #dddccf; }
.node-name { min-width: 0; overflow-wrap: anywhere; }
.node-dots { display: flex; gap: 3px; flex: 0 0 18px; align-self: center; }
.node-dots i { display: block; width: 4px; height: 4px; border-radius: 50%; background: #d9dbce; }
.knowledge-node[data-level='1'] { background: color-mix(in srgb, var(--soft) 20%, transparent); }
.knowledge-node[data-level='2'] { background: color-mix(in srgb, var(--soft) 40%, transparent); }
.knowledge-node[data-level='3'] { background: color-mix(in srgb, var(--soft) 65%, transparent); border-color: color-mix(in srgb, var(--leaf) 32%, transparent); }
.knowledge-node[data-level='1'] .node-dots i:first-child,
.knowledge-node[data-level='2'] .node-dots i:not(:last-child),
.knowledge-node[data-level='3'] .node-dots i { background: color-mix(in srgb, var(--leaf) 78%, #444b39); }
.garden-key { position: fixed; bottom: 20px; right: 22px; width: 44px; height: 44px; border: 1px solid #d9dccd; background: var(--paper); border-radius: 50%; padding: 7px; opacity: .8; }
.garden-key:hover { opacity: 1; background: #edeedf; }
.garden-key svg { width: 100%; height: 100%; fill: #707765; }
dialog { position: fixed; inset: 20px 20px 20px auto; margin: 0; width: min(462px, calc(100vw - 40px)); max-width: none; height: calc(100dvh - 40px); max-height: none; border: 1px solid #c4c8b6; border-radius: 16px; padding: 0 28px 35px; background: var(--paper); box-shadow: 0 8px 35px #3d40360c; overflow: auto; scrollbar-width: thin; scrollbar-color: #c5c5b6 transparent; overscroll-behavior: contain; }
dialog::backdrop { background: rgb(49 50 39 / .13); }
html:has(dialog[open]) { overflow: hidden; }
.panel-bar { position: sticky; top: 0; background: var(--paper); padding: 16px 0 12px; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; z-index: 2; border-bottom: 1px solid #d9d7c9; }
.icon-button { width: 36px; height: 36px; flex: 0 0 36px; border: 0; background: transparent; border-radius: 50%; display: grid; place-items: center; }
.icon-button:hover { background: #eceadd; }
.icon-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
#breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 7px; padding-top: 5px; }
#breadcrumbs button { font-size: 11px; color: var(--muted); padding: 4px 0; border: 0; background: transparent; line-height: 1.6; text-align: left; }
#breadcrumbs button + button::before { content: '/'; margin-right: 7px; color: #b4b4a4; }
#breadcrumbs button:hover { color: var(--ink); }
.panel-heading { padding-top: 27px; margin-bottom: 25px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 23px; font-weight: 500; line-height: 1.6; letter-spacing: .02em; }
h2 { font-size: 14px; font-weight: 500; margin-bottom: 15px; }
h3 { font-size: 13px; font-weight: 500; }
.intro { font-size: 13px; line-height: 1.9; color: var(--muted); margin-top: 12px; }
section { margin-top: 30px; }
.topics ul { padding: 0 0 0 17px; margin: 0; display: grid; gap: 12px; }
.topics li { padding-left: 3px; font-size: 13px; line-height: 1.85; }
.topics li::marker { color: var(--leaf); }
.summary { margin: 24px 0 25px; }
.summary > p { font-size: 12px; color: var(--muted); }
.summary-track { display: flex; gap: 3px; height: 6px; margin: 13px 0; }
.segment { border-radius: 3px; min-width: 0; transition: flex 200ms; }
.segment.level-0 { background: #e7e5d9; }
.segment.level-1 { background: #d8d7ba; }
.segment.level-2 { background: #afbe9e; }
.segment.level-3 { background: #6f8d68; }
.summary-legend { display: flex; flex-wrap: wrap; gap: 15px; font-size: 11px; color: var(--muted); }
.node-list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 17px 2px; width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid #dddccf; transition: background 180ms; }
.list-row:hover { background: #eeeddf; }
.list-copy { display: grid; gap: 6px; flex: 1; min-width: 0; font-size: 14px; line-height: 1.6; }
.list-copy small { color: var(--muted); font-size: 11px; }
.list-dot { width: 9px; height: 9px; flex: 0 0 9px; border: 1px solid var(--leaf); background: var(--soft); border-radius: 3px; }
.list-dot.level-0 { background: transparent; opacity: .55; }
.list-dot.level-1 { background: var(--soft); }
.list-dot.level-2 { background: var(--leaf); opacity: .85; }
.list-dot.level-3 { background: var(--leaf); border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--soft); }
.row-arrow { color: #a6a897; font-size: 21px; }
.guide-row { display: flex; align-items: flex-start; gap: 16px; margin-top: 20px; }
.guide-row p { font-size: 12px; line-height: 1.85; color: var(--muted); margin-top: 6px; }
.guide-leaf { display: inline-block; width: 16px; height: 16px; flex: 0 0 16px; border: 1px solid #829274; border-radius: 4px; background: #e6ebdf; }
.guide-leaf.level-2 { background: #becdb1; border-color: #839476; }
.guide-leaf.level-3 { background: #8da37d; border-color: #526448; box-shadow: inset 0 0 0 3px #b9c8a7; }
.level-guide { padding-top: 8px; }
.backup { padding-top: 25px; border-top: 1px solid #d9d7c9; }
.backup p { font-size: 12px; line-height: 1.9; color: var(--muted); }
.backup-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.backup-actions button { border: 1px solid #c5c9b6; border-radius: 12px; background: #f1f2e7; padding: 11px 15px; font-size: 12px; min-height: 42px; }
.backup-actions button:hover { background: #e6eadb; }
.level-choices { display: grid; gap: 9px; }
.level-choice { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; background: transparent; border: 1px solid #d7d7c9; border-radius: 13px; min-height: 56px; font-size: 13px; transition: background 160ms, border-color 160ms; }
.level-choice[aria-pressed=true] { background: color-mix(in srgb, var(--soft) 45%, var(--paper)); border-color: var(--leaf); }
.level-choice:hover { background: #eeeee2; }
.level-description { font-size: 12px; line-height: 1.9; color: var(--muted); margin-top: 15px; min-height: 46px; }
.quiet-button { padding: 8px 0; font-size: 11px; background: transparent; border: 0; color: var(--muted); text-decoration: underline; text-decoration-color: #c4c5b4; text-underline-offset: 4px; }
.notes label { display: block; font-size: 14px; margin-bottom: 10px; }
.field-hint { font-size: 12px; line-height: 1.8; color: var(--muted); margin-bottom: 14px; }
.notes textarea { display: block; resize: vertical; min-height: 150px; width: 100%; border: 1px solid rgb(255 255 255 / .85); border-radius: 16px; background: transparent; box-shadow: inset 0 1px 0 #ffffffa0, 0 3px 13px #484e3a08; padding: 15px; font-size: 13px; line-height: 1.9; color: var(--ink); transition: background-color 260ms; }
.notes textarea:not(:placeholder-shown) { background: rgb(251 250 246 / .8); }
.notes textarea::placeholder { color: #9a9b8b; }
.notes textarea:focus-visible { outline: 1px solid #a9b69d; outline-offset: 3px; }
.save-status { font-size: 11px !important; color: var(--muted); line-height: 1.8; margin-top: 13px; }
.save-status.error { color: #a14e3d; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 1199px) { .knowledge-map { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 48px 30px; } #garden { padding: 48px 30px 80px; } }
@media (max-width: 800px) { .knowledge-map { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 540px) {
  #garden { padding: 30px 26px 75px; }
  .knowledge-map { grid-template-columns: 1fr; gap: 42px; max-width: 400px; }
  .domain-node { font-size: 15px; }
  .module-node { font-size: 13px; min-height: 44px; }
  .knowledge-node { font-size: 13px; padding: 10px 12px; min-height: 46px; }
  .module-branches { margin-left: 13px; padding-left: 19px; }
  .module-branch::before { left: -20px; width: 18px; top: 21px; }
  .topic-branches { margin-left: 3px; padding-left: 16px; }
  .knowledge-node::before { left: -17px; width: 15px; }
  .garden-key { bottom: 17px; right: 16px; }
  dialog { inset: auto 0 0; width: 100%; height: min(88dvh,860px); max-height: 88dvh; border-radius: 18px 18px 0 0; border-bottom: 0; padding: 0 22px 28px; }
  .panel-bar { padding-top: 12px; }
  h1 { font-size: 21px; }
  .panel-heading { padding-top: 22px; }
  .icon-button { width: 40px; height: 40px; flex-basis: 40px; }
  .notes textarea { font-size: 16px; }
  #breadcrumbs button { font-size: 12px; min-height: 34px; }
  .quiet-button, .backup-actions button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
