/* =====================================================================
   导航站样式 —— 单栏居中，分类区块 + 按钮网格
   想改颜色：改下面的 :root 变量即可
   ===================================================================== */

:root {
  --bg: #f4f6fb;
  --card: rgba(255, 255, 255, 0.82);
  --text: #1d2330;
  --text-dim: #6b7280;
  --line: rgba(20, 25, 40, 0.10);
  --accent: #3b6ef6;
  --accent-2: #7a5cf0;
  --radius: 16px;
  --shadow: 0 6px 18px rgba(25, 35, 60, 0.08);
  --shadow-hover: 0 14px 30px rgba(25, 35, 60, 0.16);
}

/* ---------- 壁纸层：替换 assets/wallpaper.jpg 即可全局换图 ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: var(--wallpaper, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg);
}
body.has-wallpaper::after {
  background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.58));
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* =====================================================================
   页面容器：单栏居中
   ===================================================================== */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 34px 24px 60px;
}

/* =====================================================================
   分类区块
   ===================================================================== */
section.cat {
  margin-top: 30px;
}
section.cat:first-child { margin-top: 0; }

.cat-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 600;
}

.cat-title .count {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-dim);
}

/* =====================================================================
   按钮 / 卡片网格
   ===================================================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

a.link {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

a.link::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity .2s;
}

a.link:hover,
a.link:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(59, 110, 246, .35);
}

a.link:hover::before,
a.link:focus-visible::before { opacity: 1; }

a.link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

a.link .name {
  font-size: 16px;
  font-weight: 600;
  padding-right: 44px;
}

a.link .desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
}

a.link .tag {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: #fff;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
}

a.link .go {
  position: absolute;
  right: 16px;
  bottom: 14px;
  font-size: 13px;
  color: var(--accent);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .2s, transform .2s;
}
a.link:hover .go { opacity: 1; transform: translateX(0); }

/* 网址还没填的卡片：虚线框 */
a.link.pending {
  border-style: dashed;
  opacity: .82;
  cursor: help;
}
a.link.pending .go { display: none; }
a.link.pending:hover {
  transform: translateY(-2px);
  border-color: rgba(120, 130, 150, .45);
  box-shadow: var(--shadow);
}

/* =====================================================================
   页脚
   ===================================================================== */
footer {
  text-align: center;
  padding: 50px 0 0;
  font-size: 12.5px;
  color: var(--text-dim);
}

/* =====================================================================
   回到顶部
   ===================================================================== */
#to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  transform: translateY(8px);
  z-index: 30;
}
#to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
#to-top:hover { color: var(--accent); }

/* =====================================================================
   点击前的提示框
   ===================================================================== */
.tip-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 20, 35, .38);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.tip-mask.show { opacity: 1; pointer-events: auto; }

.tip-box {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 61;
  width: min(340px, calc(100vw - 48px));
  padding: 22px 22px 18px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(15, 25, 50, .28);
  transform: translate(-50%, -50%) scale(.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.tip-box.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.tip-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.tip-text {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dim);
  word-break: break-word;
}

/* 自动复制的状态提示 */
.tip-copy {
  display: none;
  margin: -8px 0 16px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.5;
  word-break: break-word;
}
.tip-copy.copied {
  display: block;
  color: #15803d;
  background: rgba(34, 197, 94, .12);
}
.tip-copy.failed {
  display: block;
  color: #b45309;
  background: rgba(245, 158, 11, .14);
}

.tip-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.tip-actions button {
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  transition: background .16s, border-color .16s;
}
.tip-actions button:hover { background: #f3f5fa; }

#tip-ok {
  border-color: transparent;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
}
#tip-ok:hover { filter: brightness(1.06); }

/* =====================================================================
   手机端
   ===================================================================== */
@media (max-width: 640px) {
  .page { padding: 20px 14px 60px; }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }
  a.link { padding: 13px 14px; }
  a.link .name { font-size: 15px; padding-right: 0; }
  a.link .go { display: none; }
  section.cat { margin-top: 24px; }

  footer { padding: 36px 0 0; }

  #to-top {
    right: 14px;
    bottom: 16px;
    width: 40px;
    height: 40px;
  }
}

/* 尊重系统「减少动画」设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
