/* ==========================================================================
   GeekHonize 官网 · 站点专用样式
   （设计令牌与组件全部来自 @geekhonize/ui，这里只写本站在其之上的少量补充）
   ========================================================================== */

/* Hero 变体：交替底色 */
.gh-hero--alt {
  background: var(--gh-bg-alt);
}

/* 首屏文字在深色底上更易读 */
.gh-hero__media + .gh-hero__scrim {
  background: linear-gradient(
    100deg,
    color-mix(in srgb, var(--gh-bg) 92%, transparent) 0%,
    color-mix(in srgb, var(--gh-bg) 72%, transparent) 38%,
    color-mix(in srgb, var(--gh-bg) 24%, transparent) 100%
  );
}

/* 卡片占位封面：没有配图时用品牌色底，避免大片空白 */
.gh-work__cover {
  background: var(--gh-accent-subtle);
  letter-spacing: -0.03em;
}

/* 正文可读性：长文限制行宽 */
.gh-prose {
  max-width: 76ch;
}

/* ==========================================================================
   交互优先反馈：搜索提交中的即时反馈
   （提交瞬间输入框内转圈 + 内容区 data-gh-loading 淡出，由 site.js 委托触发）
   ========================================================================== */
.gh-search.is-searching::after {
  content: '';
  position: absolute;
  right: 0.85rem;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid var(--gh-border);
  border-top-color: var(--gh-accent);
  border-radius: 50%;
  animation: gh-site-spin 0.7s linear infinite;
}

.gh-search.is-searching .gh-input {
  padding-right: 2.2rem;
}

@keyframes gh-site-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gh-search.is-searching::after {
    animation-duration: 1.6s;
  }
}

.gh-container--narrow .gh-prose,
.gh-docmain .gh-prose {
  max-width: none;
}

/* 首页 Hero 在小屏下收紧 */
@media (max-width: 700px) {
  .gh-hero {
    min-height: 0;
    padding-block: var(--gh-s7);
  }
  .gh-hero__title {
    font-size: clamp(1.75rem, 1.2rem + 4vw, 2.5rem);
  }
  .gh-section-head h2 {
    font-size: var(--gh-fs-24);
  }
}

/* 页脚社交图标在浅色底上略深一点 */
.gh-footer__social a {
  color: var(--gh-fg-muted);
}

/* 搜索结果高亮路径 */
.gh-postlist__item .gh-mono {
  word-break: break-all;
}

/* 文档中心正文中的锚点偏移 */
.gh-docmain :is(h2, h3, h4) {
  scroll-margin-top: calc(var(--gh-header-h) + 1.5rem);
}

/* 长文阅读进度条（宽高与顶部加载指示条一致，避免软导航时两条互相顶动） */
.gh-readbar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--gh-accent);
  z-index: 205;
  pointer-events: none;
  transition: width 0.1s linear;
}
@media print {
  .gh-readbar {
    display: none;
  }
}

/* 打印时隐藏主题切换等交互件 */
@media print {
  .gh-theme-toggle,
  .gh-nav__actions,
  .gh-drawer,
  .gh-toasts {
    display: none !important;
  }
}
