/* =====================================================================
   宁夏3d云Info · 基础重置层 base.css（PC 端）
   ---------------------------------------------------------------------
   本文件是全站唯一的「重置 + 通用工具类」定义处。
   ★ 铁律：.fl / .fr / .clearfix / .container / 通配重置
     只允许在本文件定义一次，其他任何 CSS 文件禁止重复定义。
   ---------------------------------------------------------------------
   加载顺序：tokens.css → base.css → layout-flex.css → 页面专属CSS
   ===================================================================== */

/* ---------- 1. 最小化重置 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;   /* 全站统一盒模型，避免 width+padding 撑破容器 */
}

html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
}

body {
  background: var(--c-bg-page, #f5f7fa);
  font-size: var(--fs-base, 15px);
  color: var(--c-text-1, #1A1D21);
  /* 正文用思源黑体/苹方：易读优先，不使用艺术字体（对齐学术风规范） */
  font-family: var(--ff-body, "Source Han Sans SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif);
  line-height: var(--lh-base, 1.75);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 避免图片在 flex 容器内被拉伸 */
  min-width: 1200px;
}

/* 标题统一思源宋体：形成学术/权威的视觉层级 */
h1, h2, h3, h4 {
  font-family: var(--ff-title, "Source Han Serif SC", "Noto Serif SC", "Songti SC", serif);
  font-weight: var(--fw-semi, 600);
  letter-spacing: .2px;
}

/* 移动端不锁最小宽度 */
@media (max-width: 1199px) {
  body { min-width: 0; }
}

/* ---------- 2. 元素重置 ---------- */
em, i, q, cite { font-style: normal; font-weight: normal; }

dl, ol, ul, li { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  font-size: 100%;
  font-weight: normal;
}

input, button, textarea, select {
  vertical-align: middle;
  font-size: 100%;
  outline: none;
  border: 0;
  font-family: inherit;
}

input::placeholder, textarea::placeholder { color: var(--c-text-4, #bbb); }

table {
  border-collapse: collapse;
  border-spacing: 0;
}

img {
  border: 0;
  max-width: 100%;      /* 全局图片不超出容器 */
  height: auto;
  vertical-align: middle;
}

a {
  text-decoration: none;
  color: var(--c-text-1, #333);
  transition: color var(--trans-fast, 0.15s ease);
}
a:hover {
  text-decoration: none;
  color: var(--c-primary, #B8860B);
}

/* 键盘可访问性：可聚焦元素显示轮廓 */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--c-primary, #B8860B);
  outline-offset: 2px;
}

/* ---------- 3. 通用工具类（全站唯一定义处） ---------- */

/* 3.1 清除浮动 —— 统一 .clear / .clearfix 两种写法 */
.clear {
  clear: both;
  height: 0;
  overflow: hidden;
  font-size: 0;
  line-height: 0;
}
.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* 3.2 浮动工具（历史遗产，逐步迁移到 flex，但保留兼容） */
.fl { float: left; }
.fr { float: right; }

/* 3.3 主容器 —— 全站唯一宽度定义 */
.container {
  width: var(--w-page, 1200px);
  margin: 0 auto;
  box-sizing: border-box;
}
.container::before,
.container::after {
  content: " ";
  display: table;
  clear: both;
}

/* 3.4 常用宽度（原 news.css/v2_index.css 重复定义，收敛至此） */
.w200 { width: 200px; }
.w300 { width: 300px; }

/* 3.5 文本工具 */
.text-dark { color: var(--c-text-1, #333); }
.text-gray { color: var(--c-text-3, #999); }
.text-primary { color: var(--c-primary, #B8860B); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* 3.6 间距工具（统一 10px / 15px 两档节奏）
   ★ 用户需求：小类间隔 10px，大类间隔 15px
   命名：.mt-10 = margin-top:10px  .mb-15 = margin-bottom:15px */
.mt-10 { margin-top: var(--sp-gap-sm, 10px); }
.mt-15 { margin-top: var(--sp-gap-lg, 15px); }
.mb-10 { margin-bottom: var(--sp-gap-sm, 10px); }
.mb-15 { margin-bottom: var(--sp-gap-lg, 15px); }
.ml-10 { margin-left: var(--sp-gap-sm, 10px); }
.mr-10 { margin-right: var(--sp-gap-sm, 10px); }
.ml-15 { margin-left: var(--sp-gap-lg, 15px); }
.mr-15 { margin-right: var(--sp-gap-lg, 15px); }

.pt-10 { padding-top: var(--sp-gap-sm, 10px); }
.pt-15 { padding-top: var(--sp-gap-lg, 15px); }
.pb-10 { padding-bottom: var(--sp-gap-sm, 10px); }
.pb-15 { padding-bottom: var(--sp-gap-lg, 15px); }

/* 3.7 隐藏工具 */
.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;
}

/* 3.8 图片刚性容器 —— 用户需求1的核心实现
   用法：<div class="img-box ratio-16x9"><img src="..." alt=""></div>
   无论原图什么尺寸，都会等比缩放铺满/装入容器 */
.img-box {
  position: relative;
  overflow: hidden;
  background: var(--c-bg-hover, #f0f2f5);
  border-radius: var(--r-sm, 3px);
}
.img-box > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;      /* 铺满裁切，不变形 */
  object-position: center;
  transition: transform var(--trans-base, 0.3s ease);
}
/* 需要完整显示（不裁切）时加 .img-contain */
.img-box.img-contain > img {
  object-fit: contain;
}
/* 悬停放大效果（可选） */
.img-box.img-zoom:hover > img {
  transform: scale(1.05);
}

/* 比例容器：padding-top 百分比法，兼容性最好 */
.ratio-16x9  { padding-top: 56.25%; }  /* 16:9 */
.ratio-4x3   { padding-top: 75%; }     /* 4:3  */
.ratio-1x1   { padding-top: 100%; }    /* 1:1  */
.ratio-3x2   { padding-top: 66.67%; }  /* 3:2  */
.ratio-21x9  { padding-top: 42.86%; }  /* 21:9 */

/* 绝对定位的子元素（img 或 cover 层） */
.img-box > img,
.img-box > .img-fill {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

/* 3.9 侧栏 / 主列通用布局（替代各文件里的 float 写法） */
.layout-main-side {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-gap-lg, 15px);
}
.layout-main-side > .main-col {
  flex: 1;
  min-width: 0;            /* 关键：防止 flex 子项撑破 */
}
.layout-main-side > .side-col {
  width: 330px;
  flex-shrink: 0;
}

/* 屏幕阅读器专用（视觉隐藏但保留可访问性与 SEO 价值） */
.u-sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
