/* KOSTI 起始页 —— 深色主题（调子参照 deepseek.com/harness，主色是绿色） */

/* 字标用的书法字体：Ma Shan Zheng（SIL OFL 1.1，取自 Google Fonts）
   只留了拉丁子集 —— 字标只有 K/O/S/T/I 五个字形，13 KB 就够了，
   不必背一整个中文字库。换字体见 README。 */
@font-face {
  font-family: 'MaShanZheng';
  src: url('fonts/MaShanZheng.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* 横向不许溢出 —— 但这只是**最后一道兜底**，真正治本的是让 .bg 别超宽（见下）。
   用 clip 不用 hidden：hidden 会把 html 变成滚动容器，clip 不会。

   ⚠️ 别把这条当主手段：像夸克那类浏览器对 html 上的 `overflow: clip` 支持不齐，
   指望它裁是靠不住的 —— 2026-10-13 在真机上验过，所以改成结构上不溢出。 */
html {
  overflow-x: clip;
  overscroll-behavior-x: none;      /* 关掉横向的过度滚动：手指横划时别让整页跟着弹一下 */
  -webkit-text-size-adjust: 100%;   /* iOS 横屏时别自作主张把字号放大 */
}

:root {
  --bg:         #080d0b;
  --card:       rgba(255, 255, 255, .045);
  --card-2:     rgba(255, 255, 255, .075);
  --line:       rgba(150, 226, 190, .13);
  --line-2:     rgba(150, 226, 190, .30);
  --text:       #e8f2ec;
  --muted:      #8ba79a;
  --brand:      #34d399;   /* 深底上的主色，比浅色主题那支亮一档 */
  --brand-ink:  #6ee7b7;   /* 用于文字，对比度更高 */
  --brand-soft: rgba(52, 211, 153, .13);
  --chip:       rgba(255, 255, 255, .06);
  --shadow-sm:  0 1px 2px rgba(0, 0, 0, .5);
  --shadow-md:  0 18px 44px -24px rgba(0, 0, 0, .85);
  --shadow-lg:  0 34px 80px -34px rgba(0, 0, 0, .95);
  --wrap:       1080px;
}

* { box-sizing: border-box; }

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;   /* 手机地址栏会伸缩：只写 vh，页脚会在半空吊着 */
  display: flex;        /* 竖着撑满：内容再短，页脚也贴屏幕底 */
  flex-direction: column;
  color: var(--text);
  /* 顶上那团微光是参照页的关键：整体压暗，只在顶部中央透一点亮 */
  background:
    radial-gradient(1100px 620px at 50% -18%, rgba(52, 211, 153, .10), transparent 68%),
    linear-gradient(180deg, #0b1310 0%, var(--bg) 52%, #060a09 100%);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;   /* 手机上点链接别闪那块灰底 */
  overflow-x: hidden;
}

/* 细颗粒噪点：大面积的渐变在深色里容易出色阶断层，撒一层几乎看不见的
   颗粒就把它打散了，画面会「实」一些。
   这一层要压在光晕**上面**、内容**下面**——所以用 body::after
   （它是 body 的最后一个背景层，z-index 0，而 main 是 1）。
   嫌脏就把 opacity 再压。 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 背景：几团会缓慢漂移的色斑，靠 blur 化开成光晕
   深底上要低透明度、高亮度——是"透出来的光"，不是"涂上去的色"。
   想调浓淡改 alpha；想停下就删掉 animation。

   ⚠️ 这一层必须**严格和视口同宽**（left/right 都是 0）。它一旦比视口宽，
   就会把文档撑宽，手机上就能左右滑动 —— 而且像夸克那类浏览器对 html 上的
   `overflow: clip` 支持不齐，指望裁是兜不住的，只能让它压根不溢出。
   指针视差要的余量由里面的 .bg-move 承担（见下）。 */
.bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 114vh;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 34%, transparent 78%);
          mask-image: linear-gradient(180deg, #000 0%, #000 34%, transparent 78%);
}

/* 真正会动的那一层：四周各比 .bg 多出一圈，供指针视差挪动时不露边。
   它超出 .bg 的部分会被上面的 overflow: hidden 裁掉，**不计入文档宽度**。 */
.bg-move {
  position: absolute;
  top: -30px;
  left: -32px;
  right: -32px;
  bottom: -30px;
}

/* 淡网格：放在 .bg 里面，好跟着光晕一起往下淡出（同一个 mask） */
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(150, 226, 190, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(150, 226, 190, .055) 1px, transparent 1px);
  background-size: 64px 64px;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}

