:root {
  --blue: #1769ff;
  --blue-2: #0b4fd4;
  --blue-soft: #edf4ff;
  --navy: #0d1730;
  --ink: #101828;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #e3eaf4;
  --bg: #f5f8fd;
  --card: #ffffff;
  --success: #12b76a;
  --warning: #f79009;
  --shadow-sm: 0 8px 24px rgba(31, 59, 102, 0.06);
  --shadow-md: 0 16px 42px rgba(28, 64, 123, 0.11);
  --shadow-lg: 0 28px 70px rgba(38, 85, 151, 0.17);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --header-height: 72px;
  --container: 1560px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 112px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(23, 105, 255, 0.22);
  outline-offset: 2px;
}

.page-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(92px);
  pointer-events: none;
  z-index: -1;
  opacity: 0.45;
}

.glow-a {
  width: min(40vw, 560px);
  aspect-ratio: 1;
  background: #d9e9ff;
  right: -180px;
  top: -180px;
}

.glow-b {
  width: min(30vw, 390px);
  aspect-ratio: 1;
  background: #e7ddff;
  left: -160px;
  top: 430px;
}

.header-inner,
.section-inner,
.hero-inner,
.footer-inner {
  width: min(var(--container), calc(100% - clamp(24px, 4vw, 64px)));
  margin-inline: auto;
}

/* Header */
.site-header {
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(220, 228, 240, 0.92);
  position: sticky;
  top: 0;
  z-index: 60;
}

@supports (backdrop-filter: blur(18px)) {
  .site-header {
    backdrop-filter: blur(18px);
  }
}

.header-inner {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(240px, 1fr);
  align-items: center;
  gap: 24px;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 11px;
  text-decoration: none;
}

.brand-logo {
  flex: 0 0 auto;
  width: 56px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo img {
  display: block;
  max-width: 56px;
  max-height: 36px;
  object-fit: contain;
}

.brand-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-copy strong {
  font-size: 16px;
  letter-spacing: 0.1px;
  white-space: nowrap;
}

.brand-copy small {
  color: var(--subtle);
  font-size: 9px;
  letter-spacing: 1.2px;
  white-space: nowrap;
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.header-nav-link {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  padding: 0 13px;
  background: transparent;
  color: #475467;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.header-nav-link:hover,
.header-nav-link.active {
  color: var(--blue);
  background: var(--blue-soft);
}

.header-nav-link.source-link {
  color: #667085;
}

.header-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.icon-button,
.primary-button,
.view-button {
  min-height: 40px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  color: #344054;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.icon-button:hover,
.view-button:hover {
  border-color: #b8cdfa;
  color: var(--blue);
}

.icon-button b {
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 10px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--blue), #3d82ff);
  box-shadow: 0 8px 22px rgba(23, 105, 255, 0.24);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(23, 105, 255, 0.3);
}

.compact {
  min-height: 40px;
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #f8fbff 0%, #edf5ff 54%, #f8f9ff 100%);
  border-bottom: 1px solid #e6edf7;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 76% 28%, rgba(78, 145, 255, 0.2), transparent 28%),
    radial-gradient(circle at 25% 95%, rgba(144, 113, 255, 0.08), transparent 24%),
    linear-gradient(164deg, transparent 0 66%, rgba(126, 176, 255, 0.08) 66% 67.2%, transparent 67.2%);
  pointer-events: none;
}

.hero-inner {
  min-height: clamp(500px, 62vh, 650px);
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(420px, 0.94fr);
  gap: clamp(40px, 5vw, 86px);
  align-items: center;
  padding: clamp(48px, 6vw, 80px) 0;
  position: relative;
}

.hero-copy {
  min-width: 0;
}

.opensource-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  color: var(--blue);
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #cfe0ff;
  padding: 8px 12px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(70, 117, 190, 0.08);
}

.opensource-pill:hover {
  border-color: #9fc2ff;
  background: #fff;
}

.opensource-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(18, 183, 106, 0.12);
}

.hero h1 {
  max-width: 760px;
  margin: 22px 0 18px;
  font-size: clamp(38px, 4.2vw, 64px);
  line-height: 1.1;
  letter-spacing: clamp(-2.2px, -0.15vw, -1px);
}

.hero h1 span {
  color: var(--blue);
}

.hero-copy > p {
  max-width: 720px;
  margin: 0 0 22px;
  color: #5f6c82;
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 1.9;
}

.search-shell {
  width: min(100%, 760px);
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 11px;
  background: #fff;
  border: 1px solid #cfdcf0;
  border-radius: 16px;
  padding: 0 12px 0 17px;
  box-shadow: 0 12px 34px rgba(41, 89, 160, 0.12);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-shell:focus-within {
  border-color: #78a7ff;
  box-shadow: 0 0 0 4px rgba(23, 105, 255, 0.1), 0 16px 40px rgba(41, 89, 160, 0.14);
}

.search-icon {
  flex: 0 0 auto;
  font-size: 24px;
  color: var(--blue);
}

.search-shell input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
}

.search-shell input::placeholder {
  color: var(--subtle);
  text-overflow: ellipsis;
}

.search-shell kbd {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid #dde3ed;
  border-bottom-width: 2px;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--subtle);
  font: 600 12px system-ui;
}

