/* ============================================================
   anoxia 资源库 · 站点样式
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;

  --bg: #fbfbfd;
  --bg-soft: #f3f4f8;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --text: #14161b;
  --text-2: #4c5463;
  --muted: #8b93a3;
  --line: #e7e9ef;
  --line-strong: #d7dae3;

  --brand: #4f46e5;
  --brand-ink: #3f35d6;
  --brand-soft: #eef0ff;
  --accent: #06b6d4;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --container: 1180px;

  --shadow-xs: 0 1px 2px rgba(16, 20, 28, 0.05);
  --shadow-sm: 0 2px 8px -2px rgba(16, 20, 28, 0.08), 0 1px 2px rgba(16, 20, 28, 0.04);
  --shadow: 0 14px 36px -18px rgba(16, 20, 28, 0.22), 0 2px 6px rgba(16, 20, 28, 0.04);
  --shadow-lg: 0 32px 70px -30px rgba(16, 20, 28, 0.32);

  --header-h: 66px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0a0b0f;
  --bg-soft: #101219;
  --surface: #13151c;
  --surface-2: #171a22;
  --text: #e9ebf2;
  --text-2: #b0b7c6;
  --muted: #7c8496;
  --line: #232733;
  --line-strong: #2f3442;

  --brand: #8b84ff;
  --brand-ink: #a49dff;
  --brand-soft: #1c1b36;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow: 0 16px 40px -20px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 32px 70px -30px rgba(0, 0, 0, 0.8);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

p {
  margin: 0;
}

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

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

::selection {
  background: color-mix(in srgb, var(--brand) 24%, transparent);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}

.ico {
  width: 1em;
  height: 1em;
  flex: none;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 12px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- buttons ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-border: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--btn-border);
  border-radius: 11px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn:active {
  transform: translateY(0);
}
.btn .ico {
  width: 16px;
  height: 16px;
}
.btn-sm {
  height: 36px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 9px;
}
.btn-lg {
  height: 48px;
  padding: 0 24px;
  font-size: 15px;
  border-radius: 13px;
}
.btn-primary {
  --btn-bg: linear-gradient(180deg, #5b52f0, #4a40e0);
  --btn-fg: #fff;
  --btn-border: transparent;
  box-shadow: 0 8px 20px -10px rgba(79, 70, 229, 0.9);
}
.btn-primary:hover {
  box-shadow: 0 14px 26px -12px rgba(79, 70, 229, 0.85);
}
[data-theme="dark"] .btn-primary {
  --btn-bg: linear-gradient(180deg, #7a72ff, #5b51ea);
  --btn-fg: #0a0b12;
}
[data-theme="dark"] .btn-primary:hover {
  box-shadow: 0 14px 30px -14px rgba(123, 114, 255, 0.9);
}
.btn-ghost {
  --btn-bg: transparent;
  --btn-border: var(--line-strong);
}
.btn-ghost:hover {
  background: var(--surface-2);
}
.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--text-2);
  transition: background 0.18s, color 0.18s;
}
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}
.icon-btn .ico {
  width: 19px;
  height: 19px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  transition: border-color 0.16s, background 0.16s, color 0.16s;
}
.chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.chip.is-active {
  background: var(--brand);
  border-color: transparent;
  color: #fff;
}
[data-theme="dark"] .chip.is-active {
  color: #0b0c12;
}
.chip-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--text-2);
}
.chip-num {
  font-size: 11px;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid transparent;
  color: var(--text-2);
  font-size: 13px;
  transition: all 0.16s ease;
}
.tag-pill span {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.tag-pill:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}
.tag-pill.is-hot {
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  color: var(--brand);
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 6px 22px -18px rgba(16, 20, 28, 0.4);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, #6b62f5, #4a40e0 55%, #3630b8);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(79, 70, 229, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.brand-mark svg {
  width: 22px;
  height: 22px;
}
.brand-text {
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.brand-text strong {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.brand-text em {
  font-style: normal;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;
}
.main-nav a {
  position: relative;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.16s, background 0.16s;
}
.main-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}
.main-nav a.is-active {
  color: var(--text);
  font-weight: 600;
}
.main-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 208px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  transition: width 0.22s ease, border-color 0.18s;
}
.header-search:focus-within {
  width: 250px;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}
.header-search .ico {
  width: 16px;
  height: 16px;
  color: var(--muted);
}
.header-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-size: 13px;
}
.header-search kbd {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
}

.theme-sun,
.theme-moon {
  display: inline-flex;
}
[data-theme="light"] .theme-moon,
[data-theme="dark"] .theme-sun {
  display: none;
}

.nav-toggle {
  display: none;
}
.nav-close {
  display: none;
}

.mobile-panel {
  display: none;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 74px 0 60px;
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -140px -10% auto -10%;
  height: 720px;
  z-index: -2;
  background: radial-gradient(620px 300px at 14% 10%, rgba(99, 91, 255, 0.2), transparent 65%),
    radial-gradient(520px 280px at 84% 16%, rgba(6, 182, 212, 0.16), transparent 62%);
  mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent 100%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.4;
  mask-image: radial-gradient(700px 420px at 50% 20%, #000 10%, transparent 75%);
  -webkit-mask-image: radial-gradient(700px 420px at 50% 20%, #000 10%, transparent 75%);
}
[data-theme="dark"] .hero::after {
  opacity: 0.22;
}

.hero-inner {
  max-width: 900px;
  text-align: center;
  margin: 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  font-size: 12.5px;
  color: var(--text-2);
  letter-spacing: 0.01em;
}
.pulse {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px color-mix(in srgb, #10b981 18%, transparent);
}
.pulse::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, #10b981 45%, transparent);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  70% {
    transform: scale(1.5);
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

.hero h1 {
  margin: 22px 0 18px;
  font-size: clamp(34px, 5.4vw, 58px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.035em;
}
.grad-text {
  background: linear-gradient(100deg, #4f46e5 0%, #7c3aed 38%, #06b6d4 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
[data-theme="dark"] .grad-text {
  background: linear-gradient(100deg, #a7a0ff 0%, #c4a4ff 40%, #67e8f9 92%);
  -webkit-background-clip: text;
  background-clip: text;
}

.lede {
  max-width: 620px;
  margin: 0 auto;
  color: var(--text-2);
  font-size: 15.5px;
  line-height: 1.85;
}

.hero-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 640px;
  height: 58px;
  margin: 30px auto 0;
  padding: 0 8px 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.hero-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent), var(--shadow);
}
.hero-search .ico {
  width: 19px;
  height: 19px;
  color: var(--muted);
}
.hero-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  outline: none;
  font-size: 14.5px;
}
.hero-search input::placeholder {
  color: var(--muted);
}
.hero-search .btn {
  height: 42px;
  padding: 0 22px;
  border-radius: 11px;
}

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
  font-size: 12.5px;
}
.quick-label {
  color: var(--muted);
}

/* ---------- stats ---------- */
.stats-band {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 22px 0;
  text-align: center;
  border-right: 1px solid var(--line);
}
.stat:last-child {
  border-right: 0;
}
.stat b {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat span {
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- section ---------- */
.section {
  padding: 62px 0 8px;
}
.section:last-of-type {
  padding-bottom: 40px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.section-head h2 {
  font-size: 23px;
  letter-spacing: -0.025em;
}
.section-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13.5px;
}
.more-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.16s, gap 0.16s;
}
.more-link .ico {
  width: 15px;
  height: 15px;
}
.more-link:hover {
  color: var(--brand);
  gap: 10px;
}

/* ---------- cards ---------- */
.grid {
  display: grid;
  gap: 20px;
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: transform 0.22s cubic-bezier(0.2, 0.7, 0.3, 1), box-shadow 0.22s, border-color 0.22s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  box-shadow: var(--shadow);
}
.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card-cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(145deg, var(--c1, #7c7af5) 0%, var(--c2, #5a51e8) 55%, var(--c3, #3b34b8) 100%);
  overflow: hidden;
  isolation: isolate;
}
.card-lg .card-cover {
  aspect-ratio: 16 / 9;
}
.card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 78% 10%, rgba(255, 255, 255, 0.28), transparent 55%);
  mix-blend-mode: soft-light;
}
.card-cover-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.22) 1px, transparent 0);
  background-size: 15px 15px;
  opacity: 0.55;
  mask-image: radial-gradient(90% 80% at 30% 100%, #000 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(90% 80% at 30% 100%, #000 20%, transparent 80%);
}
.card-cover-icon {
  position: absolute;
  right: 16px;
  bottom: 10px;
  color: rgba(255, 255, 255, 0.9);
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.28));
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.card-cover-icon .ico {
  width: 58px;
  height: 58px;
  stroke-width: 1.1;
}
.card-lg .card-cover-icon .ico {
  width: 72px;
  height: 72px;
}
.card:hover .card-cover-icon {
  transform: translateY(-4px) scale(1.06) rotate(-4deg);
}
.card-cat {
  position: absolute;
  left: 14px;
  top: 14px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.card-flag {
  position: absolute;
  right: 14px;
  top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(12, 14, 22, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
}
.card-flag .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffd166;
  box-shadow: 0 0 8px #ffd166;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
  padding: 15px 16px 14px;
}
.card-title {
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-desc {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 11.5px;
}
.card-tags {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-date {
  flex: none;
  font-variant-numeric: tabular-nums;
}
.card-lg .card-title {
  font-size: 16.5px;
}
.card-lg .card-desc {
  font-size: 13px;
}

/* ---------- category tiles ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.cat-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.cat-tile > * {
  position: relative;
  z-index: 1;
}
.cat-tile::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  z-index: 2;
  background: linear-gradient(180deg, var(--c1), var(--c2));
  opacity: 0.9;
}
.cat-tile::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c2) 22%, transparent), transparent 70%);
  transition: transform 0.3s;
}
.cat-tile:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
  box-shadow: var(--shadow-sm);
}
.cat-tile:hover::after {
  transform: scale(1.3);
}
.cat-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  background: color-mix(in srgb, var(--c2) 14%, transparent);
  color: var(--c2);
}
[data-theme="dark"] .cat-icon {
  color: var(--c1);
  background: color-mix(in srgb, var(--c1) 16%, transparent);
}
.cat-icon .ico {
  width: 20px;
  height: 20px;
}
.cat-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.cat-text strong {
  font-size: 14px;
  font-weight: 650;
}
.cat-text em {
  font-style: normal;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cat-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.cat-grid-lg {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.cat-tile-lg {
  padding: 22px;
  gap: 16px;
}
.cat-tile-lg .cat-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
}
.cat-tile-lg .cat-icon .ico {
  width: 26px;
  height: 26px;
}
.cat-tile-lg .cat-text strong {
  font-size: 17px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.cat-tile-lg .cat-text strong em {
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.cat-desc {
  color: var(--muted);
  font-size: 12.5px;
}
.cat-tile-lg .cat-count {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 19px;
  font-weight: 700;
  color: var(--text);
}
.cat-tile-lg .cat-count em {
  font-style: normal;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}

/* ---------- split panels ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.panel .section-head {
  margin-bottom: 16px;
}
.panel .section-head h2 {
  font-size: 17px;
}
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-cloud-lg {
  gap: 10px;
}
.tag-cloud-lg .tag-pill {
  padding: 8px 15px;
  font-size: 14px;
}

.row-list {
  display: flex;
  flex-direction: column;
}
.row-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  transition: background 0.16s;
}
.row-item:last-child {
  border-bottom: 0;
}
.row-item:hover {
  background: var(--surface-2);
  border-radius: 8px;
}
.row-index {
  width: 22px;
  flex: none;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
}
.row-item:nth-child(-n + 3) .row-index {
  color: var(--brand);
}
.row-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.row-title {
  font-size: 13.5px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-meta {
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.row-stat .ico {
  width: 13px;
  height: 13px;
}

/* ---------- cta ---------- */
.cta-band {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 38px 40px;
  border-radius: 22px;
  background: linear-gradient(120deg, #4a40e0, #6d4df0 45%, #0e9bb5 130%);
  color: #fff;
  overflow: hidden;
}
.cta-band::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22), transparent 65%);
}
.cta-text {
  position: relative;
  z-index: 1;
}
.cta-text h2 {
  font-size: 24px;
  letter-spacing: -0.02em;
}
.cta-text p {
  margin-top: 8px;
  max-width: 560px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13.5px;
  line-height: 1.75;
}
.cta-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  flex: none;
}
.cta-band .btn-primary {
  background: #fff;
  color: #2c25b8;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.5);
}
.cta-band .btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #fff;
}
.cta-band .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---------- page shell ---------- */
.page {
  padding: 34px 24px 80px;
}
.page.narrow {
  max-width: 860px;
}

