@charset "utf-8";
/*!
 * 公众号文章静态化 —— 公共样式
 * 复刻微信公众号图文页基础样式（res.wx.qq.com / tencent_portfolio_light），
 * 保证静态页与公众号原文版式一致。
 *
 * 约定：
 * 1. 本文件是所有文章共用的基础样式，禁止写入任何单篇文章的私有样式；
 * 2. 单篇文章的私有样式写在各自 index.html 的 <style> 标签内；
 * 3. 修改本文件会影响全部已静态化的文章，改动前请确认。
 */

/* ========== 变量（对齐微信 :root） ========== */
:root {
  --articleFontsize: 17px;
  --appmsgPageGap: 20px;
  --new-title-color: rgba(0, 0, 0, .9);
  --new-content-color: rgba(0, 0, 0, .9);
  --weui-FG-0: rgba(0, 0, 0, .9);
  --weui-FG-1: rgba(0, 0, 0, .75);
  --weui-FG-2: rgba(0, 0, 0, .6);
  --weui-LINK: #576b95;
  --article-max-width: 677px;
}

/* ========== 页面骨架 ========== */
html {
  -webkit-text-size-adjust: 100%;
}

body.wx-article-page {
  margin: 0;
  padding: 0;
  background: #EDEDED;
  line-height: 1.6;
  letter-spacing: .034em;
  word-wrap: break-word;
  font-family: "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont,
    "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei UI",
    "Microsoft YaHei", Arial, sans-serif;
  color: rgba(0, 0, 0, .9);
}

.wx-article-page a {
  color: var(--weui-LINK);
  text-decoration: none;
}

/* ========== 顶部导航栏（与首页未登录状态一致，固定白底） ========== */
.site-header {
  width: 100vw;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99;
  /* 固定为首页滚动后的白色样式（不再使用顶部蓝色渐变） */
  background: #fff;
  box-shadow: 0 2px 4px 0 rgba(0,0,0,.05);
  padding: 10px 0;
  color: #333;
}

.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-sizing: border-box;
}

.site-header__left {
  display: flex;
  align-items: center;
}

.site-header__logo {
  display: block;
  margin-right: 50px;
}

.site-header__logo img {
  width: 120px;
  height: 60px;
  display: block;
}

.site-header__link {
  margin-right: 30px;
  cursor: pointer;
  color: #333;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s;
}

.site-header__link:hover {
  color: #00a8f3;
}

/* 右侧 */
.site-header__right {
  display: flex;
  align-items: center;
}

/* 小程序二维码触发 */
.site-header__qr-trigger {
  margin-right: 20px;
  cursor: pointer;
  color: #333;
  font-size: 15px;
  transition: color .2s;
}

.site-header__qr-trigger:hover {
  color: #00a8f3;
}

/* 登录按钮 */
.site-header__login-btn {
  display: inline-block;
  width: 90px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  background-color: #1997F4;
  border-radius: 4px;
  color: #fff !important;
  font-size: 14px;
  text-decoration: none;
  transition: background-color .2s, transform .2s;
}

.site-header__login-btn:hover {
  background-color: #00a8f3;
  transform: scale(1.1);
}

/* 推荐工具下拉（移动端） */
.site-header__dropdown-toggle {
  display: none;
  cursor: pointer;
  color: #333;
  font-size: 15px;
  align-items: center;
  gap: 4px;
}

.site-header__dropdown-toggle svg {
  vertical-align: middle;
}

.site-header__dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
  padding: 6px 0;
  min-width: 140px;
  z-index: 100;
}

.site-header__dropdown-menu.show {
  display: block;
}

.site-header__dropdown-item {
  display: block;
  padding: 8px 20px;
  color: #333;
  font-size: 14px;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}

.site-header__dropdown-item:hover {
  background-color: #f5f7fa;
  color: #00a8f3;
}

