:root {
  color-scheme: light;
  --bg: #e8e3d7;
  --bg-deep: #ded7c7;
  --surface: #fdfdfb;
  --surface-2: #f7f4ec;
  --surface-3: #efeadf;
  --ink: #1d1c19;
  --ink-2: #33312c;
  --muted: #6b665b;
  --muted-2: #686256;
  --line: #d7d1c3;
  --line-soft: #e8e3d8;
  --line-strong: #b7afa0;
  --accent: #7b5b30;
  --accent-2: #9b7b46;
  --accent-soft: rgba(123, 91, 48, 0.08);
  --accent-line: rgba(123, 91, 48, 0.34);
  --seal: #24231f;
  --seal-text: #f3ecdd;
  --green: #4c6a55;
  --blue: #48647a;
  --oxblood: #76463a;
  --shadow: 0 14px 34px rgba(49, 41, 28, 0.09);
  --shadow-sm: 0 2px 8px rgba(49, 41, 28, 0.05);
  --radius: 8px;
  --radius-sm: 5px;
  --header-h: 64px;
  --left-w: 232px;
  --right-w: 224px;
  --font-body: "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-head: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", serif;
  --font-mono: "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;
  --reading-scale: 1;
  --paper-grain:
    radial-gradient(circle at 18% 12%, rgba(63, 55, 40, 0.045), transparent 42%),
    radial-gradient(circle at 82% 88%, rgba(63, 55, 40, 0.035), transparent 46%),
    repeating-linear-gradient(0deg, rgba(86, 74, 52, 0.022) 0 1px, transparent 1px 5px);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10100e;
  --bg-deep: #0a0a09;
  --surface: #1a1916;
  --surface-2: #211f1a;
  --surface-3: #29261f;
  --ink: #e9e4d7;
  --ink-2: #d2ccbe;
  --muted: #a59d8d;
  --muted-2: #969083;
  --line: #353229;
  --line-soft: #2a2822;
  --line-strong: #4b4639;
  --accent: #c2a169;
  --accent-2: #d6bb85;
  --accent-soft: rgba(194, 161, 105, 0.1);
  --accent-line: rgba(194, 161, 105, 0.34);
  --seal: #c2a169;
  --seal-text: #17150f;
  --green: #8fae95;
  --blue: #91aec2;
  --oxblood: #c08a7b;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.38);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.26);
  --paper-grain:
    radial-gradient(circle at 18% 12%, rgba(223, 208, 179, 0.04), transparent 42%),
    radial-gradient(circle at 82% 88%, rgba(223, 208, 179, 0.03), transparent 46%),
    repeating-linear-gradient(0deg, rgba(223, 208, 179, 0.018) 0 1px, transparent 1px 5px);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 22rem);
  z-index: -1;
}

[data-theme="dark"] body::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 22rem);
}

::selection {
  color: var(--seal-text);
  background: var(--accent);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-2);
}

img {
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

p {
  margin: 0;
}

kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  padding: 2px 5px;
  border: 1px solid currentColor;
  border-radius: 3px;
  opacity: 0.65;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 8px 12px;
  color: var(--seal-text);
  background: var(--seal);
  border-radius: 4px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  color: #f3ecdd;
  background: #22211d;
  background-image:
    radial-gradient(circle at 12% 30%, rgba(255, 246, 226, 0.05), transparent 22rem),
    repeating-linear-gradient(90deg, rgba(255, 246, 226, 0.018) 0 1px, transparent 1px 4px);
  border-bottom: 1px solid rgba(211, 192, 157, 0.28);
}

[data-theme="dark"] .site-header {
  background-color: #0d0d0b;
}

.header-inner {
  width: min(1500px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  color: #f7f0e2;
}

.brand:hover {
  color: #fff;
}

.brand-seal {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #f5eddd;
  background: #171713;
  border: 1px solid rgba(211, 192, 157, 0.65);
  border-radius: 3px;
  font-family: var(--font-head);
  font-size: 23px;
  line-height: 1;
  box-shadow: inset 0 0 0 2px #171713, inset 0 0 0 3px rgba(211, 192, 157, 0.35);
}

[data-theme="dark"] .brand-seal {
  color: #17150f;
  background: var(--accent);
  border-color: var(--accent-2);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-family: var(--font-head);
  font-size: 18px;
  letter-spacing: 0.12em;
}

.brand-text small {
  color: #b9ad96;
  font-size: 10px;
  letter-spacing: 0.26em;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  flex: 1;
  font-size: 13px;
  white-space: nowrap;
}

.top-nav a {
  position: relative;
  padding: 9px 0;
  color: #cec2ac;
}

.top-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 2px;
  height: 1px;
  background: var(--accent-2);
  transition: right 0.2s ease;
}

.top-nav a:hover {
  color: #fff7e8;
}

.top-nav a:hover::after {
  right: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  color: #e8ddc9;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(211, 192, 157, 0.28);
  border-radius: 4px;
  font-size: 12.5px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.search-trigger:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(211, 192, 157, 0.6);
}

.search-icon {
  width: 15px;
  height: 15px;
  display: inline-block;
  position: relative;
  flex: none;
}

.search-icon::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1.7px solid currentColor;
  border-radius: 50%;
  left: 0;
  top: 0;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 1.7px;
  background: currentColor;
  transform: rotate(45deg);
  left: 9px;
  top: 10px;
  border-radius: 1px;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  color: #e8ddc9;
  background: transparent;
  border: 1px solid rgba(211, 192, 157, 0.24);
  border-radius: 4px;
  font-size: 12px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(211, 192, 157, 0.55);
}

.theme-toggle .theme-label {
  font-family: var(--font-head);
  font-size: 13px;
}

.mobile-nav-button {
  display: none;
}

.wiki-shell {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 64px;
  display: grid;
  grid-template-columns: var(--left-w) minmax(0, 1fr) var(--right-w);
  gap: 22px;
  align-items: start;
}