.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 12.5px;
}
.crumbs a:hover {
  color: var(--brand);
}
.crumbs em {
  font-style: normal;
  color: var(--text-2);
  max-width: 46ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-head {
  margin-bottom: 26px;
}
.page-head h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(26px, 3.4vw, 34px);
  letter-spacing: -0.03em;
}
.page-head p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}
.head-count {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ---------- filter bar ---------- */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.filter-sort {
  display: flex;
  flex: none;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 13px;
}
.filter-sort a {
  padding: 5px 14px;
  border-radius: 8px;
  color: var(--text-2);
}
.filter-sort a.is-active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* ---------- pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
}
.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  transition: all 0.16s;
}
.page-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.page-btn.is-active {
  background: var(--brand);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
[data-theme="dark"] .page-btn.is-active {
  color: #0b0c12;
}
.page-btn.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}
.page-arrow .ico {
  width: 15px;
  height: 15px;
}
.page-gap {
  color: var(--muted);
  padding: 0 2px;
}

/* ---------- empty / 404 ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 70px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 6px;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--muted);
}
.empty-icon .ico {
  width: 26px;
  height: 26px;
}
.empty h3 {
  font-size: 17px;
}
.empty p {
  color: var(--muted);
  font-size: 13.5px;
}
.empty .btn {
  margin-top: 10px;
}

.notfound {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 90px 0;
  text-align: center;
}
.notfound .notfound-code {
  font-size: 92px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.06em;
  background: linear-gradient(120deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.notfound h1 {
  font-size: 24px;
}
.notfound p {
  color: var(--muted);
  font-size: 14px;
}
.notfound-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

/* ---------- detail ---------- */
.detail-page {
  padding-top: 28px;
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 322px;
  gap: 40px;
  align-items: start;
}
.detail-main {
  min-width: 0;
}

