/* ==========================================================================
   npm包中文文档 · styles
   Colour system follows npmjs.com (npm red #cb3837, ink #231f20, greys,
   and the signature orange → red → magenta gradient).
   ========================================================================== */

:root {
  /* npm brand */
  --red: #cb3837;
  --red-dark: #b0302f;
  --red-deep: #8e2121;
  --red-50: #fdf4f3;
  --red-100: #fbe5e3;
  --red-200: #f3c6c2;
  --npm-gradient: linear-gradient(90deg, #fb8817 0%, #ff4b01 30%, #c12127 62%, #e02aff 100%);

  /* neutrals (npm greys) */
  --ink: #231f20;
  --text: #333333;
  --text-2: #4d4d4d;
  --muted: #6b6b6b;
  --subtle: #8a8a8a;
  --line: #e6e6e6;
  --line-soft: #efefef;
  --soft: #f7f7f7;
  --soft-2: #f2f2f2;
  --white: #fff;

  /* status */
  --green: #1a7f45;
  --green-bg: #ebf7ef;
  --green-line: #cfe9d8;
  --amber-bg: #fff8eb;
  --amber-line: #f5dfb4;
  --amber-text: #7a5410;

  /* type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "SF Mono", "JetBrains Mono", "Fira Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* shape & motion */
  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgb(35 31 32 / 6%);
  --shadow: 0 1px 2px rgb(35 31 32 / 5%), 0 6px 20px -6px rgb(35 31 32 / 12%);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-collapse: 48px; /* top strip + topbar, scrolled away above the sticky search row */
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: var(--white);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  text-autospace: ideograph-alpha ideograph-numeric;
  text-spacing-trim: trim-start;
}
main { flex: 1 0 auto }
a { color: inherit; text-decoration: none }
button, input { font: inherit; color: inherit }
button, a, input, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent }
button { cursor: pointer; border: 0; background: none }
button:disabled { cursor: progress }
button, a { transition: color .18s var(--ease), background-color .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease), transform .18s var(--ease) }
a:hover { color: var(--red) }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; border-radius: 2px }
input { min-width: 0 }
p, h1, h2, h3, h4 { margin: 0 }
h1, h2, h3 { color: var(--ink); font-weight: 700; line-height: 1.35; text-wrap: balance }
h1 { letter-spacing: -.02em }
h2 { letter-spacing: -.01em }
p { text-wrap: pretty }
svg { flex-shrink: 0 }
ul { padding-left: 1.5em }
::selection { background: var(--red-100); color: var(--red-deep) }

.container { width: calc(100% - 48px); max-width: 1200px; margin-inline: auto }
.icon { width: 20px; height: 20px; vertical-align: middle }
.mono, code { font-family: var(--mono) }
.muted { color: var(--muted) }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0 }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 200; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: var(--radius); font-weight: 600; box-shadow: var(--shadow) }
.skip-link:focus { top: 12px; color: #fff }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: calc(-1 * var(--header-collapse));
  z-index: 50;
  background: rgb(255 255 255 / 92%);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-strip { height: 4px; background: var(--npm-gradient) }
.topbar { height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line-soft) }
.topbar-note { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.topbar-note .icon { width: 15px; height: 15px; color: var(--red); stroke-width: 2 }
.topbar nav { display: flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; flex-shrink: 0 }
.topbar nav a { position: relative; display: inline-flex; align-items: center; height: 32px; padding: 0 12px; color: var(--text-2); border-radius: var(--radius) }
.topbar nav a:hover { color: var(--ink); background: var(--soft-2) }
.topbar nav a.current { color: var(--red) }
.topbar nav a.current::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -6px; height: 2px; border-radius: 2px; background: var(--red) }
.official-link { gap: 5px }
.official-link .icon { width: 13px; height: 13px; opacity: .7 }

.searchbar { display: flex; align-items: center; gap: 32px; padding-block: 14px }
.brand { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--ink); font-weight: 800; font-size: 19px; letter-spacing: -.01em }
.brand::before { content: ""; width: 30px; height: 30px; border-radius: 7px; background: url("/favicon.svg") center / cover no-repeat; box-shadow: 0 1px 2px rgb(203 56 55 / 25%) }
.brand:hover { color: var(--ink) }
.brand:hover::before { transform: rotate(-6deg) }
.brand::before { transition: transform .25s var(--ease) }

.search-form {
  flex: 1;
  display: flex;
  align-items: center;
  height: 44px;
  min-width: 0;
  background: var(--soft-2);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px transparent;
  transition: background-color .18s var(--ease), box-shadow .18s var(--ease);
}
.search-form:hover { box-shadow: inset 0 0 0 1px #dcdcdc }
.search-form:focus-within { background: var(--white); box-shadow: inset 0 0 0 1px var(--red), 0 0 0 4px rgb(203 56 55 / 14%) }
.search-form > .icon { margin: 0 12px 0 16px; width: 18px; height: 18px; color: var(--subtle) }
.search-form:focus-within > .icon { color: var(--red) }
.search-form input { flex: 1; height: 100%; padding: 0 12px 0 0; border: 0; background: transparent; outline: none; font-size: 15px; color: var(--ink) }
.search-form input:focus, .search-form input:focus-visible { outline: none }
.search-form input::placeholder { color: #8f8f8f }
.search-form input::-webkit-search-cancel-button { cursor: pointer }
.search-form button {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 0;
  margin: 4px;
  padding: 0 18px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.search-form button:hover { background: var(--red) }
.search-form button:active { transform: scale(.98) }
.search-form button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px }
.search-form button .icon { width: 16px; height: 16px; margin-left: 10px; transition: transform .2s var(--ease) }
.search-form button:hover .icon { transform: translateX(2px) }

/* ---------- shared atoms ---------- */
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--red); margin-bottom: 10px }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 10px 20px; border: 1px solid transparent; border-radius: var(--radius); font-size: 15px; font-weight: 600; white-space: nowrap }
.button .icon { width: 17px; height: 17px; transition: transform .2s var(--ease) }
.button:hover .icon { transform: translateX(3px) }
.button:active { transform: translateY(1px) }
.button-dark { background: var(--ink); color: #fff }
.button-dark:hover { background: var(--red); color: #fff }
.button-white { background: #fff; color: var(--red) }
.button-white:hover { background: var(--red-50); color: var(--red-dark) }
.button-outline { border-color: var(--line); background: #fff; color: var(--text) }
.button-outline:hover { border-color: var(--red); color: var(--red) }

.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--red); font-size: 14px; font-weight: 600 }
.text-link .icon { width: 16px; height: 16px; transition: transform .2s var(--ease) }
.text-link:hover { color: var(--red-dark) }
.text-link:hover .icon { transform: translateX(3px) }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px 1px 7px; border: 1px solid transparent; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap }
.badge-cn { color: var(--green); background: var(--green-bg); border-color: var(--green-line) }
.badge .icon { width: 12px; height: 12px; stroke-width: 2.5 }

.keyword-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px }
.keyword-list a { position: relative; z-index: 1; display: inline-block; max-width: 100%; padding: 2px 10px; border-radius: var(--radius-sm); background: var(--soft-2); color: var(--text-2); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere }
.keyword-list a:hover { background: var(--red-100); color: var(--red-deep) }

