:root {
  --color-grey-700: #0f212e;
  --color-grey-600: #1a2c38;
  --color-grey-500: #213743;
  --color-grey-400: #2f4553;
  --color-grey-300: #3d5564;
  --color-grey-200: #b1bad3;
  --color-grey-100: #d5dceb;
  --color-white: #ffffff;
  --color-green-500: #00e701;
  --color-blue-500: #1475e1;
  --color-danger: #ed4163;
  --bg: var(--color-grey-600);
  --bg-deep: var(--color-grey-700);
  --bg-elevated: var(--color-grey-500);
  --bg-hover: var(--color-grey-400);
  --text: var(--color-white);
  --text-muted: var(--color-grey-200);
  --accent: var(--color-green-500);
  --primary: var(--color-blue-500);
  --border: var(--color-grey-400);
  --radius: 0.5rem;
  --radius-sm: 0.25rem;
  --sidebar-width: 280px;
  --header-height: 64px;
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html { scrollbar-width: thin; scrollbar-color: rgba(177, 186, 211, 0.35) transparent; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-muted);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-grey-100); text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3 { color: var(--text); line-height: 1.3; font-weight: 700; margin: 0 0 0.75rem; }
h1 { font-size: 1.85rem; }
h2 { font-size: 1.35rem; margin-top: 2rem; }
h3 { font-size: 1.1rem; margin-top: 1.5rem; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin-bottom: 0.4rem; }
code {
  background: var(--bg-deep);
  color: var(--accent);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}
img { max-width: 100%; height: auto; }

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--bg-deep);
  border-right: 1px solid var(--border);
  padding: 1rem 0 0;
  display: flex;
  flex-direction: column;
}

.sidebar-scroll {
  overflow: auto;
  padding: 0.25rem 0.45rem 2rem 0.75rem;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(177, 186, 211, 0.3) transparent;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.25rem 0.75rem 1rem;
  color: var(--text);
  font-weight: 800;
  font-size: 1.15rem;
}
.sidebar-brand span { color: var(--accent); }
.sidebar-brand .mark {
  width: 2rem; height: 2rem; border-radius: 0.4rem;
  display: grid; place-items: center;
  background: rgba(0, 231, 1, 0.12);
  color: var(--accent);
  font-size: 1rem;
}

.nav-group { margin-bottom: 1.1rem; }
.nav-group-title {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-grey-300);
  padding: 0.35rem 0.75rem;
  font-weight: 700;
}
.nav-link {
  display: block;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}
.nav-link:hover, .nav-link.active {
  background: var(--bg-hover);
  color: var(--text);
}
.nav-link.active { box-shadow: inset 3px 0 0 var(--accent); }

.main-wrap { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1.5rem;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-intro {
  flex: 1;
  min-width: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-shrink: 0;
}
.topbar-search {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.topbar-search input[type="search"] {
  width: min(180px, 28vw);
  height: 2.1rem;
  padding: 0 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  outline: none;
}
.topbar-search input[type="search"]::placeholder { color: var(--color-grey-300); }
.topbar-search input[type="search"]:focus {
  border-color: var(--accent);
}
.btn-search,
.btn-tg {
  height: 2.1rem;
  padding: 0 0.75rem;
  font-size: 0.85rem;
}
.btn-tg.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.content {
  width: min(860px, 100%);
  margin: 0 auto;
  padding: 1.75rem 1.5rem 4rem;
}

.hero {
  background:
    radial-gradient(ellipse at top right, rgba(0, 231, 1, 0.12), transparent 45%),
    radial-gradient(ellipse at bottom left, rgba(20, 117, 225, 0.16), transparent 40%),
    var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.hero h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin-bottom: 0.5rem; }
.hero p { font-size: 1.05rem; max-width: 46ch; }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.25rem 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.55rem 1rem; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 0.92rem; border: 1px solid transparent;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #1061bf; color: #fff; }
.btn-accent { background: var(--accent); color: #041406; }
.btn-accent:hover { background: #00c401; color: #041406; }
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin: 1rem 0 1.5rem;
}
.card {
  display: block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  color: inherit;
}
.card:hover { border-color: var(--accent); color: inherit; }
.card h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.card p { margin: 0; font-size: 0.9rem; }

.callout {
  border-left: 3px solid var(--accent);
  background: rgba(0, 231, 1, 0.06);
  padding: 0.9rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.25rem 0;
}
.callout.warn { border-left-color: #f6c344; background: rgba(246, 195, 68, 0.08); }
.callout.danger { border-left-color: var(--color-danger); background: rgba(237, 65, 99, 0.08); }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li {
  position: relative;
  padding: 0.85rem 0.85rem 0.85rem 3rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.65rem;
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute; left: 0.75rem; top: 0.9rem;
  width: 1.5rem; height: 1.5rem; border-radius: 999px;
  background: var(--accent); color: #041406;
  font-weight: 800; font-size: 0.8rem;
  display: grid; place-items: center;
}

.guide-figure {
  margin: 1rem 0 1.5rem; padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; background: var(--bg-deep);
}
.guide-figure img { display: block; width: 100%; }
.guide-figure figcaption {
  margin: 0; padding: 0.65rem 0.85rem; font-size: 0.85rem;
  color: var(--text-muted); border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.page-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.footer-note {
  margin-top: 3rem; padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.82rem; color: var(--text-muted);
}

table { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 0.9rem; }
th, td { border: 1px solid var(--border); padding: 0.65rem 0.75rem; text-align: left; }
th { background: var(--bg-deep); color: var(--text); }
td { background: var(--bg-elevated); }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: relative; height: auto; max-height: none;
    border-right: 0; border-bottom: 1px solid var(--border);
  }
  .sidebar-scroll { max-height: 42vh; }
  .topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem 1rem;
  }
  .topbar-actions { width: 100%; }
  .topbar-search { flex: 1; }
  .topbar-search input[type="search"] { flex: 1; width: auto; }
  .content { padding: 1.25rem 1rem 3rem; }
}