.detail-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c, #6366f1) 12%, transparent);
  color: var(--c, #6366f1);
  font-size: 12.5px;
  font-weight: 600;
}
.cat-badge .ico {
  width: 14px;
  height: 14px;
}
[data-theme="dark"] .cat-badge {
  background: color-mix(in srgb, var(--c, #6366f1) 17%, transparent);
  color: color-mix(in srgb, var(--c, #6366f1) 75%, #fff);
}
.tag-flag {
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, #f59e0b 14%, transparent);
  color: #b45309;
  font-size: 12px;
  font-weight: 600;
}
[data-theme="dark"] .tag-flag {
  color: #fbbf24;
}

.detail-head h1 {
  font-size: clamp(25px, 3.5vw, 35px);
  line-height: 1.28;
  letter-spacing: -0.03em;
}
.detail-summary {
  margin-top: 12px;
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.8;
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12.5px;
}
.detail-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.detail-meta .ico {
  width: 14px;
  height: 14px;
}

.detail-cover {
  position: relative;
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 26px 0 30px;
  padding: 30px;
  aspect-ratio: 21 / 6.4;
  border-radius: 18px;
  background: linear-gradient(140deg, var(--c1), var(--c2) 58%, var(--c3));
  overflow: hidden;
  isolation: isolate;
}
.detail-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 100% at 80% 0%, rgba(255, 255, 255, 0.26), transparent 60%);
  mix-blend-mode: soft-light;
}
.detail-cover-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  flex: none;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 14px 30px -18px rgba(0, 0, 0, 0.6);
  color: #fff;
}
.detail-cover-icon .ico {
  width: 40px;
  height: 40px;
  stroke-width: 1.4;
}
.detail-cover-text {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}
.detail-cover-title {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.32);
}
.detail-cover-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.detail-cover-chips em {
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.92);
  font-style: normal;
  font-size: 11.5px;
  backdrop-filter: blur(6px);
}