.dot { color: #c4c4c4 }

/* ---------- home ---------- */
.catalog-hero { position: relative; overflow: hidden; color: #fff; background: linear-gradient(118deg, #b72a31 0%, #cb3837 48%, #e0552e 100%) }
.catalog-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgb(255 255 255 / 16%) 1px, transparent 1.2px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(100deg, transparent 35%, #000 90%);
  mask-image: linear-gradient(100deg, transparent 35%, #000 90%);
  pointer-events: none;
}
.catalog-hero::after { content: ""; position: absolute; right: -120px; top: -180px; width: 460px; height: 460px; border-radius: 50%; background: radial-gradient(circle, rgb(255 255 255 / 14%), transparent 65%); pointer-events: none }
.catalog-hero-inner { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 40px; padding-block: 44px 46px }
.catalog-hero .eyebrow { color: #ffd9cf; margin-bottom: 12px }
.catalog-hero h1 { color: #fff; font-size: 42px; line-height: 1.2; letter-spacing: -.02em; margin-bottom: 14px }
.catalog-hero p { max-width: 560px; font-size: 17px; line-height: 1.75; color: rgb(255 255 255 / 88%) }
.catalog-hero-mark { display: flex; align-items: center; gap: 14px; flex-shrink: 0; padding: 14px 22px 14px 16px; border: 1px solid rgb(255 255 255 / 22%); border-radius: 999px; background: rgb(255 255 255 / 10%); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font-size: 16px; font-weight: 600; letter-spacing: .06em; color: #fff }
.catalog-hero-mark .icon { width: 30px; height: 30px; stroke-width: 1.5; padding: 5px; box-sizing: content-box; border-radius: 50%; background: rgb(255 255 255 / 16%) }

.catalog-section { padding-top: 40px; padding-bottom: 64px }
.catalog-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 20px }
.catalog-heading h2 { font-size: 26px; margin-bottom: 6px }
.catalog-heading p { font-size: 15px; color: var(--muted) }
.catalog-count { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; padding: 6px 14px; border-radius: var(--radius); background: var(--soft) }
.catalog-count strong { font-family: var(--mono); font-size: 24px; font-weight: 700; color: var(--red); letter-spacing: -.02em; line-height: 1.2 }
.catalog-count span { font-size: 13px; color: var(--muted) }

.catalog-tools { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line) }
.catalog-categories { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0 }
.catalog-categories a { display: inline-flex; align-items: center; min-height: 36px; padding: 6px 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--text-2); font-size: 14px; font-weight: 500; white-space: nowrap }
.catalog-categories a:hover { border-color: var(--red-200); background: var(--red-50); color: var(--red-dark) }
.catalog-categories a.selected { border-color: var(--ink); background: var(--ink); color: #fff; font-weight: 600 }
.catalog-tools > .text-link { white-space: nowrap }

.catalog-bottom-note { margin-top: 22px; font-size: 13px; line-height: 1.8; color: var(--subtle); text-align: center }

/* ---------- package rows ---------- */
.package-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
  padding: 22px 18px;
  margin-inline: -18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(var(--line-soft), var(--line-soft)) left 18px bottom 0 / calc(100% - 36px) 1px no-repeat;
  transition: background-color .2s var(--ease), box-shadow .2s var(--ease);
}
.package-row:last-child { background-image: none; }
.package-row::before { content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; width: 3px; border-radius: 3px; background: var(--red); opacity: 0; transform: scaleY(.4); transition: opacity .2s var(--ease), transform .25s var(--ease) }
.package-row:hover { background-color: #fafafa }
.package-row:hover::before { opacity: 1; transform: none }
.package-row:has(h3 a:focus-visible) { box-shadow: inset 0 0 0 2px var(--red) }
.package-row-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 40px; height: 40px; margin-top: 1px; border-radius: 9px; background: var(--red-50); color: var(--red) }
.package-row-icon .icon { width: 21px; height: 21px; stroke-width: 1.6 }
.package-row-body { flex: 1; min-width: 0 }
.package-row-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px }
.package-row-title h3 { font-family: var(--mono); font-size: 17px; font-weight: 700; line-height: 1.45; letter-spacing: -.02em; overflow-wrap: anywhere }
.package-row-title h3 a { color: var(--ink) }
.package-row-title h3 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit } /* whole row is the hit target */
.package-row-title h3 a:focus-visible { outline: none }
.package-row:hover .package-row-title h3 a { color: var(--red) }
.package-description { margin-top: 6px; font-size: 15px; line-height: 1.75; color: var(--text-2); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden }
.package-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 12px; font-size: 13px; line-height: 1.6; color: var(--muted) }
.package-meta .mono { color: var(--text-2); font-size: 12.5px }
.package-row-arrow { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; flex-shrink: 0; align-self: center; width: 36px; height: 36px; margin-left: auto; border-radius: 50%; color: #a3a3a3 }
.package-row-arrow .icon { width: 18px; height: 18px; transition: transform .2s var(--ease) }
.package-row:hover .package-row-arrow { color: #fff; background: var(--red) }
.package-row:hover .package-row-arrow .icon { transform: translateX(1px) }

.compact { padding-block: 16px }
.compact .package-row-icon { width: 32px; height: 32px; border-radius: 7px }
.compact .package-row-icon .icon { width: 17px; height: 17px }
.compact .package-row-title h3 { font-size: 15px }
.compact .package-description { font-size: 14px; -webkit-line-clamp: 1 }
.compact .package-meta { font-size: 12px; margin-top: 8px }

/* ---------- pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 28px; font-size: 14px; color: var(--muted) }
.pagination > a, .pagination > .disabled { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 16px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; font-weight: 600; color: var(--text); background: #fff; white-space: nowrap }
.pagination > a:hover { border-color: var(--ink); background: var(--ink); color: #fff }
.pagination .disabled { color: #bdbdbd; border-color: var(--line-soft); background: var(--soft); font-weight: 500; cursor: not-allowed }
.pagination > span:not(.disabled) { text-align: center }

/* ---------- empty / message ---------- */
.empty-state { padding: 72px 24px; text-align: center }
.empty-icon { display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; margin: 0 auto 22px; border-radius: 50%; background: var(--red-50); color: var(--red); box-shadow: 0 0 0 10px #fefafa }
.empty-icon .icon { width: 30px; height: 30px; stroke-width: 1.5 }
.empty-state h2 { font-size: 21px; margin-bottom: 10px }
.empty-state p { font-size: 15px; line-height: 1.85; color: var(--muted) }
.empty-state .button { margin-top: 26px }

.message-page { padding-top: 96px; padding-bottom: 112px; text-align: center }
.message-code { display: inline-block; font-family: var(--mono); font-size: 96px; font-weight: 800; line-height: 1; letter-spacing: -.06em; background: var(--npm-gradient); -webkit-background-clip: text; background-clip: text; color: transparent }
.message-page h1 { font-size: 30px; margin-top: 22px; margin-bottom: 12px }
.message-page > p { max-width: 560px; margin: auto; font-size: 16px; color: var(--muted) }
.message-actions { display: flex; align-items: center; justify-content: center; gap: 24px; margin-top: 32px }

/* ---------- search ---------- */
.page-banner { position: relative; padding: 40px 0 36px; background: linear-gradient(180deg, #fafafa, #fff); border-bottom: 1px solid var(--line-soft) }
.page-banner h1 { font-size: 32px; overflow-wrap: anywhere }
.page-banner h1 span { color: var(--red); font-family: var(--mono); letter-spacing: -.03em }
.page-banner p { margin-top: 10px; font-size: 16px; color: var(--muted) }

.search-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; padding-top: 32px; padding-bottom: 72px; min-height: 520px }
.search-sidebar { position: sticky; top: 104px; align-self: start }
.search-sidebar h2 { margin-bottom: 10px; font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--subtle) }
.filter-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin-inline: -12px; border-radius: var(--radius); font-size: 15px; color: var(--text-2); cursor: default }
.filter-item > .icon { width: 17px; height: 17px }
.filter-item.selected { background: var(--red-50); color: var(--red-dark); font-weight: 600 }
.filter-item span { margin-left: auto }
.filter-item.selected span { width: 6px; height: 6px; border-radius: 50%; background: var(--red) }
.sidebar-divider { height: 1px; margin: 22px 0; background: var(--line) }
.direction-link { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; margin-inline: -12px; border-radius: var(--radius); font-size: 15px; color: var(--text-2) }
.direction-link .icon { width: 15px; height: 15px; color: #c2c2c2; opacity: 0; transform: translateX(-4px); transition: opacity .2s var(--ease), transform .2s var(--ease) }
.direction-link:hover { background: var(--soft); color: var(--ink) }
.direction-link:hover .icon, .direction-link.selected .icon { opacity: 1; transform: none }
.direction-link.selected { background: var(--red-50); color: var(--red-dark); font-weight: 600 }
.direction-link.selected .icon { color: var(--red) }
.sidebar-tip { margin-top: 28px; padding: 18px; border-radius: var(--radius-lg); background: var(--soft); color: var(--muted) }
.sidebar-tip > .icon { width: 20px; height: 20px; color: var(--red) }
.sidebar-tip p { margin-top: 8px; font-size: 13px; line-height: 1.8 }
.sidebar-tip .text-link { margin-top: 12px; font-size: 13px }

.results { min-width: 0 }
.results-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line) }
.results-heading > div { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap }
.results-heading strong { font-size: 16px; color: var(--ink) }
.results-heading span { font-size: 14px; color: var(--muted) }
.results-source { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 13px !important; color: var(--green) !important; font-weight: 600 }
.results-source::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #2bb562; box-shadow: 0 0 0 3px #2bb56226 }

/* ---------- package page ---------- */
.package-page { padding-top: 22px; padding-bottom: 80px }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; font-size: 14px; color: var(--subtle); overflow-wrap: anywhere }
.breadcrumbs a { color: var(--muted) }
.breadcrumbs a:hover { color: var(--red) }
.breadcrumbs > span:last-child { color: var(--text); font-family: var(--mono); font-size: 13px }
.package-heading { display: flex; align-items: center; gap: 18px }
.package-heading-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 60px; height: 60px; border-radius: 14px; color: #fff; background: linear-gradient(140deg, #e0552e, var(--red) 55%, #b72a31); box-shadow: 0 6px 16px -6px rgb(203 56 55 / 55%) }
.package-heading-icon .icon { width: 30px; height: 30px; stroke-width: 1.5 }
.package-heading > div:last-child { min-width: 0 }
.package-heading-line { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px }
.package-heading h1 { font-family: var(--mono); font-size: 30px; line-height: 1.25; letter-spacing: -.04em; overflow-wrap: anywhere }
.package-heading-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: 14px; color: var(--muted) }
.version-pill { padding: 0 8px; border-radius: var(--radius-sm); background: var(--soft-2); color: var(--text); font-family: var(--mono); font-size: 13px; line-height: 1.8 }
.package-lead { max-width: 860px; margin-top: 20px; margin-bottom: 4px; font-size: 17px; line-height: 1.8; color: var(--text-2); overflow-wrap: anywhere }

