/* 618A 情报站 · 自定义 CSS · 1.9.15
   两个落点，内容必须逐字一致：
     ① 子主题 css/618a-article-extra.css —— 跟代码走，整包上传就带上
     ② 后台「主题设置 → 插入代码 → 自定义 CSS 样式」—— 老通道，仍保留
   ⚠ 后台那整框是「整段替换」的：框里原有的规则会被这段内容覆盖掉，所以凡是要
     长期生效的自定义样式都必须写在本文件里，不要单独往框里另加东西。
     实测 11-04：线上框里贴的是旧版（3903 字符），缺了第 0 节的 .site-h1，
     本地已是 5232 字符 ⇒ 注入通道会版本漂移，这就是要收进子主题的理由。
   ⚠ 本文件是全站生效的，不只文章页；下面按作用范围分节。
   ⚠ 本文件内不得出现标签字面量（会被主题的「标签嗅探」命中，见部署说明）。 */

/* 0. 站点头部 h1 —— 无障碍隐藏（全站）
   首页布局第一个组件是「自定义 HTML」，里面那句站点 slogan 是给搜索引擎看的 H1。
   它必须留在 DOM 里（删了就丢了首页 H1），但要视觉隐藏。
   用 sr-only 手法（1px + clip），不要用 display:none / visibility:hidden ——
   那会把屏幕阅读器和搜索引擎一起屏蔽掉。 */
.site-h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* 1. 正文目录卡片 */
.single-article__content .aerocore-toc-box {
  margin: 1.8em 0;
  padding: 14px 18px;
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius);
  background: var(--bg-secondary);
}

.single-article__content .aerocore-toc-box .widget-title {
  margin: 0 0 10px;
  padding: 0;
  border: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

.single-article__content .aerocore-toc-box .aerocore-toc {
  max-height: 320px;
}

/* 2. 清掉短代码留下的空段落
   段落式短代码经 WordPress 处理后会在块级元素旁留下悬空的 </p>/<p>，
   浏览器补全后形成空的 <p>，视觉上就是多余的空行。 */
.single-article__content p:empty {
  display: none;
}

@media (max-width: 640px) {
  .single-article__content .aerocore-toc-box {
    padding: 12px 14px;
  }

  .single-article__content .aerocore-toc-box .aerocore-toc {
    max-height: 220px;
  }
}

/* 3. 免费额度计算器（只在 /free-credit-calculator.html 出现）
   颜色只用主题已有的 CSS 变量，暗色切换由主题自动接管；
   四个状态色取中等亮度，深浅背景上都读得清。 */

.single-article__content .fc-calc-box {
  margin: 1.8em 0;
  padding: 16px 18px;
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius);
  background: var(--bg-secondary);
}

.single-article__content .fc-calc-box .widget-title {
  margin: 0 0 14px;
  padding: 0;
  border: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

.fc-calc__field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.fc-calc__field label {
  flex: 0 0 100%;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-primary);
  opacity: .72;
}

.fc-calc__field select,
.fc-calc__field input[type="number"] {
  flex: 1 1 auto;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  background: transparent;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.4;
}

.fc-calc__field input[type="range"] {
  flex: 1 1 180px;
  min-width: 0;
  accent-color: #2563eb;
}

.fc-calc__field output {
  flex: 0 0 auto;
  min-width: 4.5em;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  opacity: .72;
}

.fc-calc__summary {
  margin: 16px 0 12px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-primary);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-primary);
  opacity: .85;
}

.fc-calc__grid {
  display: grid;
  gap: 10px;
}

.fc-card {
  padding: 12px 14px;
  border: 1px solid var(--border-primary);
  border-left: 3px solid var(--border-primary);
  border-radius: 6px;
}

.fc-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.fc-card__name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-primary);
}

.fc-card__badge {
  flex: 0 0 auto;
  padding: 1px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.7;
  white-space: nowrap;
}

.fc-card__models {
  margin-bottom: 6px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-primary);
  opacity: .6;
}

.fc-card__detail {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-primary);
  opacity: .85;
}

.fc-card__note {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-primary);
  opacity: .6;
}

.fc-card.is-ok {
  border-left-color: #16a34a;
}

.fc-card.is-ok .fc-card__badge {
  color: #16a34a;
}

.fc-card.is-tight {
  border-left-color: #d97706;
}

.fc-card.is-tight .fc-card__badge {
  color: #d97706;
}

.fc-card.is-no {
  border-left-color: #dc2626;
}

.fc-card.is-no .fc-card__badge {
  color: #dc2626;
}

.fc-card.is-unknown .fc-card__badge {
  opacity: .45;
}

/* 1.9.15 手机适配：计算器与目录卡片在 375 宽下不撑破版心 */
@media (max-width: 640px) {
  .single-article__content .fc-calc-box {
    padding: 13px 14px;
  }

  .fc-card__head {
    flex-wrap: wrap;
  }

  .fc-calc__field,
  .fc-calc__card,
  .fc-card {
    min-width: 0;
    max-width: 100%;
  }

  .fc-calc__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .fc-card__badge {
    white-space: normal;
  }

  /* 正文里的表格自己横向滚，别把 .bs-page 撑宽 */
  .single-article__content table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