/* 二维码浮层 */
.site-header__qr-popover {
  display: none;
  position: absolute;
  top: 100%;
  right: 80px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,.12);
  padding: 16px;
  text-align: center;
  z-index: 100;
  min-width: 180px;
}

.site-header__qr-popover.show {
  display: block;
}

.site-header__qr-img {
  display: block;
  width: 150px;
  height: 150px;
  margin: 0 auto 10px;
}

.site-header__qr-tip {
  font-size: 12px;
  color: #909399;
  margin: 0;
}

/* 响应式：<=1023px 隐藏单独链接，显示下拉 */
@media screen and (max-width: 1023px) {
  .site-header {
    padding: 5px 15px;
  }

  .site-header__left .site-header__link:not(.site-header__logo) {
    display: none;
  }

  .site-header__dropdown-toggle {
    display: inline-flex;
  }

  .site-header__logo {
    margin-right: 20px;
  }

  .site-header__logo img {
    width: auto;
    height: 40px;
  }

  .site-header__login-btn {
    height: 35px;
    line-height: 35px;
    width: auto;
    padding: 0 14px;
  }
}

/* 正文卡片 */
.wx-article-area {
  max-width: var(--article-max-width);
  margin: 0 auto;
  padding: 88px var(--appmsgPageGap) 60px;
  background: #FFFFFF;
  min-height: 100vh;
}

/* ========== 标题 / 元信息 ========== */
.wx-article-title {
  font-size: 22px;
  line-height: 1.4;
  margin-bottom: 14px;
  font-weight: 500;
  color: var(--new-title-color);
}

.wx-article-meta {
  margin-bottom: 22px;
  line-height: 20px;
  font-size: 15px;
  color: var(--weui-FG-2);
}

.wx-article-meta__item {
  display: inline-block;
  vertical-align: middle;
  margin: 0 10px 10px 0;
}

.wx-article-meta__link {
  color: var(--weui-LINK);
}

/* ========== 正文（复刻 .rich_media_content） ========== */
.wx-article-content {
  color: var(--new-content-color);
  font-size: var(--articleFontsize);
  overflow: hidden;
  text-align: justify;
}

/* 微信全局重置：注意内联样式优先级更高，可覆盖这里的 margin/padding */
.wx-article-content * {
  margin: 0;
  padding: 0;
  max-width: 100% !important;
  box-sizing: border-box !important;
  -webkit-box-sizing: border-box !important;
  word-wrap: break-word !important;
}

.wx-article-content p {
  clear: both;
  min-height: 1em;
}

.wx-article-content em {
  font-style: italic;
}

.wx-article-content fieldset {
  min-width: 0;
}

.wx-article-content img {
  height: auto !important;
}

.wx-article-content table {
  table-layout: fixed !important;
}

.wx-article-content td,
.wx-article-content th {
  width: auto !important;
}

/* ========== 话题标签 ========== */
.wx-article-topics {
  margin: -2px 0 10px;
  line-height: 1;
}

.topic-tag {
  display: inline-block;
  margin: 0 8px 8px 0;
  padding: 5px 10px;
  border-radius: 4px;
  background: #EBF5FF;
  color: #1B7BD6;
  font-size: 13px;
  line-height: 1.4;
}

/* ========== 常见问题 Q&A ========== */
.wx-article-qa {
  margin: 40px 0 32px;
  padding: 24px 0.5em;
  border-top: 1px solid #EBEBEB;
  /* 注意：这里不要再加 border-bottom。Q&A 下方紧邻的 .wx-article-related 自带 border-top，
     两者叠加会在「Q&A 结束 → 相关阅读」之间出现两条中间没有任何内容的横线。
     只保留 .wx-article-related 的上边框作为唯一分隔线（该边框在无 Q&A 的页面也存在）。 */
  font-size: 16px;
  color: rgba(0, 0, 0, .9);
  overflow: hidden;
}

