/* ==========================================================================
   ABMM 官网 · 基础样式层 main.css
   设计目标：
   1) 内容优先 —— 全部正文写在 HTML 里，JS 只做增强，禁用 JS 页面依然完整可读
   2) 移动优先 —— 关键 CSS 体积 < 20KB，无外部字体/图标/CDN 依赖
   3) 无障碍 —— 语义标签、跳转链接、可见焦点、prefers-reduced-motion 降级
   主题令牌由 theme-a.css / theme-b.css 覆盖，本文件不含具体配色
   ========================================================================== */

/* ---------- 1. 令牌（中性兜底，两套主题都会覆盖） ---------- */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
               "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  --wrap: 1200px;
  --gutter: 24px;
  --radius-s: 8px;
  --radius-m: 14px;
  --radius-l: 22px;

  --step--1: clamp(0.82rem, 0.8rem + 0.1vw, 0.875rem);
  --step-0:  clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --step-1:  clamp(1.2rem, 1.12rem + 0.4vw, 1.4rem);
  --step-2:  clamp(1.45rem, 1.3rem + 0.75vw, 1.9rem);
  --step-3:  clamp(1.8rem, 1.5rem + 1.5vw, 2.6rem);
  --step-4:  clamp(2.2rem, 1.6rem + 3vw, 3.8rem);

  --lh-tight: 1.18;
  --lh-body: 1.75;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --dur: .28s;
}

/* ---------- 2. 重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: var(--lh-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, h5, h6 { margin: 0 0 .5em; line-height: var(--lh-tight); font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
a { color: var(--brand-1); text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
table { border-collapse: collapse; width: 100%; }
code, kbd, pre { font-family: var(--font-mono); font-size: .92em; }
small { font-size: var(--step--1); }
strong, b { font-weight: 700; color: var(--text-strong); }
::selection { background: var(--brand-1); color: #fff; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

/* ---------- 3. 无障碍工具 ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--brand-1); color: #fff; padding: 12px 20px; border-radius: 0 0 var(--radius-s) 0;
}
.skip-link:focus { left: 0; }
.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;
}

/* ---------- 4. 布局原语 ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--narrow { max-width: 820px; }
.section { padding: clamp(56px, 8vw, 112px) 0; position: relative; }
.section--soft { background: var(--bg-soft); }
.section--tight { padding-block: clamp(40px, 5vw, 64px); }
.grid { display: grid; gap: clamp(16px, 2vw, 28px); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.stack > * + * { margin-top: 1rem; }
.center { text-align: center; }
.mt-0 { margin-top: 0; }

/* ---------- 5. 排版组件 ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--step--1); font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--brand-2); margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }
.h-xl { font-size: var(--step-4); }
.h-lg { font-size: var(--step-3); }
.h-md { font-size: var(--step-2); }
.h-sm { font-size: var(--step-1); }
.lead { font-size: var(--step-1); color: var(--text-dim); max-width: 62ch; }
.lead--center { margin-inline: auto; }
.text-dim { color: var(--text-dim); }
.text-sm { font-size: var(--step--1); }
.mono { font-family: var(--font-mono); }
.gradient-text {
  background: linear-gradient(100deg, var(--brand-1), var(--brand-2) 55%, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.balance { text-wrap: balance; }

/* ---------- 6. 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: var(--step-0);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
              background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
  line-height: 1.2; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn--primary { background: linear-gradient(120deg, var(--brand-1), var(--accent)); color: #fff; box-shadow: 0 8px 24px -10px var(--brand-1); }
.btn--primary:hover { box-shadow: 0 14px 34px -12px var(--brand-1); }
.btn--ghost { border-color: var(--border); color: var(--text); background: var(--surface); }
.btn--ghost:hover { border-color: var(--brand-1); }
.btn--sm { padding: 9px 18px; font-size: var(--step--1); }
.link-arrow { font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.link-arrow::after { content: "→"; transition: transform var(--dur) var(--ease); }
.link-arrow:hover::after { transform: translateX(4px); }

/* ---------- 7. 徽标 / 标签 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px; font-size: var(--step--1); font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-dim);
}
.badge--brand { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-1); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

/* ---------- 8. 卡片 ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-m); padding: clamp(20px, 2.4vw, 30px);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
  position: relative; height: 100%;
}
.card:hover { border-color: var(--brand-line); box-shadow: 0 18px 40px -24px var(--shadow); }
.card h3 { font-size: var(--step-1); }
.card p:last-child { margin-bottom: 0; }
.card__icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-1); margin-bottom: 16px;
}
.card__icon svg { width: 22px; height: 22px; }

/* ---------- 9. 统计 ---------- */
.stat__num { font-size: var(--step-3); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.stat__label { color: var(--text-dim); font-size: var(--step--1); }

/* ---------- 10. 面包屑 ---------- */
.crumbs { font-size: var(--step--1); color: var(--text-dim); margin-bottom: 18px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs li + li::before { content: "/"; margin-right: 8px; opacity: .5; }
.crumbs a { color: var(--text-dim); }
.crumbs a:hover { color: var(--brand-1); }
.crumbs [aria-current="page"] { color: var(--text); }

/* ---------- 11. 页头导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg); border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px);
}
.site-header__inner { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 34px; height: 34px; flex: none; }
.nav { margin-left: auto; }
.nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.nav a {
  display: block; padding: 9px 14px; border-radius: 999px;
  color: var(--text-dim); font-weight: 500; font-size: var(--step-0);
}
.nav a:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); background: var(--brand-soft); }
.nav-toggle { display: none; }
.header-cta { display: none; }

/* ---------- 12. 页脚 ---------- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: clamp(40px, 5vw, 64px) 0 28px; font-size: var(--step--1); }
.footer-grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.site-footer h2, .site-footer h3 { font-size: var(--step-0); margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--text-dim); }
.site-footer a:hover { color: var(--brand-1); }
.footer-bottom {
  margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; color: var(--text-dim);
}
.friend-link { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- 13. 页面头（内页） ---------- */
.page-head { padding: clamp(40px, 6vw, 72px) 0 clamp(28px, 4vw, 48px); }
.page-head h1 { font-size: var(--step-3); margin-bottom: 12px; }
.page-head .lead { margin-bottom: 0; }

/* ---------- 14. 正文排版（prose，用于长文/新闻详情） ---------- */
.prose { max-width: 74ch; }
.prose h2 { font-size: var(--step-2); margin-top: 1.8em; }
.prose h3 { font-size: var(--step-1); margin-top: 1.5em; }
.prose > *:first-child { margin-top: 0; }
.prose blockquote {
  margin: 1.5em 0; padding: 14px 20px; border-left: 3px solid var(--brand-1);
  background: var(--surface); border-radius: 0 var(--radius-s) var(--radius-s) 0; color: var(--text-dim);
}
.prose figure { margin: 1.6em 0; }
.prose figcaption { font-size: var(--step--1); color: var(--text-dim); margin-top: 8px; }
.prose ul li, .prose ol li { margin-bottom: .4em; }
.keytake {
  border: 1px solid var(--brand-line); background: var(--brand-soft);
  border-radius: var(--radius-m); padding: 20px 24px; margin: 1.6em 0;
}
.keytake h2, .keytake h3 { margin-top: 0; }

/* ---------- 15. 表格 ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-m); }
table { font-size: var(--step--1); }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--surface); font-weight: 700; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- 16. FAQ（AI 抽取友好：H3 问题 + 直接答案） ---------- */
.faq-item { border-bottom: 1px solid var(--border); padding: 20px 0; }
.faq-item:last-child { border-bottom: 0; }
.faq-item h3 { font-size: var(--step-1); margin-bottom: 8px; }
.faq-item h3::before { content: "Q "; color: var(--brand-1); }
.faq-item p:last-child { margin-bottom: 0; }
.faq-item a { color: var(--brand-1); font-weight: 600; }

/* ---------- 17. 文章条目（新闻/案例列表） ---------- */
.entry {
  display: grid; gap: 6px 20px; padding: 22px 0; border-bottom: 1px solid var(--border);
  grid-template-columns: 1fr;
}
.entry:last-child { border-bottom: 0; }
.entry h3 { font-size: var(--step-1); margin: 0; }
.entry h3 a { color: var(--text); }
.entry h3 a:hover { color: var(--brand-1); text-decoration: none; }
.entry__meta { color: var(--text-dim); font-size: var(--step--1); display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.entry__summary { color: var(--text-dim); margin: 0; }
@media (min-width: 720px) { .entry { grid-template-columns: 118px 1fr; } .entry__meta { flex-direction: column; align-items: flex-start; gap: 2px; } }

/* ---------- 18. 步骤 ---------- */
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 20px; }
.steps li { counter-increment: step; position: relative; padding-left: 58px; }
.steps li::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 2px;
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand-1); font-weight: 700; font-family: var(--font-mono);
  border: 1px solid var(--brand-line);
}
.steps h3 { font-size: var(--step-1); margin-bottom: 6px; }
.steps p:last-child { margin-bottom: 0; }

