:root {
  --ink: #0b1c22;
  --ink-soft: #1e3a42;
  --paper: #e8eef0;
  --paper-deep: #d7e1e4;
  --jade: #0e5f5a;
  --jade-bright: #127a72;
  --seal: #9b2f2f;
  --muted: #4d646b;
  --line: rgba(11, 28, 34, 0.12);
  --glow: rgba(18, 122, 114, 0.2);
  --display: "Noto Serif SC", "Songti SC", "STSong", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --radius: 14px;
  --max: 920px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1100px 560px at 8% -8%, rgba(18, 122, 114, 0.16), transparent 58%),
    radial-gradient(800px 420px at 100% 8%, rgba(11, 28, 34, 0.06), transparent 48%),
    linear-gradient(165deg, #f2f6f7 0%, var(--paper) 42%, #dde7ea 100%);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

.nd-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.nd-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(232, 238, 240, 0.86);
  border-bottom: 1px solid var(--line);
}

.nd-header__inner,
.nd-hero__inner,
.nd-docs,
.nd-page-head__inner,
.nd-footer__inner,
.nd-single {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.nd-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  gap: 1rem;
}

.nd-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.nd-brand__mark {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  background: var(--seal);
  box-shadow: 0 0 0 4px rgba(166, 61, 47, 0.15);
}

.nd-brand__name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.nd-nav {
  display: flex;
  gap: 1.25rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.nd-nav a {
  position: relative;
  padding: 0.2rem 0;
}

.nd-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--jade);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nd-nav a:hover::after,
.nd-nav a:focus-visible::after {
  transform: scaleX(1);
}

.nd-main { flex: 1; }

/* Hero — brand first */
.nd-hero {
  position: relative;
  padding: clamp(3.5rem, 10vw, 6.5rem) 0 clamp(2.5rem, 6vw, 4rem);
  overflow: hidden;
}

.nd-hero__glow {
  position: absolute;
  inset: 10% auto auto 50%;
  width: min(70vw, 520px);
  height: min(70vw, 520px);
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--glow), transparent 68%);
  pointer-events: none;
  animation: nd-breathe 8s ease-in-out infinite;
}

.nd-hero__inner { position: relative; }

.nd-hero__eyebrow {
  margin: 0 0 0.85rem;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--jade);
  font-weight: 600;
}

.nd-hero__brand {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 4.4rem);
  line-height: 1.08;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.nd-hero__lead {
  margin: 1.1rem 0 0;
  max-width: 28rem;
  font-size: 1.05rem;
  color: var(--muted);
}

.nd-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.nd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nd-btn:hover { transform: translateY(-1px); }

.nd-btn--primary {
  background: var(--jade);
  color: #f7faf8;
}

.nd-btn--primary:hover { background: var(--jade-bright); }

.nd-btn--ghost {
  background: transparent;
  border-color: rgba(12, 31, 26, 0.22);
  color: var(--ink-soft);
}

.nd-btn--ghost:hover {
  border-color: var(--jade);
  color: var(--jade);
}

/* Docs list — rows, not cards */
.nd-docs {
  padding: 0 0 4rem;
}

.nd-docs--archive { padding-top: 0.5rem; }

.nd-docs__head {
  margin-bottom: 1.25rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.nd-docs__title,
.nd-page-head__title {
  margin: 1rem 0 0.35rem;
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: 0.04em;
}

.nd-docs__sub,
.nd-page-head__sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.nd-page-head {
  padding: 2.5rem 0 1rem;
}

.nd-doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.nd-doc-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 1.15rem 0.35rem;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s ease, padding-left 0.25s ease;
}

.nd-doc-row:hover,
.nd-doc-row:focus-visible {
  background: rgba(255, 255, 255, 0.45);
  padding-left: 0.6rem;
  outline: none;
}

