/* Layout: sticky site header, breadcrumb, article head, then a two-column body (sticky TOC + 720px reading column). Template regions are marked with [模板] comments. */
:root {
  --bg: #F2F4F3;
  --surface: #FFFFFF;
  --ink: #17222B;
  --muted: #55646E;
  --line: #D5DCDA;
  --accent: #0E6B58;
  --accent-ink: #FFFFFF;
  --tint: #E4EFEB;
  --signal: #A86F00;
  --font-display: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1619; --surface: #162025; --ink: #E7EEEC; --muted: #9AAAA8; --line: #2A383D;
    --accent: #3FBF9F; --accent-ink: #0B1A16; --tint: #17302B; --signal: #E2A83A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1619; --surface: #162025; --ink: #E7EEEC; --muted: #9AAAA8; --line: #2A383D;
  --accent: #3FBF9F; --accent-ink: #0B1A16; --tint: #17302B; --signal: #E2A83A;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: 1.85;
  padding-inline: 0;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 720px) { .wrap { padding-inline: 32px; } }

/* [模板] 站点头部 */
.site-head {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.site-head .wrap { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: .04em; }
.brand svg { flex: none; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav a { color: var(--ink); text-decoration: none; padding: 6px 12px; font-size: 15px; border-radius: 4px; }
.nav a:hover { background: var(--tint); }
.nav a[aria-current="page"] { color: var(--accent); font-weight: 700; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); font: 500 15px/1 var(--font-body);
  padding: 11px 18px; border-radius: 4px; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--tint); filter: none; }

/* 面包屑 */
.crumbs { font-size: 14px; color: var(--muted); padding-block: 22px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); }
.crumbs span[aria-hidden] { opacity: .6; }

/* 文章头 */
.article-head { padding-block: 20px 36px; display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 900px) { .article-head { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; } }
.kicker { font: 500 13px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 10px; }
.kicker i { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); display: inline-block; }
h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 5.2vw, 52px); line-height: 1.22; margin: 16px 0 18px; text-wrap: balance; letter-spacing: .01em; }
.byline { display: flex; gap: 6px 20px; flex-wrap: wrap; font-size: 14px; color: var(--muted); font-family: var(--font-mono); }
.byline b { color: var(--ink); font-weight: 500; }
.hero-fig { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 14px 14px 10px; min-width: 0; }
.hero-fig svg { display: block; width: 100%; height: auto; }
.hero-fig figcaption { font-size: 13px; color: var(--muted); padding: 8px 4px 0; }

/* 正文两栏 */
.body-grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); padding-block: 12px 56px; }
@media (min-width: 960px) { .body-grid { grid-template-columns: 220px minmax(0, 1fr); gap: 56px; } }
.toc { font-size: 15px; line-height: 1.5; }
.toc-inner { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); }
.toc h2 { font: 500 12px/1 var(--font-mono); letter-spacing: .14em; color: var(--muted); margin: 0 0 14px; text-transform: uppercase; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 7px 0 7px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--accent); border-left-color: var(--accent); font-weight: 500; }
@media (max-width: 959px) {
  .toc-inner { position: static; }
  .toc ol { display: flex; flex-wrap: wrap; gap: 6px 8px; border: 0; }
  .toc a { border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; margin: 0; background: var(--surface); }
  .toc a.on { background: var(--tint); }
}

