:root {
  color-scheme: light;
  --ink: #141816;
  --muted: #5f6965;
  --subtle: #8b928d;
  --paper: #f6f1e7;
  --paper-strong: #fffaf0;
  --panel: rgba(255, 252, 244, 0.86);
  --line: rgba(20, 24, 22, 0.12);
  --line-strong: rgba(20, 24, 22, 0.2);
  --green: #0b7a5b;
  --cyan: #007c89;
  --red: #be3b2b;
  --yellow: #d79a13;
  --blue: #2c5f9d;
  --shadow: 0 24px 60px rgba(20, 24, 22, 0.12);
  --radius: 8px;
  --mono: "IBM Plex Sans", "Microsoft YaHei", sans-serif;
  --display: "Noto Serif SC", "SimSun", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  font-family: var(--mono);
  background:
    linear-gradient(90deg, rgba(20, 24, 22, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(20, 24, 22, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 20% 8%, rgba(215, 154, 19, 0.14), transparent 28%),
    radial-gradient(circle at 88% 18%, rgba(0, 124, 137, 0.11), transparent 30%),
    var(--paper);
  background-size: 42px 42px, 42px 42px, auto, auto, auto;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-frame {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 72px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(246, 241, 231, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--paper-strong);
  background: conic-gradient(from 90deg, var(--green), var(--cyan), var(--red), var(--green));
  font-weight: 800;
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.32);
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand strong {
  font-size: 1rem;
  letter-spacing: 0;
}

.brand small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topnav a {
  min-height: 38px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.topnav a:hover {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 250, 240, 0.72);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.72fr);
  gap: 18px;
  min-height: clamp(520px, 62vh, 720px);
  padding: 18px 0;
}

.hero-copy,
.ops-panel,
.metrics article,
.feature-strip article,
.sidebar,
.catalog-main,
.auto-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 100%;
  padding: clamp(24px, 5vw, 64px);
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.88), rgba(255, 250, 240, 0.62)),
    repeating-linear-gradient(-16deg, rgba(20, 24, 22, 0.05) 0 1px, transparent 1px 14px);
}

.eyebrow {
  width: fit-content;
  margin: 0 0 18px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--green);
  background: rgba(11, 122, 91, 0.08);
  font-size: 0.82rem;
  font-weight: 800;
}

.hero h1 {
  max-width: 860px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.6rem, 7vw, 7rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.lead {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.22rem);
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.primary-action,
.ghost-action,
.text-button,
.copy-btn,
.filter-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.primary-action,
.ghost-action {
  min-height: 48px;
  padding: 12px 18px;
}

.primary-action {
  color: var(--paper-strong);
  background: var(--ink);
}

.ghost-action,
.text-button,
.copy-btn,
.filter-btn {
  color: var(--ink);
  background: rgba(255, 250, 240, 0.72);
}

.primary-action:hover,
.ghost-action:hover,
.text-button:hover,
.copy-btn:hover,
.filter-btn:hover {
  transform: translateY(-1px);
}

.ghost-action:hover,
.text-button:hover,
.copy-btn:hover,
.filter-btn:hover,
.filter-btn.is-active {
  border-color: rgba(11, 122, 91, 0.42);
  color: var(--green);
  background: rgba(11, 122, 91, 0.09);
}

[data-lucide] {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}

.ops-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(20, 24, 22, 0.92), rgba(28, 36, 32, 0.9)),
    var(--ink);
  color: var(--paper-strong);
}

.ops-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ops-panel-header span,
.section-heading span,
.sidebar-title span {
  color: var(--yellow);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ops-panel-header strong {
  max-width: 190px;
  text-align: right;
  font-family: var(--display);
  font-size: 1.34rem;
  line-height: 1.25;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 34px 0;
}

.flow-node {
  min-height: 116px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 250, 240, 0.16);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.08);
}

.flow-node svg {
  color: var(--yellow);
}

.flow-node span {
  font-size: 1.05rem;
  font-weight: 800;
}

