:root {
  --page: #f6f7fb;
  --surface: #fff;
  --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, .12);
  --max: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  padding-bottom: 56px;
  color: var(--ink);
  background: var(--page);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, "Microsoft YaHei", sans-serif;
  line-height: 1.55;
}
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;
}
.visually-hidden {
  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, .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;
}

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

.directory-panel, .notice-panel, .related-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(23, 33, 43, .04);
}
h1, h2, h3, p { margin-top: 0; }

.search-panel { margin: 0; padding: 0; }
.search-form {
  --search-button-width: 86px;
  position: relative;
  display: flex;
  align-items: center;
  max-width: none;
  margin: 0;
  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: 40px;
  padding: 0 46px 0 14px;
  color: var(--ink);
  font-size: 16px;
  border: 0;
  outline: 0;
  appearance: none;
  background: transparent;
}
.search-input::placeholder { color: #89949f; }
/* 焦点态：与 home-directory.css 同一处理，完整成因见那边的长注释（搜「淡红色竖线」）。
   摘要：全局 input:focus-visible(:30) 那圈 outline-offset: 3px 的描边，上/下/左三边被
   .search-form(:173) 的 overflow: hidden 裁掉，只有右边那段落在表单内部而活下来，
   渲染成一条贴着按钮左缘的淡红竖线。按钮还是实心粉底时看不见，改透明底后才显形。
   本表 --line 未中性化、静态外框是 #f0c6d5（粉），所以焦点色取 --accent-dark 而不是
   --accent：前者状态间对比 4.72:1，后者只有 3.02:1，擦着 WCAG 2.4.11 的 3:1 过。 */
.search-input:focus-visible { outline: 0; }
.search-form:focus-within { border-color: var(--accent-dark); }
.search-input::-webkit-search-cancel-button,
.search-input::-webkit-search-decoration,
.search-input::-webkit-search-results-button,
.search-input::-webkit-search-results-decoration {
  -webkit-appearance: none;
  appearance: none;
}
.search-input::-ms-clear,
.search-input::-ms-reveal {
  display: none;
  width: 0;
  height: 0;
}
.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; }
/* 2026-09-22 与 home-directory.css 的 .search-button 同步改为白底粉字（原本是实心粉底白字）。
   那张表是本组件的另一份副本（两表 :root 令牌同名同值，只有 --line 不同），
   规则文本刻意保持一致，免得两份副本再次分叉。改一边就要改另一边。
   注意：那张表里站主后续还手调过 font-weight 与文字色，本表**未**跟进，两边已有细微差异。 */
.search-button {
  flex: 0 0 auto;
  align-self: stretch;
  min-width: var(--search-button-width);
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  border: 0;
  /* **本按钮刻意没有任何边界**，与 home-directory.css 同步（站主 2026-09-22 看过实物后定的）。
     曾短暂加过一条 border-left 分隔线，随即按站主要求去掉。所以 .search-form(:176 #fff)、
     .search-input(:189 transparent) 与本按钮是一整片不间断的白，分界对比 1.00:1。
     这是有意的，不要再把线加回来。 */
  /* 写 transparent 而不是写死 #fff：白色只由 .search-form(:176) 一处提供，
     两个兄弟节点也都是 transparent，渲染结果与 #fff 逐像素相同。 */
  background: transparent;
}
/* 原来是 background: var(--accent-dark)，白底之后会在悬停时闪回整块深粉，与「不显眼」相反。
   保持本表既有的裸 :hover 写法（不套 (hover: hover)），只改取值 —— 套上去是行为改动，
   不在本次范围。注意本表因此仍有 home-directory.css 已修掉的触屏粘滞 hover 问题。 */
.search-button:hover { color: var(--accent-dark); background: var(--soft-hot); }
/* 触屏高亮靠 :focus 而非 :focus-visible（后者只对键盘生效，手机点按什么都不亮）。
   按钮原本靠粉底提示位置，底色一透明就没有任何触屏反馈了。 */
.search-button:focus,
.search-button:active { color: var(--accent-dark); }
/* 只变色不够（#d6336c -> #a61e4d 状态间仅 1.56:1，低于 WCAG 2.4.11 的 3:1）。
   键盘本该由第 30 行全局 button:focus-visible 兜底，但 .search-form(:173) 是
   overflow: hidden，outline-offset: 3px 被整条裁掉；负 offset 改画进按钮内部。 */
.search-button:focus-visible { outline-offset: -3px; }
.filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 8px;
}
.filter-chip {
  min-height: 32px;
  padding: 5px 11px;
  color: var(--muted);
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}
.filter-chip:hover, .filter-chip.is-active {
  color: var(--accent-dark);
  border-color: #f0c6d5;
  background: var(--surface-muted);
}
.filter-chip.is-active { font-weight: 700; }

