/* ============================================================
   365Lab CSV 站点扩展样式（index / faq / guide / about /
   terms / privacy / tools 页通用）
   依赖 css/style.css 的 CSS 变量与深色模式
   ============================================================ */

/* ---------- 顶部导航条 ---------- */
.site-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  height: 60px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  transition: background-color var(--transition-slow);
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text);
  white-space: nowrap;
}
/* 顶栏图标改用 <img src="favicon.svg">，与浏览器标签页/桌面图标完全一致；img 需显式宽高 */
.site-brand .logo-icon { width: 26px; height: 26px; }
.site-brand .brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.site-brand .brand-sub { font-size: 0.75rem; font-weight: 400; color: var(--color-text-muted); letter-spacing: 0.2px; }
.site-brand:hover { text-decoration: none; }

/* 主导航靠右，与右侧操作按钮相邻 */
.site-nav { margin-left: auto; }
.site-nav ul {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: 0.92rem;
  line-height: 1.4;
  transition: background-color var(--transition), color var(--transition);
}
.site-nav a:hover { color: var(--color-link); background: var(--color-surface-hover); text-decoration: none; }
.site-nav a.active {
  color: var(--color-link);
  background: var(--color-primary-light);
  font-weight: 600;
  box-shadow: inset 0 0 0 1.5px var(--color-primary);
}

.site-actions { display: flex; align-items: center; gap: 6px; }
.site-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
}
.site-action-btn:hover { background: var(--color-surface-hover); color: var(--color-text); }
.site-lang-label { font-size: 0.8rem; width: auto; padding: 0 8px; white-space: nowrap; }

.nav-toggle { display: none; }

/* ---------- 页面主体容器 ---------- */
.site-container { max-width: 1000px; margin: 0 auto; padding: 32px 20px 48px; }
.site-container.wide { max-width: 1180px; }

/* ---------- 首页 Hero ---------- */
.site-hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 48px 24px 36px;
  background: linear-gradient(180deg, var(--color-surface), var(--color-bg));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
}
/* hero 柔光装饰：两团低透明度主色径向渐变，置于背景层、不覆盖文字，
   增强首屏层次感（pointer-events:none 不影响交互，绝对定位零 CLS） */
.site-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(420px 280px at 12% 0%, rgba(37, 99, 235, 0.07), transparent 70%),
    radial-gradient(380px 260px at 92% 10%, rgba(37, 99, 235, 0.05), transparent 70%);
  pointer-events: none;
  z-index: 0;
}
/* 抬升 hero 直接子元素，确保文字/控件始终位于柔光装饰层之上（绝对定位 ::before 默认会盖在静态内容上方） */
.site-hero > * { position: relative; z-index: 1; }
.site-hero h1 { font-size: 2.1rem; color: var(--color-text); margin-bottom: 12px; line-height: 1.3; }
.site-hero .hero-sub { color: var(--color-text-secondary); font-weight: 500; font-size: 1.05rem; max-width: 680px; margin: 0 auto 24px; }
/* hero 统计条：4 项关键数据，增强首屏说服力 */
.hero-stats {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 12px 32px;
  margin: 0 auto 24px;
  padding: 14px 20px;
  max-width: 620px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.hero-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 90px; }
.hero-stat .hs-num { font-size: 1.35rem; font-weight: 700; color: var(--color-link); line-height: 1.1; }
.hero-stat .hs-label { font-size: 0.78rem; color: var(--color-text-secondary); }
@media (max-width: 600px) {
  /* 4 项统计在窄屏下改成 2×2 网格，避免折成 3+1 不对称 */
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 12px 14px; }
  .hero-stat { min-width: 0; }
  .hero-stat .hs-num { font-size: 1.15rem; }
}
.site-hero .hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-badge {
  display: inline-block;
  margin-bottom: 16px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-primary-light);
  color: var(--color-link);
  font-size: 0.82rem;
  font-weight: 600;
}

