/* 图例陈列以论文原图为中心。页面只承担选择、查阅图注和放大三项操作。 */
.fg-wrap {
  width: var(--site-width);
  margin-inline: auto;
}
.fg-section {
  padding-block: clamp(64px, 7vw, 104px);
  background: var(--bg-subtle, #f6f9f8);
  scroll-margin-top: var(--header-height, 72px);
}
.fg-heading, .ft-heading { margin-bottom: 30px; }
body[data-page="home"] .fg-section {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-content: center;
}
.fg-heading h2, .ft-heading h2 {
  margin: 0;
  color: var(--ink-primary, #161a18);
  font-size: var(--site-section-size);
  font-weight: 650;
  letter-spacing: -.025em;
  line-height: 1.25;
  text-wrap: balance;
}
.fg-heading p, .ft-heading p {
  margin: 14px 0 0;
  max-width: 72ch;
  color: var(--ink-secondary, #4a5550);
  font-size: 16px;
  line-height: 1.75;
}
.fg-types { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.fg-types a {
  display: inline-flex; align-items: center; min-height: 36px;
  padding: 6px 14px; border: 1px solid #d5dfda; border-radius: 999px;
  background: white; color: #44524a; font-size: 13px; font-weight: 560; text-decoration: none;
}
.fg-types a:hover, .fg-types a:focus-visible { border-color: #77a993; }
.fg-types a[aria-current] { color: #fff; background: #19483b; border-color: #19483b; }
.fg-exhibit {
  margin: 0;
  overflow: hidden;
  border: 1px solid #dce4e0;
  border-radius: 16px;
  background: #fff;
}
.fg-toolbar, .fg-caption {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 26px;
}
.fg-toolbar { border-bottom: 1px solid #e7ece9; }
.fg-number {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: #27342c;
}
.fg-number i { width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; background: #119a6a; }
.fg-number span { color: #65716a; font-weight: 400; }
.fg-editions {
  display: flex; gap: 1px; padding: 3px;
  border-radius: 30px; background: #f0f4f2;
}
.fg-editions a {
  padding: 5px 13px; border-radius: 24px;
  color: #515f57; font-weight: 530; font-size: 12px; text-decoration: none;
}
.fg-editions a[aria-current] { background: #fff; color: #115c42; box-shadow: 0 1px 3px #1f39251a; }
.fg-paper { display: grid; place-items: center; padding: clamp(14px, 3vw, 44px); }
.fg-paper > a { display: grid; place-items: center; width: 100%; cursor: zoom-in; }
.fg-paper img { display: block; width: 100%; max-height: clamp(220px, 37vw, 515px); object-fit: contain; }
.fg-caption { padding-block: 22px; border-top: 1px solid #e7ece9; }
.fg-caption h3 { margin: 0; font-size: clamp(18px, 2vw, 26px); line-height: 1.35; letter-spacing: -.02em; }
.fg-caption p { margin: 6px 0 0; color: #58675f; font-size: 13px; line-height: 1.6; }
.fg-expand {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  padding: 7px 0; font-size: 13px; font-weight: 600; color: #243b2e; text-decoration: none;
}
.fg-expand svg, .fg-notes summary svg { width: 17px; height: 17px; flex: none; }
.fg-expand:hover { text-decoration: underline; text-underline-offset: 3px; }
.fg-notes { margin-top: 6px; border-bottom: 1px solid #d9e2dd; color: #37453c; }
.fg-notes summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 17px 2px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 600;
}
.fg-notes summary::-webkit-details-marker { display: none; }
.fg-notes[open] summary svg { transform: rotate(180deg); }
.fg-notes-content { padding-bottom: 16px; }
.fg-notes-content ul { padding: 0; margin: 0; list-style: none; }
.fg-notes-content li { display: flex; align-items: baseline; gap: 12px; padding: 6px 0; line-height: 1.65; font-size: 14px; }
.fg-notes-content li b { min-width: 3ch; color: #245b46; }
.fg-notes-content p { font-size: 13px; color: #59675e; }
.fg-notes-content a { color: #294ead; text-underline-offset: 3px; }
.fg-index { padding: 46px 0 12px; }
.fg-index h3 { margin: 0 0 20px; font-size: clamp(20px, 2vw, 28px); }
.fg-index > div { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 18px; }
.fg-tile { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.fg-tile-art { display: grid; place-items: center; padding: 11px; background: white; border: 1px solid #dce4e0; border-radius: 8px; aspect-ratio: 2 / 1; }
.fg-tile-art img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.fg-tile:hover .fg-tile-art { border-color: #79a38c; }
.fg-tile-name { padding: 10px 1px 0; }
.fg-tile-name small { color: #53645a; font-size: 12px; }
.fg-tile-name strong { display: block; margin-top: 3px; font-size: 15px; line-height: 1.45; }

/* 首页保持画框与图注的基线。另一次选择可以在上一张图完全揭开前开始。 */
body[data-page="home"] .fg-paper > a {
  display: block;
  position: relative;
  height: clamp(220px, 38vw, 515px);
  overflow: hidden;
}
body[data-page="home"] .fg-paper img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  background: white;
}
body[data-page="home"] :is(.fg-types, .fg-editions) {
  position: relative;
  isolation: isolate;
}
.fg-indicator {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  border-radius: 999px;
}
.fg-types .fg-indicator { background: #d8ecdf; border: 1px solid #8bb099; }
.fg-editions .fg-indicator { background: white; box-shadow: 0 1px 3px #1f39251a; }
.fg-tracking a { position: relative; }
.fg-types.fg-tracking a { background: transparent; }
.fg-types.fg-tracking a[aria-current] { border-color: transparent; color: #164a32; }
.fg-editions.fg-tracking a[aria-current] { background: transparent; box-shadow: none; }
.fg-tracking a:focus-visible { outline: 2px solid #176244; outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .fg-tracking .fg-indicator {
    transition: transform 340ms cubic-bezier(.22,.8,.24,1), width 340ms cubic-bezier(.22,.8,.24,1);
  }
  .fg-tracking a { transition: color 170ms, border-color 170ms; }
  body[data-page="home"] .fg-notes summary svg { transition: transform 240ms cubic-bezier(.2,.76,.25,1); }
}

/* 功能页把实机截图、文件结构、操作顺序和权限边界按各自的阅读方式排版。 */
.ft-page { color: var(--ink-primary, #161a18); }
.ft-lead {
  display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.12fr);
  align-items: center; gap: clamp(32px, 5vw, 76px); padding-block: clamp(50px, 6.7vw, 100px);
}
.ft-lead h1 { margin: 0; font-size: var(--site-title-size); letter-spacing: -.025em; line-height: 1.2; text-wrap: balance; }
:lang(zh) .ft-lead h1 { max-width: 9em; line-height: 1.15; }
.ft-lead h1 span { display: inline-block; }
.ft-lead > div > p { max-width: 48ch; margin: 20px 0 28px; color: #4a5550; font-size: clamp(16px, 1.4vw, 19px); line-height: 1.75; }
.ft-actions { display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center; }
.ft-actions a { display: inline-flex; align-items: center; gap: 7px; min-height: 42px; font-size: 14px; font-weight: 620; text-decoration: none; color: inherit; }
.ft-actions a:first-child { padding: 11px 18px; border-radius: 999px; color: #fff; background: #18201b; }
.ft-actions a:first-child:hover { background: #174d39; }
.ft-actions svg { width: 17px; height: 17px; }
.ft-lead figure { margin: 0; min-width: 0; }
.ft-lead figure a {
  display: block; padding: clamp(14px, 2vw, 30px);
  border-radius: 16px; background: #e2f4e9; cursor: zoom-in;
}
.ft-lead figure img { width: 100%; height: auto; display: block; border-radius: 5px; box-shadow: 0 7px 24px #243c291c; }
.ft-lead figcaption { margin-top: 9px; text-align: end; color: #5c695f; font-size: 12px; }
.ft-band { padding-block: clamp(58px, 6vw, 90px); background: #f3f8f5; }
.ft-part { padding-block: clamp(56px, 6vw, 88px); }
.ft-part + .ft-part { border-top: 1px solid #dfe6e1; }
.ft-matrix {
  display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); overflow: hidden;
  border: 1px solid #d4dfd8; border-radius: 14px; background: #fff;
}
.ft-matrix article { min-width: 0; padding: clamp(20px, 2.8vw, 38px); }
.ft-matrix article + article { border-left: 1px solid #dce5df; }
.ft-matrix article:first-child { background: #e1f3e9; }
.ft-icon { display: block; color: #20664c; width: 28px; height: 28px; }
.ft-matrix h3, .ft-workshop h3 { margin: 16px 0 5px; font-size: clamp(19px, 1.9vw, 26px); letter-spacing: -.025em; line-height: 1.25; }
.ft-matrix strong { font-size: 13px; font-weight: 610; color: #216447; }
.ft-matrix p, .ft-workshop p, .ft-flow p, .ft-data p { font-size: 15px; line-height: 1.7; color: #435248; }
.ft-matrix p { margin: 15px 0 0; }
.ft-network, .ft-scan { margin: 18px 0 0; color: #546158; font-size: 14px; line-height: 1.7; }
.ft-flow { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); list-style: none; padding: 0; margin: 0; }
.ft-flow li { position: relative; padding: 24px 24px 0 0; border-top: 1px solid #a9c8b8; }
.ft-flow li::before { content: ''; position: absolute; width: 9px; height: 9px; background: #277654; border: 2px solid #fff; border-radius: 50%; top: -6px; left: 0; }
.ft-page code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .94em; overflow-wrap: anywhere; }
.ft-flow code, .ft-data code { color: #1e6445; }
.ft-flow h3 { margin: 9px 0 3px; font-size: 20px; }
.ft-flow p, .ft-data p, .ft-workshop p { margin: 5px 0 0; }
.ft-source-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: clamp(32px, 5vw, 80px); align-items: start; }
.ft-source-grid .ft-heading h2 { font-size: clamp(25px, 2.65vw, 36px); }
.ft-tree, .ft-citation { padding: 18px 22px; background: #f4f7f5; border-radius: 12px; }
.ft-tree > div { color: #20553f; margin-bottom: 8px; }
.ft-tree dl { margin: 12px 0 0 5px; border-left: 1px solid #bdcec2; padding-left: 15px; }
.ft-tree dl > div { display: grid; grid-template-columns: minmax(0, 143px) 1fr; gap: 5px; padding: 5px 0; }
.ft-tree dd { margin: 0; font-size: 13px; line-height: 1.5; color: #506056; }
.ft-citation { background: #f0f4ff; }
.ft-citation code { color: #324f9c; font-weight: 650; }
.ft-citation ol { margin: 12px 0 0; padding-left: 24px; }
.ft-citation li { padding: 4px 0 4px 6px; font-size: 14px; }
.ft-citation li::marker { color: #4866b3; font-variant-numeric: tabular-nums; }
.ft-screens { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; margin-top: 36px; }
.ft-screens figure { margin: 0; }
.ft-screens a, .ft-data > a { display: block; padding: 10px; background: #eff4f0; border-radius: 9px; cursor: zoom-in; }
.ft-screens img, .ft-data img { display: block; width: 100%; height: auto; border-radius: 3px; }
.ft-screens img { aspect-ratio: 1.55; object-fit: contain; }
.ft-screens figcaption { margin-top: 7px; font-size: 14px; font-weight: 580; }
.ft-data { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(24px, 4vw, 55px); align-items: center; }
.ft-data > a { padding: clamp(12px, 1.8vw, 22px); background: #e9f1e9; }
.ft-data ol { list-style: none; margin: 0; padding: 0; }
.ft-data li { padding: 12px 0; border-top: 1px solid #dbe3de; }
.ft-data code { font-weight: 650; }
.ft-workshop { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 32px; }
.ft-workshop h3 { margin-top: 0; }
.ft-tools { width: 100%; border-collapse: collapse; text-align: left; }
.ft-tools th, .ft-tools td { padding: 14px 14px 14px 0; font-size: 14px; line-height: 1.55; border-bottom: 1px solid #dce4df; vertical-align: top; }
.ft-tools thead th { font-size: 13px; color: #405149; border-bottom-color: #a9b7ad; }
.ft-tools tbody th { font-weight: 550; }
.ft-tools tbody td { color: #46564b; }

@media (max-width: 900px) {
  .fg-index > div { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .ft-tree dl > div { grid-template-columns: 1fr; gap: 1px; }
  .ft-lead { gap: 26px; }
}
@media (max-width: 700px) {
  .fg-toolbar, .fg-caption { padding: 14px 15px; }
  .fg-caption { align-items: start; flex-wrap: wrap; gap: 6px 16px; }
  .fg-paper { padding: 12px 6px; }
  .fg-types { gap: 6px; }
  .fg-types a { font-size: 12px; padding-inline: 10px; }
  .fg-index > div { gap: 20px 12px; }
  .fg-tile-art { padding: 5px; }
  .ft-lead, .ft-source-grid, .ft-data, .ft-workshop { grid-template-columns: 1fr; }
  .ft-lead h1 { max-width: 12ch; }
  .ft-lead figure { margin-top: 4px; }
  .ft-matrix { grid-template-columns: 1fr; }
  .ft-matrix article + article { border-left: 0; border-top: 1px solid #dce5df; }
  .ft-matrix article { padding: 20px; }
  .ft-flow { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 22px 0; }
  .ft-flow li { padding-right: 16px; }
  .ft-tree dl > div { grid-template-columns: minmax(0, 128px) 1fr; }
  .ft-screens { grid-template-columns: 1fr; gap: 24px; }
  .ft-tools, .ft-tools tbody, .ft-tools tr, .ft-tools tbody th, .ft-tools td { display: block; }
  .ft-tools thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .ft-tools tbody tr { padding: 12px 0; border-top: 1px solid #dce4df; }
  .ft-tools tbody th, .ft-tools tbody td { border: 0; padding: 2px 0; }
  .ft-tools tbody td:last-child { font-size: 13px; color: #56655c; }
  .ft-tools [data-boundary]::before { content: attr(data-boundary) ' · '; font-weight: 600; }
}

/* 画框随界面变暗；图版自身的白色画纸、标注和数据颜色由原始文件决定。 */
html[data-theme="dark"] {
  & .fg-types a, & .fg-editions a, & .fg-notes, & .ft-lead > div > p, & .ft-tree dd,
  & .ft-matrix p, & .ft-workshop p, & .ft-flow p, & .ft-data p, & .ft-tools tbody td {
    color: var(--ink-secondary);
  }
  & .fg-caption p, & .fg-number span, & .fg-notes-content p, & .fg-tile-name small,
  & .ft-network, & .ft-scan, & .ft-lead figcaption, & .ft-tools tbody td:last-child {
    color: var(--ink-tertiary);
  }
  & .fg-number, & .ft-tools thead th { color: var(--ink-primary); }
  & .fg-expand, & .fg-notes-content li b, & .ft-icon, & .ft-matrix strong,
  & .ft-flow code, & .ft-data code, & .ft-tree > div { color: var(--jade-ink); }
  & .fg-notes-content a, & .ft-citation code, & .ft-citation li::marker { color: var(--whale-accent); }

  & .fg-types a, & .fg-editions, & .ft-band, & .ft-tree,
  & .ft-screens a, & .ft-data > a, & .fg-tile-art { background: var(--bg-subtle); }
  & .fg-exhibit, & .ft-matrix { background: var(--bg-canvas); }
  & .fg-exhibit, & .fg-toolbar, & .fg-caption, & .fg-notes, & .fg-tile-art, & .ft-part + .ft-part,
  & .ft-matrix, & .ft-matrix article + article, & .ft-data li, & .ft-tree dl,
  & .ft-tools th, & .ft-tools td, & .ft-tools tbody tr { border-color: var(--border-hairline); }
  & .ft-lead figure a, & .ft-matrix article:first-child, & .fg-editions a[aria-current] {
    background: var(--jade-surface);
  }
  & .ft-citation { background: #222e44; }
  & .ft-actions a:first-child { color: var(--bg-canvas); background: var(--ink-primary); }
  & .ft-actions a:first-child:hover { background: var(--jade-ink); }
  & .ft-flow li { border-color: #557569; }
  & .ft-flow li::before { border-color: var(--bg-canvas); background: var(--jade-ink); }

  & .fg-types a { border-color: #586b73; }
  & .fg-types a:hover, & .fg-types a:focus-visible, & .fg-tile:hover .fg-tile-art { border-color: var(--jade-ink); }
  & .fg-types a[aria-current], & .fg-types .fg-indicator {
    background: var(--jade-ink);
    color: #112a22;
    border-color: transparent;
  }
  & .fg-editions a[aria-current] { color: var(--jade-ink); box-shadow: none; }
  & .fg-editions .fg-indicator { background: var(--jade-surface); box-shadow: none; }
  & .fg-types.fg-tracking a, & .fg-editions.fg-tracking a[aria-current] { background: transparent; }
  & .fg-types.fg-tracking a[aria-current] { color: #112a22; }
  & .fg-tracking a:focus-visible { outline-color: var(--jade-ink); }
}
