:root {
  color-scheme: dark;
  --ink: #0E1116;
  --fg: #e8eaed;
  --dim: #8b93a0;
  --line: #1c212b;
  --panel: #14181f;
  --field: #1a1f28;
  --solid: #5FA8F5;
  --violet: #A855F7;
  --cyan: #22D3EE;
  --app-bg: #1e1e1e;
  --app-panel: #252526;
  --app-sel: #04395e;
  --app-fg: #cccccc;
  --app-dim: #8b8b8b;
  --app-line: #333;
  --app-field: #3c3c3c;
  --warn: #c7915b;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--fg); }
body {
  min-height: 100%;
  font: 16px/1.5 -apple-system, "Segoe UI", system-ui, sans-serif;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 45% at 50% -8%, #A855F724, #22D3EE0d 42%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

code, pre, .ah, .fold, .sess, .tab, .term, .bar, .search, .copybtn, .stats, .run-head {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

a { color: var(--solid); text-decoration: none; }
a:hover { text-decoration: underline; }

.page {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3.5rem;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.1rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}
.word {
  display: flex;
  align-items: center;
  gap: .5rem;
  color: var(--fg);
  font-weight: 650;
  letter-spacing: .02em;
  text-decoration: none;
}
.word:hover { text-decoration: none; }
nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .9rem;
}
.mit {
  color: var(--dim);
  font-size: .85rem;
  text-decoration: none;
}
.mit:hover { color: var(--fg); }
.btn-gh {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  background: #f0f6fc;
  color: #1f2328;
  font-size: .88rem;
  font-weight: 600;
  line-height: 1;
  padding: .55rem .85rem;
  border: 1px solid transparent;
  border-radius: 6px;
  text-decoration: none;
}
.btn-gh:hover {
  background: #fff;
  text-decoration: none;
}
.btn-gh svg { display: block; flex: 0 0 16px; }
.btn-star {
  background: transparent;
  color: #f0f6fc;
  border: 1px solid #8b93a0;
}
.btn-star:hover {
  background: #f0f6fc;
  color: #1f2328;
  border-color: #f0f6fc;
}
.gh-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .55rem;
}

.hero {
  text-align: center;
  padding: 1.2rem 0 .4rem;
}
.kicker {
  margin: 0 0 1rem;
  color: var(--solid);
  font-size: .82rem;
  letter-spacing: .04em;
}
h1 {
  font-size: clamp(1.85rem, 4.2vw, 2.7rem);
  line-height: 1.15;
  font-weight: 650;
  letter-spacing: -0.03em;
  margin: 0 auto .8rem;
  max-width: 16ch;
}
h1 em {
  font-style: normal;
  color: var(--solid);
}
h2 {
  font-size: 1rem;
  font-weight: 650;
  margin: 0 0 .7rem;
}
.lede {
  margin: 0 auto 1rem;
  color: var(--dim);
  max-width: 38rem;
}
.clis, .tag {
  margin: 0 auto .35rem;
  max-width: 42rem;
  color: var(--dim);
  font-size: .92rem;
}
.tag { color: var(--fg); font-weight: 600; margin-bottom: 1.4rem; }
.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .4rem;
  margin: 1rem 0 0;
}
.badges img { height: 20px; display: block; }
.langs { line-height: 1.9; }
.langs a { color: var(--dim); }
.langs a:hover, .langs a.on { color: var(--fg); text-decoration: none; }
.langs a.on { font-weight: 650; }

.run {
  text-align: left;
  max-width: 40rem;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .75rem 1rem .9rem;
  box-shadow: 0 18px 50px #00000055;
}
.run-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .72rem;
  letter-spacing: .04em;
  color: var(--dim);
  margin-bottom: .45rem;
}
.copybtn {
  background: var(--field);
  border: 1px solid var(--line);
  color: var(--fg);
  font-size: .72rem;
  padding: .2rem .5rem;
  cursor: pointer;
}
.copybtn:hover { border-color: var(--solid); }
.host::before {
  content: "";
  display: inline-block;
  width: 7px; height: 7px;
  margin-right: .45rem;
  border-radius: 50%;
  background: #22c55e;
  vertical-align: middle;
}
.ps { color: var(--cyan); user-select: none; }
.then { text-align: center; }
.get .then { margin-top: 1rem; }
.get .then .btn-gh { display: inline-flex; }
.run pre, .cfg pre {
  margin: 0;
  overflow: auto;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--fg);
}
.then {
  margin: .75rem 0 0;
  font-size: .88rem;
  color: var(--dim);
}