.notice { margin-top: 18px; padding: 14px 18px; border: 1px solid var(--amber-line); border-left-width: 4px; border-radius: var(--radius); background: var(--amber-bg); color: var(--amber-text); font-size: 15px; line-height: 1.75 }
.notice strong { color: #5e3f07 }
.notice-warning { margin-bottom: 8px }
.notice-warning p { margin-top: 4px; overflow-wrap: anywhere }

.package-tabs { display: flex; align-items: stretch; gap: 4px; min-height: 52px; margin-top: 24px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none }
.package-tabs::-webkit-scrollbar { display: none }
.package-tabs a { position: relative; display: flex; align-items: center; gap: 8px; padding: 0 16px; font-size: 15px; font-weight: 500; color: var(--muted); white-space: nowrap }
.package-tabs a::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: transparent; transition: background-color .2s var(--ease) }
.package-tabs a:hover { color: var(--ink) }
.package-tabs a:hover::after { background: var(--line) }
.package-tabs .active { color: var(--ink); font-weight: 700 }
.package-tabs .active::after, .package-tabs .active:hover::after { background: var(--red) }
.package-tabs .active .icon { color: var(--red) }
.package-tabs .icon { width: 17px; height: 17px }
.package-tabs a > span { min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--soft-2); color: var(--muted); font-family: var(--mono); font-size: 12px; line-height: 1.7; text-align: center }
.package-tabs a:last-child { margin-left: auto; font-size: 14px }
.package-tabs a:last-child .icon { width: 13px; height: 13px }