.orb-a {
  width: 46vw; height: 38vw;
  left: -7vw; top: -6vh;
  background: rgba(52, 211, 153, .24);
  animation: drift-a 13s ease-in-out infinite;
}

.orb-b {
  width: 40vw; height: 34vw;
  right: -6vw; top: -8vh;
  background: rgba(94, 214, 224, .16);
  animation: drift-b 17s ease-in-out infinite;
}

.orb-c {
  width: 34vw; height: 28vw;
  left: 33vw; top: 24vh;
  background: rgba(94, 234, 212, .14);
  animation: drift-c 11s ease-in-out infinite;
}

.orb-d {
  width: 72vw; height: 30vw;
  left: 14vw; top: -14vh;
  background: rgba(16, 185, 129, .16);
  animation: drift-d 19s ease-in-out infinite;
}

@keyframes drift-a {
  0%, 100% { transform: translate3d(-2vw, 0, 0) scale(1); }
  50%      { transform: translate3d(8vw, 6vh, 0) scale(1.22); }
}

@keyframes drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.08); }
  50%      { transform: translate3d(-9vw, 7vh, 0) scale(.9); }
}

@keyframes drift-c {
  0%, 100% { transform: translate3d(0, 0, 0) scale(.92); }
  33%      { transform: translate3d(-8vw, -6vh, 0) scale(1.18); }
  66%      { transform: translate3d(7vw, 4vh, 0) scale(1); }
}

@keyframes drift-d {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(-6vw, 8vh, 0) scale(1.14); }
}

/* 极光带：横贯的细长椭圆，两端透明、中间透光，模糊后像流动的光幕。
   和色斑的区别是它有方向——横向平移 + 轻微旋转，所以看着是"在流"，
   不只是"在飘"。 */
.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  will-change: transform;
}

.aurora-a {
  width: 150vw;
  height: 32vh;
  left: -25vw;
  top: 4vh;
  background: linear-gradient(90deg,
    transparent 0%, rgba(52, 211, 153, .34) 26%, rgba(110, 231, 183, .26) 50%,
    rgba(94, 234, 212, .18) 72%, transparent 100%);
  animation: aurora-a 11s ease-in-out infinite;
}

.aurora-b {
  width: 140vw;
  height: 26vh;
  left: -20vw;
  top: 36vh;
  background: linear-gradient(90deg,
    transparent 0%, rgba(94, 214, 224, .22) 32%, rgba(52, 211, 153, .22) 62%, transparent 100%);
  animation: aurora-b 15s ease-in-out infinite;
}

@keyframes aurora-a {
  0%, 100% { transform: translate3d(-11%, 0, 0) rotate(-6deg) scaleY(.92); }
  50%      { transform: translate3d(11%, 5vh, 0) rotate(-1deg) scaleY(1.3); }
}

@keyframes aurora-b {
  0%, 100% { transform: translate3d(12%, 0, 0) rotate(3deg) scaleY(1.16); }
  50%      { transform: translate3d(-12%, -5vh, 0) rotate(9deg) scaleY(.88); }
}

/* 漂浮的光点：这一层是"一眼能看出在动"的那部分。
   每个点由 main.js 生成，位置 / 大小 / 漂移方向 / 时长都随机，
   范围刻意做小（几十像素）+ 明显的明暗呼吸——位移一大就像流星，
   反而不像壁纸了。 */
.particles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.particles i {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(190, 255, 228, .95) 0%, rgba(52, 211, 153, .45) 55%, transparent 72%);
  animation: twinkle var(--dur, 9s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  will-change: transform, opacity;
}

@keyframes twinkle {
  0%, 100% { transform: translate3d(0, 0, 0) scale(.8); opacity: .08; }
  50%      { transform: translate3d(var(--dx, 12px), var(--dy, -14px), 0) scale(1.25); opacity: 1; }
}

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

a { color: inherit; }

code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: .88em;
  color: var(--brand-ink);
  background: rgba(255, 255, 255, .07);
  border-radius: 5px;
  padding: .1em .35em;
}

/* ---------- Hero ---------- */

main { position: relative; z-index: 1; flex: 1; }

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 62px 24px 20px;
  text-align: center;
}

/* 字标：书法体 + 亮绿渐变填字，高光缓慢流动，跟背景的漂移呼应 */
.wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin: 0 0 22px;
}