.nd-doc-row__ext {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 3.2rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: var(--ink);
  color: #f3efe6;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.nd-doc-row__body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.nd-doc-row__title {
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.nd-doc-row__excerpt {
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nd-doc-row__price {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--seal);
  font-size: 1rem;
}

.nd-doc-row__go {
  font-size: 0.82rem;
  color: var(--jade);
  font-weight: 600;
  opacity: 0.85;
}

.nd-empty {
  color: var(--muted);
  padding: 2rem 0;
}

.nd-pager {
  margin-top: 1.5rem;
}

.nd-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2rem;
  margin-top: auto;
}

.nd-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

.nd-footer__brand {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.nd-footer__note {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

/* Single */
.nd-single {
  padding: 2rem 0 3.5rem;
}

.nd-single__title {
  margin: 0.35rem 0 0;
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: 0.03em;
}

.nd-single__excerpt {
  margin: 0.75rem 0 0;
  color: var(--muted);
  max-width: 36rem;
}

.nd-single__content {
  margin-top: 1.75rem;
}

.nd-single__content > p:first-child {
  color: var(--ink-soft);
}

.nd-single__back {
  margin-top: 2rem;
}

.nd-single__back a {
  color: var(--jade);
  font-weight: 600;
}

@keyframes nd-breathe {
  0%, 100% { opacity: 0.7; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.06); }
}

@media (max-width: 640px) {
  .nd-doc-row {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "ext body"
      "ext meta";
    gap: 0.45rem 0.85rem;
  }
  .nd-doc-row__ext { grid-area: ext; align-self: start; margin-top: 0.2rem; }
  .nd-doc-row__body { grid-area: body; }
  .nd-doc-row__price,
  .nd-doc-row__go {
    grid-area: meta;
  }
  .nd-doc-row__price { justify-self: start; }
  .nd-doc-row__go { justify-self: end; }
  .nd-hero__brand { letter-spacing: 0.03em; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nd-hero__glow { animation: none; }
  .nd-btn:hover,
  .nd-doc-row { transition: none; }
}

.nd-nav__parent {
  color: var(--jade);
  font-weight: 600;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nd-search {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
}
.nd-header__search {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 0 0 0.85rem;
  border-top: 0;
}
.nd-search input[type="search"] {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 12px 0 0 12px;
  padding: 0.7rem 1.1rem;
  font: inherit;
  font-size: 0.95rem;
  background: rgba(255,255,255,0.85);
  color: var(--ink);
  outline: none;
}
.nd-search input[type="search"]:focus {
  border-color: var(--jade);
  background: #fff;
}
.nd-search button {
  border: 1px solid var(--jade);
  border-radius: 0 12px 12px 0;
  background: var(--jade);
  color: #f7faf8;
  padding: 0 1.25rem;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.nd-search button:hover {
  background: var(--jade-bright);
}

.nd-search--page {
  max-width: 34rem;
  margin: 1.35rem 0 0;
  width: 100%;
}
.nd-search--page input[type="search"] {
  padding: 0.75rem 1.1rem;
  font-size: 1rem;
}
.nd-search--page button {
  padding: 0 1.2rem;
  font-size: 0.95rem;
}

.nd-search-meta {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 860px) {
  .nd-header__inner {
    flex-wrap: wrap;
  }
  .nd-search {
    max-width: none;
  }
}

.nd-cat-grid {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}
.nd-cat-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,0.55);
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.nd-cat-item:hover {
  border-color: var(--jade);
  background: #fff;
  transform: translateY(-2px);
}
.nd-cat-item__name {
  font-weight: 600;
  letter-spacing: 0.02em;
}
.nd-cat-item__count {
  color: var(--muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.nd-subcats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
}
.nd-subcats a {
  display: inline-flex;
  gap: 0.4rem;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(14, 95, 90, 0.08);
  color: var(--ink-soft);
  font-size: 0.88rem;
}
.nd-subcats span {
  color: var(--jade);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.nd-more {
  margin-top: 1.5rem;
  text-align: center;
}