.search-shell button {
  display: none;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: #eef4ff;
  color: #5073aa;
  font-size: 20px;
  cursor: pointer;
}

.hot-searches {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
  color: var(--subtle);
  font-size: 12px;
}

.hot-searches button {
  border: 0;
  border-radius: 7px;
  padding: 3px 5px;
  background: transparent;
  color: #667085;
  cursor: pointer;
}

.hot-searches button:hover {
  color: var(--blue);
  background: rgba(255, 255, 255, 0.65);
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.2vw, 24px);
  margin-top: 26px;
}

.hero-stats div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.hero-stats strong {
  font-size: clamp(18px, 1.7vw, 22px);
  white-space: nowrap;
}

.hero-stats span {
  margin-top: 2px;
  color: var(--subtle);
  font-size: 11px;
  white-space: nowrap;
}

.hero-stats i {
  width: 1px;
  height: 30px;
  background: #d8e1ef;
}

.hero-board {
  min-width: 0;
  padding: 13px;
  border: 1px solid rgba(180, 205, 244, 0.9);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-lg), inset 0 0 0 5px rgba(255, 255, 255, 0.75);
  transform: perspective(1200px) rotateY(-1.5deg);
}

.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 11px 14px;
  color: #344054;
}

.board-head > div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.board-head small {
  color: var(--subtle);
  white-space: nowrap;
}

.pulse {
  width: 9px;
  height: 9px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(18, 183, 106, 0.12);
}

.board-grid {
  min-height: 300px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  padding: 16px;
  border-radius: 18px;
  background: linear-gradient(150deg, #071024, #111b36);
}

.board-tool {
  min-width: 0;
  min-height: 126px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
  color: #fff;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.board-tool:hover {
  transform: translateY(-3px);
  border-color: rgba(111, 166, 255, 0.55);
  background: rgba(255, 255, 255, 0.1);
}

.tool-mark {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #fff;
  background: hsl(var(--hue) 78% 52%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  font-weight: 900;
}

.board-tool strong,
.board-tool span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-tool strong {
  font-size: 14px;
  white-space: nowrap;
}

.board-tool span {
  margin-top: 5px;
  color: #9eb0d0;
  font-size: 10px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.board-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 8px 1px;
  color: #7b8ba5;
  font-size: 10px;
}

.secure-dot::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--success);
}

/* Filter bar */
.quick-section {
  position: sticky;
  top: var(--header-height);
  z-index: 40;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}

@supports (backdrop-filter: blur(14px)) {
  .quick-section {
    backdrop-filter: blur(14px);
  }
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0 9px;
}

.group-tabs {
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.group-tabs::-webkit-scrollbar {
  display: none;
}

.group-tabs button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #667085;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.group-tabs button:hover {
  color: var(--blue);
  background: #f3f7ff;
}

.group-tabs button.active {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: #d7e5ff;
}

