/* home-directory.css — Love8.me 首页目录模板的共享样式表。
   /home-variants/zh-hans/ 与 /home-variants/en/ 共用这一张，两页视觉与交互一致。

   原本是 home-variants/zh-hans/index.html 里的内联 <style>（1685 行）。外置的原因是
   en 变体要复用同一套设计 —— 两个页面各存一份会立刻分叉，这正是被删掉的
   assets/css/en/directory-home.css 的由来：它是这段样式的一个分叉，大量规则逐字节相同，
   只是砍掉了侧边栏、返回顶部和富 tooltip。

   两条不能破坏的约束：
   1. <link> 必须排在 exoclick-ads.css 与 language-switcher.css 之后 —— 原内联块就在它们
      后面，同特异性时靠源顺序取胜。挪到前面会静默翻转一批平局。
   2. 不得出现 @import。 */

:root {
  --page: #f6f7fb;
  --surface: #ffffff;
  --surface-muted: #fff4f8;
  --ink: #17212b;
  --muted: #5b6876;
  --line: #f2dbe3;
  --accent: #d6336c;
  --accent-dark: #a61e4d;
  --hot: #ff1744;
  --soft-hot: #fff1f6;
  --shadow: 0 10px 24px rgba(214, 51, 108, 0.12);
  --max: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  /* background-color:#999; */
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Microsoft YaHei", sans-serif;
  line-height: 1.55;
  padding-bottom: 20px;
}

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(214, 51, 108, .28);
  outline-offset: 3px;
}

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

.topbar {
  background: var(--page);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(var(--max), calc(100% - 40px));
  min-height: 64px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: max-content;
  color: #3a2f2a;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: transparent;
  font-size: 0;
  font-weight: 800;
  border-radius: 10px;
  background: url("/assets/images/logo.png") center / contain no-repeat;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-size: 18px;
  font-weight: 545;
}

.brand-tagline {
  font-size: 12px;
  font-weight: 545;
}

.top-links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.bookmark-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 34px;
  padding: 5px 9px;
  color: var(--accent-dark);
  font-size: 13px;
  line-height: 1.2;
  border: 1px solid #f0c6d5;
  border-radius: 7px;
  background: #fff4f8;
}

.bookmark-button:hover {
  color: var(--hot);
  border-color: #e7a8bd;
  background: var(--soft-hot);
}

.bookmark-icon {
  font-size: 17px;
  line-height: 1;
}

.bookmark-toast {
  position: absolute;
  z-index: 35;
  top: calc(100% + 8px);
  right: 0;
  width: max-content;
  max-width: min(290px, calc(100vw - 28px));
  margin: 0;
  padding: 8px 10px;
  color: #34414d;
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  border: 1px solid #f0c6d5;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(23, 33, 43, .14);
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}

