/**
 * 页脚基础样式
 * @package Westlife
 * @version 1.0.1
 */

/*--------------------------------------------------------------
>>> 左：版权+备案+状态点｜中：统计｜右：6个图标一行
--------------------------------------------------------------*/
.site-footer {
  background: var(--color-background);
  border-top: 1px solid var(--color-border);
  margin-top: 0.1rem;
}
.footer-bottom { padding: 16px 0; }
.footer-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* 三列同一行（不换行） */
.footer-credits--split {
  display: flex;
  align-items: center;            /* 三列垂直居中 */
  justify-content: space-between; /* 左中右拉开 */
  gap: 1rem 1.25rem;
  flex-wrap: nowrap;              /* 关键：整行不换行 */
  width: 100%;
}
.footer-credits--split > * { min-width: 0; } /* 防止子项溢出 */

/* 左列：内部上下两行（版权一行 + 备案/状态一行） */
.footer-left {
  flex: 0 0 auto;                 /* 按内容宽度 */
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.footer-left .footer-copy {
  color: var(--color-text);
  font-size: .95rem;
  white-space: nowrap;
}
.footer-left .footer-copy a {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
}
.footer-left .footer-copy a:hover { color: var(--color-primary); }

.footer-meta-small {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .45rem .55rem;
  color: var(--color-text-light);
  font-size: .82rem;
}

/* 备案信息（小胶囊） */
.footer-left .icp-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .35rem;
}
.footer-left .icp-info a {
  display: inline-flex;
  align-items: center;
  gap: 6px;                         /* 统一为 6px，避免与后文重复冲突 */
  padding: .12rem .4rem;
  font-size: .68rem;
  background: var(--color-background);
  color: var(--color-text-light);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  opacity: .8;
  transition: all .2s ease;
  text-decoration: none;
}
.footer-left .icp-info a:hover {
  opacity: 1;
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

/* 状态绿点（轻微脉冲） */
.status-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16,185,129,.45);
  display: inline-block;
  position: relative; top: 1px;
  animation: status-pulse 1.6s ease-out infinite;
  transition: transform .2s ease, filter .2s ease;
}
.status-dot:hover { transform: scale(1.15); filter: brightness(1.05); }
@keyframes status-pulse {
  0% { box-shadow: 0 0 0 0 rgba(16,185,129,.45); }
  70% { box-shadow: 0 0 0 10px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* 中列：统计（可压缩，必要时横向滚动） */
.site-footer .footer-center {
  flex: 1 1 auto;                 /* 中列拉伸 */
  display: flex;
  justify-content: center;
  min-width: 160px;               /* 避免被压没 */
}
.site-footer .footer-center .site-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: 0; margin: 0; list-style: none;
  flex-wrap: nowrap;               /* 一排 */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.site-footer .footer-center .site-stats::-webkit-scrollbar { display: none; }
.site-footer .footer-center .stat-item {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  padding: .26rem .6rem;
  font-size: .88rem;
  color: var(--color-text-light);
  background: var(--color-background-light);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  white-space: nowrap;
  transition: all .2s ease;
}
.site-footer .footer-center .stat-item i {
  color: var(--color-primary);
  font-size: .95em;
  transition: color .2s ease, transform .2s ease;
}
.site-footer .footer-center .stat-item:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,47,167,.18);
}
.site-footer .footer-center .stat-item:hover i {
  color: #fff;
  transform: translateY(-1px);
}

/* 右列：仅图标（6个一行不换行，靠最右） */
.footer-right {
  flex: 0 0 auto;                 /* 按内容宽度 */
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: .6rem;
  text-align: right;
  margin-left: auto;              /* 推到最右 */
  overflow: visible;
}
.footer-right .info-icons {
  z-index: 1;
  display: flex;
  flex-wrap: nowrap;              /* 关键：不换行，避免5+1 */
  justify-content: flex-end;
  align-items: center;
  gap: .6rem;
  list-style: none;
  padding: 0; margin: 0;
  white-space: nowrap;            /* 双保险不换行 */
}
.footer-right .info-icons li { flex: 0 0 auto; }
.footer-right .info-icon {
  width: 32px;
  height: 32px;
  box-sizing: border-box;         /* 外尺寸含边框 => 正好 32×32 */
  aspect-ratio: 1 / 1;            /* 双保险：宽高比为 1 */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  background: var(--color-background-light);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  overflow: hidden;               /* 裁切内部，确保圆边界干净 */
  line-height: 0;                 /* 消除基线影响，图标精确居中 */
  transform-origin: center center;/* 放大以中心为轴 */
  transition: transform .18s ease, box-shadow .18s ease,
             background .18s ease, color .18s ease, border-color .18s ease;
  text-decoration: none;
}
.footer-right .info-icon i { font-size: 18px; line-height: 1; }
.footer-right .info-icon:hover {
  transform: translateY(-2px) scale(1.08);
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  border-radius: 50%;             /* 悬浮保持正圆 */
  box-shadow: 0 6px 14px rgba(0,47,167,.18);
}

