/* ============================================================
   ARIFU 官网 V2 · 统一设计系统（design-system.css）
   依据《ARIFU 官网改版实施方案》第 3 章全站统一规范
   版本：V1.0 · 2026-08-16
   ============================================================ */

/* ---------- 1. 色彩变量（第 3.3 章，全站唯一一套） ---------- */
:root {
  --c-primary:        #0B3A5B;   /* 主色：顶栏 / H1 / 主按钮 */
  --c-primary-hover:  #082A43;   /* 主色悬停 */
  --c-accent:         #1F8A70;   /* 强调 / 正向结果（达标、节省、提升） */
  --c-warn:           #C47B17;   /* 注意（仅传统方案问题，不满页使用） */
  --c-page-bg:        #F6F8FA;   /* 页面底 / 隔段背景 */
  --c-card:           #FFFFFF;   /* 卡片 */
  --c-card-border:    #E4E8EC;   /* 卡片 1px 边框 */
  --c-text:           #1A1F24;   /* 正文（长文禁止用灰） */
  --c-text-muted:     #5B6773;   /* 辅助文字（图注、来源，对比度 ≥ 4.5:1） */
  --c-disabled:       #8A939C;   /* 禁用 / 即将（不进主卡片） */

  /* ---------- 2. 字号系统（第 3.2 章，Token 命名） ---------- */
  --h1:        clamp(28px, 4.5vw, 44px);
  --h1-w:      650;
  --h1-lh:     1.2;
  --h2:        clamp(22px, 3vw, 30px);
  --h2-w:      600;
  --h2-lh:     1.3;
  --h3:        clamp(17px, 2vw, 19px);
  --h3-w:      600;
  --h3-lh:     1.4;
  --lead:      clamp(15px, 1.8vw, 17px);
  --lead-w:    400;
  --lead-lh:   1.7;
  --body:      16px;
  --body-w:    400;
  --body-lh:   1.75;
  --meta:      13px;
  --meta-lh:   1.6;
  --stat:      clamp(32px, 5vw, 52px);
  --stat-w:    600;
  --stat-lh:   1.0;
  --stat-unit: 12px;
  --stat-unit-w: 500;
  --stat-unit-lh: 1.3;
  --nav:       14px;
  --nav-w:     500;
  --nav-lh:    1;
  --btn:       15px;
  --btn-w:     600;
  --btn-lh:    1;
  --foot:      12px;
  --foot-w:    400;
  --foot-lh:   1.5;

  /* ---------- 3. 栅格与间距（第 3.1 章） ---------- */
  --max-w:      1200px;   /* 内容最大宽度 */
  --gutter:     24px;     /* 左右边距（桌面 24–40px） */
  --sec-pad:    88px;     /* 区块上下内边距（桌面 80–96px） */
  --card-pad:   28px;     /* 卡片内边距（24–32px） */
  --radius:     10px;     /* 圆角（8–12px） */
  --body-measure: 700px;  /* 正文栏宽（680–720px） */

  /* ---------- 4. 按钮 ---------- */
  --btn-radius: 8px;
}

/* ---------- 移动端覆盖 ---------- */
@media (max-width: 768px) {
  :root {
    --gutter: 16px;
    --sec-pad: 56px;
    --card-pad: 22px;
  }
}

/* ============================================================
   基础重置
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  font-size: var(--body);
  font-weight: var(--body-w);
  line-height: var(--body-lh);
  color: var(--c-text);
  background: var(--c-card);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: var(--h2-w); color: var(--c-text); }

h1 { font-size: var(--h1); font-weight: var(--h1-w); line-height: var(--h1-lh); }
h2 { font-size: var(--h2); line-height: var(--h2-lh); }
h3 { font-size: var(--h3); line-height: var(--h3-lh); }

p { margin: 0; }

a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-hover); }

img { max-width: 100%; display: block; }

ul, ol { margin: 0; padding: 0; list-style: none; }

/* 正文标题前禁止 emoji 由内容层保证；此处不额外加伪元素装饰 */

/* ============================================================
   布局容器
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section { padding-top: var(--sec-pad); padding-bottom: var(--sec-pad); }
.section--alt { background: var(--c-page-bg); }

/* 正文栏（长文限宽，避免通栏） */
.prose { max-width: var(--body-measure); }

/* 两栏：左文右图 6/6，左 7 右 5 */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.grid-2--75 { display: grid; grid-template-columns: 7fr 5fr; gap: 40px; align-items: center; }

/* 三栏卡片：桌面 3 / 平板 2 / 手机 1 */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

@media (max-width: 992px) {
  .grid-2, .grid-2--75 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .grid-3 { grid-template-columns: 1fr; }
}

/* ============================================================
   卡片
   ============================================================ */
.card {
  background: var(--c-card);
  border: 1px solid var(--c-card-border);
  border-radius: var(--radius);
  padding: var(--card-pad);
}
.card h3 { margin-bottom: 12px; }
a.card { color: var(--c-text); display: block; }
a.card:hover { border-color: var(--c-primary); }

/* Hero 区块 */
.hero { padding-top: 72px; padding-bottom: 72px; }

/* 媒体占位（素材核查入库前的临时占位，正式上线前必须替换） */
.media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  background: var(--c-page-bg);
  border: 1px dashed var(--c-card-border);
  border-radius: var(--radius);
  color: var(--c-text-muted);
  font-size: var(--meta);
}
.hero-media .media-placeholder { min-height: 320px; }
.hero-media img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  object-fit: cover;
  display: block;
}