.bookmark-toast.is-visible {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.site-tooltip {
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: min(300px, calc(100vw - 24px));
  padding: 14px 16px;
  color: #34414d;
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(23, 33, 43, .2);
  transition: opacity .16s ease, visibility .16s ease, transform .16s ease;
}

.site-tooltip--above {
  transform: translateY(4px);
}

.site-tooltip--below {
  transform: translateY(-4px);
}

.site-tooltip::after {
  position: absolute;
  left: var(--arrow-left, 50%);
  width: 14px;
  height: 14px;
  content: "";
  background: #fff;
  transform: translateX(-50%) rotate(45deg);
}

.site-tooltip--above::after {
  bottom: -8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0 0 3px;
}

.site-tooltip--below::after {
  top: -8px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  border-radius: 3px 0 0;
}

.site-tooltip.is-visible {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.site-tooltip-name {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 700;
}

.site-tooltip-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.site-tooltip-desc {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.back-to-top {
  position: fixed;
  z-index: 40;
  right: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 8px 20px rgba(214, 51, 108, .28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease, filter .15s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  filter: brightness(1.08);
}

.back-to-top-icon {
  font-size: 16px;
  line-height: 1;
}

.page {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.search-area {
  padding: 4px 0px 10px 0px;
}

.search-form {
  --search-button-width: 86px;
  position: relative;
  display: flex;
  align-items: center;
  max-width: 760px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #f0c6d5;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(23, 33, 43, .05);
}

.search-input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 48px;
  padding: 0 46px 0 14px;
  color: var(--ink);
  font-size: 16px;
  border: 0;
  outline: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

.search-input::placeholder {
  color: #89949f;
}

.search-clear {
  display: none;
  position: absolute;
  z-index: 1;
  top: 50%;
  right: calc(var(--search-button-width) + 5px);
  width: 36px;
  height: 36px;
  margin: 0;
  color: #788490;
  font-size: 26px;
  font-weight: 300;
  line-height: .9;
  border: 0;
  border-radius: 50%;
  background: transparent;
  transform: translateY(-50%);
}

.search-clear:hover {
  color: var(--ink);
  background: #eef2f4;
}

.search-clear.is-visible {
  display: block;
}

.search-button {
  flex: 0 0 auto;
  align-self: stretch;
  min-width: var(--search-button-width);
  color: #fff;
  font-weight: 700;
  border: 0;
  background: var(--accent);
  font-size: 16px;
}

.search-button:hover {
  background: var(--accent-dark);
}

.search-feedback {
  display: none;
  max-width: 760px;
  min-height: 20px;
  margin: 9px auto 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}

.search-feedback.is-visible {
  display: block;
}

.search-feedback.is-empty {
  color: var(--hot);
}

.search-feedback.is-hint {
  color: var(--accent-dark);
}

.category-navigator {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(214, 51, 108, .07);
  position: sticky;
  top: 16px;
  align-self: start;
  max-height: calc(100vh - 32px);
}

.category-navigator-header {
  position: relative;
  flex: 0 0 auto;
  padding: 12px 14px 12px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--soft-hot), var(--surface));
}

/* 标题左侧的粉色竖条，替代过去仅靠字重区分层级的做法。 */
.category-navigator-header::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 8px;
  width: 3px;
  height: 16px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), var(--hot));
}

.category-navigator-title {
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: .02em;
  white-space: nowrap;
}

.category-groups {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 8px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #efc9d7 transparent;
}

.category-groups::-webkit-scrollbar {
  width: 6px;
}

.category-groups::-webkit-scrollbar-thumb {
  border-radius: 6px;
  background: #efc9d7;
}

.category-group-button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 7px 10px 7px 11px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  border-radius: 9px;
  background: transparent;
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, border-color .18s ease;
}

/* 逐条分隔线。用伪元素而非 border-bottom，好让它在 hover 时单独淡出，
   不跟圆角高亮底色的下缘打架。 */
.category-group-button::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: var(--line);
  transition: opacity .18s ease;
}

.category-group-button:last-child::after {
  opacity: 0;
}

/* 高亮行自己的分隔线、以及它上方那条，一起让位给圆角底色。 */
.category-group-button:hover::after,
.category-group-button.is-active::after,
.category-group-button[aria-current="location"]::after,
.category-group-button:has(+ .category-group-button:hover)::after,
.category-group-button:has(+ .category-group-button.is-active)::after,
.category-group-button:has(+ .category-group-button[aria-current="location"])::after {
  opacity: 0;
}

/* 当前项指示条：用伪元素而非 border-left，避免占位导致文字左右跳动。 */
.category-group-button::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 3px;
  height: 0;
  border-radius: 3px;
  background: var(--hot);
  transform: translateY(-50%);
  transition: height .18s ease;
}

.category-group-button:hover {
  color: var(--hot);
  background: var(--soft-hot);
}

.category-group-button:hover::before {
  height: 12px;
}

.category-group-button.is-active,
.category-group-button[aria-current="location"] {
  color: var(--hot);
  font-weight: 700;
  background: var(--soft-hot);
}

