/* ============================================================
   kmd.css — Kmd detail page. Terminal mockup, start layout and
   small page-specific bits on top of the shared detail styles.
   ============================================================ */

.kmd-page h1 em { color: var(--lime); font-style: normal; }

.kmd-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--lime);
  border-radius: var(--radius);
  color: var(--lime);
  font: 600 15px/1 var(--mono);
}

/* Terminal window */
.kmd-terminal {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b0c0a;
  box-shadow: 24px 24px 0 rgba(216, 243, 106, 0.14);
}

.kmd-term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.kmd-term-bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2a2c26;
}

.kmd-term-bar i:first-child { background: rgba(216, 243, 106, 0.55); }

.kmd-term-title {
  margin-left: 10px;
  color: var(--muted);
  font: 400 11px/1 var(--mono);
  letter-spacing: 0.08em;
}

.kmd-term-clock {
  margin-left: auto;
  color: var(--muted);
  font: 400 11px/1 var(--mono);
}

.kmd-term-body {
  display: flex;
  flex-direction: column;
  padding: 20px 22px 24px;
  color: #c9cec4;
  font: 400 12.5px/2 var(--mono);
}

/* The scrollback keeps the height the mock-up always had, so the hero
   does not resize the first time a command prints anything, and stops
   growing before it can push the page around. No overscroll-behavior:
   once the log is at its end the wheel belongs to the page again. */
.kmd-term-log {
  flex: 1;
  min-height: 325px;
  max-height: min(52vh, 400px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #2f3329 transparent;
}

.kmd-term-body p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.kmd-term-body .t-indent { padding-left: 2.4em; }
.kmd-term-body .t-dim { color: #6f756c; }
.kmd-term-body .t-lime { color: var(--lime); }
.kmd-term-body .t-ice { color: #a8d4ff; }
/* The star already speaks in gold on the index page's dialogue. */
.kmd-term-body .t-gold { color: #f7b84e; }
.kmd-term-body .t-warn { color: #ff9d7a; }

/* The prompt line. A real input, so the caret, selection, IME and
   history are the browser's rather than something reimplemented on
   keydown; only the block cursor is ours, and only while the line is
   idle and empty. */
.kmd-term-input {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 0.5em;
  padding-top: 0.2em;
}

.kmd-term-input input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--paper);
  font: inherit;
  caret-color: var(--lime);
  outline: none;
}

.kmd-term-input input::placeholder { color: #5d6259; }

.kmd-term-input::after {
  content: '';
  position: absolute;
  left: 1.18em;
  top: 0.55em;
  width: 9px;
  height: 15px;
  background: var(--lime);
  pointer-events: none;
  animation: kmd-blink 1.1s steps(1) infinite;
}

.kmd-term-input:focus-within::after { display: none; }
.kmd-term-input:has(input:not(:placeholder-shown))::after { display: none; }

/* Trails the reply while 临渊星 is still talking. */
.kmd-term-log p.is-streaming::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 12px;
  margin-left: 5px;
  background: #f7b84e;
  vertical-align: -1px;
  animation: kmd-blink 0.8s steps(1) infinite;
}

.kmd-cursor {
  display: inline-block;
  width: 9px;
  height: 15px;
  background: var(--lime);
  vertical-align: text-bottom;
  animation: kmd-blink 1.1s steps(1) infinite;
}

@keyframes kmd-blink { 50% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .kmd-cursor,
  .kmd-term-input::after,
  .kmd-term-log p.is-streaming::after { animation: none; }
}

.t-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  border: 1px solid #4a4f46;
  vertical-align: baseline;
}
.t-dot-on { background: var(--lime); border-color: var(--lime); }

/* Start section layout */
.kmd-start {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--q-gap, 24px);
  align-items: start;
}

.install-code { position: relative; }
.install-code code { display: block; padding-right: 64px; }

.kmd-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font: 400 10px/1 var(--mono);
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}

.kmd-copy:hover { color: var(--lime); border-color: var(--lime); }
.kmd-copy.is-copied { color: var(--lime); border-color: var(--lime); }

@media (max-width: 980px) {
  .kmd-start { grid-template-columns: 1fr; }
  .kh-hero { grid-template-columns: 1fr; }
  .kh-hero-phone { justify-self: start; width: min(100%, 560px); }
}
