/* 保持搜索框输入区域字体为默认 */
.md-search__input {
  font-family: inherit !important;
}

/* ============================================
   Transitions.dev — Card resize
   卡片尺寸调整动画
   ============================================ */
.t-resize {
  transition:
    width  300ms cubic-bezier(0.22, 1, 0.36, 1),
    height 300ms cubic-bezier(0.22, 1, 0.36, 1),
    max-width 300ms cubic-bezier(0.22, 1, 0.36, 1),
    max-height 300ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: width, height, max-width, max-height;
}

@media (prefers-reduced-motion: reduce) {
  .t-resize { transition: none !important; }
}

/* OneClip 公告栏样式 - 简约设计 */
.oneclip-announcement {
  background: linear-gradient(135deg, rgba(81, 143, 193, 0.06) 0%, rgba(81, 143, 193, 0.03) 100%);
  border: 1px solid rgba(81, 143, 193, 0.15);
  color: var(--md-default-fg-color);
  text-align: center;
  padding: 10px 20px;
  margin: -20px auto 50px auto;
  border-radius: 20px;
  /* 使用 clamp 让宽度随视口平滑变化：最小600px，理想90%，最大1200px */
  width: clamp(600px, 90%, 1200px);
  position: relative;
  transition: opacity 0.3s ease, transform 0.3s ease, max-height 0.3s ease, margin 0.3s ease, padding 0.3s ease, width 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* 公告栏关闭按钮 */
.oneclip-announcement-close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 22px;
  height: 22px;
  border: none;
  background: rgba(81, 143, 193, 0.1);
  color: var(--md-default-fg-color);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
  padding: 0;
  margin: 0;
}

.oneclip-announcement-close svg {
  display: block;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}