.wiki-left,
.wiki-right {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  max-height: calc(100vh - var(--header-h) - 36px);
  overflow: auto;
  background-color: var(--surface-2);
  background-image: var(--paper-grain);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.wiki-left {
  padding: 12px 10px 14px;
}

.wiki-right {
  padding: 12px 10px 12px;
}

.wiki-left-head,
.quick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 6px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.18em;
}

.drawer-close {
  display: none;
  width: 28px;
  height: 28px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 17px;
  line-height: 1;
}

.site-tree {
  padding-top: 8px;
}

.tree-home {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px;
  color: var(--ink);
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  font-family: var(--font-head);
  font-size: 14px;
  letter-spacing: 0.05em;
}

.tree-home:hover,
.tree-home.is-current {
  color: var(--accent);
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.tree-group {
  margin-top: 16px;
}

.tree-group h2 {
  margin: 0 0 4px;
  padding: 0 8px;
  color: var(--muted-2);
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  display: flex;
  justify-content: space-between;
}

.tree-group h2 span {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-weight: 400;
}

.tree-link {
  display: block;
  padding: 6px 8px 6px 10px;
  color: var(--ink-2);
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  font-size: 12.5px;
  line-height: 1.55;
}

.tree-link:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.tree-link.is-current {
  color: var(--accent);
  background: var(--accent-soft);
  border-left-color: var(--accent);
  font-weight: 600;
}

.tree-extra {
  display: block;
  margin-top: 16px;
  padding: 10px 8px 4px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.tree-extra:hover {
  color: var(--accent);
}

.wiki-main {
  min-width: 0;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 12px;
  color: var(--muted-2);
  font-size: 12px;
}

.breadcrumb a {
  color: var(--muted);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.plaque {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.plaque::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  pointer-events: none;
}

.plaque::after {
  content: "";
  position: absolute;
  inset: 10px;
  pointer-events: none;
  opacity: 0.55;
  background:
    linear-gradient(var(--accent-line), var(--accent-line)) left top / 12px 1px no-repeat,
    linear-gradient(var(--accent-line), var(--accent-line)) left top / 1px 12px no-repeat,
    linear-gradient(var(--accent-line), var(--accent-line)) right top / 12px 1px no-repeat,
    linear-gradient(var(--accent-line), var(--accent-line)) right top / 1px 12px no-repeat,
    linear-gradient(var(--accent-line), var(--accent-line)) left bottom / 12px 1px no-repeat,
    linear-gradient(var(--accent-line), var(--accent-line)) left bottom / 1px 12px no-repeat,
    linear-gradient(var(--accent-line), var(--accent-line)) right bottom / 12px 1px no-repeat,
    linear-gradient(var(--accent-line), var(--accent-line)) right bottom / 1px 12px no-repeat;
}

.hero {
  position: relative;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(220px, 0.55fr);
  gap: 34px;
  padding: 46px 46px 30px;
}

.hero-copy {
  min-width: 0;
}

.hero-kicker {
  margin-bottom: 14px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: clamp(40px, 4.6vw, 60px);
  line-height: 1.12;
  letter-spacing: 0.06em;
}

.hero h1 em {
  color: var(--accent);
  font-style: normal;
  position: relative;
}

.hero h1 em::after {
  content: "";
  position: absolute;
  left: 2%;
  right: 0;
  bottom: 2px;
  height: 6px;
  background: var(--accent-soft);
  z-index: -1;
}

.hero-lead {
  max-width: 640px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.95;
}

.hero-search {
  width: min(100%, 620px);
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  text-align: left;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.hero-search:hover {
  color: var(--ink-2);
  background: var(--surface);
  border-color: var(--accent-line);
}

.hero-search span:nth-child(2) {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-search kbd {
  color: var(--muted-2);
}

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  color: var(--muted-2);
  font-size: 12px;
}

.quick-tags > span {
  margin-right: 2px;
}

.quick-tags button {
  padding: 4px 9px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.quick-tags button:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.hero-aside {
  display: flex;
  align-items: center;
  justify-content: center;
}

.seal-card {
  width: 190px;
  min-height: 240px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  color: var(--seal-text);
  background-color: var(--seal);
  background-image: var(--paper-grain);
  border: 1px solid rgba(211, 192, 157, 0.6);
  border-radius: 3px;
  box-shadow: inset 0 0 0 4px var(--seal), inset 0 0 0 5px rgba(211, 192, 157, 0.35);
  transform: none;
}

[data-theme="dark"] .seal-card {
  color: #17150f;
}

.seal-card span {
  font-family: var(--font-head);
  font-size: 14px;
  letter-spacing: 0.36em;
  writing-mode: vertical-rl;
  opacity: 0.76;
}

.seal-card strong {
  font-family: var(--font-head);
  font-size: 31px;
  letter-spacing: 0.16em;
  writing-mode: vertical-rl;
  line-height: 1.4;
}

.seal-card small {
  font-size: 10px;
  letter-spacing: 0.26em;
  opacity: 0.7;
}

.hero-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.hero-stats div {
  padding: 16px 22px;
  display: flex;
  align-items: baseline;
  gap: 9px;
  border-right: 1px solid var(--line);
}

.hero-stats div:last-child {
  border-right: 0;
}

.hero-stats strong {
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 26px;
  line-height: 1;
}

.hero-stats span {
  color: var(--muted);
  font-size: 12px;
}

.category-list {
  margin-top: 34px;
  display: flex;
  flex-direction: column;
  gap: 34px;
}

.category-section {
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background-color: var(--surface-2);
  background-image: var(--paper-grain);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.section-mark {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--accent-line);
  border-radius: 4px;
  font-family: var(--font-head);
  font-size: 20px;
}

.section-title {
  flex: 1;
  min-width: 0;
}

.section-title h2 {
  margin: 0 0 2px;
  font-size: 22px;
  letter-spacing: 0.08em;
}

.section-title p {
  color: var(--muted);
  font-size: 12.5px;
}

.section-count {
  flex: none;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.guide-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 18px 18px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.guide-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.kind-badge {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 8px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.kind-xlsx .kind-badge {
  color: var(--green);
}

.kind-docx .kind-badge {
  color: var(--blue);
}

.kind-pdf .kind-badge {
  color: var(--oxblood);
}

.kind-image .kind-badge {
  color: var(--accent);
}

.card-date {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
}

.guide-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.4;
}

.guide-card h3 a {
  color: var(--ink);
}

.guide-card h3 a:hover {
  color: var(--accent);
}

.card-desc {
  flex: 1;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 12px;
}

.tags span {
  padding: 2px 6px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  font-size: 10.5px;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-size: 11px;
}

.card-enter {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.card-enter span {
  display: inline-block;
  transition: transform 0.18s ease;
}

.guide-card:hover .card-enter span {
  transform: translateX(3px);
}

.site-note {
  margin-top: 42px;
}

.note-inner {
  padding: 24px 26px 26px;
  background-color: var(--surface-2);
  background-image: var(--paper-grain);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.note-inner > h2 {
  margin: 0 0 14px;
  font-size: 20px;
  letter-spacing: 0.08em;
}

.note-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.note-grid strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 16px;
}

.note-grid p {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}

.guide-head {
  padding: 30px 34px 26px;
  overflow: hidden;
}

.guide-head::after {
  opacity: 0.32;
}

.guide-kicker {
  margin-bottom: 8px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
}

.guide-head h1 {
  position: relative;
  z-index: 1;
  margin: 0 0 10px;
  font-size: clamp(30px, 3.4vw, 42px);
  letter-spacing: 0.04em;
}

.guide-desc {
  position: relative;
  z-index: 1;
  max-width: 820px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.9;
}

.guide-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 11.5px;
}

.guide-head .tags {
  position: relative;
  z-index: 1;
  margin-top: 10px;
}

.guide-notice {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  padding: 9px 12px;
  color: #6d542b;
  background: #f6efde;
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  font-size: 12px;
  line-height: 1.7;
}

[data-theme="dark"] .guide-notice {
  color: var(--accent-2);
  background: var(--surface-2);
}

.reading-tip {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 11px;
}

.reading-tip::before {
  content: "◇";
  margin-right: 5px;
  color: var(--accent);
}

.source-note {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  color: var(--muted-2);
  font-size: 11px;
}

.source-note summary {
  cursor: pointer;
  width: fit-content;
}

.source-note code {
  display: inline-block;
  margin-top: 5px;
  padding: 3px 7px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  word-break: break-all;
}

.warnings {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  padding: 9px 12px;
  color: #6d542b;
  background: #f8f0de;
  border: 1px solid #e4d3b0;
  border-radius: 4px;
  font-size: 11.5px;
}

[data-theme="dark"] .warnings {
  color: var(--accent-2);
  background: var(--surface-2);
  border-color: var(--line);
}

.warnings summary {
  cursor: pointer;
}

.warnings ul {
  margin: 6px 0 0;
  padding-left: 18px;
}

.content-toolbar {
  position: sticky;
  top: calc(var(--header-h) + 10px);
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding: 7px 9px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: var(--shadow-sm);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.toolbar-group label {
  color: var(--muted-2);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.tool-select {
  max-width: 210px;
  height: 30px;
  padding: 0 8px;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
}

.toolbar-current {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11.5px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.tool-btn {
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11.5px;
  transition: color 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.tool-btn:hover,
.tool-btn[aria-pressed="true"] {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.tool-btn.icon-only {
  min-width: 28px;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 13px;
}

.tool-divider {
  width: 1px;
  height: 18px;
  margin: 0 3px;
  background: var(--line);
}

.sheet-panel {
  scroll-margin-top: calc(var(--header-h) + 64px);
  margin-top: 22px;
}

.sheet-panel + .sheet-panel {
  margin-top: 36px;
}

.js-ready .sheet-panel:not(.is-active) {
  display: none;
}

.sheet-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  padding: 0 2px 9px;
  border-bottom: 1px solid var(--line);
}

.sheet-kicker {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.sheet-head h2 {
  position: relative;
  margin: 2px 0 0;
  padding-left: 12px;
  font-size: 23px;
  letter-spacing: 0.04em;
}

.sheet-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  bottom: 0.15em;
  width: 3px;
  background: var(--accent);
  border-radius: 1px;
}

.sheet-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  color: var(--muted);
  font-size: 10.5px;
}

.sheet-meta > span {
  padding: 2px 7px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}

.sheet-badge {
  color: var(--accent) !important;
  border-color: var(--accent-line) !important;
  background: var(--accent-soft) !important;
}

.table-frame {
  position: relative;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-wrap {
  max-width: 100%;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
  -webkit-overflow-scrolling: touch;
}

.table-wrap:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

.table-wrap::-webkit-scrollbar {
  height: 12px;
  width: 12px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border: 3px solid var(--surface);
  border-radius: 8px;
}

.table-wrap::-webkit-scrollbar-track {
  background: var(--surface-2);
}

.table-frame::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 34px;
  background: linear-gradient(90deg, transparent, var(--surface));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.table-frame.can-scroll-right::after {
  opacity: 0.9;
}

.table-scroll-hint {
  position: absolute;
  right: 7px;
  bottom: 7px;
  z-index: 2;
  padding: 3px 7px;
  color: var(--surface);
  background: var(--ink);
  border-radius: 999px;
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.table-frame.can-scroll-right .table-scroll-hint {
  opacity: 0.72;
}

.sheet-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--ink);
  font-size: calc(13.5px * var(--reading-scale, 1));
  line-height: 1.6;
}

.sheet-table td {
  max-width: 44em;
  padding: 6px 9px;
  border-right: 1px solid rgba(86, 76, 58, 0.12);
  border-bottom: 1px solid rgba(86, 76, 58, 0.12);
  vertical-align: middle;
  white-space: pre-wrap;
  word-break: break-word;
}

[data-theme="dark"] .sheet-table td {
  border-color: rgba(216, 204, 180, 0.12);
}

.sheet-table tr:last-child td {
  border-bottom: 0;
}

.sheet-table td:last-child {
  border-right: 0;
}

.sheet-table tbody tr:hover td {
  box-shadow: inset 0 0 0 9999px rgba(123, 91, 48, 0.045);
}

[data-theme="dark"] .sheet-table tbody tr:hover td {
  box-shadow: inset 0 0 0 9999px rgba(194, 161, 105, 0.07);
}

.sheet-table .cell-link a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 2px;
}

.sheet-table .cell-link a:hover {
  color: var(--accent);
}

.sheet-table .media-row td {
  padding: 0;
  background: var(--surface-2);
}

[data-theme="dark"] .sheet-table .media-row td {
  background: #171613;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 12px;
  align-items: start;
}

.shot {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

[data-theme="dark"] .shot {
  background: var(--surface-2);
}

.shot a {
  display: block;
  text-align: center;
  background: var(--surface);
}

[data-theme="dark"] .shot a {
  background: var(--surface-2);
}

.shot img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 480px;
  margin: 0 auto;
  cursor: zoom-in;
}

.shot figcaption {
  padding: 4px 8px;
  color: var(--muted-2);
  border-top: 1px solid var(--line-soft);
  font-size: 10.5px;
  text-align: center;
}

.doc-main {
  max-width: 940px;
}

.doc-body {
  padding: 34px 42px 42px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-size: calc(15.5px * var(--reading-scale, 1));
  line-height: 1.95;
}

.doc-body h2,
.doc-body h3,
.doc-body h4 {
  scroll-margin-top: calc(var(--header-h) + 64px);
}

.doc-body h2 {
  position: relative;
  margin: 2em 0 0.65em;
  padding: 0.15em 0 0.35em 14px;
  font-size: calc(28px * var(--reading-scale, 1));
  border-bottom: 1px solid var(--line);
}

.doc-body h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  bottom: 0.35em;
  width: 3px;
  background: var(--accent);
}

.doc-body h2:first-child {
  margin-top: 0;
}

.doc-body h3 {
  margin: 1.7em 0 0.5em;
  color: var(--accent);
  font-size: calc(21px * var(--reading-scale, 1));
}

.doc-body h4 {
  margin: 1.3em 0 0.35em;
  font-size: calc(17px * var(--reading-scale, 1));
}

.doc-body p {
  margin: 0.62em 0;
  text-align: justify;
}

.doc-body .center {
  text-align: center;
}

.doc-body .doc-note {
  padding: 9px 13px;
  color: #6d542b;
  background: #f8f0de;
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  font-size: calc(13.5px * var(--reading-scale, 1));
}

[data-theme="dark"] .doc-body .doc-note {
  color: var(--accent-2);
  background: var(--surface-2);
}

.doc-body .doc-li {
  position: relative;
  padding-left: 1.05em;
}

.doc-body .doc-li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.doc-body a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.doc-body .doc-media-block {
  margin: 0;
}

.doc-body .media-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  padding: 12px 0;
}

.doc-body .shot img {
  max-height: 560px;
}

.doc-table-wrap {
  margin: 1.1em 0;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: calc(13px * var(--reading-scale, 1));
  line-height: 1.65;
}

.doc-table td {
  padding: 6px 9px;
  border: 1px solid var(--line);
  vertical-align: top;
}

.doc-table p {
  margin: 0.18em 0;
}

.doc-table tr:nth-child(even) td {
  background: var(--surface-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 12px;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.btn:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.btn.primary {
  color: var(--seal-text);
  background: var(--seal);
  border-color: var(--seal);
}

[data-theme="dark"] .btn.primary {
  color: #17150f;
  background: var(--accent);
  border-color: var(--accent);
}

.btn.primary:hover {
  color: var(--seal-text);
  background: #11110e;
  border-color: #11110e;
}

[data-theme="dark"] .btn.primary:hover {
  color: #17150f;
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.btn.ghost {
  background: transparent;
}

.pdf-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 14px;
}

.pdf-actions-meta {
  color: var(--muted);
  font-size: 11.5px;
}

.pdf-toc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 9px 11px;
  background-color: var(--surface-2);
  background-image: var(--paper-grain);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 11px;
}

.pdf-toc > span {
  margin-right: 3px;
  color: var(--muted-2);
}

.pdf-toc a {
  padding: 3px 8px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
}

.pdf-toc a:hover {
  color: var(--accent);
  border-color: var(--accent-line);
}

.pdf-viewer {
  margin: 0 0 18px;
  background: #292722;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.pdf-viewer iframe {
  display: block;
  width: 100%;
  height: 76vh;
  border: 0;
  background: #fff;
}

.page-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.page-card {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  scroll-margin-top: calc(var(--header-h) + 64px);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.page-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow);
}

.page-thumb {
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line-soft);
}

.page-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
  background: var(--surface);
}

.page-thumb.placeholder {
  color: var(--muted-2);
  font-size: 11px;
}

.page-info {
  padding: 8px 10px 10px;
}

.page-no {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.page-info p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10.8px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pdf-text {
  margin-top: 22px;
  padding: 13px 16px;
  background-color: var(--surface-2);
  background-image: var(--paper-grain);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.pdf-text summary {
  cursor: pointer;
  color: var(--ink-2);
  font-family: var(--font-head);
  font-size: 17px;
}

.pdf-text-body {
  margin-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.pdf-text-page {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.pdf-text-page h3 {
  margin: 0 0 7px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
}

.pdf-text-page pre {
  margin: 0;
  color: var(--ink-2);
  font-family: var(--font-body);
  font-size: calc(13px * var(--reading-scale, 1));
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
}

.image-doc {
  margin-top: 18px;
}

.image-sheet {
  margin: 0;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.image-sheet a {
  display: inline-block;
  max-width: 100%;
}

.image-sheet img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  cursor: zoom-in;
}

.image-sheet figcaption {
  margin-top: 9px;
  color: var(--muted-2);
  font-size: 11px;
}

.image-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.sheet-pager {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.guide-end {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.empty-state {
  padding: 36px;
  color: var(--muted);
  text-align: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.focus-flash {
  animation: focusFlash 2.4s ease;
}

.focus-flash td {
  animation: focusFlash 2.4s ease;
}

.focus-flash.page-card {
  animation: focusFlashCard 2.4s ease;
}

@keyframes focusFlash {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(123, 91, 48, 0); }
  18% { box-shadow: inset 0 0 0 3px rgba(123, 91, 48, 0.75); }
  62% { box-shadow: inset 0 0 0 2px rgba(123, 91, 48, 0.4); }
}

@keyframes focusFlashCard {
  0%, 100% { box-shadow: var(--shadow-sm); }
  18% { box-shadow: 0 0 0 3px rgba(123, 91, 48, 0.7), var(--shadow); }
  62% { box-shadow: 0 0 0 2px rgba(123, 91, 48, 0.3), var(--shadow); }
}

.quick-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line-soft);
}

.quick-tools .tool-btn {
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  font-size: 10.5px;
}

.quick-filter {
  padding: 8px 4px 5px;
}

.quick-filter input {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11.5px;
}

.quick-filter input:focus {
  border-color: var(--accent-line);
  outline: none;
}

.quick-links {
  min-height: 0;
  overflow: auto;
  max-height: calc(100vh - 300px);
  padding: 4px 0 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.quick-sheet-link,
.toc-link {
  display: block;
  padding: 5px 7px;
  color: var(--ink-2);
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  font-size: 11.8px;
  line-height: 1.5;
}

.quick-sheet-link {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
}

.quick-sheet-link:hover,
.toc-link:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.quick-sheet-link.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

[data-theme="dark"] .sheet-table {
  color: var(--ink);
}

[data-theme="dark"] .table-frame,
[data-theme="dark"] .table-wrap {
  background: var(--surface);
}

[data-theme="dark"] .table-scroll-hint {
  color: var(--seal-text);
  background: #11110e;
}

.quick-index-num {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.quick-index-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-index-meta {
  color: var(--muted-2);
  font-size: 9.5px;
  white-space: nowrap;
}

.quick-group-label {
  margin: 9px 7px 3px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
  color: var(--muted-2);
  font-size: 9.5px;
  letter-spacing: 0.1em;
}

.quick-foot {
  padding: 8px 4px 0;
  border-top: 1px solid var(--line-soft);
  color: var(--muted-2);
  font-size: 10.5px;
}

.quick-foot a {
  color: var(--muted);
}

.quick-foot a:hover {
  color: var(--accent);
}

.quick-page-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 4px;
}

.quick-page-grid a {
  display: grid;
  place-items: center;
  min-height: 28px;
  color: var(--muted);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10.5px;
}

.quick-page-grid a:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.quick-info {
  padding: 8px 8px 4px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.8;
}

.quick-info strong {
  color: var(--ink-2);
  font-weight: 600;
}

.quick-links-title {
  margin: 8px 7px 2px;
  color: var(--muted-2);
  font-size: 9.5px;
  letter-spacing: 0.12em;
}

.quick-stat {
  margin: 8px 4px 0;
  padding: 8px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.7;
}

.quick-stat strong {
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 15px;
}

.mobile-bar {
  display: none;
}

.drawer-backdrop {
  display: none;
}

.table-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.table-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 16, 12, 0.72);
}

.table-modal-panel {
  position: relative;
  width: min(96vw, 1600px);
  height: min(92vh, 1100px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
  overflow: hidden;
}

.table-modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.table-modal-bar strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 600;
}

.table-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.table-modal-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px;
  background: var(--surface-2);
}

.table-modal-body .table-wrap {
  max-height: none;
  overflow: visible;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.table-modal-body .sheet-table {
  font-size: calc(14px * var(--reading-scale, 1));
}

body.table-modal-open,
body.nav-open,
body.toc-open,
body.search-open,
body.lightbox-open {
  overflow: hidden;
}

.site-footer {
  border-top: 1px solid var(--line);
  background-color: var(--surface-2);
  background-image: var(--paper-grain);
}

.footer-inner {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.9;
}

.footer-main {
  color: var(--ink-2);
  font-family: var(--font-head);
  font-size: 16px;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--accent);
}

.muted {
  color: var(--muted-2);
}

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 8vh 20px 20px;
}

.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 16, 12, 0.58);
}

.search-panel {
  position: relative;
  width: min(800px, 100%);
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  overflow: hidden;
}

.search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 0;
}

.search-head h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: 0.06em;
}

.search-close {
  padding: 4px 8px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 10px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 13px 20px 0;
  padding: 11px 13px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.search-box:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.search-box input {
  width: 100%;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 15px;
}

.search-box input::placeholder {
  color: var(--muted-2);
}

.search-status {
  padding: 10px 22px 7px;
  color: var(--muted-2);
  font-size: 11px;
}

.search-results {
  min-height: 100px;
  overflow: auto;
  padding: 0 10px 14px;
}

.search-result {
  display: block;
  padding: 11px 12px;
  color: var(--ink);
  border-bottom: 1px solid var(--line-soft);
  border-radius: 4px;
}

.search-result:hover,
.search-result.active {
  color: var(--ink);
  background: var(--accent-soft);
}

.search-result:last-child {
  border-bottom: 0;
}

.result-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 3px;
}

.result-guide {
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
}

.result-loc {
  padding: 1px 6px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  font-size: 9.5px;
}

.result-cat {
  color: var(--muted-2);
  font-size: 9.5px;
}

.result-text {
  color: var(--muted);
  font-size: 11.8px;
  line-height: 1.7;
}

.result-text mark {
  padding: 0 2px;
  color: var(--seal-text);
  background: var(--accent);
  border-radius: 2px;
}

.search-empty {
  padding: 30px 18px 38px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.search-hint {
  padding: 7px 22px 12px;
  color: var(--muted-2);
  font-size: 10px;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 64px;
  background: rgba(14, 13, 10, 0.94);
}

.lightbox-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  max-height: 100%;
}

.lightbox-figure img {
  display: block;
  max-width: min(94vw, 1500px);
  max-height: 82vh;
  object-fit: contain;
  border-radius: 3px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.5);
}

