/* ==========================================================================
   OpenDesign 版面对齐层 · 20261103
   --------------------------------------------------------------------------
   目的：把门户各页散落的边距、圆角、标题与眉标字号收敛到同一套标度。
   实测基线（1440px · 本机 Chromium，逐页 getComputedStyle 采样）：

     内容栏      x=100 / w=1240  —— 各页已一致，本层仅固化为令牌
     板块圆角    24 / 20 / 16 / 10 —— 收敛自 8、9、11、12、14、15、18、22
     板块间距    22px             —— 收敛自 20、22、24、72、118
     首屏内边距  50px             —— 收敛自 50、52、92
     板块内边距  40px             —— 收敛自 40、58
     区块标题    38px / 760 / -.035em —— 收敛自 36、38、40、42、54
     眉标        11px / .11em / 700  —— 收敛自 11、13px 与 .08、.12、.16em

   约束：
   1. 本层在 od-nav-flat.css 之后加载，只覆盖数值，不改变任何页面的信息层级与内容。
   2. 首页 Hero 画板（8px 外边距 / 1424px / 24px 圆角）由
      verify_opendesign_visual_alignment.js 守护，本层不触碰 .od-hero 的外边距与宽度。
   3. 需要与 od-system.css / pilot.css 中 html:root 级 !important 规则对抗处，
      选择器保持同等或更高特异性。
   ========================================================================== */

:root {
  /* 圆角四级标度 */
  --od-r-board: 24px;
  --od-r-panel: 20px;
  --od-r-card: 16px;
  --od-r-chip: 10px;

  /* 版面节奏 */
  --od-rail: 1240px;
  --od-board-gap: 22px;
  --od-board-pad: 40px;
  --od-hero-pad: clamp(28px, 3.5vw, 50px);

  /* 文字标度 */
  --od-fs-title: 38px;
  --od-title-weight: 760;
  --od-title-tracking: -0.035em;
  --od-fs-statement: 42px;
  --od-statement-weight: 800;
  --od-statement-tracking: -0.025em;
  --od-fs-kicker: 11px;
  --od-kicker-tracking: 0.11em;
}

/* --------------------------------------------------------------------------
   1. 内容栏：各页主栏统一为 1240px 居中
   -------------------------------------------------------------------------- */
html:root body.od-pilot .pilot-shell,
html:root body.od-service main,
html:root body.od-service .service-main,
html:root body.od-social main,
html:root body.od-social .social-main,
html:root body.od-architecture .arch-main,
html:root body.od-solution .solution-main,
html:root body.od-trace .trace-main,
html:root body.od-trace #resultContainer {
  width: min(100%, var(--od-rail)) !important;
  max-width: var(--od-rail) !important;
  margin-inline: auto !important;
}

/* 首页各业务板块统一收敛到 1240px 主轨（保留 .od-hero 1424px 作为满幅视觉门面） */
html:root body.lg-portal-theme #portal .od-hero-window.hero-media,
html:root body.lg-portal-theme #portal .od-stats-band.hero-stats,
html:root body.lg-portal-theme #portal .architecture-overview-section,
html:root body.lg-portal-theme #portal .od-statement,
html:root body.lg-portal-theme #portal .priority-platforms-section,
html:root body.lg-portal-theme #portal .opendesign-capabilities-section,
html:root body.lg-portal-theme #portal .opendesign-dock-wrap,
html:root body.lg-portal-theme .portal-footer .footer-inner {
  width: min(100%, var(--od-rail)) !important;
  max-width: var(--od-rail) !important;
  margin-inline: auto !important;
}

/* --------------------------------------------------------------------------
   2. 板块节奏：首屏 50 / 板块 40 / 板块间距 22
   -------------------------------------------------------------------------- */
html:root body.od-pilot .pilot-hero,
html:root body.od-service .hero,
html:root body.od-social .portal-hero,
html:root body.od-architecture .arch-hero,
html:root body.od-solution .solution-hero {
  padding: var(--od-hero-pad) !important;
  border-radius: var(--od-r-board) !important;
}

html:root body.od-pilot .scope-board,
html:root body.od-pilot .architecture-section,
html:root body.od-pilot .readiness-grid,
html:root body.od-pilot .data-boundary-section,
html:root body.od-service .section,
html:root body.od-social .six-rings-section,
html:root body.od-social .evidence-section,
html:root body.od-social .role-matrix,
html:root body.od-social .portal-modules,
html:root body.od-architecture .arch-section,
html:root body.od-architecture .arch-cta,
html:root body.od-solution .solution-section,
html:root body.od-solution .solution-cta {
  padding: var(--od-board-pad) !important;
}