/* ---------- 19. 定义列表（实体/术语，AI 抽取友好） ---------- */
.deflist { margin: 0; display: grid; gap: 2px; }
.deflist dt { font-weight: 700; margin-top: 14px; }
.deflist dt:first-child { margin-top: 0; }
.deflist dd { margin: 4px 0 0; color: var(--text-dim); }

/* ---------- 20. 表格化的实体卡（用于"我们是谁"） ---------- */
.fact { display: grid; grid-template-columns: 120px 1fr; gap: 6px 16px; margin: 0; }
.fact dt { color: var(--text-dim); font-size: var(--step--1); }
.fact dd { margin: 0; }

/* ---------- 21. 动效：仅在 JS 可用时启用（html.js），禁用 JS 时内容直接可见 ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- 22. 响应式：导航折叠 ---------- */
@media (max-width: 900px) {
  :root { --gutter: 18px; }
  .nav-toggle {
    display: inline-grid; place-items: center; margin-left: auto;
    width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text); cursor: pointer; padding: 0;
  }
  .nav-toggle span { display: block; width: 18px; height: 2px; background: currentColor; position: relative; transition: background .2s; }
  .nav-toggle span::before, .nav-toggle span::after {
    content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor;
    transition: transform var(--dur) var(--ease);
  }
  .nav-toggle span::before { top: -6px; }
  .nav-toggle span::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] span { background: transparent; }
  .nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span::after { transform: translateY(-6px) rotate(-45deg); }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%; margin: 0;
    background: var(--header-bg-solid); border-bottom: 1px solid var(--border);
    display: none; padding: 12px var(--gutter) 20px;
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; gap: 2px; }
  .nav a { padding: 12px 14px; border-radius: var(--radius-s); }
  .site-header__inner { position: relative; }
  .header-cta { display: none; }
}
@media (min-width: 901px) { .nav-toggle { display: none; } }

/* ---------- 23. 打印 ---------- */
@media print {
  .site-header, .site-footer, .btn, .nav { display: none !important; }
  body { background: #fff; color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; color: #555; }
}
