/**
 * Shared Footer Styles — WenPill Series
 *
 * 通用页脚样式，支持亮色/暗色主题切换。
 * 零外部依赖，纯 CSS 实现。
 * 可选：Tailwind CSS（如果项目已引入 Tailwind，本文件中的基础类会被覆盖）。
 */

/* ══════════════════════════════════════════
   1. Footer 布局
   ══════════════════════════════════════════ */

.sf-footer {
  width: 100%;
  padding: 3rem 0;
  border-top: 1px solid #e2e8f0;
  background-color: #f8fafc;
  color: #334155;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
}

html.dark .sf-footer {
  border-top-color: #1e293b;
  background-color: #020617;
  color: #e2e8f0;
}

.sf-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 0 1.5rem;
  max-width: 80rem;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .sf-inner {
    padding: 0 2rem;
  }
}

/* ══════════════════════════════════════════
   2. 公告横幅
   ══════════════════════════════════════════ */

.sf-banner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 2rem;
  font-size: 0.875rem;
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

html.dark .sf-banner {
  background-color: rgba(30, 41, 59, 0.5);
  color: #94a3b8;
  border-color: rgba(51, 65, 85, 0.6);
}

.sf-banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #0ea5e9;
  flex-shrink: 0;
}

html.dark .sf-banner-dot {
  background-color: #38bdf8;
}

.sf-banner-icon {
  font-size: 18px;
  line-height: 1;
}

/* ══════════════════════════════════════════
   3. 底部行（品牌 + 主题切换）
   ══════════════════════════════════════════ */

.sf-bottom-row {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 768px) {
  .sf-bottom-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }
}

/* ── 品牌 ── */
.sf-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.125rem 0.5rem;
}

.sf-brand-name {
  display: inline-flex;
  align-items: baseline;
  font-size: 1.25rem;
  font-weight: 400;
  color: #0c4a6e;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 带图标时改为垂直居中：baseline 对齐会让图标底边贴在文字基线上、视觉偏高 */
.sf-brand-name.has-icon {
  align-items: center;
}

/* 品牌图标（圆角矩形）。尺寸用 em 跟随品牌字号，改字号时无需另调。
   同时禁止拖拽、选中与长按弹出菜单：它是装饰元素，不应可被拖动 */
.sf-brand-icon {
  width: 1.25em;
  height: 1.25em;
  flex: 0 0 auto;
  margin-right: 0.4em;
  border-radius: 0.3em;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.sf-brand-prefix {
  font-weight: 400;
}

.sf-brand-strong {
  font-weight: 700;
}

html.dark .sf-brand-name {
  color: #e0f2fe;
}

.sf-copyright {
  font-size: 0.875rem;
  font-weight: 400;
  color: #64748b;
}

html.dark .sf-copyright {
  color: #94a3b8;
}

.sf-author {
  color: #2196f3;
}

.sf-author-link {
  color: #2196f3;
  text-decoration: none;
  transition: opacity 0.2s;
}

.sf-author-link:hover {
  opacity: 0.8;
}

.sf-version {
  margin-left: 0.25rem;
  font-size: 10px;
  opacity: 0.4;
  user-select: none;
}

/* ══════════════════════════════════════════
   4. 主题切换按钮
   ══════════════════════════════════════════ */

.sf-toggle-wrap {
  width: 100%;
  display: flex;
  justify-content: flex-end;
}

@media (min-width: 768px) {
  .sf-toggle-wrap {
    width: auto;
  }
}

.sf-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-shrink: 0;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.85);
  color: #0f4c76;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 180ms ease;
}

.sf-toggle:active {
  transform: scale(0.96);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

.sf-toggle-icon {
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  line-height: 1;
}

.sf-toggle[data-theme="light"] [data-theme-icon="dark"],
.sf-toggle[data-theme="dark"] [data-theme-icon="light"] {
  display: inline-flex;
}

html.dark .sf-toggle {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(148, 163, 184, 0.38);
  color: #9dcfe8;
  box-shadow: 0 10px 20px rgba(2, 6, 23, 0.35);
}

/* ══════════════════════════════════════════
   5. 底部链接
   ══════════════════════════════════════════ */

.sf-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.5rem 2rem;
}

.sf-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s;
}

.sf-link:hover {
  color: #0284c7;
}

html.dark .sf-link {
  color: #64748b;
}

html.dark .sf-link:hover {
  color: #7dd3fc;
}

.sf-icon {
  line-height: 1;
}

.sf-link-icon {
  font-size: 14px;
}

/* ══════════════════════════════════════════
   6. 页面过渡动画（可选）
   ══════════════════════════════════════════ */

.sf-transition-enabled [data-site-footer] {
  opacity: 0;
}

.sf-transition-entering [data-site-footer],
.sf-transition-ready [data-site-footer] {
  transition: opacity 360ms cubic-bezier(0.22, 1, 0.36, 1) 60ms;
}

.sf-transition-ready [data-site-footer] {
  opacity: 1;
}

.sf-transition-exiting [data-site-footer] {
  transition: opacity 260ms ease-out 40ms;
  opacity: 0;
}

/* ══════════════════════════════════════════
   7. 无障碍
   ══════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .sf-transition-enabled [data-site-footer],
  .sf-transition-entering [data-site-footer],
  .sf-transition-ready [data-site-footer],
  .sf-transition-exiting [data-site-footer] {
    transition-duration: 0ms !important;
  }
}
