#import "../../brand/colors.typ": *
#import "tailwind.typ": *

// 技术报告 · 主色 #3052c8
#let color-primary = rgb("#3052c8")
#let color-accent = color-primary
#let color-accent-surface = color-primary.lighten(88%)
#let color-heading = color-ink
#let color-caption = rgb(110, 110, 110)
#let color-quote = rgb(90, 90, 90)
#let color-code-inline = color-ink
#let color-page = white
#let color-block-bg = color.mix(
  (white, 20),
  (color-ink, 1),
  space: oklab,
)

#let code-token-keyword = color-ink
#let code-token-comment = rgb(130, 130, 130)
#let code-token-string = rgb(40, 40, 40)
#let code-token-number = rgb(70, 70, 70)
#let code-token-function = color-ink
#let code-token-operator = rgb(100, 100, 100)

// 字体：微软雅黑
#let report-font = ("Microsoft YaHei", "Microsoft YaHei UI")
#let heading-font = report-font
#let body-font = report-font
#let mono-font = report-font

// 正文（text-base · leading-normal）
#let size-body = text-base
#let leading-ratio = leading-normal
#let leading-body = size-body * leading-ratio - size-body

#let size-h1 = text-2xl
#let size-caption = text-sm

#let space-micro = tw(1)
#let space-block = tw(4)
#let space-section = tw(6)
#let space-chapter = tw(12)

#let image-max-width = 100%

#let code-block-fill = color-block-bg
#let code-block-radius = 0pt
#let code-inline-fill = color-block-bg

// --- 页面边距（A4 常用 2.5 cm）---
#let page-margin-a4 = 2.5cm
#let page-margin-x = page-margin-a4
#let page-margin-y = page-margin-a4

// --- 封面页边距（色块左贴边 · 上下等距）---
#let cover-margin-y = tw(8)
#let cover-margin-right = tw(8)
#let cover-content-inset = tw(11)
#let cover-footer-inset = cover-content-inset
#let cover-band-height = tw(24)
#let cover-header-est = cover-band-height
#let cover-footer-est = cover-band-height
#let cover-footer-line-gap-tight = tw(0.5)
#let cover-footer-line-gap = tw(0.75)
#let cover-footer-column-gap = tw(16)
#let cover-panel-right-gap = tw(24)
#let page-margin-cover = (
  top: cover-margin-y,
  bottom: cover-margin-y,
  left: 0pt,
  right: cover-margin-right,
)

// --- 封面（Proposal 色块布局 · 蓝色系）---
#let cover-bg = white
#let cover-text = color-ink
#let cover-text-muted = color-muted
#let cover-logo-size = tw(10)
#let cover-brand-size = text-base
#let cover-tagline-size = text-sm
#let cover-body-height = 25.7cm
#let cover-panel-gap-y = tw(6)
#let cover-header-gap = cover-panel-gap-y + cover-footer-est - cover-header-est
#let cover-below-gap = cover-panel-gap-y
#let cover-panel-fill = color-primary
#let cover-panel-height = cover-body-height - cover-header-est - cover-footer-est - cover-header-gap - cover-below-gap
#let cover-panel-inset-y = tw(18)
#let cover-panel-inset-bottom-y = tw(16)
#let cover-panel-text-gap = tw(4)
#let cover-panel-title-outer-gap = tw(5)
#let cover-panel-title-pull = -tw(8)
#let cover-quote-column-width = tw(40)
#let cover-panel-footer-rule-stroke = 2pt
#let cover-panel-meta-divider-width = 2pt
#let cover-panel-kicker = text-sm
#let cover-panel-kicker-color = white.transparentize(18%)
#let cover-panel-title-color = white
#let cover-panel-subtitle-color = white.transparentize(12%)
#let cover-panel-divider-color = white
#let cover-panel-accent-stroke = 3.5pt
#let cover-panel-line-color = white.transparentize(45%)
#let cover-panel-footer-line-color = white.transparentize(15%)
#let cover-panel-rule-width = tw(22)
#let cover-panel-meta-column-gap = tw(8)
#let cover-panel-author-size = text-base
#let cover-panel-role-size = text-sm
#let cover-panel-meta-size = text-sm
#let cover-panel-meta-label = text-xs
#let cover-panel-meta-color = white.transparentize(12%)
#let cover-quote-size = 16 * tw-rem
#let cover-quote-color = white.transparentize(8%)
#let cover-quote-clearance = cover-quote-column-width
#let cover-quote-offset-y = tw(0)
#let cover-panel-role-gap-before-line = tw(4)
#let cover-panel-meta-gap-after-line = tw(3)
#let cover-panel-footer-line-length = 78%
#let cover-footer-divider-height = tw(7.5)
#let cover-footer-label = text-sm
#let cover-footer-body = text-sm
#let cover-footer-note = text-xs
#let cover-footer-heading = color-ink
#let cover-footer-text = color-body
#let cover-footer-rule = color-muted.transparentize(55%)
#let size-cover-title = text-6xl
#let size-cover-title-line2 = text-7xl
#let size-cover-subtitle = text-lg

// --- 目录页 ---
#let toc-head-gap = tw(18)
#let toc-content-indent = tw(12)
#let summary-top-offset = tw(10)
#let summary-body-gap = tw(8)
#let toc-head-zh = text-4xl
#let toc-l2-color = color-muted.lighten(28%)
#let toc-head-color = toc-l2-color
#let toc-classification-label = "C3 Confidential"
#let toc-classification-size = text-xs
#let toc-classification-color = toc-l2-color
#let toc-classification-dx = -page-margin-x + tw(3)
#let toc-classification-dy = page-margin-y - tw(7)
#let toc-l1-number-width = tw(14)
#let toc-l1-number-title-gap = tw(11)
#let toc-l1-number-size = text-5xl
#let toc-l1-number-color = color-primary
#let toc-l1-size = text-base
#let toc-l2-size = text-sm
#let toc-page-size = text-sm
#let toc-l1-color = color-primary
#let toc-l1-leader-color = color-primary.lighten(22%)
#let toc-l2-leader-color = toc-l2-color.transparentize(35%)
#let toc-leader-dot-size = text-xs
#let toc-leader-gap = tw(0.5)
#let toc-l1-gap-above = tw(6)
#let toc-l1-gap-below = tw(2.5)
#let toc-l2-gap-above = tw(2.5)
#let toc-l2-gap-below = tw(2)
