:root {
  color-scheme: light;
  --paper: #f6f5ed;
  --surface: #fffef9;
  --ink: #162e27;
  --green: #235747;
  --muted: #51645a;
  --line: #cdd6cb;
  --wash: #e9efe6;
  --accent: #9b4a2c;
  --shadow: #162e2710;
  --body: system-ui, sans-serif;
  --display: "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.65 var(--body); }
a { color: inherit; text-underline-offset: .25em; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .72; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.frame { width: min(100% - 2rem, 66rem); margin-inline: auto; }
.masthead, footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.masthead { min-height: 4.4rem; border-bottom: 1px solid var(--line); font-size: .875rem; }
.brand { display: inline-flex; gap: .6rem; align-items: center; font-weight: 700; text-decoration: none; }
.mark { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; background: var(--ink); color: var(--paper); border-radius: .25rem; font-family: var(--display); }
.hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: center; gap: 1rem; padding: clamp(2.5rem, 7vw, 5rem) 0 2rem; }
.intro { animation: resolve .58s ease-out both; }
h1 { font: 700 clamp(3.5rem, 9vw, 7rem)/1.05 var(--display); margin: 0; overflow-wrap: break-word; }
.intro p { color: var(--muted); margin: 1.15rem 0 0; }
.figure { margin: 0; color: var(--green); animation: resolve .72s ease-out both; }
.figure svg { display: block; width: 100%; }
.grid { stroke: var(--line); }
.orbit { stroke: currentColor; opacity: .35; }
.trace { stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.node { fill: var(--accent); }
.workspace { border: 1px solid var(--line); background: var(--surface); border-radius: 1rem; box-shadow: 0 12px 35px var(--shadow); overflow: clip; }
form, .output { padding: clamp(1rem, 3vw, 2rem); }
form > label { display: block; margin-bottom: .5rem; font-weight: 700; }
.searchbar { display: flex; align-items: center; gap: .7rem; padding: .35rem; border: 1px solid var(--line); border-radius: .65rem; background: var(--paper); }
.searchbar:focus-within { border-color: var(--green); }
.searchbar > svg { flex: 0 0 1.25rem; margin-left: .55rem; fill: none; stroke: var(--green); stroke-width: 1.8; }
.searchbar input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); padding: .55rem .15rem; }
#submit { padding: .65rem .95rem; border: 1px solid var(--ink); border-radius: .4rem; background: var(--ink); color: var(--surface); white-space: nowrap; transition: background-color .18s ease, transform .18s ease; }
#submit:hover:enabled { background: var(--green); }
#submit:active:enabled { transform: translateY(2px); }
.examples, .options { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; font-size: .875rem; }
.examples { margin-top: 1rem; color: var(--muted); }
.examples button { background: var(--wash); border: 1px solid var(--line); border-radius: 2rem; padding: .35rem .75rem; color: var(--ink); }
.examples button:hover { border-color: var(--green); }
.options { margin-top: 1.2rem; padding-top: .9rem; border-top: 1px solid var(--line); justify-content: space-between; }
.options input { accent-color: var(--green); }
small { display: inline-block; color: var(--muted); margin-left: .3rem; }
.text-button { border: 0; background: transparent; color: var(--green); padding: .35rem 0; text-decoration: underline; text-underline-offset: .25em; }
.output { border-top: 1px solid var(--line); }
.output p { margin: 0; }
#advice { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--wash); padding: 1rem; margin-top: .85rem; border-radius: .4rem; }
#results { margin: .65rem 0 0; padding-left: 1.4rem; }
#results:empty { display: none; }
#results li { padding: .7rem 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
#results li:last-child { border-bottom: 0; }
#results p, footer { color: var(--muted); font-size: .875rem; }
footer { padding-block: 1.1rem 2rem; }
@keyframes resolve { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@media (max-width: 38rem) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: .45rem; padding-bottom: 1rem; }
  .figure { max-width: 15rem; }
  .searchbar { flex-wrap: wrap; }
  #submit { width: 100%; }
  small { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  #submit:active:enabled { transform: none; }
}