.lightbox-figure figcaption {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #ded4c1;
  font-size: 11px;
}

.lightbox-figure figcaption a {
  color: #d8c49a;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #efe5d2;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  font-size: 23px;
  line-height: 1;
  transition: background 0.18s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.14);
}

.lightbox-close {
  top: 16px;
  right: 18px;
  font-size: 26px;
}

.lightbox-nav.prev {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-nav.next {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.component-block {
  margin-top: 30px;
  scroll-margin-top: calc(var(--header-h) + 64px);
}

.component-block > h2 {
  position: relative;
  margin: 0 0 12px;
  padding-left: 12px;
  font-size: 23px;
}

.component-block > h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.12em;
  bottom: 0.12em;
  width: 3px;
  background: var(--accent);
}

.component-note {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
}

.skill-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.skill-card {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 2px solid var(--accent-line);
  border-radius: 5px;
}

.skill-card h3 {
  margin: 0;
  font-size: 18px;
}

.skill-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 7px 0;
}

.skill-meta span {
  padding: 1px 6px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  font-size: 10px;
}

.skill-desc {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.affix-panel {
  max-width: 620px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.affix-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}

.affix-head strong {
  font-family: var(--font-head);
  font-size: 20px;
}

.affix-head span {
  color: var(--muted-2);
  font-size: 10.5px;
}

.affix-base {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 9px 0;
  color: var(--muted);
  font-size: 12px;
}

.affix-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px dashed var(--line-soft);
  font-size: 12.5px;
}

