/* =============================================================
 * 线性图标基础样式 · icons.css
 * 配合 js/icons.js 使用。图标尺寸统一跟随所在元素的 font-size（1em），
 * 与原先 emoji 按字号渲染的行为保持一致，替换后版式不错位。
 * ============================================================= */

/* —— 基础：1em 方形 + 基线微调 + 不被 flex 压缩 —— */
svg.ic,
.ic {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  flex: none;
  stroke: currentColor;
  overflow: visible;
}

/* —— 与文字的间距：仅在图标后紧跟文字时补，避免与源码中已有的空格叠加 —— */
.btn > .ic:first-child,
.tag > .ic:first-child,
.badge > .ic:first-child,
.chip > .ic:first-child {
  margin-right: .38em;
}
.btn > .ic:last-child,
.tag > .ic:last-child {
  margin-left: .38em;
}

/* —— 标题 / 段落内图标：与文字基线对齐更紧 —— */
h1 > .ic, h2 > .ic, h3 > .ic, h4 > .ic,
.section-head .ic,
.cw-head .ic,
.msec-t .ic {
  vertical-align: -0.14em;
}

/* —— 实心色点：色卡语义（红/绿/蓝板块标识等），由 inline color 着色 ——
   需排在 .ic 之后，覆盖其 stroke: currentColor —— */
.ic-dot {
  fill: currentColor;
  stroke: none;
}

/* —— 纯图标容器（原来直接放 emoji 的容器）：居中并继承字号 —— */
.mc-icon, .hc-ic, .tt-ic, .st-icon, .arb-ico,
.yx-about-ic, .ba-empty-ico, .album-empty-ico,
.dz-ic, .rr-icon, .mc-ico, .wb-task-mark,
.avatar-cam, .lk-ic, .yx-eco-ic, .pbp-h,
.ph-block, .ph-float, .rank-no {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 纯图标容器内放大一档，弥补线性图标比实心 emoji 视觉更轻 */
.mc-icon > .ic,
.hc-ic > .ic,
.tt-ic > .ic,
.st-icon > .ic,
.yx-about-ic > .ic,
.mc-ico > .ic {
  width: 1.15em;
  height: 1.15em;
}

/* —— 头像回退图标（用户未上传头像时的占位）—— */
.avatar-sm .ic,
.avatar-lg .ic,
.avatar .ic {
  width: 55%;
  height: 55%;
  opacity: .72;
}

/* —— 减弱动效偏好：图标无动画，仅继承 —— */
@media (prefers-reduced-motion: reduce) {
  svg.ic, .ic { transition: none !important; animation: none !important; }
}