.wx-article-qa h2 {
  margin-bottom: 20px;
  font-size: 18px;
  font-weight: 700;
  color: rgba(0, 0, 0, .9);
}

.wx-article-qa .qa-item {
  margin-bottom: 16px;
  line-height: 1.75;
  text-align: justify;
}

.wx-article-qa .qa-q {
  font-weight: 700;
  margin-bottom: 4px;
}

.wx-article-qa .qa-a {
  color: rgba(0, 0, 0, .75);
}

/* ========== 公众号视频（已本地化，原生 <video> 直接播放） ========== */
/* 抓取时用无头浏览器打开原文，从网络请求里拿到真实 mp4 地址
   （mpvideo.qpic.cn/....f10002.mp4?...）并下载到 images/video.mp4，
   页面用原生 <video controls> 播放，不依赖微信播放器、不跳站外。
   工具：verifyFile/fetch_video_urls.js（抓地址）+ embed_wx_videos.py（下载+替换）。 */
.wx-article-video {
  margin: 26px auto;
  text-align: center;
}

/* 竖版短视频（教程演示多为手机录屏）限宽居中，避免占满整屏。
   注意：正文的微信全局重置里有 `max-width: 100% !important`（见 .wx-article-content *），
   这里必须用更高特异性 + !important 才能真正限宽。 */
.wx-article-content .wx-article-video--portrait {
  max-width: 280px !important;
}

/* 横版占满正文宽度 */
.wx-article-content .wx-article-video--landscape {
  max-width: 100% !important;
}

.wx-article-video__el {
  display: block;
  width: 100%;
  height: auto !important;
  max-height: 70vh;
  background: #000;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
  /* 微信视频封面图顶部自带约 0.9% 黑边，poster 按 cover 填充可把它顶出去 */
  object-fit: cover;
  object-position: center top;
}

.wx-article-video__cap {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: #8a8f99;
  text-align: center;
}

/* ---------- 兜底形态：封面卡片 ----------
   视频本地化（抓真实 mp4 → 下载 → <video>）失败时，页面会保留这一步的产物：
     <figure class="wx-video-card"><a><img 封面><span 播放按钮><span 角标></a><figcaption></figure>
   点击新窗口打开原公众号文章（微信内可播放）。样式必须保留，否则抓取失败时
   页面会掉样式。生成逻辑见 _tools/fetch_wx_article.py 的 localize_videos()。 */
.wx-video-card {
  margin: 26px auto;
  text-align: center;
}

.wx-article-content .wx-video-card--portrait {
  max-width: 280px !important;
}

.wx-article-content .wx-video-card--landscape {
  max-width: 100% !important;
}

.wx-video-card__link {
  position: relative;
  display: block;
  border-radius: 10px;
  overflow: hidden;
  line-height: 0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
  -webkit-tap-highlight-color: transparent;
}

.wx-video-card__cover {
  display: block;
  width: 100%;
  height: auto !important;
  /* 封面顶部自带约 0.9% 的黑边（视频帧比例补齐留下的），裁掉让卡片顶部干净 */
  clip-path: inset(0.9% 0 0 0);
}

.wx-video-card__play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .5);
  border: 2px solid rgba(255, 255, 255, .9);
  box-sizing: border-box;
}

.wx-video-card__play::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -12px 0 0 -5px;
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #fff;
}

.wx-video-card__hint {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 12px;
  line-height: 18px;
}

.wx-video-card__cap {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.6;
  color: #8a8f99;
  text-align: center;
}

/* ========== 页脚声明 ========== */
.wx-article-footer {
  max-width: var(--article-max-width);
  margin: 0 auto;
  padding: 0 var(--appmsgPageGap) 40px;
  background: #FFFFFF;
  font-size: 13px;
  color: var(--weui-FG-2);
  line-height: 1.8;
}

.wx-article-footer a {
  color: var(--weui-LINK);
}