.shot {
  margin: 1.6rem 0 0;
  height: 480px;
  background: var(--app-bg);
  border: 1px solid var(--app-line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 18px 50px #00000066;
}

.app {
  display: flex;
  height: 100%;
  color: var(--app-fg);
  font-size: 13px;
  line-height: 1.4;
  background: var(--app-bg);
}
.app aside {
  width: 200px;
  flex: 0 0 200px;
  background: var(--app-panel);
  border-right: 1px solid var(--app-line);
  display: flex;
  flex-direction: column;
}
.ah {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--app-line);
  font-size: 11px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--app-dim);
}
.search {
  margin: 8px;
  padding: 5px 8px;
  background: var(--app-field);
  color: #777;
  border-radius: 3px;
  font-size: 12px;
}
.fold {
  padding: 7px 10px 4px;
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--app-dim);
}
.sess {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 18px;
}
.sess.on { background: var(--app-sel); }
.meta { min-width: 0; }
.meta b {
  display: block;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.meta small { display: block; color: var(--app-dim); font-size: 11px; }

.cli-status { position: relative; display: inline-flex; flex: 0 0 auto; }
.cli-status i {
  width: 13px; height: 13px; display: block;
  background: var(--c, #ccc);
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
}
.cli-status::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid transparent;
}
.cli-status.work::after {
  border-top-color: var(--c);
  border-right-color: var(--c);
  animation: spin 1s linear infinite;
}
.cli-status.wait::after {
  border-color: var(--warn);
  animation: nudge 1.8s ease-in-out infinite;
}

.pane { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tabs {
  display: flex;
  align-items: stretch;
  height: 35px;
  background: var(--app-panel);
  border-bottom: 1px solid var(--app-line);
  font-size: 12px;
}
.tab {
  padding: 0 12px;
  display: flex;
  align-items: center;
  color: var(--app-dim);
  border-right: 1px solid var(--app-line);
  white-space: nowrap;
}
.tab.active {
  background: var(--app-bg);
  color: var(--app-fg);
  box-shadow: inset 0 2px 0 var(--cli, #0078d4);
}
.plus, .stats {
  color: var(--app-dim);
  display: flex;
  align-items: center;
  padding: 0 12px;
}
.stats { margin-left: auto; font-size: 11px; }

.term {
  flex: 1;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.55;
  background: var(--app-bg);
  border-top: 2px solid #D97757;
}
.tline { color: #d4d4d4; }
.tline.dim { color: var(--app-dim); margin-bottom: .4rem; }
.file { color: #7ee0c8; }
.caret {
  display: inline-block;
  margin-top: .4rem;
  color: var(--warn);
  animation: nudge 1.1s steps(1) infinite;
}

.bar {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  background: var(--app-panel);
  border-top: 1px solid var(--app-line);
}
.field {
  flex: 1;
  background: var(--app-field);
  color: #777;
  padding: 7px 9px;
  border-radius: 4px;
}
.runbtn {
  background: var(--app-field);
  color: var(--app-fg);
  padding: 7px 14px;
  border-radius: 4px;
}

.tracks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 2.4rem 0 0;
  padding: 1.4rem 0 0;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: .95rem;
}
.tracks b, .facts b { color: var(--fg); font-weight: 650; display: block; margin-bottom: .25rem; }

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.5rem;
  margin: 1.6rem 0 0;
  padding: 1.4rem 0 0;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: .95rem;
}

.cfg {
  margin-top: 2rem;
  max-width: 36rem;
}
.faq {
  margin-top: 2.4rem;
  max-width: 40rem;
}
.faq details {
  border-top: 1px solid var(--line);
}
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer;
  padding: .85rem 0;
  font-weight: 600;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: "▸ ";
  color: var(--dim);
  font-weight: 400;
}
.faq details[open] summary::before { content: "▾ "; }
.faq details p {
  margin: 0 0 1rem;
  color: var(--dim);
}
.get {
  margin-top: 2.6rem;
  text-align: center;
}
.get h2 { font-size: 1.35rem; }
.cfg pre {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: .85rem 1rem;
}

footer {
  margin-top: 2.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: .88rem;
}
footer p { margin: 0 0 .35rem; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes nudge { 50% { opacity: .35; } }

@media (prefers-reduced-motion: reduce) {
  .cli-status.work::after,
  .cli-status.wait::after,
  .caret { animation: none; }
}

:lang(zh-Hans) h1, :lang(ja) h1, :lang(ko) h1 { max-width: 12em; letter-spacing: 0; }

@media (max-width: 960px) {
  .shot { height: 360px; }
  .tracks, .facts { grid-template-columns: 1fr; gap: .9rem; }
  h1 { max-width: none; }
}

@media (max-width: 640px) {
  .page { padding: 1rem 1rem 2.5rem; }
  h1 { font-size: 1.65rem; }
  .shot { height: 280px; }
  .app aside { width: 148px; flex-basis: 148px; }
  .meta small, .stats { display: none; }
  .copybtn { min-height: 44px; padding: .4rem .7rem; }
  .btn-gh { min-height: 44px; padding: .7rem .9rem; }
}