.prose {
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.9;
}
.prose h2 {
  position: relative;
  margin: 34px 0 12px;
  padding-left: 13px;
  color: var(--text);
  font-size: 17.5px;
  letter-spacing: -0.015em;
}
.prose h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  bottom: 0.35em;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
}
.prose h3 {
  margin: 24px 0 10px;
  color: var(--text);
  font-size: 15.5px;
}
.prose p {
  margin: 0 0 14px;
}
.prose ul {
  margin: 0 0 16px;
  padding-left: 0;
}
.prose li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 7px;
}
.prose li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.72em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 65%, transparent);
}
.prose strong {
  color: var(--text);
  font-weight: 650;
}
.prose code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.88em;
}
.prose a {
  color: var(--brand);
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
}
.prose a:hover {
  border-bottom-color: var(--brand);
}

.download-box {
  margin: 38px 0 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden;
}
.download-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.download-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}
.download-head h2 .ico {
  width: 18px;
  height: 18px;
  color: var(--brand);
}
.download-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
}
.download-list {
  display: flex;
  flex-direction: column;
}
.download-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 22px;
  border-bottom: 1px solid var(--line);
}
.download-item:last-child {
  border-bottom: 0;
}
.download-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.download-name {
  font-size: 14px;
  font-weight: 600;
}
.download-note {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}
.download-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.code-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 12px;
  transition: all 0.16s;
}
.code-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}
.code-btn .ico {
  width: 14px;
  height: 14px;
}