.category-group-button.is-active::before,
.category-group-button[aria-current="location"]::before {
  height: 18px;
}

/* emoji 字形宽高不一，统一装进固定尺寸的圆角底板里对齐。 */
.category-group-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-muted);
  font-size: 13px;
  line-height: 1;
  text-align: center;
  transition: background-color .18s ease, transform .18s ease;
}

.category-group-button:hover .category-group-icon,
.category-group-button.is-active .category-group-icon,
.category-group-button[aria-current="location"] .category-group-icon {
  background: #ffe0ea;
  transform: scale(1.06);
}

.category-group-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-group-chevron {
  flex: 0 0 auto;
  color: #d8b9c4;
  opacity: .7;
  transition: transform .18s ease, color .18s ease, opacity .18s ease;
}

.category-group-button:hover .category-group-chevron,
.category-group-button.is-active .category-group-chevron,
.category-group-button[aria-current="location"] .category-group-chevron {
  color: var(--hot);
  opacity: 1;
  transform: translateX(2px);
}

.category-groups a[hidden] {
  display: none !important;
}

.direct-grid {
  display: grid;
  /* 桌面端 14 个常用入口刚好排成两行，每行 7 个，减少横向留白。 */
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin: 0 auto;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(23, 33, 43, .035);
}

.direct-site {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 86px;
  padding: 8px 5px;
  color: #26333d;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 8px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background-color .15s ease, color .15s ease;
}

.direct-site:hover {
  color: var(--hot);
  border-color: #f0c6d5;
  background: var(--soft-hot);
  box-shadow: 0 4px 12px rgba(214, 51, 108, .1);
  transform: translateY(-1px);
}

/* 搜索筛选依赖 hidden 属性；显式提高优先级，防止下面的 display:flex 覆盖浏览器默认隐藏规则。 */
.direct-grid[hidden],
.direct-site[hidden],
.site-link[hidden],
.category-row[hidden] {
  display: none !important;
}

.direct-favicon {
  display: block;
  width: 40px;
  height: 40px;
  box-sizing: border-box;
  padding: 3px;
  object-fit: contain;
  border-radius: 9px;
  background: #fff;
  border: 1px solid #edf0f3;
  box-shadow: 0 3px 7px rgba(23, 33, 43, .12);
}

.direct-site span:last-child {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.directory {
  padding: 0px 0 0px;
  margin-top: 10px;
}

.other-directory {
  padding: 0px 0 0px;
  margin-top: 10px;
}

.other-directory h2 {
  font-size: 18px;
  margin: 0 0 5px 4px;
  color: var(--accent-dark);
}

.category-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  grid-template-areas:
    "sidebar top"
    "sidebar bottom";
  align-items: start;
  gap: 16px;
}

.category-main-top {
  grid-area: top;
}

.category-main-bottom {
  grid-area: bottom;
}

.directory-panel {
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(23, 33, 43, .035);
}

.category-row {
  display: block;
  scroll-margin-top: 18px;
  border-bottom: 1px solid var(--line);
}

.category-row:last-child {
  border-bottom: 0;
}

.category-heading {
  margin: 0;
}

.category-row:first-child .category-heading {
  border-radius: 7px 7px 0 0;
}

.category-row:first-child .category-name {
  border-top-left-radius: 7px;
}

.category-row:first-child .category-more-link:last-child,
.category-row:first-child .category-name:last-child {
  border-top-right-radius: 7px;
}

/* 标题行上淡粉底，把它与下面白底的链接区分开。原先一个分类行里叠了四层白
   （.directory-panel / 这里 / .category-links / .site-link），中间只有一条 1px 发线，
   而那条线与行间分隔线同色同粗，所以读不出「标题」和「内容」是两个区域。
   取值用表里已有的 --surface-muted，不新增颜色。 */
.category-row--enhanced .category-heading {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #f2dbe3;
  background: var(--surface-muted);
}