.ops-panel p {
  margin: 0;
  color: rgba(255, 250, 240, 0.74);
  line-height: 1.8;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metrics article {
  min-height: 128px;
  padding: 18px;
  box-shadow: none;
}

.metrics span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.metrics strong {
  display: block;
  margin-top: 12px;
  font-family: var(--display);
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 1;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.feature-strip article {
  min-height: 170px;
  padding: 20px;
  box-shadow: none;
}

.feature-strip i,
.feature-strip svg {
  color: var(--red);
}

.feature-strip h2 {
  margin: 22px 0 8px;
  font-size: 1.12rem;
}

.feature-strip p {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.catalog-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 96px;
  padding: 16px;
  box-shadow: none;
}

.sidebar-title {
  margin-bottom: 12px;
}

.sidebar-title strong {
  display: block;
  margin-top: 4px;
  font-family: var(--display);
  font-size: 1.35rem;
}

.group-list {
  display: grid;
  gap: 6px;
  max-height: calc(100vh - 190px);
  overflow: auto;
  padding-right: 4px;
}

.group-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.group-btn:hover,
.group-btn.is-active {
  color: var(--ink);
  border-color: var(--line);
  background: rgba(255, 250, 240, 0.76);
}

.group-btn span:first-child {
  display: inline-flex;
  justify-content: center;
}

.group-btn strong {
  overflow: hidden;
  font-size: 0.88rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.group-btn small {
  color: var(--subtle);
}

.catalog-main {
  min-width: 0;
  padding: 16px;
  box-shadow: none;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
}

.search-field svg {
  position: absolute;
  left: 14px;
  color: var(--muted);
}

.search-field input {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px 12px 44px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  outline: none;
  background: rgba(255, 250, 240, 0.74);
}

.search-field input:focus {
  border-color: rgba(0, 124, 137, 0.62);
  box-shadow: 0 0 0 4px rgba(0, 124, 137, 0.1);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.filter-btn {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.84rem;
}

.result-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  color: var(--muted);
  font-size: 0.9rem;
}

.text-button {
  min-height: 36px;
  padding: 8px 12px;
  border-color: var(--line);
  color: var(--muted);
}

.command-sections {
  display: grid;
  gap: 14px;
}

.command-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 250, 240, 0.62);
}

.command-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, var(--section-accent, rgba(11, 122, 91, 0.13)), transparent 70%),
    rgba(255, 250, 240, 0.42);
}

.section-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
}

.section-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-strong);
  font-size: 1.35rem;
}

.section-title h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.35rem;
  line-height: 1.2;
}

.section-title p {
  margin: 7px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.section-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 250, 240, 0.76);
  font-size: 0.74rem;
  font-weight: 800;
}

.command-list {
  display: grid;
}

.command-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(240px, 1.2fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.command-row:last-child {
  border-bottom: none;
}

.command-row:hover {
  background: rgba(0, 124, 137, 0.055);
}

.command-token {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.command-token code {
  display: inline-block;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(20, 24, 22, 0.055);
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.5;
  white-space: normal;
  word-break: break-word;
}

.copy-btn {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  color: var(--muted);
}

.command-desc {
  min-width: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.72;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 250, 240, 0.62);
  font-size: 0.74rem;
  font-weight: 900;
}

.tag.admin {
  color: var(--red);
  border-color: rgba(190, 59, 43, 0.28);
  background: rgba(190, 59, 43, 0.08);
}

.tag.group {
  color: var(--blue);
  border-color: rgba(44, 95, 157, 0.26);
  background: rgba(44, 95, 157, 0.08);
}

.tag.auto {
  color: #9a6700;
  border-color: rgba(215, 154, 19, 0.32);
  background: rgba(215, 154, 19, 0.11);
}

.empty-state {
  padding: 44px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.auto-section {
  margin-top: 18px;
  padding: 22px;
  box-shadow: none;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.auto-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.auto-card {
  min-height: 140px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.62);
}

.auto-card strong {
  display: block;
  font-size: 1rem;
}

.auto-card p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--paper-strong);
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1080px) {
  .hero,
  .catalog-shell {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .sidebar {
    position: static;
  }

  .group-list {
    display: flex;
    overflow-x: auto;
    max-height: none;
    padding-bottom: 4px;
  }

  .group-btn {
    width: auto;
    min-width: 176px;
  }

  .auto-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .site-frame {
    padding: 10px;
  }

  .topbar,
  .toolbar,
  .result-line,
  .command-card-header {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    width: 100%;
  }

  .topnav a {
    flex: 1;
    text-align: center;
  }

  .metrics,
  .feature-strip,
  .flow-grid,
  .auto-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    display: grid;
  }

  .filter-row {
    justify-content: flex-start;
  }

  .command-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .section-meta {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .hero-copy,
  .ops-panel,
  .catalog-main,
  .auto-section {
    padding: 16px;
  }

  .hero-actions,
  .filter-row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-action,
  .ghost-action,
  .filter-btn {
    width: 100%;
  }
}