article { min-width: 0; max-width: 720px; }
article p { margin: 0 0 1.1em; }
article h2 { font-family: var(--font-display); font-size: clamp(25px, 3.4vw, 32px); line-height: 1.35; margin: 2.1em 0 .6em; scroll-margin-top: 90px; text-wrap: balance; }
article h2:first-child { margin-top: 0; }
article h3 { font-family: var(--font-display); font-size: 22px; line-height: 1.4; margin: 2em 0 .5em; scroll-margin-top: 90px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
article h3 small { font: 500 12px/1 var(--font-mono); letter-spacing: .08em; color: var(--accent); background: var(--tint); padding: 5px 8px; border-radius: 3px; }
article ul { margin: 0 0 1.2em; padding-left: 1.25em; }
article li { margin-bottom: .35em; }
article li::marker { color: var(--accent); }
.lead { font-size: 19px; color: var(--ink); }
.def {
  margin: 0 0 1.6em; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 6px;
}
.def b { font: 500 12px/1 var(--font-mono); letter-spacing: .12em; color: var(--accent); display: block; margin-bottom: 8px; }
.def p { margin: 0; }

/* MES 视角框 */
.mes-note {
  margin: 1.2em 0 0; padding: 14px 18px; background: var(--tint); border-radius: 6px; font-size: 15.5px; line-height: 1.75;
}
.mes-note b { font: 500 12px/1 var(--font-mono); letter-spacing: .12em; color: var(--accent); margin-right: 8px; }

/* ISA-95 层级图 */
.isa { margin: 1.4em 0 .6em; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); overflow-x: auto; }
.isa-row { display: grid; grid-template-columns: 52px minmax(120px, 1fr) minmax(180px, 1.3fr); min-width: 520px; border-top: 1px solid var(--line); }
.isa-row:first-child { border-top: 0; }
.isa-row > div { padding: 12px 14px; line-height: 1.5; font-size: 15px; }
.isa-row .lv { font: 500 14px/1.5 var(--font-mono); color: var(--muted); border-right: 1px solid var(--line); display: flex; align-items: center; }
.isa-row .nm b { display: block; font-weight: 700; }
.isa-row .nm span { color: var(--muted); font-size: 13.5px; }
.isa-row .tech { color: var(--muted); font-size: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.isa-row .tech i { font-style: normal; font-size: 13px; border: 1px solid var(--line); border-radius: 3px; padding: 2px 8px; background: var(--bg); color: var(--ink); }
.isa-row.hot { background: var(--tint); }
.isa-row.hot .lv { color: var(--accent); font-weight: 500; }
.fig-cap { font-size: 13px; color: var(--muted); margin: 0 0 1.4em; }

/* 优势卡片 */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: 1.2em 0 1.6em; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 18px 18px 16px; min-width: 0; }
.kpi .tag { font: 500 12px/1 var(--font-mono); letter-spacing: .1em; color: var(--accent); }
.kpi h3 { margin: 10px 0 8px; font-size: 20px; display: block; }
.kpi p { font-size: 15px; line-height: 1.7; margin: 0 0 14px; color: var(--muted); }
.kpi .ex { font: 500 14px/1.4 var(--font-mono); color: var(--ink); border-top: 1px dashed var(--line); padding-top: 10px; font-variant-numeric: tabular-nums; }
.kpi .ex em { font-style: normal; color: var(--signal); }

/* FAQ */
details { border-top: 1px solid var(--line); }
details:last-of-type { border-bottom: 1px solid var(--line); }
summary { cursor: pointer; padding: 16px 28px 16px 0; font-weight: 500; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font: 400 22px/1.6 var(--font-mono); color: var(--accent); }
details[open] summary::after { content: "–"; }
details p { margin: 0 0 16px; color: var(--muted); font-size: 16px; }

/* 资源 */
.resources { background: var(--surface); border-block: 1px solid var(--line); padding-block: 48px; }
.resources h2 { font-family: var(--font-display); font-size: 26px; margin: 0 0 22px; }
.res-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.res { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); text-decoration: none; color: var(--ink); min-width: 0; }
.res:hover { border-color: var(--accent); }
.res .t { font: 500 12px/1 var(--font-mono); letter-spacing: .1em; color: var(--accent); }
.res b { font-size: 17px; line-height: 1.5; }
.res span:last-child { color: var(--muted); font-size: 14.5px; line-height: 1.7; }

/* 订阅 */
.cta { padding-block: 56px; }
.cta-box { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); align-items: center; background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: 28px 22px; }
@media (min-width: 760px) { .cta-box { grid-template-columns: minmax(0, 1fr) 168px; padding: 40px 44px; gap: 44px; } }
.cta-box h2 { font-family: var(--font-display); font-size: clamp(24px, 3.4vw, 32px); line-height: 1.35; margin: 0 0 10px; text-wrap: balance; }
.cta-box p { margin: 0 0 20px; opacity: .92; }
.cta-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.cta-box .btn { background: var(--accent-ink); color: var(--accent); border-color: var(--accent-ink); }
.cta-box .acct { font: 500 15px/1 var(--font-mono); padding: 11px 14px; border: 1px solid currentColor; border-radius: 4px; user-select: all; }
.qr {
  width: 168px; max-width: 100%; aspect-ratio: 1; background: var(--surface); color: var(--muted); border-radius: 6px;
  display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; line-height: 1.6;
  border: 2px dashed var(--line); padding: 12px; justify-self: start;
}