/* 按钮必须透明。它是 flex: 1 1 auto，占满整条标题行，自带的 background: #fff（:832）
   会把上面那层粉底整个盖住 —— 只改 .category-heading 是看不出任何变化的。 */
.category-row--enhanced .category-name {
  flex: 1 1 auto;
  width: auto;
  border-bottom: 0;
  color: #282128;
  background: transparent;
}

/* 悬停时**不动背景**：文字已经从 #282128 变成 var(--hot)，反馈足够，再加深底色是多余的。
   但这条规则不能省 —— 全局的 .category-name:hover{background:#fbfcfd}（近白）会在悬停时
   把粉底洗成白色，比不做还糟。这里显式保持透明，让标题行的粉底原样透上来。 */
.category-row--enhanced .category-name:hover {
  background: transparent;
}

.category-row--enhanced .category-caret {
  width: 25px;
  height: 25px;
  /* margin-right: 8px; */
  margin-left: 0;
  /* font-size: 30px; */
  /* border-radius: 5px; */
  transform: translateY(-2px);
}

.category-row--enhanced .category-caret-icon {
  display: inline-block;
  transition: transform 0.5s ease;
}

.category-row--enhanced.is-collapsed .category-caret-icon {
  transform: rotate(-90deg);
}

.category-row--enhanced .category-caret::after {
  top: auto;
  right: auto;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translate(-50%, 3px);
}

.category-row--enhanced .category-caret.is-tooltip-visible::after {
  transform: translate(-50%, 0);
}

.category-more-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  padding: 10px 16px 10px 10px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 540;
  white-space: nowrap;
}

.category-more-link:hover {
  color: var(--hot);
  font-weight: 600;
}

.category-name {
  display: flex;
  align-items: center;
  width: 100%;
  margin: 0;
  min-height: 48px;
  padding: 12px 18px;
  color: var(--accent-dark);
  font-size: 15px;
  font-weight: 750;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #f2dbe3;
  -webkit-appearance: none;
  appearance: none;
  background: #fff;
}

/* .category-name::before {
  width: 4px;
  height: 18px;
  margin-right: 9px;
  content: "";
  border-radius: 4px;
  background: var(--accent);
} */

.category-caret {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  margin-left: auto;
  place-items: center;
  color: var(--accent-dark);
  line-height: 0.9;
  /* border: 1px solid #f0c6d5;
  border-radius: 7px; */
  font-size: 32px;
}

.category-caret::after {
  position: absolute;
  z-index: 20;
  top: 50%;
  right: calc(100% + 8px);
  padding: 6px 8px;
  color: #34414d;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  content: attr(data-tooltip);
  visibility: hidden;
  opacity: 0;
  border: 1px solid #f0c6d5;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(23, 33, 43, .2);
  transform: translate(3px, -50%);
  transition: opacity .14s ease, transform .14s ease, visibility .14s ease;
}

.category-caret.is-tooltip-visible::after {
  visibility: visible;
  opacity: 1;
  transform: translate(0, -50%);
}

.category-row.is-collapsed .category-links {
  height: 0;
  padding-block: 0;
  opacity: 0;
  pointer-events: none;
}

.category-name:hover {
  color: var(--hot);
  background: #fbfcfd;
}

.category-name:hover .category-caret {
  color: var(--hot);
}

.category-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  opacity: 1;
  padding: 12px;
  transition: height .5s ease, opacity .5s ease;
  will-change: height, opacity;
}

.site-link {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  color: #34414d;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, color .15s ease;
}

.site-link:hover {
  color: var(--hot);
  border-color: #dfa7bb;
  box-shadow: 0 4px 12px rgba(214, 51, 108, .12);
  transform: translateY(-1px);
}

.site-link-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-right: 8px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
}

.site-link span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-link[data-featured] {
  color: var(--hot);
  border-color: #f0aac2;
}