html:root body.od-pilot .scope-board,
html:root body.od-pilot .architecture-section,
html:root body.od-pilot .readiness-grid,
html:root body.od-pilot .data-boundary-section,
html:root body.od-service main > .section,
html:root body.od-social .six-rings-section,
html:root body.od-social .evidence-section,
html:root body.od-social .role-matrix,
html:root body.od-social .portal-modules,
html:root body.od-architecture .arch-section,
html:root body.od-architecture .arch-cta,
html:root body.od-solution .solution-section,
html:root body.od-solution .solution-cta {
  margin-top: var(--od-board-gap) !important;
}

/* 运行监测左右两列的列间距与板块间距同源 */
html:root body.od-pilot .readiness-grid {
  gap: var(--od-board-gap) !important;
}

/* --------------------------------------------------------------------------
   3. 圆角四级标度
   -------------------------------------------------------------------------- */

/* 3.1 板块级 24px */
html:root body.od-page .pilot-hero,
html:root body.od-page .portal-hero,
html:root body.od-page .arch-hero,
html:root body.od-page .solution-hero,
html:root body.od-page .arch-cta,
html:root body.od-page .architecture-board,
html:root body.od-page .priority-platforms-section,
html:root body.od-page .portal-footer {
  border-radius: var(--od-r-board) !important;
}

/* 3.2 面板级 20px */
html:root body.od-pilot #workstreams .gate-board,
html:root body.od-page .release-board,
html:root body.od-page .workstream-board,
html:root body.od-page .scope-board,
html:root body.od-page .architecture-section,
html:root body.od-page .data-boundary-section,
html:root body.od-page .policy-panel,
html:root body.od-page .portal-copy,
html:root body.od-page .arch-window,
html:root body.od-page .arch-directory,
html:root body.od-page .arch-flow,
html:root body.od-page .solution-window,
html:root body.od-page .solution-section,
html:root body.od-page .solution-cta,
html:root body.od-page .od-hero-window,
html:root body.od-page .login-card {
  border-radius: var(--od-r-panel) !important;
}

/* 3.3 卡片级 16px */
html:root body.od-page .platform-card,
html:root body.od-page .boundary-card,
html:root body.od-page .shared-layer,
html:root body.od-page .workstream-list,
html:root body.od-page .workstream-card,
html:root body.od-page .gate-card,
html:root body.od-page .hero-copy,
html:root body.od-page .architecture-relations,
html:root body.od-page .service-card,
html:root body.od-page .op-feature-card,
html:root body.od-page .arch-directory-item,
html:root body.od-page .arch-principle,
html:root body.od-page .solution-outcome-card,
html:root body.od-page .solution-capability-card,
html:root body.od-page .solution-related-card,
html:root body.od-page .solution-stat-band,
html:root body.od-page .flow-card,
html:root body.od-page .timeline-accordion-card,
html:root body.od-page .quad-seal-card,
html:root body.od-page .priority-platform-card,
html:root body.od-page .architecture-summary,
html:root body.od-page .opendesign-dock,
html:root body.od-page .opendesign-cap-card,
html:root body.od-page .architecture-layer,
html:root body.od-page .architecture-domains,
html:root body.od-page .architecture-platform-layer {
  border-radius: var(--od-r-card) !important;
}

/* 平台门户页的"相关平台"卡在 od-portal-shell.css 中以四段选择器写成 18px，
   这里用同等特异性 + 后置加载收回卡片级。 */
html:root body.od-solution:not(.od-domain-solution):not(.od-shared-solution) .solution-related-card {
  border-radius: var(--od-r-card) !important;
}

/* 平台门户页的收束陈述带是无边框块，od-portal-shell.css 给了 72px 上边距；
   首屏内边距已收口到 50px，这里与其他板块共用同一间距令牌。 */
html:root body.od-solution:not(.od-domain-solution):not(.od-shared-solution) #related {
  margin-top: var(--od-board-gap) !important;
}

/* 通用卡片类名兜底（合同网签、工作台等页面的 .card） */
html:root body.od-page .card {
  border-radius: var(--od-r-card) !important;
}

/* 3.4 小块级 10px */
html:root body.od-page .platform-switch,
html:root body.od-page .hero-stats,
html:root body.od-page .hero-stat,
html:root body.od-page .service-status-strip,
html:root body.od-page .quick-search,
html:root body.od-page .arch-window-layer,
html:root body.od-page .arch-flow-node,
html:root body.od-page .record-counts div,
html:root body.od-page .login-proof,
html:root body.od-page .master-seal-container,
html:root body.od-page .voucher-summary-box,
html:root body.od-page .portal-stage-card,
html:root body.od-page .portal-mini-metric,
html:root body.od-page .architecture-platform-item {
  border-radius: var(--od-r-chip) !important;
}