.directory-panel { margin-top: 10px; overflow: hidden; }
.directory-heading {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 0;
  padding: 8px 14px;
  border-bottom: 1px solid #f2dbe3;
}
.directory-heading h1 {
  flex: 0 1 auto;
  min-width: 0;
  margin: 0;
  color: var(--accent-dark);
  font-size: 16px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.result-count { flex: 0 0 auto; margin: 0; color: var(--muted); font-size: 13px; white-space: nowrap; }
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  align-items: stretch;
  padding: 12px;
  background: #fbfcfd;
}
.platform-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.platform-card[hidden], .empty-state[hidden] { display: none !important; }
@media (hover: hover) {
  .platform-card:hover { border-color: #f0c6d5; }
  .platform-card:hover .platform-title-wrap h3 { color: var(--hot); }
}
.platform-card-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.platform-icon {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #edf0f3;
  border-radius: 6px;
  background: #fff;
}
.platform-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.platform-title-wrap { min-width: 0; flex: 1; }
.platform-title-wrap h3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  margin: 0;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.platform-type,
.platform-tags { display: none; }
.platform-description {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
body.hide-card-desc .platform-description { display: none; }
.platform-actions { margin: 0; padding: 0; }
.platform-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: transparent;
  font-size: 16px;
}
.platform-card .platform-link:hover,
.platform-card .platform-link:focus,
.platform-card .platform-link:active {
  border: 0;
  background: transparent;
  color: transparent;
}
.platform-link:focus-visible {
  outline: 3px solid rgba(214, 51, 108, .45);
  outline-offset: -3px;
}
.platform-guide {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  margin-top: 8px;
  padding: 4px 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.platform-guide:hover { color: var(--accent-dark); border-color: #f0c6d5; background: var(--soft-hot); }
.empty-state {
  margin: 0;
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
  border-top: 1px solid var(--line);
}

.notice-panel, .related-panel { margin-top: 16px; padding: 20px; }
.notice-panel h2, .related-panel h2 { margin-bottom: 10px; color: var(--accent-dark); font-size: 18px; }
.notice-panel p { margin-bottom: 0; color: #43515f; font-size: 14px; line-height: 1.75; }
.safety-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 24px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.safety-list li {
  position: relative;
  padding: 0 0 0 14px;
  color: #43515f;
  font-size: 13px;
  line-height: 1.65;
}
.safety-list li::before {
  position: absolute;
  top: .72em;
  left: 0;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #aeb7c0;
  content: "";
}
.related-links {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.related-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 650;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.related-links a::after { flex: 0 0 auto; content: "→"; }
.related-links a:hover { color: var(--hot); border-color: #e7a8bd; background: var(--soft-hot); }

.footer { margin-top: 20px; }
.footer-inner {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0 0;
  text-align: center;
  border-top: 1px solid var(--line);
}
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
/* 页脚常有两段 footer-links（分类导航 / 法律链接）；gap 只作用在段内，段与段之间要单独留行距 */
.footer-links + .footer-links { margin-top: 10px; }
.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  color: var(--accent-dark);
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
}
.footer-links a:hover { color: var(--hot); border-color: #e7a8bd; background: var(--soft-hot); }
.footer-note, .footer-copy {
  max-width: 680px;
  margin-right: auto;
  margin-left: auto;
  color: #536273;
  font-size: 13px;
  line-height: 1.7;
}
.footer-note { margin-top: 14px; margin-bottom: 0; }
.footer-copy { margin-top: 8px; margin-bottom: 0; font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .platform-card { transition: none; }
}
@media (max-width: 900px) {
  .safety-list { grid-template-columns: 1fr; }
  .related-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .topbar-inner, .page, .footer-inner { width: min(calc(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; }
  .search-panel { padding: 0; }
  .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; }
  .filter-row { justify-content: flex-start; gap: 6px; }
  .filter-chip { min-height: 30px; padding: 4px 9px; font-size: 12px; }
  .directory-heading { min-height: 0; padding: 8px 12px; }
  .directory-heading h1 { font-size: 14px; }
  .result-count { font-size: 12px; }
  /* 手机固定双列。更宽的屏幕用基础层 auto-fill，不在这里写死列数。 */
  .platform-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
  }
  .platform-card { padding: 8px; }
  .platform-card-head { gap: 6px; }
  .platform-icon {
    flex-basis: 24px;
    width: 24px;
    height: 24px;
  }
  .platform-title-wrap h3 { font-size: 13px; }
  .platform-description {
    display: none;
    font-size: 12px;
  }
  body.show-card-desc .platform-description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }
  .notice-panel, .related-panel { padding: 16px; border-radius: 8px; }
  .related-links { grid-template-columns: 1fr; }
  .footer-inner { padding-top: 14px; }
}