/* 页脚 */
footer { padding-block: 36px 48px; font-size: 14px; color: var(--muted); }
footer .wrap { display: flex; gap: 12px 28px; flex-wrap: wrap; justify-content: space-between; }
footer nav { display: flex; gap: 8px 20px; flex-wrap: wrap; }
footer a { color: var(--muted); }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ===== 多页站点补充 ===== */
.home-hero { padding-block: 36px 24px; display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 900px) { .home-hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 56px; } }
.home-hero .lead { font-size: 19px; max-width: 32em; margin: 0 0 24px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.section-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; margin: 44px 0 18px; }
.section-h h2 { font-family: var(--font-display); font-size: 26px; line-height: 1.4; margin: 0; }
.section-h a { font-size: 15px; }
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.card { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 20px 20px 18px; text-decoration: none; color: var(--ink); min-width: 0; }
.card:hover { border-color: var(--accent); }
.card .tag { font: 500 12px/1 var(--font-mono); letter-spacing: .1em; color: var(--accent); }
.card b { font-family: var(--font-display); font-size: 20px; line-height: 1.5; text-wrap: balance; }
.card .sum { color: var(--muted); font-size: 15px; line-height: 1.75; }
.card .meta { margin-top: auto; padding-top: 6px; font: 400 13px/1 var(--font-mono); color: var(--muted); }
.topic-banner { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); align-items: center; background: var(--tint); border-radius: 8px; padding: 26px 24px; margin-top: 40px; }
@media (min-width: 760px) { .topic-banner { grid-template-columns: minmax(0, 1fr) auto; padding: 32px 36px; } }
.topic-banner h2 { font-family: var(--font-display); font-size: 24px; line-height: 1.4; margin: 6px 0 8px; }
.topic-banner p { margin: 0; color: var(--muted); max-width: 36em; }
.article-head.plain { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
.article-head.cover-right .cover { align-self: start; }
.cover { margin: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--surface); min-width: 0; }
.cover img { display: block; width: 100%; height: auto; }
h1.long { font-size: clamp(26px, 4vw, 38px); }
.body-grid.single { grid-template-columns: minmax(0, 1fr); justify-items: start; }
.body-grid.single article { width: 100%; }
article .fig { margin: 1.8em 0; }
article .fig img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
article .fig figcaption { font-size: 13px; color: var(--muted); padding-top: 8px; }
article blockquote { margin: 1.4em 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--accent); color: var(--muted); }
article strong { font-weight: 700; }
.end-note { margin-top: 2.4em; padding-top: 1.2em; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.more { padding-bottom: 8px; }


.card-cover { aspect-ratio: 4 / 3; overflow: hidden; border-radius: 6px; background: var(--tint); margin-bottom: 4px; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.gallery { display: grid; gap: 28px; justify-items: center; margin: 8px 0 32px; }
.gallery figure { margin: 0; width: 100%; max-width: 760px; }
.feature { display: grid; gap: 20px; margin: 8px 0 8px; padding: 20px; background: var(--tint); border-radius: 12px; align-items: center; }
.feature .fcover { aspect-ratio: 4 / 3; overflow: hidden; border-radius: 8px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.feature .fcover img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.feature h2 { margin: 6px 0 10px; font-size: 24px; line-height: 1.35; }
.feature p { margin: 0 0 16px; color: var(--muted); }
@media (min-width: 760px) { .feature { grid-template-columns: 300px minmax(0, 1fr); padding: 24px; } }
.pdf-link { margin: 0 0 24px; }
.cgroup { margin: 40px 0 0; }
.cgroup h2 { font-size: 20px; margin: 0 0 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.cgroup h2 small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 10px; }
.gallery img { display: block; width: 100%; height: auto; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); background: #fff; }
.gallery figcaption { font-size: 13px; color: var(--muted); padding-top: 8px; text-align: center; }
.related-article { margin: 8px 0 32px; padding: 16px 20px; background: var(--tint); border-radius: 8px; }
.related-article a { font-weight: 600; }

.brand-logo { flex: none; width: 40px; height: auto; background: #fff; border-radius: 10px; padding: 3px; box-shadow: 0 0 0 1px var(--line); }
.qrs { display: flex; flex-wrap: wrap; gap: 14px; }
@media (min-width: 760px) { .cta-box { grid-template-columns: minmax(0, 1fr) 350px; } }
.cta-box .qr { width: 168px; max-width: 100%; aspect-ratio: auto; background: #fff; color: var(--ink); border: 0; padding: 8px 8px 6px; margin: 0; display: block; text-align: center; border-radius: 6px; justify-self: start; }
.cta-box .qr img { display: block; width: 100%; height: auto; }
.cta-box .qr figcaption { font-size: 13px; line-height: 1.6; padding-top: 4px; color: #3b4a45; }

.lang { font-size: 13px; font-weight: 600; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.lang:hover { border-color: var(--accent); color: var(--accent); }
article table { border-collapse: collapse; width: 100%; margin: 18px 0 22px; font-size: 15px; }
article th, article td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
article th { background: var(--tint); }
article blockquote { margin: 20px 0; padding: 4px 18px; border-left: 3px solid var(--accent); background: var(--tint); border-radius: 0 6px 6px 0; }
article blockquote p { margin: 10px 0; }
article .note, .about .note { color: var(--muted); font-size: 14px; }
article figcaption { font-size: 13px; color: var(--muted); padding-top: 6px; }
.en-contact a { font-weight: 600; }
.en-hero-note { color: var(--muted); font-size: 14px; margin-top: 14px; }