.filter-tools {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-tools label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-tools label > span {
  color: var(--subtle);
  font-size: 11px;
}

.filter-tools select {
  height: 37px;
  min-width: 108px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: #fff;
  color: #475467;
  padding: 0 30px 0 10px;
}

.category-strip {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 0 0 12px;
  scrollbar-width: none;
}

.category-strip::-webkit-scrollbar {
  display: none;
}

.category-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid #e3eaf4;
  border-radius: 999px;
  background: #fafcff;
  color: #475467;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
}

.category-chip:hover,
.category-chip.active {
  border-color: #b8d0ff;
  background: var(--blue-soft);
  color: var(--blue);
}

.category-chip i {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #eaf2ff;
  color: var(--blue);
  font-style: normal;
  font-weight: 800;
  font-size: 9px;
}

/* Main content */
.content-section {
  padding: clamp(24px, 3vw, 38px) 0 clamp(56px, 7vw, 90px);
}

.layout-grid {
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  gap: clamp(22px, 2.2vw, 34px);
  align-items: start;
}

.side-nav {
  min-width: 0;
}

.side-card {
  position: sticky;
  top: calc(var(--header-height) + 112px);
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.side-title {
  padding: 8px 10px 11px;
  color: #344054;
  font-weight: 800;
}

.side-card button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 1px 0;
  padding: 7px 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #667085;
  text-align: left;
  cursor: pointer;
}

.side-card button:hover,
.side-card button.active {
  background: var(--blue-soft);
  color: var(--blue);
}

.side-card button i {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f1f5fb;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
}

.side-card button span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-card button b {
  color: var(--subtle);
  font-size: 10px;
}

.side-note {
  margin-top: 13px;
  padding: 14px;
  border: 1px solid #dce8fb;
  border-radius: 14px;
  background: linear-gradient(145deg, #eef5ff, #fff);
  color: #667085;
}

.side-note.neutral {
  background: #fff;
  border-color: var(--line);
}

.side-note strong {
  color: #344054;
}

.side-note p {
  margin: 7px 0 8px;
  font-size: 11px;
  line-height: 1.7;
}

.side-note a {
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

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

.opensource-section {
  padding: 0 0 clamp(56px, 7vw, 90px);
  scroll-margin-top: calc(var(--header-height) + 112px);
}

.opensource-card {
  padding: clamp(24px, 3vw, 38px);
  border: 1px solid #d7e5ff;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #edf5ff 0%, #fff 58%);
  box-shadow: var(--shadow-md);
}

.opensource-eyebrow {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
}

.opensource-card h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(24px, 2.2vw, 32px);
}

.opensource-card > p {
  max-width: 760px;
  margin: 12px 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.opensource-meta,
.opensource-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.opensource-meta span {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .8);
  color: #52677f;
}

.opensource-meta strong {
  margin-right: 6px;
  color: #344054;
}

.opensource-actions {
  margin-top: 20px;
}

.opensource-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid #cfe0ff;
  border-radius: 11px;
  background: #fff;
  color: var(--blue);
  font-weight: 750;
  text-decoration: none;
}

.opensource-actions a:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow-sm);
}

.result-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.result-toolbar h2 {
  margin: 0 0 4px;
  font-size: clamp(22px, 2vw, 28px);
}

.result-toolbar p {
  margin: 0;
  color: var(--subtle);
  font-size: 12px;
}

.view-button {
  flex: 0 0 auto;
  min-height: 36px;
  font-size: 11px;
}

