/* ===== Revenue Library UI v3 ===== */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=Noto+Sans+SC:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg-page: #f4f7f8;
  --bg-surface: #ffffff;
  --bg-subtle: #edf2f4;
  --bg-elevated: #fbfcfd;
  --text-main: #11161a;
  --text-muted: #5c6670;
  --text-light: #87929d;
  --border: #d8e0e5;
  --border-hover: #b6c3cc;
  --accent: #0d8666;
  --accent-hover: #096f55;
  --accent-bg: #e5f4ef;
  --accent-secondary: #2f6edb;
  --accent-secondary-bg: #e7eefb;
  --color-indigo: #6757c8;
  --color-green: #0d8666;
  --color-cyan: #0b7893;
  --color-orange: #b76b18;
  --color-pink: #aa3d77;
  --color-yellow: #9f7400;
  --color-red: #ba3c3c;
  --card-hover: #f7fafb;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(17, 22, 26, 0.04), 0 8px 24px rgba(17, 22, 26, 0.06);
  --shadow-md: 0 2px 4px rgba(17, 22, 26, 0.06), 0 16px 38px rgba(17, 22, 26, 0.1);
  --shadow-hover: 0 4px 8px rgba(17, 22, 26, 0.08), 0 18px 42px rgba(17, 22, 26, 0.12);
  --shadow-glow: 0 0 0 1px rgba(13, 134, 102, 0.14), 0 10px 28px rgba(13, 134, 102, 0.1);
  --tag-green-bg: #e5f4ef;
  --tag-green-txt: #0d755a;
  --tag-blue-bg: #e7eefb;
  --tag-blue-txt: #285bb8;
  --tag-orange-bg: #f8eee1;
  --tag-orange-txt: #9a5a12;
  --tag-red-bg: #fae9e9;
  --tag-red-txt: #9d3030;
  --tag-purple-bg: #f0ebfb;
  --tag-purple-txt: #5c47ad;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-page: #111416;
    --bg-surface: #181d20;
    --bg-subtle: #20272b;
    --bg-elevated: #15191c;
    --text-main: #f0f4f5;
    --text-muted: #b4bec5;
    --text-light: #7f8b94;
    --border: #2d363d;
    --border-hover: #46535d;
    --accent: #42c49a;
    --accent-hover: #66d6af;
    --accent-bg: rgba(66, 196, 154, 0.12);
    --accent-secondary: #79a7ff;
    --accent-secondary-bg: rgba(121, 167, 255, 0.12);
    --card-hover: #1d2428;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.18), 0 12px 34px rgba(0, 0, 0, 0.22);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.22), 0 18px 46px rgba(0, 0, 0, 0.28);
    --shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.24), 0 22px 56px rgba(0, 0, 0, 0.34);
    --shadow-glow: 0 0 0 1px rgba(66, 196, 154, 0.18), 0 12px 30px rgba(66, 196, 154, 0.1);
    --tag-green-bg: rgba(66, 196, 154, 0.14);
    --tag-green-txt: #63d7ae;
    --tag-blue-bg: rgba(121, 167, 255, 0.14);
    --tag-blue-txt: #9abaff;
    --tag-orange-bg: rgba(245, 168, 80, 0.14);
    --tag-orange-txt: #f5b66f;
    --tag-red-bg: rgba(245, 105, 105, 0.14);
    --tag-red-txt: #ff8b8b;
    --tag-purple-bg: rgba(169, 145, 246, 0.14);
    --tag-purple-txt: #b8a6ff;
    --color-indigo: #a292ff;
    --color-green: #63d7ae;
    --color-cyan: #64d7ef;
    --color-orange: #f5b66f;
    --color-pink: #ee8dc0;
    --color-yellow: #e8c95d;
    --color-red: #ff8b8b;
  }
}

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