.affix-dot {
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
}

.affix-value {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 11px;
}

.quest-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.flow-node {
  position: relative;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 12px;
}

.flow-node::after {
  content: "→";
  position: absolute;
  right: -9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
}

.flow-node:last-child::after {
  display: none;
}

.flow-node strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-family: var(--font-head);
  font-size: 15px;
}

.flow-node span {
  color: var(--muted);
}

.talent-tree {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.talent-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.talent-row::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--accent-line);
}

.talent-node {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
}

.talent-node.is-core {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.talent-node small {
  color: var(--muted-2);
  font-size: 10px;
}

.npc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.npc-table th,
.npc-table td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

.npc-table th {
  color: var(--muted-2);
  background: var(--surface-2);
  font-weight: 600;
  font-size: 11px;
}

.changelog {
  position: relative;
  padding-left: 18px;
  border-left: 1px solid var(--accent-line);
}

.change-item {
  position: relative;
  padding: 0 0 18px 10px;
}

.change-item::before {
  content: "";
  position: absolute;
  left: -24px;
  top: 5px;
  width: 9px;
  height: 9px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 50%;
}

.change-item strong {
  font-family: var(--font-head);
  font-size: 16px;
}

.change-date {
  margin-left: 8px;
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
}

.change-item p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 1280px) {
  .wiki-shell {
    grid-template-columns: var(--left-w) minmax(0, 1fr);
  }

  .wiki-right {
    display: none;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .skill-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1000px) {
  .top-nav {
    gap: 14px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .top-nav::-webkit-scrollbar {
    display: none;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    padding: 34px 28px 24px;
  }

  .hero-aside {
    display: none;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .note-grid {
    grid-template-columns: 1fr;
  }

  .quest-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-node:nth-child(2)::after {
    display: none;
  }
}

@media (max-width: 900px) {
  :root {
    --header-h: 58px;
  }

  .header-inner {
    width: calc(100% - 20px);
    gap: 10px;
  }

  .brand-text small,
  .top-nav,
  .search-trigger span:not(.search-icon),
  .search-trigger kbd {
    display: none;
  }

  .brand-seal {
    width: 34px;
    height: 34px;
    font-size: 21px;
  }

  .brand-text strong {
    font-size: 16px;
  }

  .header-actions {
    margin-left: auto;
  }

  .search-trigger,
  .icon-button {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
  }

  .mobile-nav-button {
    display: inline-grid;
  }

  .wiki-shell {
    width: calc(100% - 20px);
    grid-template-columns: minmax(0, 1fr);
    padding: 12px 0 90px;
  }

  .wiki-left,
  .wiki-right {
    position: fixed;
    top: 0;
    bottom: 0;
    z-index: 80;
    width: min(86vw, 330px);
    max-height: none;
    border-radius: 0;
    transition: transform 0.18s ease;
    overflow: auto;
  }

  .wiki-left {
    left: 0;
    transform: translateX(-102%);
  }

  .wiki-right {
    right: 0;
    display: block;
    transform: translateX(102%);
  }

  body.nav-open .wiki-left,
  body.toc-open .wiki-right {
    transform: none;
  }

  .drawer-close {
    display: inline-grid;
  }

  .drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: none;
    background: rgba(18, 16, 12, 0.5);
  }

  body.nav-open .drawer-backdrop,
  body.toc-open .drawer-backdrop {
    display: block;
  }

  .mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 65;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: 54px;
    color: #f0e8d8;
    background: #22211d;
    border-top: 1px solid rgba(211, 192, 157, 0.25);
  }

  [data-theme="dark"] .mobile-bar {
    background: #0d0d0b;
  }

  .mobile-bar button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: inherit;
    background: transparent;
    border: 0;
    font-size: 11px;
  }

  .mobile-bar button:hover {
    background: rgba(255, 255, 255, 0.06);
  }

  .mobile-bar span {
    font-family: var(--font-head);
    font-size: 12px;
    letter-spacing: 0.08em;
  }

  .breadcrumb {
    margin-top: 4px;
  }

  .guide-head {
    padding: 22px 20px 20px;
  }

  .guide-head h1 {
    font-size: 30px;
  }

  .guide-desc {
    font-size: 13.5px;
  }

  .content-toolbar {
    top: calc(var(--header-h) + 6px);
    padding: 6px;
  }

  .toolbar-current {
    display: none;
  }

  .tool-select {
    max-width: 150px;
  }

  .toolbar-actions .tool-btn[data-width-toggle] {
    display: none;
  }

  .sheet-panel {
    scroll-margin-top: calc(var(--header-h) + 54px);
  }

  .page-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-stats div {
    border-bottom: 1px solid var(--line);
  }

  .hero-stats div:nth-child(2) {
    border-right: 0;
  }

  .hero-stats div:nth-child(3),
  .hero-stats div:nth-child(4) {
    border-bottom: 0;
  }

  .table-modal {
    padding: 0;
  }

  .table-modal-panel {
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: 0;
  }

  .table-modal-bar {
    padding: 6px 8px;
  }

  .table-modal-body {
    padding: 6px;
  }

  .search-modal {
    padding: 0;
  }

  .search-panel {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    border: 0;
  }

  .search-head {
    padding: 14px 14px 0;
  }

  .search-box {
    margin: 10px 14px 0;
  }

  .lightbox {
    padding: 26px 8px;
  }

  .lightbox-nav {
    width: 36px;
    height: 36px;
  }

  .lightbox-nav.prev {
    left: 6px;
  }

  .lightbox-nav.next {
    right: 6px;
  }

  .skill-card-grid {
    grid-template-columns: 1fr;
  }

  .quest-flow {
    grid-template-columns: 1fr;
  }

  .flow-node::after {
    content: "↓";
    right: auto;
    left: 50%;
    top: auto;
    bottom: -14px;
    transform: translateX(-50%);
  }

  .flow-node:nth-child(2)::after {
    display: block;
  }
}