.featured-section {
  margin-bottom: 30px;
  padding: clamp(14px, 2vw, 20px);
  border: 1px solid #dce8fb;
  border-radius: 20px;
  background: linear-gradient(135deg, #edf5ff, #f7f2ff);
}

.subheading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.subheading > div {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.subheading strong {
  font-size: 17px;
}

.subheading small {
  color: #7d8ba2;
}

.sparkle {
  color: var(--blue);
  font-size: 18px;
}

.featured-grid,
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: clamp(10px, 1.2vw, 14px);
}

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

.category-section {
  margin: 0 0 34px;
  scroll-margin-top: calc(var(--header-height) + 116px);
  content-visibility: auto;
  contain-intrinsic-size: 600px;
}

/* 深链到页尾时先使用真实卡片高度，避免 content-visibility 的估算值让锚点二次偏移。 */
.opensource-deep-link .category-section {
  content-visibility: visible;
  contain-intrinsic-size: none;
}

.category-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.category-heading > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-icon {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #eaf2ff;
  color: var(--blue);
  font-weight: 900;
}

.category-heading h3 {
  margin: 0 0 2px;
  font-size: 18px;
}

.category-heading p {
  margin: 0;
  color: var(--subtle);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.category-heading > span {
  flex: 0 0 auto;
  color: var(--subtle);
  font-size: 11px;
}

.tool-card {
  position: relative;
  min-width: 0;
  min-height: 188px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 7px 22px rgba(31, 59, 102, 0.045);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.tool-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: hsl(var(--hue) 77% 55%);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: #bed2f6;
  box-shadow: var(--shadow-md);
}

.tool-card:hover::before {
  opacity: 1;
}

.tool-link {
  min-width: 0;
  min-height: 188px;
  display: flex;
  flex-direction: column;
  padding: 16px;
  color: inherit;
  text-decoration: none;
}

.tool-top {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  padding-right: 34px;
}

.card-mark {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, hsl(var(--hue) 76% 56%), hsl(var(--hue) 75% 42%));
  box-shadow: 0 8px 18px hsl(var(--hue) 70% 50% / 0.22);
  font-weight: 900;
}

.tool-name {
  min-width: 0;
}

.tool-name strong,
.tool-name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-name strong {
  font-size: 14px;
}

.tool-name small {
  margin-top: 3px;
  color: var(--subtle);
  font-size: 10px;
}

.favorite-star {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  background: #f6f8fb;
  color: var(--subtle);
  font-size: 17px;
  cursor: pointer;
}

.favorite-star:hover,
.favorite-star.active {
  background: #fff4db;
  color: var(--warning);
}

.tool-desc {
  min-height: 41px;
  margin: 14px 0 12px;
  color: #667085;
  font-size: 12px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
}

.tool-tags span {
  max-width: 100%;
  padding: 4px 6px;
  overflow: hidden;
  border: 1px solid #e3e9f2;
  border-radius: 6px;
  background: #f9fbfd;
  color: #667085;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #eef1f5;
}

.pricing {
  min-width: 0;
  overflow: hidden;
  color: #667085;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.open-label {
  flex: 0 0 auto;
  color: var(--blue);
  font-size: 10px;
  font-weight: 800;
}

.featured-grid .tool-card,
.featured-grid .tool-link {
  min-height: 176px;
}

.compact-view .tools-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 188px), 1fr));
  gap: 10px;
}

.compact-view .tool-card,
.compact-view .tool-link {
  min-height: 148px;
}

.compact-view .tool-link {
  padding: 13px;
}

.compact-view .tool-desc {
  min-height: 20px;
  -webkit-line-clamp: 1;
}

.compact-view .tool-tags {
  display: none;
}

.empty-state {
  padding: 70px 20px;
  border: 1px dashed #cfd9e7;
  border-radius: 18px;
  background: #fff;
  text-align: center;
}

.empty-icon {
  color: #9eb9e8;
  font-size: 44px;
}

.empty-state h3 {
  margin: 10px 0 6px;
}

.empty-state p {
  color: var(--subtle);
}

.empty-state button {
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  padding: 10px 18px;
  cursor: pointer;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
}

.footer-inner {
  min-height: 154px;
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.15fr) minmax(360px, 1.35fr);
  align-items: center;
  gap: clamp(22px, 3vw, 42px);
  padding: 30px 0;
  color: var(--subtle);
  font-size: 11px;
}

.footer-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #344054;
}

.footer-brand img {
  flex: 0 0 auto;
  width: 48px;
}