* {
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  font-family: "Noto Sans SC", "IBM Plex Sans", "Microsoft YaHei", sans-serif;
  color: var(--text-muted);
  background-color: var(--bg-page);
  background-image:
    linear-gradient(rgba(17, 22, 26, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 22, 26, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

@media (prefers-color-scheme: dark) {
  body {
    background-image:
      linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  }
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: 0;
}

p {
  letter-spacing: 0;
}

a {
  color: var(--accent-secondary);
  text-decoration: none;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

a:hover {
  color: var(--accent-hover);
}

strong {
  color: var(--text-main);
  font-weight: 700;
}

::selection {
  color: #ffffff;
  background: var(--accent);
}

/* ===== Navigation ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 247, 248, 0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

@media (prefers-color-scheme: dark) {
  .nav {
    background: rgba(17, 20, 22, 0.9);
  }
}

.nav.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  height: 68px;
  margin: 0 auto;
  padding: 0 28px;
  gap: 20px;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-main);
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
}

.nav-logo::before {
  content: "";
  width: 10px;
  height: 26px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-secondary));
  box-shadow: 10px 0 0 rgba(183, 107, 24, 0.8);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.nav-links a:hover {
  color: var(--text-main);
  background: var(--bg-surface);
  border-color: var(--border);
}

.nav-links a.active {
  color: #ffffff;
  background: var(--text-main);
  border-color: var(--text-main);
}

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  background: var(--bg-surface);
  font-size: 20px;
  cursor: pointer;
}

.menu-btn:hover {
  border-color: var(--border-hover);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 376px;
  gap: 44px;
  align-items: end;
  max-width: 1280px;
  margin: 0 auto;
  padding: 76px 28px 58px;
}

.hero > * {
  min-width: 0;
}

.hero::after {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
}

.hero h1 {
  max-width: 820px;
  margin: 0 0 18px;
  font-size: 52px;
  font-weight: 900;
}

.hero h1::after {
  content: "";
  display: block;
  width: 92px;
  height: 4px;
  margin-top: 24px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary), var(--color-orange));
}

.hero p {
  max-width: 760px;
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 500;
}

.hero .stats {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-self: stretch;
  min-height: 222px;
  width: 100%;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.hero .stat {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 92px;
  padding: 16px;
  background: var(--bg-subtle);
  border: 1px solid rgba(17, 22, 26, 0.03);
  border-radius: var(--radius-sm);
}

.hero .stat:nth-child(1) {
  border-top: 3px solid var(--accent);
}

.hero .stat:nth-child(2) {
  border-top: 3px solid var(--accent-secondary);
}

.hero .stat:nth-child(3) {
  border-top: 3px solid var(--color-orange);
}

.hero .stat:nth-child(4) {
  border-top: 3px solid var(--color-indigo);
}

.hero .stat-val {
  color: var(--text-main);
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1;
}

.hero .stat-label {
  margin-top: 8px;
  color: var(--text-light);
  font-size: 13px;
  font-weight: 700;
}

/* ===== Shared Layout ===== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 34px 28px 64px;
}

.page-layout {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 34px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 38px 28px 72px;
}

.page-main {
  min-width: 0;
}

/* ===== Hub Cards ===== */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.hub-grid > a {
  display: block;
  min-width: 0;
}

.hub-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 24px;
  overflow: hidden;
  text-align: left;
  color: inherit;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.hub-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-secondary), var(--color-orange));
}

.hub-card:hover {
  transform: translateY(-4px);
  background: var(--bg-elevated);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-hover);
}

.hub-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle) !important;
  font-size: 22px;
}

.hub-card h3 {
  margin-bottom: 10px;
  font-size: 20px;
}