.oneclip-announcement-close:hover {
  background: rgba(81, 143, 193, 0.2);
  color: var(--md-primary-fg-color, #518FC1);
}

/* 已关闭的公告栏状态 */
.oneclip-announcement.is-closed {
  opacity: 0;
  transform: translateY(-20px);
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  overflow: hidden;
  pointer-events: none;
}

/* 暗色模式适配 */
[data-md-color-scheme="slate"] .oneclip-announcement {
  background: linear-gradient(135deg, rgba(81, 143, 193, 0.04) 0%, rgba(81, 143, 193, 0.02) 100%);
  border-color: rgba(81, 143, 193, 0.12);
}

.oneclip-announcement-content {
  font-size: 16px;
  line-height: 1.5;
}

/* 移动端：单行公告（OneClip 页面使用；首页多条公告在移动端已隐藏） */
@media (max-width: 767px) {
  .oneclip-announcement {
    width: calc(100% - 16px);
    padding: 12px 36px 12px 14px;
    margin-left: 8px;
    margin-right: 8px;
    margin-bottom: 12px;
    border-radius: 16px;
  }

  .oneclip-announcement-content {
    font-size: 14px;
    line-height: 1.55;
    text-align: left;
  }
  /* “了解更多”在窄屏单独成行，避免与主文案挤在一起断行混乱 */
  .oneclip-cta {
    display: block;
    margin-left: 0;
    margin-top: 4px;
    font-size: 13px;
    opacity: 0.9;
  }
}

/* 移动端隐藏首页顶部的多条活动公告栏（OneClip 页面的单行公告不受影响） */
@media (max-width: 767px) {
  .oneclip-announcement--top {
    display: none;
  }
}

.oneclip-announcement a {
  color: var(--md-primary-fg-color, #518FC1) !important;
  text-decoration: none;
  transition: opacity 0.2s;
  font-weight: 500;
}

.oneclip-announcement a:hover {
  opacity: 0.7;
}

.oneclip-cta {
  margin-left: 8px;
  text-decoration: none !important;
  display: inline;
}

/* 隐藏右侧目录滚动条，保留滚动功能 */
.md-sidebar--secondary .md-sidebar__scrollwrap {
  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* IE/Edge */
}

/* 友链页面：一键复制本站信息 */
.friend-info-copy {
  margin: 1rem 0 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(96, 141, 189, 0.2);
  background: linear-gradient(135deg, rgba(96, 141, 189, 0.04), rgba(96, 141, 189, 0.02));
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.friend-info-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.friend-info-label {
  min-width: 5.5rem;
  font-size: 0.9rem;
  color: var(--md-default-fg-color);
}

.friend-info-input {
  flex: 1;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  background-color: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-info-input:focus {
  outline: none;
  border-color: #608DBD;
  box-shadow: 0 0 0 1px rgba(96, 141, 189, 0.35);
}

.friend-info-copy-btn {
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: none;
  background-color: #608DBD;
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.friend-info-copy-btn:hover:not(.friend-info-copy-btn--copied) {
  background-color: #4b76a5;
  transform: translateY(-0.5px);
}

.friend-info-copy-btn:active:not(.friend-info-copy-btn--copied) {
  transform: translateY(0);
}

/* 复制成功状态 */
.friend-info-copy-btn--copied {
  background-color: #e3f7e9;
  color: #1a7f3b;
  box-shadow: 0 0 0 1px rgba(56, 142, 60, 0.2);
}

@media (max-width: 600px) {
  .friend-info-row {
    flex-direction: column;
    align-items: stretch;
  }

  .friend-info-copy {
    margin-left: 0;
    margin-right: 0;
  }

  .friend-info-label {
    min-width: auto;
  }

  .friend-info-copy-btn {
    /* 移动端直接隐藏复制按钮，避免布局挤压 */
    display: none;
  }
}

/* ============================================
   本文作者头像：悬浮轻微放大 + Transitions.dev Tooltip
   ============================================ */

/* Tooltip 动画变量 */
:root {
  --author-tt-in-dur: 150ms;
  --author-tt-out-dur: 50ms;
  --author-tt-scale: 0.98;
  --author-tt-delay: 80ms;
  --author-tt-in-ease: ease-out;
  --author-tt-out-ease: ease-out;
  --author-tt-bg: #ffffff;
  --author-tt-fg: #2f2f2f;
}

img.author-avatar {
  width: 28px;
  height: 28px;
  vertical-align: middle;
  transition: transform 0.25s ease;
  cursor: pointer;
}

img.author-avatar:hover {
  transform: scale(1.15);
}

/* 作者头像容器 */
.author-avatar-wrapper {
  position: relative;
  display: inline-block;
}

/* 作者名字 popover - Transitions.dev 样式 */
.author-name-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translate(-50%, 0) scale(var(--author-tt-scale));
  transform-origin: 50% 100%;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--author-tt-bg);
  color: var(--author-tt-fg);
  white-space: nowrap;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.06),
    0 2px 6px 0 rgba(0, 0, 0, 0.05),
    0 4px 42px 0 rgba(0, 0, 0, 0.06);
  opacity: 0;
  pointer-events: none;
  font-size: 0.85rem;
  font-weight: 500;
  /* 离开动画：无延迟，立即消失 */
  transition:
    opacity   var(--author-tt-out-dur) var(--author-tt-out-ease),
    transform var(--author-tt-out-dur) var(--author-tt-out-ease);
}

/* 悬停/聚焦时显示 - 进入动画带延迟 */
.author-avatar-wrapper:hover .author-name-popover {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  transition-duration: var(--author-tt-in-dur);
  transition-timing-function: var(--author-tt-in-ease);
  transition-delay: var(--author-tt-delay);
}

@media (prefers-reduced-motion: reduce) {
  .author-name-popover { transition: none !important; }
}

/* 暗色模式适配 */
[data-md-color-scheme="slate"] {
  --author-tt-bg: #1f2937;
  --author-tt-fg: #f3f4f6;
}




/* 目录导航的缩进参考线：仅二级及以上目录显示 */
nav.md-nav--secondary ul ul {
  border-left: 1px solid #B0B4BA;
}

/* 表格圆角与裁剪溢出（不带自定义 class 的标准表格） */
.md-typeset table:not([class]) {
  border-radius: 0.75rem;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

/* 移动端隐藏侧边栏按钮 */
/* @media screen and (max-width: 768px) {
  .md-sidebar-button {
    display: none !important;
  }
} */

/* 高亮行随长内容扩展，同时至少铺满代码块的可视宽度 */
/* .md-typeset .highlight .hll,
.md-typeset pre code .hll {
  display: block !important;
  width: max-content;
  min-width: 100%;
  box-shadow:
    2px 0 0 0 var(--md-code-hl-color) inset,
    0 0 0 1000vmax var(--md-code-hl-color--light);
  clip-path: inset(0 -1000vmax);
} */

/* Keep long desktop sidebars in document flow until Zensical constrains them. */
/* @media screen and (min-width: 76.25em) {
  html.js .md-sidebar:has(> .md-sidebar__scrollwrap:not([style*="height"])) {
    height: auto;
  }
} */