.detail-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0;
  color: var(--muted);
}
.detail-tags > .ico {
  width: 16px;
  height: 16px;
}

.disclaimer {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
}
.disclaimer .ico {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 2px;
  color: var(--brand);
}

.detail-aside {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.aside-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.aside-card h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  font-size: 14px;
  letter-spacing: 0;
}
.aside-card h3 .ico {
  width: 16px;
  height: 16px;
  color: var(--brand);
}
.info-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}
.info-list > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.info-list > div:last-child {
  border-bottom: 0;
}
.info-list dt {
  color: var(--muted);
  flex: none;
}
.info-list dd {
  margin: 0;
  text-align: right;
  color: var(--text);
  font-weight: 500;
  word-break: break-word;
}
.info-list dd a {
  color: var(--brand);
}

.aside-related {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.related-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  transition: background 0.16s;
}
.related-item:hover {
  background: var(--surface-2);
}
.related-cover {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 10px;
  background: linear-gradient(140deg, var(--c1), var(--c2));
  color: rgba(255, 255, 255, 0.9);
}
.related-cover .ico {
  width: 19px;
  height: 19px;
}
.related-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.related-text strong {
  font-size: 13px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.related-text em {
  font-style: normal;
  color: var(--muted);
  font-size: 11.5px;
}
.aside-notice p {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.75;
  margin-bottom: 12px;
}

/* ---------- search / submit ---------- */
.search-head {
  max-width: 720px;
}
.inline-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 520px;
  height: 50px;
  margin-top: 18px;
  padding: 0 6px 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: var(--surface);
}
.inline-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}
.inline-search .ico {
  width: 17px;
  height: 17px;
  color: var(--muted);
}
.inline-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-size: 14px;
}
.inline-search .btn {
  height: 38px;
  border-radius: 10px;
}
.search-tags {
  margin-top: 54px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.search-tags > span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12.5px;
}

.submit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.submit-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.submit-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--brand) 35%, var(--line));
  box-shadow: var(--shadow-sm);
}
.submit-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
}
.submit-icon .ico {
  width: 21px;
  height: 21px;
}
.submit-card strong {
  font-size: 15px;
}
.submit-card p {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}
.about-prose {
  padding-top: 8px;
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: 40px;
  padding-top: 48px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1fr;
  gap: 36px;
  padding-bottom: 36px;
}
.footer-brand p {
  margin-top: 12px;
  max-width: 380px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}