.wordmark-text {
  /* 书法字体只有一个字重，写 800 会让浏览器合成加粗、笔画糊掉 */
  font-family: 'MaShanZheng', 'KaiTi', '楷体', system-ui, sans-serif;
  font-size: clamp(3.4rem, 10.5vw, 6.6rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: .06em;
  text-indent: .06em;             /* 补掉字距在右侧多出来的空隙，视觉上才是居中的 */
  /* 毛笔字笔画粗细差得大，渐变跨度太宽会像褪色；收在中绿到亮薄荷之间 */
  background: linear-gradient(100deg, #10a56a 0%, #6ee7b7 48%, #10a56a 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  /* 深底上不用白光托底，改成一圈绿辉光，字像是自己发光的 */
  filter: drop-shadow(0 0 26px rgba(52, 211, 153, .38));
  animation: sheen 11s ease-in-out infinite;
}

@keyframes sheen {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* ---------- 搜索卡片 ---------- */

.search {
  position: relative;
  /* 联想下拉要盖住下面的胶囊和卡片。注意 .search 有 backdrop-filter，
     它本身是个层叠上下文 —— 下拉的 z-index 只在它内部有效，所以这里
     必须把整个搜索卡抬到 .board 之上，否则下半截会被卡片板盖掉。 */
  z-index: 2;
  width: 100%;
  max-width: 720px;
  padding: 18px 20px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
  text-align: left;
}

.search:focus-within {
  background: var(--card-2);
  border-color: rgba(52, 211, 153, .45);
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(52, 211, 153, .12);
}

.search input {
  width: 100%;
  padding: 6px 2px 18px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
  outline: none;
  -webkit-appearance: none;
          appearance: none;
}

.search input::placeholder { color: #9cb8ab; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* 搜索联想下拉：absolute 挂在搜索卡下方，不撑开卡片、不挤下面的胶囊 */
.sug {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 6;
  padding: 6px;
  /* 必须不透明：用 --card-2 那类半透明，下面的胶囊/卡片会透过来，看着很脏 */
  background: #0a110e;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  max-height: min(56vh, 400px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sug[hidden] { display: none; }

.sug-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text);
  font-size: .92rem;
  line-height: 1.4;
  cursor: pointer;
  transition: background .12s ease;
}

.sug-item:hover { background: rgba(255, 255, 255, .07); }

/* 键盘 ↑↓ 选中的那一条 */
.sug-item.is-hot { background: rgba(255, 255, 255, .1); }

.sug-ic {
  flex: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.sug-ic svg { width: 15px; height: 15px; display: block; }

.sug-t {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 命中的那几个字节用主色标出来（由 main.js 用 <b> 包，不是 innerHTML 拼的） */
.sug-t b { font-weight: 600; color: var(--brand-ink); }

.search-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.engines {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.chip {
  font: inherit;
  font-size: .82rem;
  color: #a8c2b6;
  background: var(--chip);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: .34em .95em;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.chip:hover { background: rgba(255, 255, 255, .12); color: var(--text); }

.chip.is-on {
  background: var(--brand);
  color: #04231a;
  font-weight: 600;
}

.chip.is-on:hover { background: #4ade80; color: #04231a; }

.go {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #6ee7b7);
  color: #04231a;
  cursor: pointer;
  box-shadow: 0 10px 26px -10px rgba(52, 211, 153, .9);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.go svg { width: 19px; height: 19px; }

.go:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 14px 30px -10px rgba(52, 211, 153, .95);
}

.go:active { transform: translateY(0) scale(.96); }

/* ---------- 本站服务胶囊 ---------- */

.quick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
}

.quick-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: .62em 1.25em;
  font-size: .92rem;
  text-decoration: none;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}

.pill svg { width: 16px; height: 16px; color: var(--brand); }

.pill:hover {
  transform: translateY(-2px);
  color: var(--brand-ink);
  background: var(--card-2);
  border-color: var(--line-2);
}

.pill:focus-visible,
.tile:focus-visible,
.chip:focus-visible,
.go:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- 自定义开关（右上角那个小铅笔） ---------- */

.edit-toggle {
  position: fixed;
  /* 避开刘海和圆角，不然横屏时这支笔会被切掉 */
  top: calc(18px + env(safe-area-inset-top, 0px));
  right: calc(18px + env(safe-area-inset-right, 0px));
  z-index: 20;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(8, 14, 11, .62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--muted);
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease, transform .16s ease;
}

.edit-toggle svg { width: 18px; height: 18px; }

.edit-toggle:hover {
  color: var(--brand-ink);
  border-color: var(--line-2);
  transform: translateY(-1px);
}

.edit-toggle.is-on {
  background: var(--brand);
  border-color: transparent;
  color: #04231a;
}

.edit-toggle.is-on:hover { color: #04231a; filter: brightness(1.06); }

/* ---------- 卡片板 ---------- */

.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
  padding-top: 34px;
  padding-bottom: 8px;
}

.card {
  min-width: 0;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* 进了自定义模式，卡片描边变虚线，一眼知道现在能改 */
.board.is-editing .card {
  border-style: dashed;
  border-color: var(--line-2);
}

/* 热点卡片横跨两列——它是唯一内容会溢出的那张 */
.card-hot { grid-column: span 2; }

/* 只剩一张卡时（比如备案审核期把热点撤了），别让它孤零零杵在左下角：
   宽度对齐搜索框、链接摆成图标网格，整页读下来是「标题 → 搜索 → 卡片」一条中轴。 */
.board.is-solo {
  grid-template-columns: minmax(0, 720px);
  justify-content: center;
}

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.card-head h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .04em;
}

.card-head h2::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .16);
}

.card-note {
  font-size: .74rem;
  color: var(--muted);
  white-space: nowrap;
}

/* 热点卡片头上的那排来源切换（百度 / 哔哩哔哩 / 今日头条）。
   tab 有哪些、叫什么，是 hot.json 里的 order 和 names 说了算的。 */
.hot-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.card-hot .card-head { align-items: center; }

.hot-tab {
  padding: .3em .85em;
  border: 1px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: .8rem;
  line-height: 1.4;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}

.hot-tab:hover { background: rgba(255, 255, 255, .06); color: var(--text); }

.hot-tab.is-on {
  background: var(--brand);
  color: #04231a;
  font-weight: 600;
}

/* 内容区：热点这张要能滚（滚轮/触摸都行），别把整页带走 */
.card-body { min-width: 0; }

.card-hot .card-body {
  max-height: 292px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(150, 226, 190, .25) transparent;
}

.card-hot .card-body::-webkit-scrollbar { width: 8px; }
.card-hot .card-body::-webkit-scrollbar-track { background: transparent; }

.card-hot .card-body::-webkit-scrollbar-thumb {
  background: rgba(150, 226, 190, .18);
  border-radius: 4px;
}

.card-hot .card-body::-webkit-scrollbar-thumb:hover { background: rgba(150, 226, 190, .34); }

/* 热点条目 */
.hot-item {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 9px;
  text-decoration: none;
  transition: background .16s ease;
}

.hot-item:hover { background: rgba(255, 255, 255, .05); }

.hot-item .no {
  flex: none;
  width: 17px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: .78rem;
  color: var(--muted);
}

/* 前三条序号点亮，一眼看出是热榜 */
.hot-item:nth-child(-n+3) .no { color: var(--brand-ink); font-weight: 600; }

.hot-item .hot-t {
  min-width: 0;
  font-size: .88rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color .16s ease;
}

.hot-item:hover .hot-t { color: var(--brand-ink); }

.hot-empty {
  padding: 14px 8px;
  font-size: .84rem;
  color: var(--muted);
}

/* ---------- 卡片里的链接（图标方块网格） ---------- */

.links {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

/* 只剩这一张卡时卡片更宽，用 6 列，免得一排方块孤零零的 */
.board.is-solo .links {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px 10px;
  border-radius: 14px;
  text-decoration: none;
  transition: background .16s ease;
}

.link:hover { background: rgba(255, 255, 255, .05); }

/* 删除键：只在自定义模式下才由 main.js 生成，平时 DOM 里根本没有它们 */
.link-del,
.card-del {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: var(--muted);
  font: inherit;
  font-size: .95rem;
  line-height: 1;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}

.link-del {
  position: absolute;
  right: 6px;
  top: 5px;
  width: 20px;
  height: 20px;
}

.card-del {
  flex: none;
  width: 20px;
  height: 20px;
  font-size: .85rem;
}

.link-del:hover,
.link-del:focus-visible,
.card-del:hover,
.card-del:focus-visible {
  background: rgba(255, 100, 100, .22);
  color: #ffb4b4;
}

/* 「＋ 添加」 */
.add-link {
  width: 100%;
  margin-top: 6px;
  padding: 7px;
  border: 1px dashed var(--line-2);
  border-radius: 11px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: .83rem;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}

.add-link:hover {
  color: var(--brand-ink);
  border-color: var(--brand);
  background: rgba(52, 211, 153, .06);
}

/* 「＋ 新建卡片」那张虚线卡片 */
.card-new {
  display: grid;
  place-items: center;
  min-height: 116px;
  border-style: dashed;
  border-color: var(--line-2);
  background: rgba(255, 255, 255, .012);
  color: var(--muted);
  font: inherit;
  font-size: .88rem;
  cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}

.card-new:hover {
  color: var(--brand-ink);
  border-color: var(--brand);
  background: rgba(52, 211, 153, .05);
}

/* 卡片里的内联表单（加链接 / 建卡片） */
.edit-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  padding: 11px;
  border: 1px solid var(--line-2);
  border-radius: 13px;
  background: rgba(0, 0, 0, .22);
}

.edit-form input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, .05);
  color: var(--text);
  font: inherit;
  font-size: .86rem;
  outline: none;
  transition: border-color .16s ease;
}

.edit-form input:focus { border-color: var(--brand); }
.edit-form input::placeholder { color: #8aa79a; }

.edit-row { display: flex; gap: 8px; }

.edit-btn {
  flex: 1;
  padding: 7px;
  border: 0;
  border-radius: 9px;
  background: var(--brand);
  color: #04231a;
  font: inherit;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter .16s ease;
}

.edit-btn:hover { filter: brightness(1.08); }

.edit-btn.ghost {
  background: rgba(255, 255, 255, .07);
  color: var(--muted);
  font-weight: 400;
}

.edit-btn.ghost:hover { color: var(--text); }

.ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 15px;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;
  transition: background .16s ease, color .16s ease;
}

.link:hover .ico {
  background: rgba(52, 211, 153, .22);
  color: #a7f3d0;
}

.link-name {
  max-width: 100%;
  font-size: .76rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 卡片列表里「＋ 添加」那行、页脚里当按钮使的链接 */
.linkish {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: color .16s ease;
}

.linkish:hover { color: var(--brand-ink); }

/* ---------- 页脚 ---------- */

.foot {
  position: relative;
  z-index: 1;
  margin-top: 42px;
  /* 底下这截是给 iPhone 的横条留位置，别让页脚被它压住 */
  padding: 28px 0 calc(36px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .015);
}

.foot-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 56px;
}

.foot-brand {
  flex: 1 1 260px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  align-content: flex-start;
}

.foot-brand .logo { color: var(--brand); }

.foot-brand b { font-size: 1rem; }

.logo {
  display: inline-flex;
  align-items: center;
}

.logo svg { width: 24px; height: 24px; display: block; }

.foot-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: .84rem;
  color: var(--muted);
}

.foot-col h3 {
  margin: 0 0 2px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
}

.foot-col a {
  text-decoration: none;
  transition: color .16s ease;
}

.foot-col a:hover { color: var(--brand-ink); }

/* 页脚最底下那行备案号（ICP / 公安）。工信部的要求是：可点击、能跳到 beian.miit.gov.cn，
   所以它必须是个真链接，别做成纯文字。公安备案官方要求「图标 + 号 + 链接」三样都有。 */
.foot-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 18px;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: .76rem;
  line-height: 1.5;
  letter-spacing: .01em;
}