/* 右侧图标：统一尺寸与颜色（跟随 currentColor） */
.footer-right .info-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}
.footer-right .info-icon svg path {
  fill: currentColor !important;
}

/* 移动端：整块上下堆叠；右侧图标仍不换行，允许横向滑动 */
@media (max-width: 768px) {
  .footer-credits--split {
    flex-direction: column;
    align-items: flex-start;
    gap: .6rem;
  }
  .footer-center { justify-content: flex-start; }
  .footer-right { align-items: flex-start; text-align: left; }
  .footer-right .info-icons { overflow-x: auto; }
}

/* 深色模式 */
[data-theme="dark"] .site-footer { background: var(--color-background); }
[data-theme="dark"] .footer-center .stat-item,
[data-theme="dark"] .footer-right .info-icon,
[data-theme="dark"] .footer-left .icp-info a {
  background: var(--color-background);
  border-color: var(--color-border);
}

/* 页脚：站点名徽标默认高亮，悬浮仅放大 */
.footer-left .footer-copy .site-name-badge {
  display: inline-flex;
  font-family: "Source Han Serif CN","Tencent Sans","PingFang SC","Microsoft YaHei",serif;
  font-weight: 700;
  align-items: center;
  padding: .16rem .55rem;
  border: 1px solid var(--color-primary);
  border-radius: 6px;
  background: var(--color-primary);
  color: #fff;
  line-height: 1.2;
  box-shadow: 0 6px 14px rgba(0,47,167,.18);
  transition: transform .18s ease, box-shadow .18s ease,
              background .18s ease, color .18s ease, border-color .18s ease;
}
.footer-left .footer-copy .site-name-badge:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 18px rgba(0,47,167,.22);
}