.package-columns { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 52px; padding-top: 28px }
.package-main { min-width: 0 }

.readme-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line-soft) }
.readme-toolbar > span { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted) }
.readme-toolbar > span .icon { width: 16px; height: 16px }
.language-toggle { display: inline-flex; padding: 3px; border-radius: 8px; background: var(--soft-2) }
.language-toggle a { padding: 4px 16px; border-radius: 6px; font-size: 14px; font-weight: 500; color: var(--muted) }
.language-toggle a:hover { color: var(--ink) }
.language-toggle a.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm), 0 0 0 1px rgb(0 0 0 / 4%) }

/* sidebar */
.package-sidebar { min-width: 0 }
.install-panel { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; box-shadow: var(--shadow-sm) }
.sidebar-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-size: 15px; font-weight: 700; color: var(--ink) }
.sidebar-title > span { padding: 0 7px; border-radius: var(--radius-sm); background: var(--red); color: #fff; font-family: var(--mono); font-size: 11px; font-weight: 700; line-height: 1.7 }
.install-command { display: flex; align-items: center; gap: 6px; padding: 5px 5px 5px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); transition: border-color .18s var(--ease) }
.install-command:hover { border-color: #cfcfcf }
.install-command > code { flex: 1; min-width: 0; font-size: 13px; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere }
.install-command > code::before { content: "›"; margin-right: 6px; color: var(--red); font-weight: 700 }
.copy-button { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px; border-radius: var(--radius); color: var(--muted) }
.copy-button .icon { width: 17px; height: 17px }
.copy-button:hover { background: #fff; color: var(--red); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line) }
.copy-button:active { transform: scale(.94) }
.copy-button.copied { color: var(--green); background: var(--green-bg) }
.install-panel > p { margin-top: 10px; font-size: 13px; color: var(--subtle) }

.package-info { display: grid; grid-template-columns: 1fr 1fr; margin-top: 20px; border-top: 1px solid var(--line) }
.info-pair { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 14px 0; border-bottom: 1px solid var(--line) }
.info-pair:nth-child(odd):not(:last-child) { padding-right: 12px }
.info-pair:last-child:nth-child(odd) { grid-column: 1 / -1 }
.info-pair > span { font-size: 13px; color: var(--muted) }
.info-pair strong { font-size: 17px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere }
.info-pair strong.mono { font-size: 16px; letter-spacing: -.02em }

.sidebar-section { margin-top: 26px }
.sidebar-section h2 { margin-bottom: 12px; font-size: 15px; font-weight: 700 }
.sidebar-project-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-inline: -10px; border-radius: var(--radius); font-size: 15px; color: var(--text) }
.sidebar-project-link .icon { width: 17px; height: 17px; color: var(--muted) }
.sidebar-project-link > .icon:last-child { width: 13px; height: 13px; margin-left: auto; opacity: .55 }
.sidebar-project-link:hover { background: var(--soft); color: var(--red) }
.sidebar-project-link:hover .icon { color: var(--red); opacity: 1 }
.maintainers { display: flex; flex-wrap: wrap; gap: 8px }
.maintainers > span { display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 100%; padding: 3px 10px 3px 3px; border: 1px solid var(--line-soft); border-radius: 999px; font-size: 13px; color: var(--text-2); overflow-wrap: anywhere }
.maintainer-avatar { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(135deg, #ff8a3d, var(--red)); color: #fff; font-family: var(--mono); font-size: 12px; font-weight: 700 }
.maintainers > span:nth-child(3n+2) .maintainer-avatar { background: linear-gradient(135deg, #e0552e, #a8244f) }
.maintainers > span:nth-child(3n+3) .maintainer-avatar { background: linear-gradient(135deg, #c12127, #b33ad8) }
.sidebar-keywords { margin-top: 0 }
.sidebar-keywords a { font-size: 13px }
.open-source-note { display: flex; align-items: center; gap: 12px; margin-top: 28px; padding: 16px; border-radius: var(--radius-lg); background: linear-gradient(135deg, #fff6f2, #fdf2f6); color: var(--red-dark) }
.open-source-note .icon { width: 22px; height: 22px; stroke-width: 1.8 }
.open-source-note p { font-size: 13px; line-height: 1.8; color: #8b3a35 }

/* dependencies */
.dependency-section { margin-bottom: 40px }
.dependency-section h2 { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; font-size: 20px }
.dependency-section h2 span { min-width: 26px; padding: 0 8px; border-radius: 999px; background: var(--soft-2); color: var(--muted); font-family: var(--mono); font-size: 13px; font-weight: 600; line-height: 1.8; text-align: center }
.dependency-section > .muted { font-size: 15px; padding: 18px; border-radius: var(--radius); background: var(--soft) }
.dependency-list { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden }
.dependency-list > a { display: flex; align-items: center; gap: 16px; min-width: 0; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); font-size: 15px; line-height: 1.6 }
.dependency-list > a:last-child { border-bottom: 0 }
.dependency-list > a:hover { background: var(--soft) }
.dependency-list > a > span { flex: 1; min-width: 0; color: var(--ink); font-weight: 600; overflow-wrap: anywhere }
.dependency-list > a:hover > span { color: var(--red) }
.dependency-list code { padding: 1px 8px; border-radius: var(--radius-sm); background: var(--soft-2); font-size: 13px; color: var(--text-2) }
.dependency-list .icon { width: 15px; height: 15px; color: #bdbdbd; transition: transform .2s var(--ease), color .2s var(--ease) }
.dependency-list > a:hover .icon { color: var(--red); transform: translateX(2px) }

/* ---------- README typography ---------- */
.readme-content { padding-top: 24px; font-size: 16px; line-height: 1.85; color: var(--text); overflow-wrap: anywhere }
.readme-content > :first-child { margin-top: 0 }
.readme-content h1, .readme-content h2, .readme-content h3, .readme-content h4, .readme-content h5, .readme-content h6 { margin-top: 1.9em; margin-bottom: .7em; color: var(--ink); font-weight: 700; line-height: 1.4; letter-spacing: -.01em; scroll-margin-top: 104px }
.readme-content > h1:first-child, .readme-content > h2:first-child { margin-top: 6px }
.readme-content h1 { font-size: 30px; padding-bottom: 12px; border-bottom: 1px solid var(--line) }
.readme-content h2 { font-size: 24px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft) }
.readme-content h3 { font-size: 20px }
.readme-content h4 { font-size: 17px }
.readme-content h5, .readme-content h6 { font-size: 16px; color: var(--text-2) }
.readme-content p, .readme-content ul, .readme-content ol, .readme-content dl, .readme-content pre, .readme-content blockquote, .readme-content table, .readme-content details, .readme-content figure { margin-top: 0; margin-bottom: 1.15em }
.readme-content ul, .readme-content ol { padding-left: 1.6em }
.readme-content li + li { margin-top: .3em }
.readme-content li > ul, .readme-content li > ol { margin-top: .3em; margin-bottom: 0 }
.readme-content li::marker { color: #9a9a9a }
.readme-content ol > li::marker { font-family: var(--mono); font-size: .9em }
.readme-content li:has(> input[type=checkbox]) { list-style: none; margin-left: -1.3em }
.readme-content input[type=checkbox] { width: 15px; height: 15px; margin: 0 8px 0 0; vertical-align: -2px; accent-color: var(--red) }
.readme-content strong, .readme-content b { color: var(--ink); font-weight: 700 }
.readme-content img { max-width: 100%; height: auto; vertical-align: middle; border-radius: 2px }
.readme-content a { color: var(--red-dark); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: rgb(176 48 47 / 35%) }
.readme-content a:hover { color: var(--red-deep); text-decoration-color: currentColor }
.readme-content a:has(> img) { text-decoration: none }
.readme-content code { padding: .15em .4em; border-radius: var(--radius-sm); background: var(--soft-2); color: #1f1f1f; font-size: .875em; overflow-wrap: anywhere }
.readme-content a code { color: inherit }
.readme-content pre { position: relative; max-width: 100%; overflow-x: auto; padding: 18px 20px; border: 1px solid var(--line-soft); border-radius: var(--radius-lg); background: var(--soft); line-height: 1.65; white-space: pre; tab-size: 2; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #d4d4d4 transparent }
.readme-content pre code { padding: 0; border-radius: 0; background: none; color: #24292f; font-size: 14px; white-space: pre; overflow-wrap: normal }
.readme-content kbd { display: inline-block; min-width: 1.6em; padding: 0 .45em; border: 1px solid #d0d0d0; border-bottom-width: 2px; border-radius: 5px; background: #fff; font-family: var(--mono); font-size: .82em; line-height: 1.6; text-align: center; color: var(--ink) }
.readme-content mark { padding: 0 .2em; border-radius: 2px; background: #fff1b8 }
.readme-content blockquote { margin-left: 0; margin-right: 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--line); color: var(--text-2) }
.readme-content blockquote > :last-child { margin-bottom: 0 }
.readme-content hr { height: 1px; margin: 32px 0; border: 0; background: var(--line) }
.readme-content table { display: block; width: max-content; max-width: 100%; overflow-x: auto; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: var(--radius-lg); font-size: 15px; line-height: 1.7 }
.readme-content td, .readme-content th { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: top }
.readme-content td + td, .readme-content th + th { border-left: 1px solid var(--line-soft) }
.readme-content tr:last-child > td { border-bottom: 0 }
.readme-content th { background: var(--soft); color: var(--ink); font-weight: 700; white-space: nowrap }
.readme-content tbody tr:hover { background: #fcfcfc }
.readme-content td code { white-space: nowrap }
.readme-content details { padding: 10px 16px; border: 1px solid var(--line); border-radius: var(--radius) }
.readme-content details[open] { padding-bottom: 4px }
.readme-content summary { cursor: pointer; font-weight: 600; color: var(--ink); margin: -10px -16px; padding: 10px 16px }
.readme-content summary:hover { color: var(--red) }
.readme-content details[open] > summary { margin-bottom: 8px; border-bottom: 1px solid var(--line-soft) }
.readme-content dt { font-weight: 700; color: var(--ink) }
.readme-content dd { margin-left: 1.5em; margin-bottom: .6em }
.readme-content sup, .readme-content sub { line-height: 0 }

/* description fragments (lead paragraph) */
.package-lead.description-content { overflow-wrap: anywhere }
.description-content > :first-child { margin-top: 0 }
.description-content > :last-child { margin-bottom: 0 }
.description-content p, .description-content ul, .description-content ol, .description-content blockquote, .description-content pre, .description-content table { margin-block: .6em }
.description-content h1, .description-content h2, .description-content h3, .description-content h4, .description-content h5, .description-content h6 { margin-block: .85em .35em; font-size: 1.1em; line-height: 1.5; color: var(--ink) }
.description-content a { color: var(--red-dark); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgb(176 48 47 / 35%) }
.description-content code { padding: .12em .35em; border-radius: var(--radius-sm); background: var(--soft-2); font-size: .88em }
.description-content pre { max-width: 100%; overflow: auto; padding: 12px 14px; border-radius: var(--radius); background: var(--soft) }
.description-content pre code { padding: 0; background: none }
.description-content blockquote { margin-inline: 0; padding-left: 14px; border-left: 3px solid var(--line) }
.description-content img { max-width: 100%; height: auto }
.description-content table { display: block; max-width: 100%; overflow: auto; border-collapse: collapse }
.description-content th, .description-content td { padding: 6px 10px; border: 1px solid var(--line) }

/* ---------- about ---------- */
.about-banner { padding-top: 56px; padding-bottom: 52px; background: radial-gradient(900px 260px at 85% 0%, #fff0eb, transparent 70%), linear-gradient(180deg, #fafafa, #fff) }
.about-banner h1 { font-size: 40px; line-height: 1.35; letter-spacing: -.03em }
.about-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); gap: 80px; padding-top: 56px; padding-bottom: 88px }
.about-intro { position: sticky; top: 112px; align-self: start }
.about-intro > .icon { width: 44px; height: 44px; padding: 10px; box-sizing: content-box; border-radius: 14px; background: var(--red-50); color: var(--red); stroke-width: 1.5 }
.about-intro h2 { margin-top: 22px; font-size: 26px; line-height: 1.6 }
.about-copy > h2 { position: relative; margin-top: 36px; margin-bottom: 10px; padding-left: 14px; font-size: 20px }
.about-copy > h2::before { content: ""; position: absolute; left: 0; top: .3em; bottom: .3em; width: 4px; border-radius: 4px; background: var(--red) }
.about-copy > h2:first-child { margin-top: 0 }
.about-copy > p { font-size: 16px; line-height: 1.95; color: var(--text-2) }
.about-copy a:not(.button) { color: var(--red-dark); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgb(176 48 47 / 35%) }
.about-copy code { padding: .12em .4em; border-radius: var(--radius-sm); background: var(--soft-2); font-size: .88em; color: var(--ink) }
.about-copy > .button { margin-top: 36px }

/* ---------- footer ---------- */
.site-footer { margin-top: auto; border-top: 1px solid var(--line); background: var(--soft) }
.footer-main { display: flex; align-items: center; justify-content: space-between; gap: 32px; padding-top: 40px; padding-bottom: 32px }
.footer-brand { font-size: 18px }
.footer-brand::before { width: 26px; height: 26px; border-radius: 6px }
.footer-main p { margin-top: 10px; font-size: 14px; color: var(--muted) }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 14px; color: var(--text-2) }
.footer-links a { display: inline-flex; align-items: center; gap: 5px }
.footer-links .icon { width: 13px; height: 13px; opacity: .65 }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 22px; border-top: 1px solid var(--line); font-size: 13px; color: var(--subtle) }
.footer-heart { display: inline-block; margin-left: 4px; color: var(--red); animation: beat 2.4s var(--ease) infinite }
@keyframes beat { 0%, 60%, 100% { transform: scale(1) } 10% { transform: scale(1.25) } 20% { transform: scale(1) } 30% { transform: scale(1.18) } }

/* ---------- toast & misc ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 300; display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px; background: rgb(35 31 32 / 94%); color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 10px 30px -8px rgb(0 0 0 / 35%); opacity: 0; transform: translate(-50%, 12px) scale(.98); pointer-events: none; transition: opacity .22s var(--ease), transform .22s var(--ease) }
.toast:empty { display: none }
.toast::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2bb562 }
.toast.visible { opacity: 1; transform: translate(-50%, 0) scale(1) }
.clipboard-fallback { position: fixed; top: 0; left: -9999px; opacity: 0 }

/* ==========================================================================
   Package insights (first-party facts, TOC, release history, FAQ)
   ========================================================================== */
.package-heading-meta .trait { padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); font-size: 12.5px; line-height: 1.7 }
.info-pair small { font-size: 12px; color: var(--subtle); line-height: 1.5; overflow-wrap: anywhere }

.install-alternatives { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px }
.install-alternatives li { display: flex; align-items: center; gap: 8px; padding: 2px 5px 2px 10px; border-radius: var(--radius) }
.install-alternatives li:hover { background: var(--soft) }
.install-alternatives span { width: 34px; flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--subtle) }
.install-alternatives code { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere }
.install-alternatives .copy-button { width: 28px; height: 28px }
.install-alternatives .copy-button .icon { width: 15px; height: 15px }
.install-peers { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line) }
.install-peers > span { width: 100%; font-size: 12px; font-weight: 700; color: var(--muted) }
.install-peers code { padding: 1px 8px; border-radius: var(--radius-sm); background: var(--soft-2); font-size: 12.5px; color: var(--ink) }
.install-peers code em { font-style: normal; color: var(--muted) }
.install-peers code i { margin-left: 4px; font-style: normal; font-family: var(--font); font-size: 11px; color: var(--subtle) }
.install-peers p { width: 100%; margin-top: 2px; font-size: 12px; line-height: 1.6; color: var(--subtle) }
.sidebar-author { margin-bottom: 10px; font-size: 14px; color: var(--text-2) }

.translation-note { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; padding: 10px 14px; border-radius: var(--radius); background: var(--soft); font-size: 13.5px; line-height: 1.7; color: var(--muted) }
.translation-note > .icon { width: 16px; height: 16px; margin-top: 3px; color: var(--green); stroke-width: 2.2 }
.translation-note a { color: var(--red-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgb(176 48 47 / 35%) }
.translation-note time { color: var(--text) }

.readme-toc { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff }
.readme-toc summary { display: flex; align-items: center; gap: 10px; padding: 10px 16px; cursor: pointer; font-size: 14px; font-weight: 700; color: var(--ink); list-style: none }
.readme-toc summary::-webkit-details-marker { display: none }
.readme-toc summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--subtle); border-bottom: 2px solid var(--subtle); transform: rotate(-45deg); transition: transform .2s var(--ease) }
.readme-toc[open] summary::before { transform: rotate(45deg) translate(-2px, -2px) }
.readme-toc summary span { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--subtle) }
.readme-toc ol { list-style: none; margin: 0; padding: 4px 8px 12px; columns: 2 240px; column-gap: 16px; border-top: 1px solid var(--line-soft) }
.readme-toc li { break-inside: avoid }
.readme-toc li a { display: block; padding: 4px 8px; border-radius: var(--radius-sm); font-size: 14px; line-height: 1.55; color: var(--text-2) }
.readme-toc li a:hover { background: var(--soft); color: var(--red) }
.readme-toc li.sub a { padding-left: 22px; font-size: 13px; color: var(--muted) }

.package-section { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line) }
.package-section > h2 { display: flex; align-items: center; gap: 10px; font-size: 22px; scroll-margin-top: 104px }
.package-section > h2 .icon { width: 22px; height: 22px; color: var(--red) }
.package-section { scroll-margin-top: 96px }
.section-lead { margin-top: 8px; font-size: 15px; line-height: 1.8; color: var(--muted) }
.section-note { margin-top: 10px; font-size: 13px; color: var(--subtle) }
.release-table { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow-x: auto }
.release-table table { width: 100%; border-collapse: collapse; font-size: 14px }
.release-table th { padding: 9px 14px; background: var(--soft); text-align: left; font-weight: 700; color: var(--ink); white-space: nowrap }
.release-table td { padding: 9px 14px; border-top: 1px solid var(--line-soft); color: var(--text-2); white-space: nowrap }
.release-table td code { font-size: 13.5px; color: var(--ink); font-weight: 600 }
.release-table tr.current td { background: #fffafa }
.release-table .tag { margin-left: 8px; padding: 0 7px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 1.7 }
.release-table .tag-muted { background: var(--soft-2); color: var(--muted) }

.faq-item { padding: 18px 0; border-bottom: 1px solid var(--line-soft) }
.faq-item:last-child { border-bottom: 0 }
.faq-item h3 { font-size: 17px; line-height: 1.5 }
.faq-item p { margin-top: 6px; font-size: 15.5px; line-height: 1.85; color: var(--text-2) }

/* about page */
.about-facts { display: grid; gap: 0; margin: 28px 0 0; border-top: 1px solid var(--line) }
.about-facts > div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line) }
.about-facts dt { font-size: 14px; color: var(--muted) }
.about-facts dd { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); text-align: right }
.method-steps { list-style: none; margin: 14px 0 0; padding: 0; counter-reset: step }
.method-steps li { position: relative; padding: 0 0 18px 44px; counter-increment: step }
.method-steps li::before { content: counter(step); position: absolute; left: 0; top: 0; display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--red-50); color: var(--red); font-family: var(--mono); font-size: 13px; font-weight: 700 }
.method-steps li:not(:last-child)::after { content: ""; position: absolute; left: 13.5px; top: 32px; bottom: 4px; width: 1px; background: var(--line) }
.method-steps h3 { font-size: 16px; line-height: 1.75 }
.method-steps p { margin-top: 2px; font-size: 15px; line-height: 1.9; color: var(--text-2) }
.contact-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px }
.about-copy > h2 { scroll-margin-top: 104px }

}
@media (max-width: 600px) {
  .readme-toc ol { columns: 1 }
  .package-section { margin-top: 36px; padding-top: 22px }
  .package-section > h2 { font-size: 19px }
  .faq-item h3 { font-size: 16px }
  .faq-item p { font-size: 15px }
  .release-table { margin-inline: -16px; border-radius: 0; border-inline: 0 }
  .package-heading-meta .trait { font-size: 12px }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .searchbar { gap: 24px }
  .package-columns { grid-template-columns: minmax(0, 1fr) 268px; gap: 36px }
  .search-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 36px }
  .about-body { gap: 48px }
  .footer-links { gap: 8px 20px }
}

@media (max-width: 860px) {
  .container { width: calc(100% - 40px) }
  html { scroll-padding-top: 24px }
  .site-header { position: relative; top: 0; -webkit-backdrop-filter: none; backdrop-filter: none; background: #fff }
  .official-link { display: none !important }
  .search-button-long { display: none }
  .search-form button .icon { display: none }

  .catalog-hero h1 { font-size: 34px }
  .catalog-hero-mark { padding: 10px 16px 10px 10px; font-size: 14px }

  /* package page: install + facts before the README, the rest after it */
  .package-columns { display: flex; flex-direction: column; gap: 0; padding-top: 22px }
  .package-sidebar { display: contents }
  .install-panel { order: -1; margin-bottom: 20px }
  .package-info { margin-bottom: 8px }
  .info-pair strong { font-size: 16px }
  .sidebar-section, .open-source-note { margin-top: 0; padding-top: 22px; border-top: 1px solid var(--line-soft) }
  .package-main + .sidebar-section, .package-main { margin-bottom: 28px }
  .package-sidebar > .sidebar-section:first-of-type { margin-top: 8px }
  .open-source-note { margin-top: 24px; border-top: 0 }
  .sidebar-section + .sidebar-section { margin-top: 22px }

  .search-layout { display: block; padding-top: 18px; padding-bottom: 48px; min-height: 0 }
  .search-sidebar { position: static; display: flex; align-items: center; gap: 8px; margin: 0 -20px 20px; padding: 0 20px 14px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line-soft) }
  .search-sidebar::-webkit-scrollbar { display: none }
  .search-sidebar h2, .sidebar-divider, .sidebar-tip { display: none }
  .filter-item, .direction-link { flex-shrink: 0; margin: 0; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; white-space: nowrap }
  .filter-item.selected { border-color: var(--red-200) }
  .filter-item span { display: none }
  .direction-link .icon { display: none }
  .direction-link.selected { border-color: var(--red-200) }

  .about-body { grid-template-columns: 1fr; gap: 28px; padding-top: 40px }
  .about-intro { position: static }
  .about-intro h2 { font-size: 22px }

  .footer-main { flex-direction: column; align-items: flex-start; gap: 20px }
}

@media (max-width: 600px) {
  body { font-size: 15px }
  .container { width: calc(100% - 32px) }

  .topbar { height: 42px }
  .topbar-note { font-size: 12px }
  .topbar nav { gap: 0; font-size: 13px }
  .topbar nav a { padding: 0 8px }
  .topbar nav a.current::after { left: 8px; right: 8px; bottom: -5px }
  .topbar nav a:not(.current):not(.official-link):nth-child(2) { display: none }

  .searchbar { flex-wrap: wrap; gap: 12px; padding-block: 14px }
  .brand { font-size: 18px }
  .brand::before { width: 26px; height: 26px; border-radius: 6px }
  .searchbar .search-form { flex-basis: 100% }
  .search-form input { font-size: 16px } /* prevents iOS zoom */
  .search-form button { padding-inline: 16px }

  .catalog-hero-inner { display: block; padding-block: 30px 32px }
  .catalog-hero h1 { font-size: 30px; margin-bottom: 10px }
  .catalog-hero p { font-size: 15px }
  .catalog-hero-mark { display: none }

  .catalog-section { padding-top: 28px; padding-bottom: 44px }
  .catalog-heading { align-items: flex-start; gap: 12px; margin-bottom: 16px }
  .catalog-heading h2 { font-size: 21px }
  .catalog-heading p { font-size: 14px }
  .catalog-count { flex-direction: column; align-items: center; gap: 0; padding: 6px 12px }
  .catalog-count strong { font-size: 22px }
  .catalog-count span { font-size: 11px }
  .catalog-tools { margin-inline: -16px; padding: 0 16px 14px }
  .catalog-categories { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 24px }
  .catalog-categories::-webkit-scrollbar { display: none }
  .catalog-categories a { flex-shrink: 0; font-size: 14px; padding-inline: 14px }
  .catalog-tools > .text-link { display: none }

  .package-row { gap: 12px; padding: 18px 16px; margin-inline: -16px; border-radius: 0; background-position: left 16px bottom 0; background-size: calc(100% - 32px) 1px }
  .package-row::before { top: 18px; bottom: 18px }
  .package-row-icon { display: none }
  .package-row-title h3 { font-size: 16px }
  .badge { font-size: 11px }
  .package-description { font-size: 15px }
  .package-meta { font-size: 12px }
  .keyword-list a { font-size: 12px; padding: 1px 8px }
  .package-row-arrow { width: 28px; height: 28px; align-self: flex-start; margin-top: 2px }

  .pagination { gap: 8px; font-size: 13px }
  .pagination > a, .pagination > .disabled { padding: 8px 12px; font-size: 13px }
  .catalog-bottom-note { font-size: 12px; text-align: left }

  .page-banner { padding: 26px 0 22px }
  .page-banner h1 { font-size: 24px }
  .page-banner p { font-size: 15px }
  .search-sidebar { margin-inline: -16px; padding-inline: 16px }
  .results-heading { flex-wrap: wrap; gap: 6px }

  .package-page { padding-top: 14px; padding-bottom: 56px }
  .breadcrumbs { margin-bottom: 18px; font-size: 13px }
  .package-heading { align-items: flex-start; gap: 14px }
  .package-heading-icon { width: 46px; height: 46px; border-radius: 11px }
  .package-heading-icon .icon { width: 24px; height: 24px }
  .package-heading h1 { font-size: 23px }
  .package-heading-meta { font-size: 13px; gap: 4px 12px }
  .package-lead { font-size: 16px; margin-top: 16px }
  .package-tabs { margin-inline: -16px; padding-inline: 8px; min-height: 48px; margin-top: 18px }
  .package-tabs a { padding: 0 10px; font-size: 14px }
  .package-tabs a:last-child { font-size: 0; gap: 0 }
  .package-tabs a:last-child .icon { width: 17px; height: 17px }
  .install-panel { padding: 14px }
  .install-command > code { font-size: 13px }
  .info-pair > span { font-size: 12px }
  .info-pair strong, .info-pair strong.mono { font-size: 14px }

  .readme-toolbar > span { font-size: 13px }
  .readme-content { font-size: 16px; line-height: 1.85 }
  .readme-content h1 { font-size: 25px }
  .readme-content h2 { font-size: 21px }
  .readme-content h3 { font-size: 18px }
  .readme-content pre { max-width: none; margin-inline: -16px; padding: 16px; border-radius: 0; border-inline: 0 }
  .readme-content pre code { font-size: 13px }
  .readme-content table { font-size: 14px }
  .readme-content td, .readme-content th { padding: 8px 11px }

  .dependency-section h2 { font-size: 18px }
  .dependency-list > a { padding: 11px 12px; font-size: 14px; gap: 10px }

  .empty-state { padding: 52px 8px }
  .message-page { padding-top: 64px; padding-bottom: 80px }
  .message-code { font-size: 72px }
  .message-page h1 { font-size: 24px }
  .message-actions { flex-direction: column; gap: 16px }

  .about-banner { padding-top: 36px; padding-bottom: 32px }
  .about-banner h1 { font-size: 28px }
  .about-copy > p { font-size: 15px }

  .footer-main { padding-top: 32px; padding-bottom: 24px }
  .footer-links { gap: 8px 18px; font-size: 14px }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 4px; font-size: 12px }
  .toast { bottom: max(20px, env(safe-area-inset-bottom)); max-width: calc(100% - 32px); font-size: 13px }
}

@media (hover: none) {
  .package-row:hover { background-color: transparent }
  .package-row:hover::before { opacity: 0 }
  .package-row:active { background-color: #fafafa }
  .package-row:hover .package-row-arrow { color: #a3a3a3; background: transparent }
  .package-row:hover .package-row-title h3 a { color: var(--ink) }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important }
}

@media print {
  .site-header, .site-footer, .package-sidebar, .package-tabs, .readme-toolbar, .toast, .skip-link { display: none !important }
  .package-columns { display: block }
  body { font-size: 12pt }
  .readme-content pre { white-space: pre-wrap }
  .readme-content a { color: inherit }
}