/* ---------- 区块标题 ---------- */
.section-title {
  font-size: 1.35rem;
  color: var(--color-text);
  margin: 36px 0 18px;
  padding: 0 0 10px 14px;
  border-bottom: 2px solid var(--color-border);
  position: relative;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 50px; height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
}
.section-title .section-sub { display: block; font-size: 0.85rem; font-weight: 400; color: var(--color-text-muted); margin-top: 4px; }

/* ---------- 功能卡片 ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.feature-card {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  color: var(--color-text);
}
.feature-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--color-primary);
}
/* 标题行：图标与标题都左对齐 */
.feature-card .fc-head {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px;
  margin-bottom: 8px;
  color: var(--color-text);
  font-size: 1.02rem;
  font-weight: 600;
}
.feature-card .fc-head h3 { margin: 0; font-size: inherit; font-weight: inherit; line-height: 1.3; text-align: left; }
.feature-card .fc-icon { font-size: 22px; color: var(--color-link); flex-shrink: 0; line-height: 1; }
.feature-card p { font-size: 0.84rem; color: var(--color-text-secondary); line-height: 1.55; margin: 0; text-align: left; }
.feature-card p code {
  padding: 1px 5px; border-radius: var(--radius-sm);
  background: var(--color-surface-hover); border: 1px solid var(--color-border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

/* ---------- 信息步骤 / 列表 ---------- */
.step-list { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.step-list li {
  counter-increment: step;
  position: relative;
  padding: 12px 16px 12px 52px;
  margin-bottom: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
}
.step-list li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 14px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-list li strong { display: block; margin-bottom: 2px; }
.step-list li p { margin: 0; color: var(--color-text-secondary); font-size: 0.92rem; }

/* ---------- 长文排版（条款 / 隐私 / 指南 / FAQ） ---------- */
.prose { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 28px 32px; }
.prose h2 { font-size: 1.25rem; margin: 28px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--color-border); color: var(--color-text); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 1.05rem; margin: 20px 0 8px; color: var(--color-text); }
.prose p { margin: 8px 0; color: var(--color-text); line-height: 1.75; }
.prose ul, .prose ol { margin: 8px 0 8px 22px; line-height: 1.75; color: var(--color-text); }
.prose li { margin: 4px 0; }
.prose a { color: var(--color-link); }
/* 行内正文链接：用 padding + 负 margin 在不改变视觉排版的前提下，
   把可点击/触摸热区撑到 ≥24px，满足 WCAG 2.5.8（移动端更易点中） */
.prose a, .updated-note a { padding: 3px 4px; margin: -3px -4px; border-radius: var(--radius-sm); }
.prose a:hover, .updated-note a:hover { background: var(--color-surface-hover); text-decoration: none; }
.prose .muted { color: var(--color-text-secondary); font-size: 0.9rem; }
.updated-note { color: var(--color-text-muted); font-size: 0.85rem; margin-bottom: 12px; }

/* ---------- FAQ ---------- */
.faq-item { margin-bottom: 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-bg); overflow: hidden; }
.faq-item summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 600;
  color: var(--color-text);
  list-style: none;
  position: relative;
  padding-right: 40px;
  transition: background-color var(--transition), color var(--transition);
}
.faq-item summary:hover { background: var(--color-surface-hover); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--color-link);
  transition: transform var(--transition);
}
.faq-item[open] summary::after { content: "–"; }
.faq-item .faq-answer { padding: 0 16px 14px; color: var(--color-text-secondary); line-height: 1.7; }

