:root {
  --bg: #0c0f12;
  --bg-elevated: #12171c;
  --bg-hover: #1a2229;
  --border: #2a3540;
  --text: #c8d4dc;
  --text-muted: #6b7d8a;
  --accent: #3dd68c;
  --accent-dim: #2a9d63;
  --warn: #e8b84a;
  --cmd-bg: #0a0e11;
  --font-sans: "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", ui-monospace, monospace;
  --radius: 6px;
  --tab-h: 42px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(61, 214, 140, 0.08), transparent),
    linear-gradient(180deg, #0e1216 0%, var(--bg) 40%);
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(12, 15, 18, 0.92);
  backdrop-filter: blur(12px);
}

.header-inner {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.prompt {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  font-size: 1.25rem;
}

h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.badge {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: rgba(61, 214, 140, 0.12);
  color: var(--accent);
  border: 1px solid rgba(61, 214, 140, 0.25);
}

.home-link {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(61, 214, 140, 0.25);
  border-radius: var(--radius);
  color: var(--accent);
  background: rgba(61, 214, 140, 0.08);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}

.home-link:hover,
.home-link:focus-visible {
  border-color: rgba(61, 214, 140, 0.5);
  background: rgba(61, 214, 140, 0.13);
}

.subtitle {
  margin: 0.35rem 0 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.search-wrap {
  position: relative;
  max-width: 520px;
}

.search-wrap input {
  width: 100%;
  padding: 0.65rem 2.5rem 0.65rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-wrap input:focus {
  border-color: var(--accent-dim);
  box-shadow: 0 0 0 3px rgba(61, 214, 140, 0.12);
}

.search-wrap input::placeholder {
  color: var(--text-muted);
}

.search-wrap .hint {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.main {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  min-height: calc(100vh - 180px);
}

@media (max-width: 860px) {
  .header-inner {
    padding-top: 1rem;
  }

  .home-link {
    position: static;
    display: inline-flex;
    width: fit-content;
    margin-top: 0.75rem;
  }

  .main {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.tabs {
  position: sticky;
  top: 140px;
  align-self: start;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  padding: 1rem 0;
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

@media (max-width: 860px) {
  .tabs {
    position: static;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
    max-height: none;
    gap: 0.25rem;
  }
}

.tab {
  display: block;
  width: 100%;
  padding: 0.55rem 1rem;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  text-align: left;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .tab {
    width: auto;
    flex-shrink: 0;
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius);
  }
}

.tab:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.tab[aria-selected="true"] {
  color: var(--accent);
  background: rgba(61, 214, 140, 0.06);
  border-left-color: var(--accent);
}

@media (max-width: 860px) {
  .tab[aria-selected="true"] {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }
}

.panel {
  padding: 1rem 0 1rem 1.5rem;
  min-width: 0;
}

@media (max-width: 860px) {
  .panel {
    padding: 1rem 0;
  }
}

.panel-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.count {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.table-head {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(200px, 1fr);
  gap: 1rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

@media (max-width: 720px) {
  .table-head {
    display: none;
  }
}

.cmd-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cmd-item {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(200px, 1fr);
  gap: 1rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(42, 53, 64, 0.5);
  align-items: start;
  transition: background 0.1s;
}

.cmd-item:hover {
  background: var(--bg-hover);
}

@media (max-width: 720px) {
  .cmd-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}

.cmd-item button.cmd {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.55;
  color: #8ecfb0;
  background: var(--cmd-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  word-break: break-all;
  transition: border-color 0.12s, color 0.12s;
}

.cmd-item button.cmd:hover {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.cmd-item button.cmd:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text);
  padding-top: 0.15rem;
}

.desc mark {
  background: rgba(232, 184, 74, 0.25);
  color: var(--warn);
  padding: 0 2px;
  border-radius: 2px;
}

.tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.05rem 0.35rem;
  margin-right: 0.35rem;
  border-radius: 2px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tag--danger {
  background: rgba(232, 90, 74, 0.15);
  color: #f08070;
}

.tag--root {
  background: rgba(232, 184, 74, 0.12);
  color: var(--warn);
}

.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

.footer {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  background: var(--bg-elevated);
  border: 1px solid var(--accent-dim);
  color: var(--accent);
  border-radius: var(--radius);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
  z-index: 100;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