.foot-legal a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  text-decoration: none;
  transition: color .16s ease;
}

/* 公安备案的徽标：原图 36×40，缩到 20px 宽（高度等比），和文字垂直居中 */
.foot-legal img {
  display: block;
  width: 20px;
  height: auto;
  flex: none;
}

.foot-legal a:hover { color: var(--brand-ink); }

/* ---------- 小屏 ---------- */

@media (max-width: 640px) {
  /* 手机上左右各收 8px，内容能多占一点宽度 */
  .wrap { padding: 0 16px; }
  .hero { padding: 38px 16px 14px; }
  .wordmark { margin-bottom: 18px; }
  .search { padding: 15px 16px 12px; border-radius: 20px; }
  .search-foot { flex-wrap: wrap; }
  .board { padding-top: 26px; }
  /* 手机上就是 5 列（is-solo 时的 6 列在这里太挤） */
  .board.is-solo .links { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .foot-inner { gap: 22px 40px; }
  /* 页脚那几个链接是纯文字，手机上高度只有二十来像素，点起来费劲 —— 补触摸区 */
  .foot-col a { padding: 8px 0; }
  /* 备案号那行字更小，同样补触摸区 */
  .foot-legal { margin-top: 20px; }
  .foot-legal a { padding: 8px 2px; }

  /* 联想条目在手机上要按得到 */
  .sug-item { padding: 12px; min-height: 44px; }

  /* 热榜卡头现在有 4 个 tab（含 AI热榜），窄屏塞不进「tabs + 更新于」一行 ——
     让 tab 那排独占一行、更新时间落到第二行右侧，别把 AI热榜 挤到第二行和更新时间错位 */
  .card-hot .card-head { flex-wrap: wrap; row-gap: 2px; }
  .card-hot .hot-tabs { flex: 1 1 100%; }
  .card-hot .card-note { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
  /* html 上有 .force-motion 时不匹配 —— 那是 main.js 给 ?motion=1 加的逃生开关 */
  html:not(.force-motion) * { transition: none !important; animation: none !important; }
}
