:root {
  --ink: #111;
  --muted: #4c4c4c;
  --line: #d4d4d4;
  --soft: #f7f7f7;
  --paper: #fff;
  --screen: #ececea;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--screen);
  font-family: "Times New Roman", "Noto Serif SC", SimSun, serif;
}

.toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  border-bottom: 1px solid #cfcfcf;
  background: rgba(255, 255, 255, 0.94);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.toolbar a,
.toolbar button {
  border: 1px solid #222;
  border-radius: 4px;
  padding: 7px 11px;
  color: #111;
  background: #fff;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.toolbar span {
  color: #555;
  font-size: 13px;
}

.paper {
  width: min(900px, calc(100% - 28px));
  margin: 32px auto;
  padding: 58px 68px;
  background: var(--paper);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.paper-header {
  margin-bottom: 34px;
  text-align: center;
}

.title-page {
  border-bottom: 2px solid #111;
  padding-bottom: 28px;
}

.doc-type {
  margin-bottom: 12px;
  color: #111;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 36px;
  line-height: 1.12;
}

h2 {
  margin: 30px 0 12px;
  font-size: 24px;
}

h3 {
  margin: 0 0 9px;
  font-size: 17px;
}

p {
  margin-bottom: 13px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.78;
  text-align: justify;
}

.tagline {
  margin: 15px 0 6px;
  color: #222;
  font-size: 19px;
  font-style: italic;
  font-weight: 700;
  text-align: center;
}

.meta {
  color: #666;
  font-size: 14px;
  text-align: center;
}

.publication-meta {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  justify-content: center;
  gap: 14px;
  margin: 16px auto 10px;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  text-align: center;
}

.publication-meta span {
  color: #333;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.publication-meta span + span::before {
  content: "/";
  margin-right: 14px;
  color: #777;
}

.toc {
  break-inside: avoid;
  margin: 28px 0 30px;
  border: 1px solid #111;
  padding: 22px 24px;
  background: #fff;
}

.toc h2 {
  margin-top: 0;
}

.toc ol {
  columns: 2;
  column-gap: 36px;
  margin: 0;
  padding-left: 22px;
}

.toc li {
  break-inside: avoid;
  margin: 7px 0;
}

.toc a {
  color: #111;
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}

section {
  break-inside: avoid;
}

code {
  font-family: "Courier New", Consolas, monospace;
  font-size: 13px;
}

p code,
li code {
  border: 1px solid #ddd;
  padding: 1px 3px;
  background: #f8f8f8;
}

pre {
  overflow-x: auto;
  margin: 15px 0 18px;
  border: 1px solid var(--line);
  padding: 13px 15px;
  background: var(--soft);
}

pre code {
  line-height: 1.58;
}

table {
  width: 100%;
  margin: 16px 0 20px;
  border-collapse: collapse;
  break-inside: avoid;
  font-size: 14px;
}

th,
td {
  border: 1px solid var(--line);
  padding: 10px 11px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #111;
  background: #efefef;
  font-weight: 700;
}

td {
  color: #333;
  line-height: 1.55;
}

ul {
  margin: 0;
  padding-left: 20px;
}

li {
  margin: 5px 0;
  color: #333;
  font-size: 15px;
  line-height: 1.55;
}

.hero-principle {
  border: 2px solid #111;
  padding: 24px;
  margin-bottom: 26px;
}

.hero-principle h2 {
  margin-top: 0;
}

.left-right,
.process,
.reward-rule {
  display: grid;
  align-items: stretch;
  gap: 12px;
  margin: 20px 0;
}

.left-right {
  grid-template-columns: 1fr 42px 1fr;
}

.left-right.wide {
  grid-template-columns: 1.15fr 42px 1fr;
}

.process {
  grid-template-columns: repeat(4, 1fr 28px) 1fr;
}

.reward-rule {
  grid-template-columns: 1fr 42px 1fr 42px 1fr;
}

.left-right > div,
.process > div,
.reward-rule > div {
  border: 1px solid var(--line);
  background: var(--soft);
}

.left-right > div {
  padding: 17px;
}

.process > div,
.reward-rule > div {
  padding: 15px 10px;
  text-align: center;
}

.left-right > b,
.process > b,
.reward-rule > b {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.process strong,
.process span,
.reward-rule strong,
.reward-rule span {
  display: block;
}

.process strong,
.reward-rule strong {
  font-size: 16px;
}

.process span,
.reward-rule span {
  margin-top: 6px;
  color: var(--muted);
  font-family: "Courier New", Consolas, monospace;
  font-size: 12px;
}

.final-line {
  margin-top: 18px;
  color: #111;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}

.statement {
  margin: 16px 0 18px;
  border-left: 4px solid #111;
  padding: 10px 14px;
  color: #111;
  background: var(--soft);
  font-style: italic;
  font-weight: 700;
}

.chapter {
  margin-top: 34px;
  border-top: 1.5px solid #111;
  padding-top: 18px;
}

.chapter > h2 {
  margin-top: 0;
}

.chapter-intro {
  margin-bottom: 18px;
  border-left: 3px solid #111;
  padding: 8px 12px;
  color: #222;
  background: var(--soft);
  font-size: 15px;
  line-height: 1.7;
}

.subsection {
  break-inside: avoid;
  margin: 20px 0 0;
  border-left: 1px solid var(--line);
  padding-left: 14px;
}

.subsection h3 {
  margin: 0 0 8px;
  color: #111;
}

.process-flow {
  display: grid;
  grid-template-columns: repeat(5, 1fr 24px) 1fr;
  align-items: stretch;
  gap: 8px;
  margin: 16px 0 18px;
}

.process-flow span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  border: 1px solid var(--line);
  padding: 8px;
  background: var(--soft);
  color: #111;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.process-flow b {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  font-size: 18px;
}

.references {
  margin: 0;
  padding-left: 22px;
}

.references li {
  margin: 10px 0;
}

.references a {
  color: #111;
  overflow-wrap: anywhere;
}

.protocol-svg {
  display: block;
  width: 100%;
  height: auto;
  margin: 22px 0 18px;
  border: 1px solid var(--line);
  background: #fff;
}

.glance-section {
  break-inside: avoid;
}

.glance-svg {
  display: block;
  width: 100%;
  height: auto;
  margin: 22px 0 10px;
  border: 1.5px solid #111;
  background: #fff;
}

.glance-circle,
.glance-thought,
.glance-ai-head {
  fill: #fff;
  stroke: #111;
  stroke-width: 1.5;
}

.glance-behavior {
  fill: #f9f9f9;
  stroke: #111;
  stroke-width: 2;
}

.glance-grid-line {
  stroke: #111;
  stroke-width: 1.1;
}

.glance-line,
.glance-thought-line {
  fill: none;
  stroke: #111;
  stroke-width: 1.5;
  marker-end: url(#glance-arrow);
}

.glance-thought-line {
  stroke-width: 1.1;
}

.glance-input {
  fill: #fff;
  stroke: #111;
  stroke-width: 2;
}

.glance-output,
.glance-ai-eye {
  fill: #111;
}

.glance-dot-text {
  fill: #111;
  font-family: "Courier New", Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
}

.glance-output-text {
  fill: #fff;
  font-family: "Courier New", Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
}

.glance-ai-face {
  fill: #fff;
  stroke: #111;
  stroke-width: 1.5;
}

.glance-ai-mouth {
  stroke: #111;
  stroke-width: 1.5;
  stroke-linecap: round;
}

.glance-thought-title {
  fill: #111;
  font-family: "Times New Roman", "Noto Serif SC", SimSun, serif;
  font-size: 12px;
  font-weight: 700;
}

.glance-thought-text {
  fill: #555;
  font-family: "Noto Serif SC", SimSun, serif;
  font-size: 11px;
}

.caption {
  margin: 0 0 18px;
  color: #555;
  font-size: 13px;
  font-style: italic;
  line-height: 1.55;
  text-align: left;
}

.svg-core {
  fill: #111;
  stroke: #111;
  stroke-width: 1.2;
}

.svg-box {
  fill: var(--soft);
  stroke: #111;
  stroke-width: 1.1;
}

.svg-line {
  stroke: #111;
  stroke-width: 1.6;
  marker-end: url(#arrow);
}

.svg-core-title {
  fill: #fff;
  font-family: "Times New Roman", "Noto Serif SC", SimSun, serif;
  font-size: 18px;
  font-weight: 700;
}

.svg-core-text {
  fill: #fff;
  font-family: "Courier New", Consolas, monospace;
  font-size: 13px;
}

.svg-title {
  fill: #111;
  font-family: "Times New Roman", "Noto Serif SC", SimSun, serif;
  font-size: 15px;
  font-weight: 700;
}

.svg-text {
  fill: #555;
  font-family: "Noto Serif SC", SimSun, serif;
  font-size: 13px;
}

.triad-svg {
  display: block;
  width: 100%;
  height: auto;
  margin: 22px 0 20px;
  border: 1px solid var(--line);
  background: #fff;
}

.triad-edge {
  fill: none;
  stroke: #111;
  stroke-linecap: round;
  stroke-width: 1.35;
}

.triad-node {
  fill: var(--soft);
  stroke: #111;
  stroke-width: 1.4;
}

.triad-core {
  fill: #111;
  stroke: #111;
  stroke-width: 1.2;
}

.triad-title {
  fill: #111;
  font-family: "Times New Roman", "Noto Serif SC", SimSun, serif;
  font-size: 15px;
  font-weight: 700;
}

.triad-text {
  fill: #555;
  font-family: "Noto Serif SC", SimSun, serif;
  font-size: 13px;
}

.triad-core-title {
  fill: #fff;
  font-family: "Times New Roman", "Noto Serif SC", SimSun, serif;
  font-size: 18px;
  font-weight: 700;
}

.triad-core-text {
  fill: #fff;
  font-family: "Courier New", Consolas, monospace;
  font-size: 12px;
}

.triad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 18px 0;
}

.triad-grid > div {
  border: 1px solid var(--line);
  padding: 16px;
  background: var(--soft);
}

.triad-grid p {
  margin: 0;
  font-size: 14px;
  line-height: 1.62;
}

@media (max-width: 820px) {
  .toolbar {
    flex-wrap: wrap;
    padding: 10px;
  }

  .paper {
    width: 100%;
    margin: 0;
    padding: 32px 20px;
    box-shadow: none;
  }

  .left-right,
  .left-right.wide,
  .process,
  .reward-rule,
  .process-flow,
  .publication-meta,
  .triad-grid {
    grid-template-columns: 1fr;
  }

  .left-right > b,
  .process > b,
  .reward-rule > b,
  .process-flow > b {
    transform: rotate(90deg);
  }
}

@media print {
  @page {
    margin: 16mm 17mm;
    size: A4;
  }

  body {
    background: #fff;
  }

  .no-print {
    display: none !important;
  }

  .paper {
    width: 100%;
    margin: 0;
    padding: 0;
    box-shadow: none;
  }

  h1 {
    font-size: 25pt;
  }

  h2 {
    font-size: 17pt;
  }

  h3 {
    font-size: 12pt;
  }

  p,
  li {
    font-size: 10.5pt;
  }

  table {
    font-size: 9.5pt;
  }

  .hero-principle {
    border-width: 1.5px;
  }

  .toc ol {
    columns: 1;
  }

  pre {
    white-space: pre-wrap;
  }
}
