:root {
  --bg: #14110f;
  --bg-2: #1c1916;
  --bg-3: #24201c;
  --ink: #f3eadf;
  --muted: #9a8e82;
  --line: #3b342e;
  --accent: #e2574a;
  --accent-dim: #c44a3f;
  --gold: #d4a574;
  --online: #7cb892;
  --offline: #8a8078;
  --danger: #e2574a;
  --font-display: "Newsreader", "Songti SC", "Noto Serif SC", Palatino, serif;
  --font-ui: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-mono: "IBM Plex Mono", "Sarasa Mono SC", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 0% 0%, rgba(226, 87, 74, 0.07), transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(212, 165, 116, 0.05), transparent 45%);
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--ink); }

.shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

header.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 3.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
}

.brand svg { width: 28px; height: 28px; display: block; }

.wordmark {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav { display: flex; gap: 0.6rem; align-items: center; color: var(--muted); font-size: 0.92rem; }

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  line-height: 1.15;
  margin: 0 0 1rem;
  letter-spacing: -0.03em;
  max-width: 14ch;
}

.hero h1 em {
  font-style: italic;
  color: var(--gold);
  font-weight: 500;
}

.lede {
  color: var(--muted);
  max-width: 36em;
  margin: 0 0 2.25rem;
  font-size: 1.05rem;
}

.install {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  padding: 1rem 1rem 1rem 1.15rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.install code {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--ink);
  word-break: break-all;
}

.steps {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
}
.steps code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--ink);
  background: var(--bg-3);
  padding: 0.05em 0.4em;
}

.btn {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  border: 1px solid var(--line);
  background: var(--bg-3);
  color: var(--ink);
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  border-radius: 2px;
}
.btn:hover { border-color: var(--gold); color: #fff; }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover { background: var(--accent-dim); }
.btn.ghost { background: transparent; }
.btn.danger { border-color: var(--danger); color: var(--danger); background: transparent; }

.err {
  color: #f0b4ae;
  background: rgba(226, 87, 74, 0.12);
  border: 1px solid rgba(226, 87, 74, 0.35);
  padding: 0.6rem 0.8rem;
  margin: 0 0 1rem;
  font-size: 0.92rem;
}

.form {
  max-width: 24rem;
}
.form h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0 0 1.25rem;
}
label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.3rem;
}
input[type="text"], input[type="password"] {
  width: 100%;
  margin: 0 0 1rem;
  padding: 0.65rem 0.7rem;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1rem;
  border-radius: 2px;
}
input:focus { outline: 1px solid var(--gold); border-color: var(--gold); }

.hint { color: var(--muted); font-size: 0.88rem; margin-top: 1rem; }

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1.25rem;
  gap: 1rem;
}
.toolbar h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  margin: 0;
}

.machines { display: flex; flex-direction: column; gap: 0.7rem; }

.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 1rem 1.1rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem 1rem;
  align-items: center;
}
.card .name {
  font-family: var(--font-mono);
  font-size: 1.05rem;
}
.meta { color: var(--muted); font-size: 0.88rem; }
.dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  margin-right: 0.4rem;
  background: var(--offline);
  vertical-align: middle;
}
.dot.on { background: var(--online); box-shadow: 0 0 0 3px rgba(124, 184, 146, 0.15); }
.actions { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }

.empty {
  color: var(--muted);
  border: 1px dashed var(--line);
  padding: 2rem 1.2rem;
}
.empty code { font-family: var(--font-mono); color: var(--ink); }

.term-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.term-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  gap: 1rem;
}
.term-bar .name { font-family: var(--font-mono); }
.term-wrap {
  flex: 1;
  min-height: 0;
  padding: 0.6rem;
  background: #0e0c0b;
}
#terminal { height: 100%; width: 100%; }

.xterm-viewport::-webkit-scrollbar { width: 8px; }
.xterm-viewport::-webkit-scrollbar-thumb { background: #3b342e; }

@media (max-width: 640px) {
  .install { flex-direction: column; align-items: stretch; }
  .card { grid-template-columns: 1fr; }
  .actions { justify-content: flex-start; }
}