.hub-card p {
  margin-bottom: 22px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

.hub-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.hub-stats > div {
  min-width: 0;
}

.hub-stat-val {
  display: block;
  color: var(--text-main);
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.hub-stat-lbl {
  display: block;
  color: var(--text-light);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.hub-arrow {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  background: var(--bg-subtle);
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 18px;
  line-height: 1;
}

/* ===== TOC Sidebar ===== */
.toc-sidebar {
  position: sticky;
  top: 92px;
  align-self: start;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
  scrollbar-color: var(--border-hover) transparent;
}

.toc-title {
  margin: 2px 6px 10px;
  color: var(--text-light);
  font-size: 12px;
  font-weight: 800;
}

.toc-sidebar a {
  display: flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.toc-sidebar a:hover {
  color: var(--text-main);
  background: var(--card-hover);
}

.toc-sidebar a.active {
  color: var(--accent);
  background: var(--accent-bg);
  border-left-color: var(--accent);
}

/* ===== Sections ===== */
.section {
  margin-bottom: 52px;
  scroll-margin-top: 94px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  font-size: 26px;
}

.section-title .icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle) !important;
  box-shadow: none;
  font-size: 21px;
}

.section h3 {
  margin: 24px 0 12px;
  color: var(--text-main);
  font-size: 17px !important;
  font-weight: 800;
}

.section > h3:first-child {
  margin-top: 0;
}

.hub-grid + .section {
  margin-top: 64px;
}

/* ===== Cards ===== */
.cards {
  display: grid;
  gap: 14px;
}

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

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

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

.card {
  position: relative;
  padding: 18px;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  background: var(--bg-elevated);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
}

.card-desc {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

.card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* ===== Tables ===== */
.table-wrap {
  overflow-x: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  text-align: left;
}

thead {
  background: var(--text-main);
}

th {
  padding: 12px 16px;
  color: var(--bg-surface);
  font-size: 13px;
  font-weight: 800;
  vertical-align: middle;
  white-space: nowrap;
}

td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
  vertical-align: top;
}

tbody tr:nth-child(even) {
  background: var(--bg-elevated);
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background-color 0.18s ease;
}

tbody tr:hover {
  background: var(--accent-bg);
}

td:first-child {
  color: var(--text-main);
  font-weight: 600;
}

/* ===== Tips & Code Flows ===== */
.tip {
  position: relative;
  margin: 20px 0;
  padding: 18px 20px 18px 22px;
  overflow: hidden;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
  line-height: 1.75;
}

.tip strong {
  color: var(--text-main);
}

.tip-green {
  border-left-color: var(--accent);
}

.tip-yellow {
  border-left-color: var(--color-yellow);
}

.tip-red {
  border-left-color: var(--color-red);
}

.flow {
  overflow-x: auto;
  padding: 18px 20px;
  color: #dfe8e5;
  background: #101619;
  border: 1px solid #2a3439;
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.9;
  white-space: pre-wrap;
}

/* ===== Tags ===== */
.tag,
.tool-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.tag {
  background: var(--tag-blue-bg);
  color: var(--tag-blue-txt);
}

.tag-green,
.t-all {
  background: var(--tag-green-bg);
  color: var(--tag-green-txt);
}

.tag-yellow,
.tag-orange,
.t-mac {
  background: var(--tag-orange-bg);
  color: var(--tag-orange-txt);
}

.tag-red {
  background: var(--tag-red-bg);
  color: var(--tag-red-txt);
}

.tag-pink,
.tag-cyan {
  background: var(--tag-purple-bg);
  color: var(--tag-purple-txt);
}

.t-win {
  background: var(--tag-blue-bg);
  color: var(--tag-blue-txt);
}

/* ===== Home Sections ===== */
.principles {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.principle {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.principle:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.principle .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--accent-bg) !important;
  color: var(--accent) !important;
  font-family: "IBM Plex Sans", "Noto Sans SC", sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.principle h4 {
  margin-bottom: 6px;
  font-size: 15px;
}

.principle p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.65;
}

.repo-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.repo-card {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 74px;
  padding: 14px 16px;
  color: inherit;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.repo-card:hover {
  transform: translateY(-2px);
  color: inherit;
  background: var(--bg-elevated);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-glow);
}

.repo-stars {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 4px 8px;
  color: var(--color-yellow);
  background: var(--tag-orange-bg);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.repo-card .text-sm {
  color: var(--text-muted);
}

/* ===== Footer & Utilities ===== */
.footer {
  padding: 34px 28px 44px;
  color: var(--text-light);
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
}

.footer p {
  margin-bottom: 6px;
}

.footer a {
  margin: 0 4px;
  color: var(--text-muted);
  font-weight: 700;
}

.footer a:hover {
  color: var(--accent);
}

.back-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: #ffffff;
  background: var(--text-main);
  border: 1px solid var(--text-main);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, background-color 0.18s ease;
}

.back-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-top:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.mt-1 {
  margin-top: 8px;
}

.mt-2 {
  margin-top: 16px;
}

.mt-3 {
  margin-top: 24px;
}

.mb-2 {
  margin-bottom: 16px;
}

.text-center {
  text-align: center;
}

.text-sm {
  font-size: 14px;
}

.fw-700 {
  color: var(--text-main);
  font-weight: 800;
}

/* ===== Animations ===== */
@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  animation: riseIn 0.42s ease both;
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.42s ease, transform 0.42s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 {
  transition-delay: 0.06s;
}

.reveal-delay-2 {
  transition-delay: 0.12s;
}

.reveal-delay-3 {
  transition-delay: 0.18s;
}

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

/* ===== Responsive ===== */
@media (max-width: 1120px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .hero .stats {
    grid-column: 1;
    grid-row: auto;
    max-width: 720px;
  }

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

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

@media (max-width: 980px) {
  .page-layout {
    grid-template-columns: 1fr;
    padding-top: 30px;
  }

  .toc-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
  }

  .toc-title {
    grid-column: 1 / -1;
  }

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

@media (max-width: 760px) {
  .nav-inner {
    height: 62px;
    width: 100%;
    max-width: none;
    padding: 0 18px;
  }

  .menu-btn {
    display: inline-flex;
    flex: 0 0 auto;
    margin-left: auto;
  }

  .nav-links {
    position: absolute;
    top: 62px;
    left: 12px;
    right: 12px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    justify-content: flex-start;
  }

  .hero {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 48px 18px 38px;
  }

  .hero::after {
    left: 18px;
    right: 18px;
  }

  .hero h1 {
    font-size: 34px;
    overflow-wrap: anywhere;
  }

  .hero p {
    max-width: 100%;
    font-size: 16px;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .hero .stats,
  .hub-grid,
  .principles,
  .repo-list,
  .cards-2,
  .cards-3,
  .cards-4 {
    grid-template-columns: 1fr;
  }

  .hero .stats {
    min-height: 0;
    max-width: 100%;
    margin-top: 28px;
  }

  .container,
  .page-layout {
    padding-left: 18px;
    padding-right: 18px;
  }

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

  .section {
    margin-bottom: 40px;
  }

  .section-title {
    align-items: flex-start;
    font-size: 22px;
  }

  .hub-card,
  .card,
  .principle {
    padding: 18px;
  }

  th,
  td {
    padding: 11px 12px;
    font-size: 13px;
  }

  .back-top {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 460px) {
  .nav-logo {
    font-size: 15px;
  }

  .toc-sidebar {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 30px;
  }

  .hero .stat-val {
    font-size: 28px;
  }
}