/* 142 分类批量导入后使用的站点卡片：保留完整简介文本（DOM 中不截断，
   仅视觉上用 line-clamp 收到 3 行，不影响搜索和 SEO）。
   用 .category-links.category-links--cards 复合选择器提高优先级，
   盖过 .category-links 在 900px / 640px 断点里已有的列数规则，
   不需要再为这个新组件单独写响应式断点。 */
.category-links.category-links--cards {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  padding: 12px;
}

.site-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
  color: inherit;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.site-card:hover,
.site-card:focus-visible {
  border-color: #dfa7bb;
  box-shadow: 0 4px 12px rgba(214, 51, 108, .12);
  transform: translateY(-1px);
}

.site-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.site-card-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
}

.site-card-name {
  overflow: hidden;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .15s ease;
}

.site-card:hover .site-card-name,
.site-card:focus-visible .site-card-name {
  color: var(--hot);
}

.site-card-desc {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.related-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  padding: 0 4px;
}

.related-directory-link {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 14px;
  color: inherit;
  text-decoration: none;
  border: 1px solid #dfe5ec;
  border-radius: 8px;
  background: #fff;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.related-directory-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.related-directory-name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #bf3152;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .18s ease, font-weight .18s ease;
}

.related-directory-note {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.related-directory-link:hover,
.related-directory-link:focus-visible {
  border-color: #dfa7bb;
  /* background: #fff4f8; */
  box-shadow: 0 7px 18px rgba(166, 30, 77, .12);
  transform: translateY(-2px);
}

.related-directory-link:hover .related-directory-name,
.related-directory-link:focus-visible .related-directory-name {
  color: var(--hot);
  font-weight: 700;
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  /* .category-links 刻意不在此列：分类折叠是用户主动触发、0.5 秒即止的单轴高度动画，
     而同一手势里的 .category-caret-icon 旋转从未受本块约束。两者若不同步，
     就会出现「箭头平滑旋转、面板瞬间跳变」的自相矛盾。详见 setCategoryExpanded()。 */
  .related-directory-link,
  .related-directory-name {
    transition: none;
  }
}

.site-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 0;
  background: #fff;
}