/* --------------------------------------------------------------------------
   4. 标题两级标度
   4.1 区块标题 38px / 760 / -.035em（各页所有常规区块）
   4.2 收束陈述标题 42px / 800 / -.025em（页面结尾的深色陈述带）
   仅命中区块标题容器，不触及卡片内小标题与弹层标题。
   -------------------------------------------------------------------------- */
html:root body.od-page:not(.lg-dash-theme) :is(
  .section-heading,
  .section-head,
  .section-title,
  .title-area,
  .gate-head,
  .arch-section-head,
  .solution-section-head,
  .dispatch-copy,
  .policy-panel,
  .voucher-editorial-header,
  .login-card
) h2 {
  color: var(--od-ink, #262626);
  font-family: var(--od-font-display, "Albert Sans", sans-serif) !important;
  font-size: var(--od-fs-title) !important;
  font-weight: var(--od-title-weight) !important;
  line-height: 1.2 !important;
  letter-spacing: var(--od-title-tracking) !important;
}

html:root body.od-page:not(.lg-dash-theme) :is(
  .od-statement,
  .topics-header,
  .arch-cta,
  .solution-cta
) h2,
html:root body.od-solution:not(.lg-dash-theme) #related h2 {
  font-size: var(--od-fs-statement) !important;
  font-weight: var(--od-statement-weight) !important;
  letter-spacing: var(--od-statement-tracking) !important;
}

/* 深色板面上的标题改用纸面浅色，避免被上面的墨色规则压成不可读 */
html:root body.od-pilot #workstreams .gate-head h2,
html:root body.od-page .solution-cta h2,
html:root body.od-page .arch-cta h2 {
  color: #fdfff7 !important;
}

/* --------------------------------------------------------------------------
   5. 眉标 / 区块编号：11px / .11em / 700
   -------------------------------------------------------------------------- */
html:root body.od-page .eyebrow,
html:root body.od-page .section-index,
html:root body.od-page .release-kicker,
html:root body.od-page .section-kicker,
html:root body.od-page .kicker {
  font-size: var(--od-fs-kicker) !important;
  font-weight: 700 !important;
  letter-spacing: var(--od-kicker-tracking) !important;
}

html:root body.od-page .eyebrow,
html:root body.od-page .kicker {
  color: var(--od-muted, #595959) !important;
}

html:root body.od-page .section-index,
html:root body.od-page .release-kicker {
  color: var(--od-lime-deep, #218c00) !important;
}

/* 深色板面内的编号使用青柠本体 */
html:root body.od-pilot .gate-board .section-index,
html:root body.od-pilot .shared-layer .layer-label {
  color: var(--od-lime, #63fe13) !important;
}

/* --------------------------------------------------------------------------
   6. 全域门户首页（body.lg-portal-theme）
   首页 body 不带 od-page，上面的规则不会命中，这里按同一标度单独收口。
   注意：.od-hero 的 8px 外边距 / 1424px 宽度 / 24px 圆角由视觉门禁守护，不触碰。
   -------------------------------------------------------------------------- */

/* 6.1 区块标题并入 38px 标度 */
html:root body.lg-portal-theme :is(.section-head, .architecture-overview-head) h2 {
  font-size: var(--od-fs-title) !important;
  font-weight: var(--od-title-weight) !important;
  letter-spacing: var(--od-title-tracking) !important;
}

/* 6.2 眉标并入 11px / .11em / 700 */
html:root body.lg-portal-theme .eyebrow {
  font-size: var(--od-fs-kicker) !important;
  font-weight: 700 !important;
  letter-spacing: var(--od-kicker-tracking) !important;
}

/* 6.3 圆角四级标度 */
html:root body.lg-portal-theme .architecture-board,
html:root body.lg-portal-theme .priority-platforms-section,
html:root body.lg-portal-theme .portal-footer {
  border-radius: var(--od-r-board) !important;
}

/* 架构总览内部画板撑满 1240px 主轨，消除此前 1035px 内部收缩凹陷 */
html:root body.lg-portal-theme #portal .architecture-overview-section .architecture-board {
  width: 100% !important;
  max-width: none !important;
}

html:root body.lg-portal-theme :is(
  .priority-platform-card,
  .opendesign-dock,
  .opendesign-cap-card,
  .architecture-summary,
  .architecture-layer,
  .architecture-domains,
  .architecture-platform-layer
) {
  border-radius: var(--od-r-card) !important;
}

html:root body.lg-portal-theme :is(
  .portal-stage-card,
  .portal-mini-metric,
  .architecture-platform-item,
  .is-priority,
  .is-connected,
  .is-service,
  .is-extended
) {
  border-radius: var(--od-r-chip) !important;
}

/* --------------------------------------------------------------------------
   7. 社会化服务平台门户（/platform，body.od-platform）
   该页是系统入口页，元素多但同样需要落在四级圆角与首屏标度上。
   -------------------------------------------------------------------------- */
html:root body.od-platform .ops-hero {
  padding: var(--od-hero-pad) !important;
  border-radius: var(--od-r-board) !important;
}

html:root body.od-platform :is(.module-panel, .workspace, .system-entry-panel) {
  border-radius: var(--od-r-panel) !important;
}

html:root body.od-platform :is(.module-card, .terminal-panel, .risk-board, .table-wrap) {
  border-radius: var(--od-r-card) !important;
}

html:root body.od-platform :is(.terminal-metric, .table-toolbar-bar) {
  border-radius: var(--od-r-chip) !important;
}

/* 该页的指标小块多为无类名 article，统一收到小块级；带类名的卡片另行分级 */
html:root body.od-platform article:not([class]) {
  border-radius: var(--od-r-chip) !important;
}

html:root body.od-platform .login-panel {
  border-radius: var(--od-r-panel) !important;
}

html:root.dark body.lg-portal-theme #portal .od-btn-dark,
html:root.dark body.lg-portal-theme #portal .od-btn-dark:hover,
html:root.dark body.lg-portal-theme #portal .od-btn-dark:focus-visible {
  background: #171a15 !important;
  color: #fff !important;
}

html:root.dark body.lg-portal-theme #portal .od-btn-glass,
html:root.dark body.lg-portal-theme #portal .od-btn-glass:hover,
html:root.dark body.lg-portal-theme #portal .od-btn-glass:focus-visible {
  background: #f4f4f4 !important;
  color: #20231d !important;
}