@media (max-width: 560px) {
  .hero-inner {
    padding: 26px 18px 20px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero-lead {
    font-size: 13.5px;
  }

  .hero-stats div {
    padding: 12px 14px;
  }

  .hero-stats strong {
    font-size: 22px;
  }

  .section-head {
    padding: 8px 10px;
  }

  .section-mark {
    width: 32px;
    height: 32px;
    font-size: 17px;
  }

  .section-title h2 {
    font-size: 19px;
  }

  .section-title p {
    font-size: 11.5px;
  }

  .section-count {
    display: none;
  }

  .guide-head h1 {
    font-size: 26px;
  }

  .guide-meta {
    gap: 6px 10px;
    font-size: 10.5px;
  }

  .sheet-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .sheet-head h2 {
    font-size: 21px;
  }

  .sheet-table {
    font-size: calc(12.5px * var(--reading-scale, 1));
  }

  .sheet-table td {
    padding: 5px 7px;
  }

  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    padding: 8px;
  }

  .shot img {
    max-height: 360px;
  }

  .doc-body {
    padding: 22px 17px 30px;
  }

  .doc-body h2 {
    font-size: calc(24px * var(--reading-scale, 1));
  }

  .doc-body h3 {
    font-size: calc(19px * var(--reading-scale, 1));
  }

  .page-grid {
    grid-template-columns: 1fr;
  }

  .quick-page-grid {
    grid-template-columns: repeat(6, 1fr);
  }

  .guide-end,
  .sheet-pager {
    flex-direction: column-reverse;
  }

  .guide-end .btn,
  .sheet-pager .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .site-header,
  .site-footer,
  .wiki-left,
  .wiki-right,
  .mobile-bar,
  .drawer-backdrop,
  .content-toolbar,
  .sheet-pager,
  .guide-end,
  .pdf-actions,
  .pdf-viewer,
  .search-modal,
  .lightbox,
  .table-modal,
  .quick-tags,
  .hero-aside,
  .hero-search,
  .hero-stats,
  .site-note {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .wiki-shell {
    display: block;
    width: 100%;
    padding: 0;
  }

  .js-ready .sheet-panel:not(.is-active) {
    display: block !important;
  }

  .table-frame,
  .doc-body,
  .guide-head,
  .page-card {
    box-shadow: none;
  }

  .table-wrap {
    overflow: visible;
  }

  .sheet-table {
    width: 100%;
    min-width: 0;
    font-size: 9pt;
  }

  .shot,
  .page-card,
  .guide-card {
    break-inside: avoid;
  }
}

.hero,
.guide-head {
  background-image: var(--paper-grain);
}

.tree-home span {
  color: var(--muted-2);
  font-size: 10px;
  font-weight: 400;
}

.tree-extra.is-current {
  color: var(--accent);
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  padding-left: 10px;
}

.toc-l3 {
  padding-left: 16px;
  color: var(--muted);
}

.toc-l4 {
  padding-left: 26px;
  color: var(--muted-2);
  font-size: 11px;
}

.quick-links .quick-tags {
  margin-top: 4px;
  margin-bottom: 8px;
}

.quick-links .quick-tags button {
  font-size: 11px;
}

.mobile-theme {
  color: inherit;
}

@media (min-width: 901px) {
  body.focus-mode .wiki-shell {
    grid-template-columns: minmax(0, 1fr);
    width: min(1600px, calc(100% - 32px));
  }

  body.focus-mode .wiki-left,
  body.focus-mode .wiki-right {
    display: none;
  }

  body.focus-mode .wiki-main {
    max-width: none;
  }
}

.table-edge-next {
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 26px;
  height: 42px;
  display: none;
  place-items: center;
  color: var(--seal-text);
  background: var(--seal);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 14px;
  opacity: 0.78;
  transition: opacity 0.16s ease;
}

.table-frame.can-scroll-right .table-edge-next {
  display: grid;
}

.table-edge-next:hover {
  opacity: 1;
}

[data-theme="dark"] .table-edge-next {
  color: #17150f;
  background: var(--accent);
}

.toolbar-hint {
  color: var(--muted-2);
  font-size: 10px;
  white-space: nowrap;
}

.tool-btn.tool-accent {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

@media (max-width: 900px) {
  .toolbar-hint {
    display: none;
  }
}

@media (max-width: 900px) {
  .quick-tools [data-width-toggle] {
    display: none;
  }
}

.record-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.record-card {
  position: relative;
  padding: 14px 16px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease;
}

.record-card:hover {
  border-color: var(--line-strong);
}

.record-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.record-title-wrap {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.record-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--surface);
}

.record-index {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 10px;
}

.record-card h3 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-head);
  font-size: calc(19px * var(--reading-scale, 1));
  line-height: 1.45;
  letter-spacing: 0.015em;
  overflow-wrap: anywhere;
}