.wx-article-origin {
  margin-top: 8px;
}

/* 「阅读原文」：仿公众号底栏的卡片式入口，点击跳转公众号原文 */
.wx-read-origin {
  display: inline-block;
  margin-top: 4px;
  padding: 7px 14px;
  border-radius: 4px;
  background: #F5F5F7;
  color: var(--weui-FG-2);
  font-size: 13px;
}

.wx-read-origin:hover {
  background: #EEEDEF;
  text-decoration: none;
}

/* ========== SEO / GEO 组件：面包屑 / 速览 / 目录 / 相关阅读 ========== */
/* 这些是站点自有区块（非公众号原文内容），改这里对所有文章生效 */

/* 面包屑：层级导航，帮助搜索引擎与 AI 判断页面归属 */
.wx-crumbs {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--weui-FG-2);
}

.wx-crumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  /* 清掉 ol 的浏览器默认左内边距（40px），否则面包屑会比正文内容整体右缩进 */
  margin: 0;
  padding: 0;
}

.wx-crumb + .wx-crumb::before {
  content: "›";
  margin-right: 6px;
  color: #C8C8CC;
}

.wx-crumb a {
  color: var(--weui-FG-2);
}

.wx-crumb a:hover {
  color: var(--weui-LINK);
}

.wx-crumb--current {
  color: var(--weui-FG-1);
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 本文速览（TL;DR）：开篇给结论，AI 摘要优先引用 */
.wx-article-summary {
  margin: 0 0 28px;
  padding: 16px 18px;
  border-left: 3px solid var(--weui-LINK);
  background: #F7F9FC;
  border-radius: 0 4px 4px 0;
  font-size: 15px;
  line-height: 1.75;
  scroll-margin-top: 88px;
}

.wx-summary__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--weui-FG-0);
  margin: 0 0 8px;
}

.wx-summary__lead {
  margin: 0;
  color: var(--weui-FG-1);
}

.wx-summary__list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--weui-FG-1);
}

.wx-summary__list li {
  margin: 4px 0;
}

/* 目录（TOC）：锚点导航，正文小标题由脚本自动加 id */
.wx-article-toc {
  margin: 0 0 28px;
  padding: 14px 18px;
  border: 1px solid #EBEBEB;
  border-radius: 4px;
  background: #FCFCFD;
  font-size: 14px;
  scroll-margin-top: 88px;
}

.wx-toc__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--weui-FG-0);
  margin: 0 0 8px;
}

.wx-toc__list {
  margin: 0;
  padding-left: 2px;
  list-style: none;
  color: var(--weui-FG-1);
}

.wx-toc__item {
  margin: 4px 0;
}

.wx-toc__item a {
  color: var(--weui-LINK);
}

.wx-toc__item--h3 {
  margin-left: 14px;
  font-size: 13px;
}

/* 正文小标题锚点跳转时，避免被固定顶栏遮住 */
.wx-article-content [id] {
  scroll-margin-top: 88px;
}

/* 相关阅读：站内互链 + 产品入口 */
.wx-article-related {
  margin: 40px 0 0;
  padding-top: 24px;
  border-top: 1px solid #EBEBEB;
  font-size: 15px;
}

.wx-related__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--weui-FG-0);
  margin: 0 0 12px;
}

.wx-article-related ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wx-related__item {
  margin: 0 0 10px;
  line-height: 1.6;
}

.wx-related__item a {
  color: var(--weui-LINK);
}

.wx-related__item a:hover {
  text-decoration: underline;
}

.wx-related__desc {
  display: block;
  font-size: 13px;
  color: var(--weui-FG-2);
}

/* ========== 移动端适配 ========== */
@media screen and (max-width: 767px) {
  :root {
    --article-max-width: 100%;
  }

  .wx-article-area {
    padding: 24px var(--appmsgPageGap) 40px;
  }

  .wx-article-title {
    font-size: 20px;
  }
}