.footer-brand div {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.footer-brand strong,
.footer-brand small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-brand small {
  color: var(--subtle);
  font-size: 9px;
  letter-spacing: 1px;
}

.footer-copy {
  min-width: 0;
}

.footer-copy p {
  margin: 0 0 4px;
  color: #475467;
  font-size: 12px;
}

.footer-copy span {
  line-height: 1.65;
}

.footer-credits {
  min-width: 0;
  justify-self: end;
  padding: 12px 14px;
  border: 1px solid #e6ebf3;
  border-radius: 12px;
  background: #f8faff;
  color: #667085;
  line-height: 1.58;
}

.footer-credits p {
  margin: 0;
  overflow-wrap: anywhere;
}

.footer-credits p + p {
  margin-top: 2px;
}

.footer-credits a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.footer-credits a:hover {
  text-decoration: underline;
}

.footer-credits strong {
  color: #344054;
  font-weight: 800;
}

/* Drawer / utility */
.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  visibility: hidden;
  opacity: 0;
  background: rgba(8, 15, 31, 0.34);
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.favorites-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 90;
  width: min(440px, 94vw);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  background: #f7f9fc;
  box-shadow: -20px 0 50px rgba(8, 24, 52, 0.18);
  transition: transform 0.25s ease;
}

.drawer-mask.open {
  visibility: visible;
  opacity: 1;
}

.favorites-drawer.open {
  transform: translateX(0);
}

.drawer-head {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.drawer-head div {
  display: flex;
  flex-direction: column;
}

.drawer-head small {
  margin-top: 3px;
  color: var(--subtle);
}

.drawer-head button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: #f3f5f8;
  font-size: 20px;
  cursor: pointer;
}

.drawer-body {
  padding: 15px;
  overflow: auto;
  overscroll-behavior: contain;
}

.drawer-body .tool-card {
  margin-bottom: 10px;
}

.drawer-empty {
  padding: 70px 20px;
  color: var(--subtle);
  text-align: center;
}

.back-top {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 50;
  width: 44px;
  height: 44px;
  visibility: hidden;
  opacity: 0;
  border: 0;
  border-radius: 13px;
  background: #fff;
  color: var(--blue);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}