.record-card h3 a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
}

.record-card h3 a:hover {
  color: var(--accent);
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.record-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 7px;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  font-size: calc(11.5px * var(--reading-scale, 1));
  line-height: 1.55;
}

.record-chip b {
  color: var(--muted-2);
  font-weight: 500;
}

.record-chip a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 2px;
}

.record-body {
  margin-top: 7px;
  border-top: 1px solid var(--line-soft);
}

.record-row {
  display: grid;
  grid-template-columns: 7.5em minmax(0, 1fr);
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line-soft);
}

.record-row:last-child {
  border-bottom: 0;
}

.record-label {
  color: var(--muted-2);
  font-size: calc(11.5px * var(--reading-scale, 1));
  line-height: 1.7;
  letter-spacing: 0.02em;
}

.record-value {
  color: var(--ink-2);
  font-size: calc(13.5px * var(--reading-scale, 1));
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
}

.record-value a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 2px;
}

.record-note {
  padding: 10px 14px;
  color: var(--ink-2);
  background: var(--surface-2);
  border-left: 3px solid var(--note-accent, var(--accent));
  border-radius: 0 4px 4px 0;
  font-size: calc(13.5px * var(--reading-scale, 1));
  line-height: 1.85;
}

.record-note a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.record-note-label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.record-section {
  margin: 10px 0 2px;
  padding-left: 10px;
  color: var(--ink);
  border-left: 3px solid var(--accent);
  font-family: var(--font-head);
  font-size: calc(18px * var(--reading-scale, 1));
  line-height: 1.5;
}

