/* ============================================================
   全站工具分类导航（由 docs/tool-nav/build.js 注入页面）
   依赖 css/style.css 的 :root 设计变量
   ============================================================ */

/* 分类小节标题（工具导航区块内） */
.tool-cat-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--gray-900);
  margin: 16px 0 8px;
  scroll-margin-top: 16px;
}

.links-section .tool-cat-title:first-of-type {
  margin-top: 4px;
}

.tool-cat-title small {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--gray-400);
  margin-left: 6px;
}

/* 首页头部分类快捷锚点 */
.tool-nav-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}

.tool-nav-chips a {
  display: inline-block;
  padding: 6px 14px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  color: var(--gray-700);
  text-decoration: none;
  font-size: 0.85rem;
  transition: all 0.15s;
}

.tool-nav-chips a:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #eef2ff;
}

/* 独立注入版（页面无 style.css 设计变量时用 var 回退值，如 beijing-time / time / tianqi） */
.tool-nav-standalone {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin: 20px auto;
  max-width: 1200px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  font-size: 16px;
}

.tool-nav-standalone h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--gray-900, #111827);
  margin: 0 0 4px;
}

.tool-nav-standalone .tool-cat-title {
  color: var(--gray-900, #111827);
}

.tool-nav-standalone .links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.tool-nav-standalone .links-grid a {
  display: block;
  padding: 10px 14px;
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 8px;
  color: var(--gray-700, #374151);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.15s;
}

.tool-nav-standalone .links-grid a:hover {
  border-color: var(--primary, #4f46e5);
  color: var(--primary, #4f46e5);
  background: #eef2ff;
}

/* ============================================================
   打赏按钮 + 弹窗（由 docs/tool-nav/build.js 随导航块注入）
   按钮定位在「工具导航」标题栏右侧，弹窗展示微信/支付宝赞赏码
   ============================================================ */

.links-section,
.tool-nav-standalone {
  position: relative;
}

.links-section .donate-btn,
.tool-nav-standalone .donate-btn {
  --donate-orange: #fb9639; /* 与 logo.psd 橙色一致 */
  position: absolute;
  top: 20px;
  right: 24px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  border: 1px solid var(--donate-orange);
  border-radius: 999px;
  background: #fff;
  color: var(--donate-orange);
  font-family: inherit;
  font-size: 0.85rem;
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.15s;
}

.links-section .donate-btn:hover,
.tool-nav-standalone .donate-btn:hover {
  background: var(--donate-orange);
  color: #fff;
}

.links-section .donate-btn svg,
.tool-nav-standalone .donate-btn svg {
  display: block;
}

.donate-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.donate-modal[hidden] {
  display: none;
}

.donate-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.donate-modal .donate-dialog {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px 24px;
  width: min(92vw, 560px);
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  text-align: center;
  animation: donate-in 0.18s ease-out;
}

@keyframes donate-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.donate-modal .donate-dialog h3 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--gray-900, #111827);
}

.donate-modal .donate-dialog > p {
  margin: 0 0 18px;
  font-size: 0.88rem;
  color: var(--gray-500, #6b7280);
}

.donate-modal .donate-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--gray-400, #9ca3af);
  font-family: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.donate-modal .donate-close:hover {
  background: var(--gray-100, #f3f4f6);
  color: var(--gray-700, #374151);
}

.donate-modal .donate-qr-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.donate-modal .donate-qr-row figure {
  margin: 0;
}

.donate-modal .donate-qr-row img {
  display: block;
  width: min(38vw, 210px);
  height: auto;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 12px;
}

.donate-modal .donate-qr-row figcaption {
  margin-top: 8px;
  font-size: 0.88rem;
  font-weight: 600;
}

.donate-modal .donate-qr-row .donate-wechat {
  color: #07c160;
}

.donate-modal .donate-qr-row .donate-alipay {
  color: #1677ff;
}

body.donate-open {
  overflow: hidden;
}

@media (max-width: 480px) {
  .donate-modal .donate-qr-row img {
    width: min(40vw, 180px);
  }

  .donate-modal .donate-dialog {
    padding: 24px 16px 20px;
  }
}