.site-item {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 48px;
  padding: 9px 13px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.site-item:nth-child(4n) {
  border-right: 0;
}

.site-item:hover {
  background: #fffafc;
}

.site-dot {
  flex: 0 0 auto;
  display: grid;
  width: 25px;
  height: 25px;
  margin-right: 9px;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  border-radius: 6px;
  background: var(--dot, #d6336c);
}

.site-item strong {
  display: block;
  overflow: hidden;
  color: #28333d;
  font-size: 14px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-item small {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: #89949f;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-item:hover strong {
  color: var(--hot);
}

.site-grid.is-empty::after {
  grid-column: 1 / -1;
  padding: 22px;
  color: var(--muted);
  text-align: center;
  content: "未找到匹配站点";
}

.guides-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 25px 0 0;
  padding: 13px 15px;
  color: var(--muted);
  font-size: 13px;
  border: 1px solid #f0dbe3;
  border-radius: 7px;
  background: #fff4f8;
}

.guides-line b {
  color: var(--accent-dark);
}

.guides-line a:hover {
  color: var(--hot);
}

.guides-line a::before {
  margin-right: 14px;
  color: #f0c6d5;
  content: "·";
}

.footer {
  margin-top: 0px;
  /* border-top: 1px solid var(--line); */
  background: #f4f6f9;
}

.footer-inner {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 0px 0 0px;
  text-align: center;
}

.footer-nav,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
}

.footer-nav a,
.footer-links a {
  min-height: 36px;
  padding: 7px 13px;
  color: var(--hot);
  font-size: 13px;
  border: 1px solid #f2d3df;
  border-radius: 7px;
  background: rgba(255, 255, 255, .76);
}

.footer-nav a:hover,
.footer-links a:hover {
  border-color: var(--hot);
  background: var(--soft-hot);
}

.footer-links {
  margin: 0px auto 0;
  padding: 0px;
  /* border-top: 1px solid #e7ebf0;
  border-bottom: 1px solid #e7ebf0; */
  /* background: rgba(255, 255, 255, .52); */
}

.footer-note,
.footer-disclosure,
.footer-copy {
  max-width: 680px;
  margin-right: auto;
  margin-left: auto;
  color: #34465b;
  font-size: 14px;
  line-height: 1.75;
}

.footer-note {
  margin-top: 0px;
  margin-bottom: 0;
}

.footer-disclosure {
  margin-top: 12px;
  margin-bottom: 0;
}

.footer-copy {
  margin-top: 17px;
  margin-bottom: 0;
  color: #536273;
  font-size: 13px;
}

@media (max-width: 900px) {
  .category-shell {
    grid-template-columns: 200px minmax(0, 1fr);
  }

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

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

  .site-item:nth-child(4n) {
    border-right: 1px solid var(--line);
  }

  .site-item:nth-child(3n) {
    border-right: 0;
  }
}

@media (max-width: 640px) {

  .topbar-inner,
  .page {
    width: min(100% - 28px, var(--max));
  }

  .topbar-inner {
    min-height: 58px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .brand-name {
    font-size: 16px;
  }

  .brand-tagline {
    font-size: 11px;
  }

  .top-links {
    gap: 6px;
    font-size: 12px;
  }

  .bookmark-button {
    width: 30px;
    min-height: 28px;
    padding: 3px;
    border-radius: 5px;
  }

  .bookmark-label {
    display: none;
  }

  .bookmark-icon {
    font-size: 17px;
  }

  .bookmark-toast {
    top: calc(100% + 6px);
    max-width: min(250px, calc(100vw - 28px));
  }

  .language-button {
    min-height: 28px;
    padding: 3px 6px;
    font-size: 12px;
    border-radius: 5px;
  }

  .language-menu {
    max-height: min(70vh, 480px);
  }

  .language-option {
    min-height: 40px;
    padding: 10px 12px;
    font-size: 14px;
  }

  .search-area {
    padding: 2px 0px 5px 0px;
  }

  .search-form {
    --search-button-width: 58px;
    border-radius: 6px;
  }

  .search-input {
    height: 35px;
    padding: 0 41px 0 10px;
    font-size: 14px;
  }

  .search-clear {
    width: 28px;
    height: 28px;
    font-size: 19px;
    line-height: 1;
  }

  .search-button {
    font-size: 13px;
  }

  .category-shell {
    display: block;
  }

  .category-navigator {
    position: static;
    display: block;
    max-height: none;
    overflow: visible;
    margin: 5px 0 5px;
    border-radius: 12px;
  }

  .category-navigator-header {
    padding: 10px 12px 10px 16px;
  }

  .category-navigator-header::before {
    top: 11px;
    left: 7px;
  }

  /* 窄屏改双列卡片：靠卡片边界分隔，不再用逐条的下划线。 */
  .category-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    overflow: visible;
  }

  .category-group-button {
    gap: 8px;
    min-height: 46px;
    padding: 8px 8px 8px 10px;
    font-size: 13px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(214, 51, 108, .05);
  }

  /* 卡片模式靠底色和描边表达状态，指示条与分隔线在这里都是多余的。 */
  .category-group-button::before,
  .category-group-button::after {
    display: none;
  }

  .category-group-button:hover {
    border-color: #f4b6cb;
  }

  .category-group-button.is-active,
  .category-group-button[aria-current="location"] {
    border-color: var(--hot);
    box-shadow: 0 2px 10px rgba(255, 23, 68, .16);
  }

  .category-group-icon {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    font-size: 12px;
  }

  .category-group-label {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.25;
  }

  .category-group-chevron {
    font-size: 13px;
  }

  .direct-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 0;
    padding: 5px 2px;
    border-radius: 6px;
  }

  .direct-site {
    gap: 3px;
    min-height: 62px;
    padding: 5px 1px;
    font-size: 11px;
    line-height: 1.15;
  }

  .direct-favicon {
    width: 30px;
    height: 30px;
    padding: 2px;
    border-radius: 7px;
  }

  .back-to-top {
    right: 12px;
    bottom: 12px;
    border-radius: 8px;
    font-size: 12px;
  }

  .directory {
    padding: 0px 0 0px;
  }

  .directory-panel {
    border-radius: 6px;
  }

  .category-name {
    min-height: 39px;
    padding: 8px 5px;
    font-size: 13px;
  }

  /* .category-name::before {
    width: 3px;
    height: 16px;
    margin-right: 7px;
  } */

  .category-caret {
    /* width: 29px;
    height: 29px; */
    font-size: 30px;
  }

  .category-row--enhanced .category-caret::after {
    right: auto;
    left: 0;
    transform: translate(0, 3px);
  }

  .category-row--enhanced .category-caret.is-tooltip-visible::after {
    transform: translate(0, 0);
  }

  .category-links {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 6px;
    padding: 8px;
  }

  .site-link {
    padding: 9px 10px;
    font-size: 12.5px;
  }

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

  .site-item {
    min-height: 47px;
    padding: 8px;
  }

  .site-item:nth-child(n) {
    border-right: 1px solid var(--line);
  }

  .site-item:nth-child(2n) {
    border-right: 0;
  }

  .site-dot {
    width: 23px;
    height: 23px;
    margin-right: 7px;
    font-size: 10px;
    border-radius: 5px;
  }

  .site-item strong {
    font-size: 13px;
  }

  .site-item small {
    font-size: 10px;
  }

  .guides-line {
    gap: 4px 9px;
    margin-top: 18px;
    padding: 10px 11px;
    font-size: 12px;
    line-height: 1.7;
  }

  .guides-line a::before {
    margin-right: 9px;
  }

  .footer {
    margin-top: 0px;
  }

  .footer-inner {
    width: min(100% - 28px, var(--max));
    padding: 0px 0 0px;
  }

  .footer-nav,
  .footer-links {
    gap: 8px;
  }

  .footer-nav a,
  .footer-links a {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 12px;
  }

  .footer-links {
    margin-top: 0px;
    padding: 0px 8px;
  }

  .footer-note,
  .footer-disclosure,
  .footer-copy {
    font-size: 13px;
    line-height: 1.7;
  }

  .footer-note {
    margin-top: 0px;
  }

  .footer-disclosure {
    margin-top: 10px;
  }

  .footer-copy {
    margin-top: 14px;
    font-size: 12px;
  }

  .other-directory h2 {
    font-size: 16px;
  }
}

/* 极窄手机保留四列，避免站点名称被压缩到难以辨认。 */
@media (max-width: 390px) {
  .direct-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .direct-site {
    min-height: 60px;
  }

  .direct-favicon {
    width: 29px;
    height: 29px;
  }

  /* 极窄屏把箭头让位给分类名，避免 10 字标题被挤成三行。 */
  .category-group-chevron {
    display: none;
  }

  .category-group-button {
    padding-right: 6px;
  }
}
/* inline-style-classes:begin --- 由 scripts/sync-inline-style-classes.mjs 生成，勿手改 */
.directory-gap-sm,
.directory.directory-gap-sm,
.section-after-ad + section.directory-gap-sm {
  margin-top: 5px;
}

.directory-title-sm,
.other-directory h2.directory-title-sm {
  font-size: 18px;
  margin: 0 0 8px 4px;
}

.footer-nav-start,
.footer-nav.footer-nav-start {
  justify-content: flex-start;
  padding: 0 4px;
}

.home-footnote {
  color: var(--muted);
  font-size: 13px;
  margin-top: 16px;
  text-align: center;
}
/* inline-style-classes:end */