.footer-note {
  margin-top: 10px !important;
  padding-top: 10px;
  border-top: 1px dashed var(--line-strong);
  font-size: 11.5px !important;
  opacity: 0.85;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-top: 4px;
}
.footer-col h4 {
  margin-bottom: 3px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
}
.footer-col a,
.footer-col span {
  color: var(--muted);
  font-size: 12.5px;
  transition: color 0.16s;
}
.footer-col a:hover {
  color: var(--brand);
}
.footer-bottom {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-top: 18px;
  padding-bottom: 26px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
}
.footer-made {
  margin-left: auto;
}
.footer-icp {
  color: inherit;
  transition: color 0.16s;
}
.footer-icp:hover {
  color: var(--brand);
}

/* ---------- to top ---------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.to-top:hover {
  color: var(--brand);
  border-color: var(--brand);
}
.to-top .ico {
  width: 18px;
  height: 18px;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 120;
  padding: 10px 18px;
  border-radius: 11px;
  background: #13151c;
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s, transform 0.24s;
}
.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s cubic-bezier(0.2, 0.7, 0.3, 1), transform 0.5s cubic-bezier(0.2, 0.7, 0.3, 1);
}
.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- admin ---------- */
.is-admin {
  background: var(--bg-soft);
}
.admin-shell {
  padding: 26px 24px 80px;
}
.admin-bar {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 18px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.admin-bar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.admin-badge {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.admin-nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  font-size: 13px;
}
.admin-nav a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--text-2);
}
.admin-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.admin-logout button {
  height: 32px;
}

.flash {
  margin-bottom: 16px;
  padding: 11px 16px;
  border: 1px solid color-mix(in srgb, #10b981 30%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, #10b981 8%, transparent);
  color: #047857;
  font-size: 13px;
}
[data-theme="dark"] .flash {
  color: #6ee7b7;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.admin-stats > div {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.admin-stats b {
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.admin-stats span {
  color: var(--muted);
  font-size: 12px;
}

.admin-table-wrap {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  overflow-x: auto;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}
.admin-table th {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  letter-spacing: 0.03em;
}
.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.admin-table tr:last-child td {
  border-bottom: 0;
}
.cell-title a {
  font-weight: 600;
}
.cell-title a:hover {
  color: var(--brand);
}
.cell-tags {
  color: var(--muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cell-actions {
  display: flex;
  gap: 8px;
}
.pill {
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 10.5px;
  font-weight: 600;
}
.pill-muted {
  background: var(--surface-2);
  color: var(--muted);
}
.mini-btn {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text-2);
  font-size: 12px;
  transition: all 0.16s;
}
.mini-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.mini-danger:hover {
  border-color: #ef4444;
  color: #ef4444;
}
.admin-hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}
.admin-hint code {
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.admin-form {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-grid .field {
  margin-bottom: 0;
}
.field-wide {
  grid-column: 1 / -1;
}
.field > span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.field > span i {
  font-style: normal;
  color: #ef4444;
  margin-left: 3px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface-2);
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.16s, box-shadow 0.16s;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}
.field textarea {
  resize: vertical;
  line-height: 1.75;
  font-family: inherit;
}
.field em {
  font-style: normal;
  color: var(--muted);
  font-size: 11.5px;
}
.form-flags {
  display: flex;
  gap: 22px;
  margin: 4px 0 20px;
}
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}
.checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
}
.form-actions {
  display: flex;
  gap: 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.form-error {
  margin-bottom: 16px;
  padding: 11px 15px;
  border: 1px solid color-mix(in srgb, #ef4444 30%, var(--line));
  border-radius: 10px;
  background: color-mix(in srgb, #ef4444 7%, transparent);
  color: #dc2626;
  font-size: 13px;
}
[data-theme="dark"] .form-error {
  color: #fca5a5;
}

.admin-login {
  display: grid;
  place-items: center;
  padding: 70px 24px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}
.login-mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin: 0 auto 16px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
}
.login-mark .ico {
  width: 24px;
  height: 24px;
}
.login-card h1 {
  font-size: 20px;
}
.login-card > p {
  margin: 6px 0 22px;
  color: var(--muted);
  font-size: 13px;
}
.login-card .field {
  text-align: left;
}
.login-back {
  display: inline-block;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12.5px;
}
.login-back:hover {
  color: var(--brand);
}

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .cat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .detail-grid {
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 28px;
  }
}

@media (max-width: 960px) {
  .main-nav,
  .header-search {
    display: none;
  }
  .nav-toggle {
    display: inline-flex;
  }
  .header-cta {
    display: none;
  }
  .header-inner {
    gap: 14px;
  }
  .mobile-panel {
    display: none;
    padding: 16px 24px 22px;
    border-top: 1px solid var(--line);
    background: var(--bg);
  }
  body.is-nav-open .mobile-panel {
    display: block;
  }
  body.is-nav-open {
    overflow: hidden;
  }
  body.is-nav-open .nav-open {
    display: none;
  }
  body.is-nav-open .nav-close {
    display: inline-flex;
  }
  .mobile-search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
  }
  .mobile-search .ico {
    width: 17px;
    height: 17px;
    color: var(--muted);
  }
  .mobile-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: none;
    outline: none;
    font-size: 14px;
  }
  .mobile-nav {
    display: flex;
    flex-direction: column;
    margin: 14px 0;
    border-top: 1px solid var(--line);
  }
  .mobile-nav a {
    padding: 12px 2px;
    border-bottom: 1px solid var(--line);
    font-size: 15px;
  }
  .mobile-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .split {
    grid-template-columns: 1fr;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .detail-aside {
    position: static;
  }
  .submit-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 26px;
  }
  .cta-band {
    flex-direction: column;
    align-items: flex-start;
    padding: 30px;
  }
  .admin-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-bar {
    flex-wrap: wrap;
  }
  .admin-nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
  }
}