.back-top.show {
  visibility: visible;
  opacity: 1;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 110;
  visibility: hidden;
  opacity: 0;
  transform: translate(-50%, 18px);
  padding: 10px 16px;
  border-radius: 10px;
  background: #101828;
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.toast.show {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Zoom-friendly breakpoints */
@media (max-width: 1280px) {
  .header-inner {
    grid-template-columns: minmax(220px, 1fr) auto;
  }

  .header-nav {
    display: none;
  }

  .hero-inner {
    grid-template-columns: minmax(0, 1fr) minmax(380px, 0.86fr);
    gap: 38px;
  }

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

@media (max-width: 1100px) {
  .footer-inner {
    grid-template-columns: minmax(210px, 0.85fr) minmax(260px, 1.15fr);
  }

  .footer-credits {
    grid-column: 1 / -1;
    width: 100%;
    justify-self: stretch;
  }
}

@media (max-width: 1024px) {
  :root {
    --header-height: 68px;
  }

  .hero-inner {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 44px 0 48px;
  }

  .hero-copy {
    max-width: 880px;
  }

  .hero-board {
    width: 100%;
    transform: none;
  }

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

  .layout-grid {
    grid-template-columns: 1fr;
  }

  .side-nav {
    display: none;
  }

  .quick-section {
    position: relative;
    top: auto;
  }

  html {
    scroll-padding-top: calc(var(--header-height) + 20px);
  }

  .category-section {
    scroll-margin-top: 20px;
  }

  .opensource-section {
    scroll-margin-top: calc(var(--header-height) + 20px);
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

}

@media (max-width: 760px) {
  :root {
    --header-height: 64px;
  }

  .header-inner,
  .section-inner,
  .hero-inner,
  .footer-inner {
    width: min(100% - 24px, var(--container));
  }

  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .brand-logo {
    width: 46px;
  }

  .brand-logo img {
    max-width: 46px;
  }

  .brand-copy strong {
    font-size: 14px;
  }

  .brand-copy small {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .icon-button,
  .primary-button {
    min-height: 38px;
    padding: 0 11px;
  }

  .button-label {
    display: none;
  }

  .favorite-button b {
    position: absolute;
    transform: translate(13px, -12px);
    min-width: 17px;
    padding: 1px 4px;
    font-size: 8px;
  }

  .hero-inner {
    gap: 28px;
    padding: 34px 0 38px;
  }

  .opensource-pill {
    font-size: 11px;
  }

  .hero h1 {
    margin-top: 19px;
    font-size: clamp(34px, 9.8vw, 48px);
  }

  .hero-copy > p {
    line-height: 1.78;
  }

  .search-shell {
    min-height: 56px;
    border-radius: 14px;
  }

  .search-shell kbd {
    display: none;
  }

  .hero-stats {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }

  .hero-stats div {
    flex: 1;
  }

  .hero-stats i {
    height: 28px;
  }

  .board-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
  }

  .board-tool {
    min-height: 112px;
    padding: 12px;
  }

  .board-foot {
    display: none;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .group-tabs {
    width: calc(100% + 24px);
    margin-right: -12px;
    margin-left: -12px;
    padding: 0 12px;
  }

  .filter-tools {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .filter-tools label {
    display: block;
  }

  .filter-tools label > span {
    display: block;
    margin-bottom: 4px;
  }

  .filter-tools select {
    width: 100%;
    min-width: 0;
  }

  .category-strip {
    width: calc(100% + 24px);
    margin-right: -12px;
    margin-left: -12px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .result-toolbar {
    align-items: center;
  }

  .result-toolbar p {
    max-width: 70vw;
  }

  .featured-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding-bottom: 3px;
  }

  .featured-grid::-webkit-scrollbar {
    display: none;
  }

  .featured-grid .tool-card {
    flex: 0 0 min(82vw, 310px);
    scroll-snap-align: start;
  }

  .tools-grid,
  .compact-view .tools-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  }

  .tool-card,
  .tool-link,
  .compact-view .tool-card,
  .compact-view .tool-link {
    min-height: 164px;
  }

  .tool-link,
  .compact-view .tool-link {
    padding: 14px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 28px 0;
  }

  .footer-credits {
    width: 100%;
    justify-self: stretch;
  }
}

@media (max-width: 480px) {
  .footer-credits {
    padding: 12px;
    border-radius: 11px;
    font-size: 10px;
  }

  .header-inner,
  .section-inner,
  .hero-inner,
  .footer-inner {
    width: min(100% - 20px, var(--container));
  }

  .hero h1 br {
    display: none;
  }

  .hero-stats strong {
    font-size: 16px;
  }

  .hero-stats span {
    font-size: 9px;
  }

  .hero-board {
    padding: 8px;
    border-radius: 19px;
  }

  .board-head small {
    display: none;
  }

  .board-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 9px;
  }

  .board-tool {
    min-height: 100px;
    gap: 9px;
    padding: 10px;
  }

  .tool-mark {
    width: 36px;
    height: 36px;
    font-size: 11px;
  }

  .board-tool span {
    display: none;
  }

  .group-tabs {
    width: calc(100% + 20px);
    margin-right: -10px;
    margin-left: -10px;
    padding: 0 10px;
  }

  .category-strip {
    width: calc(100% + 20px);
    margin-right: -10px;
    margin-left: -10px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .filter-tools {
    gap: 7px;
  }

  .featured-section {
    margin-right: -2px;
    margin-left: -2px;
    border-radius: 16px;
  }

  .subheading small {
    display: none;
  }

  .category-heading {
    align-items: center;
  }

  .category-heading p {
    display: none;
  }

  .tool-card,
  .tool-link,
  .compact-view .tool-card,
  .compact-view .tool-link {
    min-height: 154px;
  }

  .tool-desc {
    margin-top: 12px;
    -webkit-line-clamp: 2;
  }

  .tool-tags {
    gap: 4px;
  }

  .tool-tags span:nth-child(n + 3) {
    display: none;
  }

  .drawer-body {
    padding: 10px;
  }

  .toast {
    max-width: calc(100vw - 24px);
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