/* ---------- 关于我们 ---------- */
.about-card { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.about-avatar {
  width: 84px; height: 84px; flex: 0 0 84px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-link);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
}
.about-meta { flex: 1; min-width: 240px; }
.about-meta h2 { margin: 0 0 6px; font-size: 1.3rem; }
.contact-list { list-style: none; padding: 0; margin: 0; }
.contact-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); margin-bottom: 10px; background: var(--color-bg); transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
.contact-list .c-icon { font-size: 20px; color: var(--color-link); }
.contact-list li:hover { border-color: var(--color-border-focus); box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.copy-email {
  user-select: all;
  font-weight: 600;
  color: var(--color-link);
  cursor: pointer;
  border: 1px dashed var(--color-primary);
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-light);
}
.copy-email:hover { background: var(--color-primary); color: #fff; }


/* ---------- Toast ---------- */
.site-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--color-text);
  color: var(--color-bg);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-slow), transform var(--transition-slow);
  z-index: 9999;
  box-shadow: var(--shadow-lg);
}
.site-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 统一页脚 ---------- */
/* 单行页脚：左侧版权与隐私说明，右侧站点链接 */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
  padding: 20px;
}
.site-footer .footer-inner {
  max-width: 1000px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px 28px;
}
.site-footer .footer-copy {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  line-height: 1.65;
}
.site-footer .footer-dot { margin: 0 7px; opacity: 0.45; }
.site-footer .footer-links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0; }
/* footer 链接触控目标达 24px（原 23px 差 1px 不达 WCAG AA） */
.site-footer a { color: var(--color-text-secondary); font-size: 0.82rem; transition: color var(--transition); display: inline-flex; align-items: center; min-height: 24px; }
.site-footer a:hover { color: var(--color-link); text-decoration: none; }

/* 窄屏：版权与链接改为上下居中堆叠（断点与站点其他响应式规则一致） */
@media (max-width: 900px) {
  .site-footer .footer-inner { flex-direction: column; align-items: center; text-align: center; gap: 12px; }
  .site-footer .footer-copy { text-align: center; }
}

/* ---------- 移动端 ---------- */
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-lg);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-slow);
  }
  .site-nav.open { max-height: 420px; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 16px; }
  .site-nav a { display: block; padding: 12px 8px; }
  .site-nav a.active { background: var(--color-primary-light); }
  .site-hero h1 { font-size: 1.6rem; }
  .site-container { padding: 20px 14px 36px; }
  .prose { padding: 20px 18px; }
  /* 窄屏下压缩语言切换标签，避免 "中文 / English" 折成两行 */
  .site-lang-label { font-size: 0.72rem; padding: 0 6px; }
  .site-topbar { padding: 0 12px; gap: 8px; }
  .site-brand { font-size: 0.95rem; }
  /* 窄屏下副标题再小一档，避免把顶部栏撑高（不低于 11px，否则不可读） */
  .site-brand .brand-sub { font-size: 0.7rem; }
}

/* ---------- 页脚互链 ---------- */
.footer-links { display: flex; flex-wrap: wrap; gap: 2px 18px; margin-bottom: 8px; }
.footer-links a { color: var(--color-text-secondary); font-size: 0.9rem; display: inline-flex; align-items: center; min-height: 24px; }
.footer-links a:hover { color: var(--color-link); text-decoration: none; }

/* ---------- 双语块显隐（无 JS 兜底：默认中文） ---------- */
.lang-zh { display: inline; }
.lang-en { display: none; }
/* html 上的标记由 <head> 内联脚本写入，早于首屏绘制，避免语言闪烁 */
html[data-lang="en"] .lang-zh,
body[data-lang="en"] .lang-zh { display: none; }
html[data-lang="en"] .lang-en,
body[data-lang="en"] .lang-en { display: inline; }
[hidden] { display: none !important; }

/* ---------- 无障碍：仅屏幕阅读器可见 / 跳转到主内容 ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 200;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: #fff;
  font-size: 0.9rem;
  transition: top var(--transition);
}
.skip-link:focus { top: 12px; color: #fff; text-decoration: none; }

/* ---------- 窄屏长串换行：邮箱 / 长 URL 不撑出横向滚动条 ---------- */
.prose,
.prose a,
.prose p,
.prose li,
.copy-email,
.contact-list,
.footer-copy,
.feature-card p,
.updated-note {
  overflow-wrap: anywhere;
}

/* ---------- 无 JS 提示 ---------- */
.noscript-notice {
  padding: 40px 20px;
  text-align: center;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--color-text);
}
.noscript-notice p { margin: 6px 0; }