/* 悬浮/焦点时仍保持白字，覆盖 .footer-left .footer-copy a:hover */
.footer-left .footer-copy a.site-name-badge,
.footer-left .footer-copy a.site-name-badge:visited { color: #fff; }
.footer-left .footer-copy a.site-name-badge:hover,
.footer-left .footer-copy a.site-name-badge:focus,
.footer-left .footer-copy a.site-name-badge:active { color: #fff; }

/* 深色模式与默认一致 */
[data-theme="dark"] .footer-left .footer-copy .site-name-badge {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* 页脚备案小图标统一尺寸与间距 */
.footer-left .icp-info svg.icon,
.footer-left .icp-info img.icon {
  width: 16px;
  height: 16px;
  display: inline-block;
}
/* 让 SVG 颜色跟随文字色，覆盖内联 fill 以保证可读性 */
.footer-left .icp-info svg.icon path { fill: currentColor !important; }

/*--------------------------------------------------------------
>>> 返回顶部按钮（FA 火箭图标：不放大不变色，悬浮仅火焰动态）
--------------------------------------------------------------*/
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 14px;
  background: transparent;
  color: var(--color-primary);         /* #002FA7 */
  border: 0;
  padding: 6px 8px;                    /* 可点击区域 */
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

/* 显示控制：兼容两种类名 */
.back-to-top.show,
.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
}

/* 图标：默认朝正上方；不随悬浮放大或变色 */
.back-to-top i {
  font-size: 28px;
  line-height: 1;
  opacity: .95;
  transform: rotate(-45deg);           /* 将 FA 火箭校正为正上方 */
  transition: opacity .2s ease;        /* 仅轻微透明度过渡 */
}

/* 悬浮：不改变颜色与尺寸，仅提升图标不透明度 */
@media (hover: hover) {
  .back-to-top:hover { color: var(--color-primary); }  /* 保持 #002FA7 */
  .back-to-top:hover i { opacity: 1; }
}

/* 键盘可访问性（增加兜底颜色） */
.back-to-top:focus-visible {
  outline: 2px solid rgba(var(--color-primary-rgb, 0,47,167), .6);
  outline-offset: 2px;
}

/* 火焰：默认隐藏，悬浮/聚焦时显示并动态闪烁 */
.back-to-top::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;                         /* 火箭底部下方 */
  transform: translateX(-50%) scaleY(0.9);
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 10px solid #f59e0b;   /* 橙色火焰 */
  filter: drop-shadow(0 0 3px rgba(245,158,11,.6));
  opacity: 0;
  pointer-events: none;
}

/* 悬浮/聚焦时仅火焰动态 */
@media (hover: hover) {
  .back-to-top:hover::after {
    opacity: 1;
    animation: rocket-flame .9s ease-in-out infinite alternate;
  }
}
.back-to-top:focus-visible::after {
  opacity: 1;
  animation: rocket-flame .9s ease-in-out infinite alternate;
}

/* 火焰闪烁动画 */
@keyframes rocket-flame {
  0%   { transform: translateX(-50%) scaleY(0.85); filter: drop-shadow(0 0 2px rgba(245,158,11,.5)); }
  50%  { transform: translateX(-50%) scaleY(1.1);  filter: drop-shadow(0 0 6px rgba(245,158,11,.8)); }
  100% { transform: translateX(-50%) scaleY(0.95); filter: drop-shadow(0 0 3px rgba(245,158,11,.6)); }
}

/* 移动端重写（≤768px）：消除错位，三列上下堆叠 */
@media (max-width: 768px) {
  .footer-bottom { padding: 14px 0; }

  /* 容器内边距兼容安全区 */
  .footer-inner {
    padding-left: calc(var(--container-padding) + env(safe-area-inset-left));
    padding-right: calc(var(--container-padding) + env(safe-area-inset-right));
  }

  /* 纵向排列，子项全宽 */
  .footer-credits--split {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: .6rem;
  }
  .footer-credits--split > * { width: 100%; min-width: 0; }

  /* 左列：上下两行紧凑排布 */
  .footer-left {
    flex: 0 0 auto;
    align-items: flex-start;
    justify-content: flex-start;
    gap: .4rem;
  }
  .footer-left .footer-copy {
    font-size: .92rem;
    white-space: normal;   /* 允许换行，避免挤压 */
    line-height: 1.4;
  }
  .footer-meta-small { font-size: .8rem; gap: .35rem .5rem; }

  /* 中列：统计横向滚动一行显示 */
  .site-footer .footer-center {
    justify-content: flex-start;
    min-width: 0;
    order: 3;              /* 可按需：放在最下；删掉此行则保持中间 */
  }
  .site-footer .footer-center .site-stats {
    gap: .45rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .site-footer .footer-center .site-stats::-webkit-scrollbar { display: none; }
  .site-footer .footer-center .stat-item {
    padding: .22rem .5rem;
    font-size: .84rem;
    flex: 0 0 auto;        /* 防止被压行 */
  }

  /* 右列：图标一行，不换行，横向滚动 */
  .footer-right {
    align-items: flex-start;
    text-align: left;
    margin-left: 0;
    order: 2;
  }
  .footer-right .info-icons {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: .5rem;
    max-width: 100%;
    padding-bottom: 2px;      /* 防止滚动条压住图标 */
    scrollbar-width: none;
  }
  .footer-right .info-icons::-webkit-scrollbar { height: 0; display: none; }
  .footer-right .info-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    line-height: 0;
  }
  .footer-right .info-icon i,
  .footer-right .info-icon svg { font-size: 16px; width: 16px; height: 16px; }

  /* 备案小胶囊与图标尺寸微调 */
  .footer-left .icp-info a { padding: .1rem .38rem; font-size: .7rem; }
  .footer-left .icp-info .icon { width: 16px; height: 16px; }

  /* 返回顶部按钮位置稍靠内侧（保留一次定义，移除重复） */
  .back-to-top { right: 14px; bottom: 14px; padding: 6px; }
}

/* 极窄屏（≤420px）再压缩图标尺寸，进一步避免顶开 */
@media (max-width: 420px) {
  .footer-right .info-icon { width: 28px; height: 28px; }
  .footer-right .info-icon i,
  .footer-right .info-icon svg { font-size: 15px; width: 15px; height: 15px; }
  .site-footer .footer-center .stat-item { font-size: .8rem; padding: .18rem .45rem; }
}