/* ============================================================
   基础层：reset / 排版 / 栅格 / 工具类
   排版原则：标题 semibold，正文 regular；行高宽松；中英阿混排不挤
   方向原则：布局用逻辑属性（inline-start/end），阿拉伯语 RTL 自动镜像
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--n-0);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  line-height: var(--lh-body);
  font-feature-settings: "cv05" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
  margin: 0;
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: -0.008em;
  color: var(--text);
}
h1 { font-size: var(--fs-38); }
h2 { font-size: var(--fs-22); }
h3 { font-size: var(--fs-16); }
h4 { font-size: var(--fs-14); }

p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; border-top: 1px solid var(--line); margin: 0; }

:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 2px;
  border-radius: 1px;
}

::selection { background: var(--blue-100); color: var(--blue-900); }

/* 滚动条：细、无圆角 */
* { scrollbar-width: thin; scrollbar-color: var(--n-300) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--n-300); border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--n-400); background-clip: content-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* 尊重系统「减少动态效果」设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------- 布局 ---------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: 28px;
}

.grid { display: grid; gap: var(--s4); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-7-5 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.g-8-4 { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
.g-3-9 { grid-template-columns: var(--rail-w) minmax(0, 1fr); }

.row { display: flex; align-items: center; gap: var(--s3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.col { display: flex; flex-direction: column; }
.wrapf { flex-wrap: wrap; }
.gap1 { gap: var(--s1); } .gap2 { gap: var(--s2); } .gap3 { gap: var(--s3); }
.gap4 { gap: var(--s4); } .gap5 { gap: var(--s5); } .gap6 { gap: var(--s6); }
.mt1 { margin-top: var(--s1); } .mt2 { margin-top: var(--s2); } .mt3 { margin-top: var(--s3); }
.mt4 { margin-top: var(--s4); } .mt5 { margin-top: var(--s5); } .mt6 { margin-top: var(--s6); }
.mt7 { margin-top: var(--s7); } .mb0 { margin-bottom: 0; }

/* ---------------------------- 文字工具 ---------------------------- */
.mono { font-family: var(--font-mono); font-size: 0.94em; letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; letter-spacing: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: var(--fs-13); line-height: var(--lh-snug); }
.xs { font-size: var(--fs-12); line-height: 1.6; }
.s { font-size: var(--fs-13); color: var(--muted); line-height: var(--lh-snug); }
.strong { font-weight: 600; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pre { white-space: pre-wrap; }

/* 小标签：只用字重与颜色区分层级，不做大写字距装饰 */
.eyebrow {
  font-size: var(--fs-12);
  line-height: 1.5;
  color: var(--muted);
  font-weight: 500;
}
.eyebrow-line {
  display: flex;
  align-items: center;
  gap: 10px;
}
.eyebrow-line::before {
  content: "";
  width: 20px;
  height: 1px;
  background: var(--n-300);
  flex-shrink: 0;
}

/* ---------------------------- 章节标题 ---------------------------- */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s4);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--s5);
}
.section-head h2 {
  font-size: var(--fs-28);
  letter-spacing: -0.018em;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.section-head h2 .idx {
  font-size: var(--fs-12);
  font-weight: 500;
  color: var(--n-500);
  font-variant-numeric: tabular-nums;
}
.section-head .more {
  font-size: var(--fs-13);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--t);
}
.section-head .more:hover { color: var(--blue-700); }

/* 分区标题（带说明的段落头） */
.block-head { margin-bottom: var(--s4); }
.block-head h2 { font-size: var(--fs-18); }
.block-head p { font-size: var(--fs-13); color: var(--muted); margin-top: 6px; max-width: 62em; }

/* 通用分隔线 */
.rule { height: 1px; background: var(--line); border: 0; }

/* ---------------------------- 响应式 ---------------------------- */
@media (max-width: 1080px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-7-5, .g-8-4 { grid-template-columns: minmax(0, 1fr); }
  .g-3-9 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .wrap { padding-inline: 18px; }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .hide-sm { display: none !important; }
  h1 { font-size: var(--fs-26); }
}

/* ---------------------------- RTL ---------------------------- */
[dir="rtl"] .eyebrow-line::before { order: 1; }
[dir="rtl"] .truncate { text-align: right; }