html:root.dark body.lg-portal-theme #portal .od-hero-window .media-panel {
  background: #171915 !important;
}

html:root.dark body.lg-portal-theme #portal .od-hero-window .od-live {
  color: #262626 !important;
}

html:root.dark body.lg-portal-theme #portal .od-statement h2 {
  color: #f4f4f4 !important;
}

html:root.dark body.lg-portal-theme #portal .architecture-platform-item.is-lead {
  background: #20231d !important;
  color: #f4f4f4 !important;
}

html:root.dark body.lg-portal-theme #portal .architecture-platform-item.is-lead strong {
  color: #a8ef86 !important;
}

html:root.dark body.lg-portal-theme #portal .priority-status-pill.is-ready {
  color: #20231d !important;
  -webkit-text-fill-color: #20231d !important;
}

/* 首页平台卡快捷入口：暗色下提亮语义色，保证 12px 文本达到 4.5:1。 */
html:root.dark body.lg-portal-theme #portal .priority-quick-link.is-teal {
  color: #5eead4 !important;
}

html:root.dark body.lg-portal-theme #portal .priority-quick-link.is-amber {
  color: #fbbf24 !important;
}

html:root.dark body.lg-portal-theme #portal .priority-quick-link.is-violet {
  color: #c4b5fd !important;
}

html:root.dark body.od-solution .solution-cta {
  background: radial-gradient(48% 90% at 84% 12%, rgba(99, 254, 19, 0.12), transparent 70%), #20231d !important;
  color: #f4f4f4 !important;
}

html:root.dark body.od-solution .solution-btn.is-lime,
html:root.dark body.od-solution .solution-btn.is-lime:hover,
html:root.dark body.od-solution .solution-btn.is-lime:focus-visible {
  color: #20231d !important;
}

html:root.dark body.od-trace :is(.timeline-ring-title, .voucher-issuer-strip, .voucher-issuer-strip span, .voucher-issuer-strip b) {
  color: #e4e8df !important;
}

html:root.dark body.od-trace .flow-card-head .head-sub {
  color: #b7bdb2 !important;
}

html:root.dark body.od-trace .gm-type-badge.sm3 {
  color: #a6e693 !important;
}

html:root.dark body.od-trace .gm-pill-badge:not([style*="#fef2f2"]) {
  background: #e3f6df !important;
  color: #245c20 !important;
}

html:root.dark body.od-trace .gm-pill-badge:not([style*="#fef2f2"]) span {
  color: inherit !important;
}

html:root.dark body.od-trace .gm-type-badge.sm2 {
  color: #8fd5fa !important;
}

html:root.dark body.od-trace .quad-seal-role-tag {
  color: #ffad7a !important;
}