.record-media {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding: 10px 0 0;
}

.record-media-block {
  margin-top: 8px;
}

.record-media-block .record-media {
  padding-top: 0;
}

.record-card .record-media .shot img {
  max-height: 420px;
}

.record-card .record-media figcaption {
  font-size: 10px;
}

@media (max-width: 760px) {
  .record-card {
    padding: 12px 12px 10px;
  }

  .record-card h3 {
    font-size: calc(18px * var(--reading-scale, 1));
  }

  .record-row {
    grid-template-columns: 1fr;
    gap: 1px;
    padding: 5px 0;
  }

  .record-label {
    font-size: 10.5px;
  }

  .record-value {
    font-size: calc(13px * var(--reading-scale, 1));
  }

  .record-media {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

.record-title-wrap {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.record-title-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.record-title-label {
  color: var(--muted-2);
  font-size: 9.5px;
  letter-spacing: 0.14em;
}

.pdf-conversion-note {
  margin: 10px 0 0;
  padding: 9px 12px;
  color: var(--muted);
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
  font-size: 11.5px;
}

.pdf-reader {
  margin-top: 14px;
}

.pdf-page-block {
  scroll-margin-top: calc(var(--header-h) + 64px);
}

.pdf-page-label {
  margin: 28px 0 14px;
  padding-bottom: 7px;
  color: var(--muted-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.pdf-page-block:first-child .pdf-page-label {
  margin-top: 0;
}

.pdf-paragraph {
  margin: 0.68em 0;
}

.pdf-list {
  padding-left: 1.35em;
  text-indent: -1.35em;
}

.pdf-callout {
  padding: 10px 14px;
  color: var(--ink-2);
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 4px 4px 0;
}

.pdf-figure {
  margin: 16px 0;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  text-align: center;
}

.pdf-figure a {
  display: inline-block;
  max-width: 100%;
}

.pdf-figure img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  cursor: zoom-in;
}

.pdf-figure figcaption {
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 10.5px;
}

.pdf-table-block {
  margin: 16px 0;
}

.pdf-table-block .record-list {
  gap: 8px;
}

.pdf-reader .record-card {
  box-shadow: none;
}

@media (max-width: 900px) {
  .pdf-conversion-note {
    font-size: 10.8px;
  }

  .pdf-page-label {
    margin-top: 22px;
  }
}

.record-lines {
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}

.record-line {
  position: relative;
  padding: 7px 0 7px 14px;
  color: var(--ink-2);
  border-bottom: 1px dashed var(--line-soft);
  font-size: calc(13.5px * var(--reading-scale, 1));
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}

.record-line:last-child {
  border-bottom: 0;
}

.record-line::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 1.05em;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

.record-line a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 2px;
}

@media (max-width: 760px) {
  .record-lines {
    padding: 0 11px;
  }
}

.pdf-page-context {
  margin: 0 0 10px;
  padding: 4px 9px;
  color: var(--muted-2);
  background: var(--surface-2);
  border-left: 2px solid var(--line-strong);
  border-radius: 0 3px 3px 0;
  font-size: 10.5px;
  letter-spacing: 0.04em;
}

.doc-body span[style*="color:#ffffff"],
.doc-body span[style*="color:white"],
.doc-body span[style*="color:#fff"] {
  color: var(--ink) !important;
}