/* ============================================================
   按钮（第 3.4 章，全站只允许 3 种）
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: var(--btn);
  font-weight: var(--btn-w);
  line-height: var(--btn-lh);
  border-radius: var(--btn-radius);
  padding: 14px 28px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
  text-align: center;
}
.btn--primary {
  background: var(--c-primary);
  color: #fff;
}
.btn--primary:hover { background: var(--c-primary-hover); color: #fff; }
.btn--secondary {
  background: #fff;
  color: var(--c-primary);
  border-color: var(--c-primary);
}
.btn--secondary:hover { background: var(--c-page-bg); }
.btn--link {
  color: var(--c-primary);
  padding: 4px 0;
  gap: 4px;
  background: none;
  border: none;
}
.btn--link::after { content: "→"; }

/* ============================================================
   文字样式
   ============================================================ */
.lead { font-size: var(--lead); line-height: var(--lead-lh); color: var(--c-text); }
.meta { font-size: var(--meta); line-height: var(--meta-lh); color: var(--c-text-muted); }

/* 标签（12px，不得与 H2 抢权重） */
.tag {
  display: inline-block;
  font-size: 12px;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--c-page-bg);
  color: var(--c-text-muted);
  border: 1px solid var(--c-card-border);
}
.tag--status-verified { background: #e8f3ef; color: var(--c-accent); border-color: #cfe6dd; }
.tag--status-debug   { background: #fdf3e7; color: var(--c-warn); border-color: #f0dcbf; }
.tag--status-plan    { background: var(--c-page-bg); color: var(--c-text-muted); border-color: var(--c-card-border); }

/* 大数字（一屏最多 4 个） */
.stat {
  font-size: var(--stat);
  font-weight: var(--stat-w);
  line-height: var(--stat-lh);
  color: var(--c-text);
}
.stat__unit { font-size: var(--stat-unit); font-weight: var(--stat-unit-w); color: var(--c-text-muted); margin-left: 4px; }

/* 来源行（表格/数据下方必须带来源） */
.src { font-size: var(--meta); color: var(--c-text-muted); }

/* ============================================================
   表格
   ============================================================ */
table.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--c-card);
  border: 1px solid var(--c-card-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.data-table th, .data-table td {
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-card-border);
  font-size: 15px;
}
.data-table thead th {
  background: var(--c-page-bg);
  font-weight: 600;
  color: var(--c-text);
}
.data-table tr:last-child td { border-bottom: none; }

/* ============================================================
   顶栏（第 3.8 章）
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--c-card-border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.site-logo { font-size: 20px; font-weight: 700; color: var(--c-primary); }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav > li > a { font-size: var(--nav); font-weight: var(--nav-w); color: var(--c-text); }
.site-nav > li > a:hover { color: var(--c-primary); }
.header-cta { margin-left: 12px; }

/* 汉堡按钮（桌面隐藏） */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--c-text);
}

/* 移动端抽屉 */
.nav-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 280px;
  height: 100vh;
  background: #fff;
  box-shadow: -8px 0 24px rgba(0,0,0,.08);
  z-index: 300;
  padding: 72px 24px 24px;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.nav-drawer.is-open { transform: translateX(0); }
.nav-drawer nav { display: flex; flex-direction: column; gap: 8px; }
.nav-drawer nav a {
  font-size: 16px;
  font-weight: 500;
  padding: 12px 0;
  border-bottom: 1px solid var(--c-card-border);
  color: var(--c-text);
}
.nav-drawer nav a.btn { margin-top: 16px; border-bottom: none; justify-content: center; }

@media (max-width: 992px) {
  .site-nav { display: none; }
  .header-cta { display: none; }
  .nav-toggle { display: flex; }
}

/* ============================================================
   页脚（第 3.5 章，4 列）
   ============================================================ */
.site-footer {
  background: #0d1c28;
  color: #cbd5dc;
  font-size: var(--foot);
  line-height: var(--foot-lh);
  padding: 56px 0 32px;
}
.site-footer a { color: #cbd5dc; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.footer-col h4 { color: #fff; font-size: 14px; margin-bottom: 16px; }
.footer-col li { margin-bottom: 10px; }
.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #24303a;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  font-size: var(--foot);
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   视频播放器（第 3.7 章，统一皮肤）
   ============================================================ */
.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
}
.video-wrap video { width: 100%; height: 100%; object-fit: cover; }
.video-cover {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.video-cover img { width: 100%; height: 100%; object-fit: cover; }
.video-play {
  position: absolute;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
}
.video-meta {
  position: absolute;
  left: 12px; bottom: 12px;
  display: flex; gap: 8px; align-items: center;
}
.video-meta .tag { background: rgba(0,0,0,.6); color: #fff; border: none; }

/* ============================================================
   表单（第 3.4 章，三级意向）
   ============================================================ */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border: 1px solid var(--c-card-border);
  border-radius: var(--btn-radius);
  font-family: inherit;
  color: var(--c-text);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--c-primary);
}

/* ============================================================
   浮层（第 3.8 章：仅「联系」+「回顶」）
   ============================================================ */
.float-panel {
  position: fixed;
  right: 24px; bottom: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.float-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--c-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 12px rgba(11,58,91,.25);
  font-size: 20px;
}
.float-btn:hover { background: var(--c-primary-hover); }
.float-backtop { display: none; }  /* 滚动超 1.5 屏后由 JS 显示 */
.float-backtop.show { display: flex; }

/* ============================================================
   无障碍：对比度与焦点
   ============================================================ */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}