@media (max-width: 720px) {
  .container,
  .page {
    padding-left: 18px;
    padding-right: 18px;
  }
  .hero {
    padding: 46px 0 40px;
  }
  .lede {
    font-size: 14.5px;
  }
  .br-lg {
    display: none;
  }
  .hero-search {
    height: 52px;
    padding-left: 14px;
  }
  .hero-search .btn {
    height: 38px;
    padding: 0 14px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat:nth-child(2) {
    border-right: 0;
  }
  .stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
  .grid-4,
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .cat-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .cat-grid-lg {
    grid-template-columns: 1fr;
  }
  .cat-tile {
    padding: 13px;
    gap: 9px;
  }
  .cat-text em {
    display: none;
  }
  .section {
    padding-top: 46px;
  }
  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .section-head h2 {
    font-size: 20px;
  }
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .filter-sort {
    align-self: flex-start;
  }
  .detail-cover {
    aspect-ratio: auto;
    padding: 20px;
    gap: 14px;
  }
  .detail-cover-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
  }
  .detail-cover-icon .ico {
    width: 28px;
    height: 28px;
  }
  .detail-cover-title {
    font-size: 16px;
  }
  .download-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .download-actions {
    width: 100%;
  }
  .download-actions .btn {
    margin-left: auto;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
  .footer-bottom {
    flex-wrap: wrap;
    gap: 8px 16px;
  }
  .footer-made {
    margin-left: 0;
    width: 100%;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .admin-form {
    padding: 18px;
  }
  .to-top {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 560px) {
  .grid-4,
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .card-link {
    flex-direction: row;
  }
  .card-cover,
  .card-lg .card-cover {
    width: 106px;
    flex: none;
    aspect-ratio: auto;
    min-height: 104px;
  }
  .card-cover-icon,
  .card-lg .card-cover-icon {
    right: 50%;
    bottom: 50%;
    transform: translate(50%, 50%);
  }
  .card:hover .card-cover-icon {
    transform: translate(50%, 50%) scale(1.06);
  }
  .card-cover-icon .ico,
  .card-lg .card-cover-icon .ico {
    width: 36px;
    height: 36px;
  }
  .card-cat,
  .card-flag {
    display: none;
  }
  .card-body {
    padding: 12px 14px;
    gap: 4px;
  }
  .card-title,
  .card-lg .card-title {
    font-size: 14px;
  }
  .card-desc,
  .card-lg .card-desc {
    font-size: 11.5px;
  }
  .card-meta {
    padding-top: 6px;
  }
  .quick-tags {
    display: none;
  }
  .stat b {
    font-size: 21px;
  }
  .notfound-code {
    font-size: 68px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
