:root {
  --ink: #101425;
  --ink-soft: #31384d;
  --night: #0b1020;
  --night-2: #111a32;
  --blue: #2e6bff;
  --blue-dark: #1e52d7;
  --blue-soft: #edf3ff;
  --cyan: #62dcff;
  --paper: #f3f5f9;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --line: #e2e6ef;
  --line-strong: #cbd2df;
  --muted: #70788c;
  --success: #42d392;
  --warning: #d98419;
  --shadow-lg: 0 28px 70px rgba(19, 30, 60, 0.13);
  --shadow-md: 0 14px 34px rgba(23, 34, 64, 0.09);
  --radius-lg: 28px;
  --radius-md: 18px;
  --font-sans: "Segoe UI Variable", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(46, 107, 255, 0.2);
}

a {
  color: var(--blue-dark);
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.page-width {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  box-shadow: var(--shadow-md);
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(46, 107, 255, 0.45);
  outline-offset: 3px;
}

/* Home header */
.site-header {
  position: relative;
  overflow: hidden;
  padding-bottom: 70px;
  color: #fff;
  background:
    radial-gradient(circle at 80% 22%, rgba(46, 107, 255, 0.35), transparent 26%),
    radial-gradient(circle at 13% 70%, rgba(98, 220, 255, 0.12), transparent 25%),
    linear-gradient(135deg, var(--night) 0%, #0d1428 55%, #111d39 100%);
}

.site-header::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 92%);
}

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  letter-spacing: -0.02em;
  font-size: 19px;
  font-weight: 750;
}

.brand:hover {
  color: #fff;
}

.brand-mark,
.footer-brand span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 9px;
  background: linear-gradient(145deg, var(--blue), #64b2ff);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 23px;
  font-style: italic;
  font-weight: 700;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.14), 0 7px 18px rgba(46, 107, 255, 0.24);
}

.brand-name b {
  margin-left: 7px;
  color: rgba(255, 255, 255, 0.54);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.archive-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.archive-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(66, 211, 146, 0.1);
}

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  gap: 74px;
  align-items: center;
  padding-top: 76px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 18px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.eyebrow {
  color: rgba(255, 255, 255, 0.45);
}

.eyebrow span {
  color: var(--cyan);
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  color: #fff;
  font-size: clamp(54px, 6.6vw, 92px);
  font-weight: 760;
  letter-spacing: -0.065em;
  line-height: 0.98;
}

.hero h1 em {
  color: #78a7ff;
  font-style: normal;
}

.hero-lead {
  max-width: 610px;
  margin: 30px 0 0;
  color: rgba(255, 255, 255, 0.67);
  font-size: 17px;
  line-height: 1.8;
}

.hero-metrics {
  display: flex;
  gap: 0;
  margin-top: 38px;
}

.metric {
  display: grid;
  min-width: 128px;
  padding-right: 30px;
}

.metric + .metric {
  padding-left: 30px;
  border-left: 1px solid rgba(255, 255, 255, 0.13);
}

.metric strong {
  color: #fff;
  font-family: var(--font-mono);
  font-size: 24px;
  line-height: 1.2;
}

.metric span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.44);
  font-size: 12px;
}

.keyboard-visual {
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 32px 70px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: perspective(900px) rotateY(-5deg) rotateX(3deg);
  backdrop-filter: blur(12px);
}

.keyboard-topline {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  color: rgba(255, 255, 255, 0.38);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.13em;
}

.key-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

.key-grid span {
  display: flex;
  align-items: flex-end;
  min-width: 0;
  aspect-ratio: 1.25;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 9px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.035));
  color: rgba(255, 255, 255, 0.64);
  font-family: var(--font-mono);
  font-size: 9px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}

.key-grid .key-wide,
.key-grid .key-space {
  grid-column: span 2;
  aspect-ratio: auto;
  min-height: 50px;
}

.key-grid .key-space {
  justify-content: center;
  color: #8fb4ff;
  letter-spacing: 0.12em;
}

/* Home manual library */
.home-page main {
  position: relative;
  z-index: 2;
  margin-top: -38px;
  padding-bottom: 92px;
}

.library {
  overflow: hidden;
  border: 1px solid rgba(209, 215, 227, 0.84);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.library-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 30px;
  padding: 46px 52px 30px;
}

.section-kicker {
  margin-bottom: 10px;
  color: var(--blue);
}

.library-head h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 43px);
  letter-spacing: -0.045em;
  line-height: 1.2;
}

.library-head p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.library-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--line-strong);
}

.library-total strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 42px;
  line-height: 1;
}

.library-total span {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  writing-mode: vertical-rl;
}

.search-panel {
  padding: 0 52px 26px;
}

.search-panel > label,
.series-filter legend {
  display: block;
  margin-bottom: 9px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.search-control {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  background: var(--surface-soft);
  color: var(--muted);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.search-control:focus-within {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(46, 107, 255, 0.1);
}

.search-control svg {
  flex: 0 0 auto;
  margin-left: 18px;
}

.search-control input {
  width: 100%;
  min-width: 0;
  padding: 17px 16px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.search-control input::placeholder {
  color: #9aa1b1;
}

.search-control input::-webkit-search-cancel-button {
  display: none;
}

.clear-search {
  flex: 0 0 auto;
  margin-right: 10px;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.clear-search:hover {
  background: var(--blue-soft);
}

.search-shortcut,
.search-panel > p kbd {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  box-shadow: 0 2px 0 var(--line);
}

.search-shortcut {
  flex: 0 0 auto;
  margin-right: 15px;
  padding: 3px 8px;
}

.search-panel > p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.search-panel > p kbd {
  padding: 1px 5px;
}

.series-filter {
  min-width: 0;
  margin: 0;
  padding: 0 52px 34px;
  border: 0;
}

.filter-scroll {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-chip {
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.filter-chip:hover {
  border-color: #b8c7ec;
  color: var(--blue-dark);
  transform: translateY(-1px);
}

.filter-chip.is-active,
.filter-chip[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 49px;
  padding: 0 30px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.result-bar p {
  margin: 0;
}

.result-bar strong {
  color: var(--ink);
  font-size: 13px;
}

.library-shell {
  width: 100%;
}

.manual-table {
  width: 100%;
  border-spacing: 0;
  border-collapse: collapse;
  table-layout: auto;
}

.manual-table th {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-align: left;
  white-space: nowrap;
}

.manual-table th:first-child,
.manual-table td:first-child {
  width: 76px;
  padding-left: 30px;
  color: #a5abba;
  font-family: var(--font-mono);
  font-size: 11px;
}

.manual-table th:nth-child(2),
.manual-table td:nth-child(2) {
  width: 136px;
}

.manual-table th:nth-child(3),
.manual-table td:nth-child(3) {
  width: 235px;
}

.manual-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 14px;
  overflow-wrap: anywhere;
  transition: background 150ms ease;
}

.manual-table tbody tr:last-child td {
  border-bottom: 0;
}

.manual-table tbody tr:hover td {
  background: #f7f9ff;
}

.manual-table tbody tr:focus-within td {
  background: var(--blue-soft);
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 9px;
  border: 1px solid #dce4f7;
  border-radius: 7px;
  background: var(--blue-soft);
  color: #315ba9;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.manual-table a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.45;
}

.manual-table a::after {
  content: "→";
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 14px;
  transition: transform 150ms ease;
}

.manual-table a:hover {
  color: var(--blue-dark);
}

.manual-table a:hover::after {
  transform: translateX(3px);
}

.empty-state {
  padding: 72px 24px;
  text-align: center;
}

.empty-state > span {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 18px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
}

.empty-state h3 {
  margin: 0;
  font-size: 20px;
}

.empty-state p {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.empty-state button {
  padding: 10px 15px;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.site-footer {
  padding: 46px 0 54px;
  border-top: 1px solid var(--line);
  background: #edf0f6;
  color: var(--muted);
}

.site-footer .page-width {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 24px;
}

.footer-brand {
  display: inline-flex;
  grid-row: span 2;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.footer-brand span {
  width: 30px;
  height: 30px;
  font-size: 19px;
}

.site-footer p {
  margin: 0;
  text-align: right;
  font-size: 12px;
}

.site-footer .footer-note {
  color: #9aa1b1;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

/* Shared manual detail page styles. */
.detail-page {
  background:
    linear-gradient(rgba(26, 37, 67, 0.025) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 42px;
}

.detail-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(11, 16, 32, 0.94);
  backdrop-filter: blur(18px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 48px));
  min-height: 68px;
  margin: 0 auto;
}

.detail-nav .brand {
  color: #fff;
  font-size: 16px;
}

.detail-nav .brand-mark {
  display: inline-flex;
  width: auto;
  height: 31px;
  padding: 0 10px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-label {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 650;
}

.nav-actions,
.manual-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.button:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.button--quiet {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.76);
}

.button--quiet:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.button--primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 24px rgba(46, 107, 255, 0.24);
}

.button--primary:hover {
  background: #4179ff;
  color: #fff;
}

.button--secondary {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.button--secondary:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.manual-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 82% 25%, rgba(46, 107, 255, 0.3), transparent 27%),
    linear-gradient(135deg, var(--night), var(--night-2));
}

.manual-hero::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.18;
  background-image: linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(90deg, black, transparent 82%);
}

.manual-hero__inner {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100% - 48px));
  margin: 0 auto;
  padding: 58px 0 62px;
}

.manual-hero .eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
}

.manual-hero .tag {
  border-color: rgba(127, 169, 255, 0.28);
  background: rgba(46, 107, 255, 0.16);
  color: #a9c4ff;
}

.document-state {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 4px 9px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.62);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.document-state--verified {
  border-color: rgba(66, 211, 146, 0.28);
  background: rgba(66, 211, 146, 0.1);
  color: #7ee6b7;
}

.document-state--extracted {
  border-color: rgba(255, 187, 92, 0.3);
  background: rgba(255, 187, 92, 0.1);
  color: #ffd090;
}

.document-state--source-only {
  background: rgba(255, 255, 255, 0.06);
}

.manual-hero h1 {
  max-width: 780px;
  margin: 0;
  color: #fff;
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 780;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.manual-hero p {
  max-width: 680px;
  margin: 17px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 15px;
}

.manual-actions {
  margin-top: 28px;
}

.accuracy-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: min(960px, calc(100% - 48px));
  margin: 20px auto 0;
  padding: 13px 16px;
  border: 1px solid #d9e3f7;
  border-radius: 12px;
  background: #f3f7ff;
  color: var(--ink-soft);
  font-size: 12px;
}

.accuracy-note strong {
  flex: 0 0 auto;
  color: var(--blue-dark);
}

.accuracy-note--verified {
  border-color: #cae8da;
  background: #effaf5;
}

.accuracy-note--verified strong {
  color: #15724a;
}

.accuracy-note--extracted {
  border-color: #eedcbd;
  background: #fff9ef;
}

.accuracy-note--extracted strong {
  color: #a4610d;
}

.accuracy-note--source-only {
  border-color: #dce1ea;
  background: #f7f8fb;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px 24px;
  border-bottom: 1px solid rgba(213, 219, 231, 0.88);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(960px, 100%);
  margin: 0 auto;
}

.header h1 {
  min-width: 0;
  margin: 0;
  flex: 1;
  color: var(--ink);
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.back:hover {
  color: var(--blue-dark);
}

.main {
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
  padding: 38px 0 72px;
}

.section {
  position: relative;
  margin-bottom: 20px;
  padding: 32px 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(24, 35, 65, 0.045);
  overflow-wrap: anywhere;
}

.section::before {
  position: absolute;
  top: 24px;
  bottom: 24px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--blue);
  content: "";
}

.section h2,
.section h3 {
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1.35;
}

.section h2 {
  margin: 0 0 18px;
  font-size: 23px;
}

.section h3 {
  margin: 26px 0 10px;
  font-size: 17px;
}

.section h3:first-child {
  margin-top: 0;
}

.section p {
  margin: 0 0 11px;
  color: var(--ink-soft);
  font-size: 15px;
}

.section ul,
.section ol {
  margin: 10px 0 14px;
  padding-left: 22px;
  color: var(--ink-soft);
  font-size: 15px;
}

.section li + li {
  margin-top: 6px;
}

.section li::marker {
  color: var(--blue);
}

.main table,
.manual-content table {
  width: 100%;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-spacing: 0;
  border-collapse: separate;
  border-radius: 12px;
  font-size: 14px;
  overflow: hidden;
}

.main th,
.manual-content th {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--night);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: left;
}

.main td,
.manual-content td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
}

.main tr:last-child td,
.manual-content tr:last-child td {
  border-bottom: 0;
}

.main tbody tr:nth-child(even) td,
.manual-content tbody tr:nth-child(even) td {
  background: var(--surface-soft);
}

.key {
  display: inline-block;
  min-width: 28px;
  padding: 3px 8px 4px;
  border: 1px solid #30384a;
  border-radius: 6px;
  background: linear-gradient(#2a3141, #121725);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.45;
  text-align: center;
  vertical-align: 1px;
  box-shadow: inset 0 -2px 0 #080b12, 0 2px 3px rgba(11, 16, 32, 0.16);
}

.tip,
.warn {
  position: relative;
  margin: 18px 0;
  padding: 16px 18px 16px 48px;
  border: 1px solid #d6e2ff;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--ink-soft);
  font-size: 14px;
}

.tip::before,
.warn::before {
  position: absolute;
  top: 16px;
  left: 17px;
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  content: "i";
  font-family: Georgia, serif;
  font-size: 13px;
  font-style: italic;
  font-weight: 700;
}

.warn {
  border-color: #f0d9bb;
  background: #fff8ef;
}

.warn::before {
  background: var(--warning);
  content: "!";
  font-family: var(--font-sans);
  font-style: normal;
}

.footer {
  padding: 36px 24px 48px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.footer a {
  color: var(--blue-dark);
  font-weight: 700;
}

/* Optional detail-page table of contents and source actions. */
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 28px;
  width: min(1210px, calc(100% - 40px));
  margin: 28px auto 0;
  align-items: start;
}

.manual-content {
  min-width: 0;
}

.toc,
.toc-nav {
  position: sticky;
  top: 86px;
  align-self: start;
  max-height: calc(100vh - 110px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  overflow: auto;
}

.toc-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.toc a,
.toc-nav a {
  display: block;
  padding: 7px 9px;
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: 12px;
}

.toc a:hover,
.toc a[aria-current="true"],
.toc-nav a:hover,
.toc-nav a[aria-current="true"] {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.toc-panel {
  min-width: 0;
}

.toc-panel__inner {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 116px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 24px rgba(24, 35, 65, 0.045);
  overflow: auto;
  backdrop-filter: blur(12px);
}

.toc-panel__inner > p {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.toc-panel ol {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.toc-panel li + li {
  margin-top: 3px;
}

.toc-panel a {
  display: block;
  padding: 7px 9px;
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
}

.toc-panel a:hover,
.toc-panel a[aria-current="true"] {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.toc-panel__inner > a:last-child {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  border-radius: 0;
  color: var(--blue-dark);
  font-weight: 700;
}

.back-to-top {
  position: fixed;
  right: max(18px, calc((100vw - 1240px) / 2));
  bottom: 22px;
  z-index: 25;
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: var(--night);
  color: #fff;
  font-family: var(--font-mono);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
  cursor: pointer;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.page-tools,
.source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tool-button,
.source-button,
.source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.tool-button:hover,
.source-button:hover,
.source-link:hover {
  border-color: var(--blue);
  color: var(--blue-dark);
}

@media (max-width: 920px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 34px;
  }

  .keyboard-visual {
    padding: 16px;
  }

  .manual-table th:nth-child(3),
  .manual-table td:nth-child(3) {
    width: 190px;
  }

  .detail-layout {
    display: block;
  }

  .toc,
  .toc-nav {
    position: static;
    max-height: none;
    margin: 24px 0;
  }

  .toc-panel__inner {
    position: static;
    max-height: none;
    margin-bottom: 32px;
  }
}

@media (max-width: 760px) {
  .page-width {
    width: min(100% - 28px, 1180px);
  }

  .site-header {
    padding-bottom: 58px;
  }

  .topbar {
    min-height: 67px;
  }

  .brand-name b {
    display: none;
  }

  .archive-status {
    font-size: 10px;
  }

  .hero {
    display: block;
    padding-top: 54px;
  }

  .hero h1 {
    font-size: clamp(50px, 15vw, 72px);
  }

  .hero-lead {
    margin-top: 24px;
    font-size: 15px;
  }

  .hero-metrics {
    margin-top: 30px;
  }

  .metric {
    min-width: 0;
    padding-right: 18px;
    flex: 1;
  }

  .metric + .metric {
    padding-left: 18px;
  }

  .metric strong {
    font-size: 19px;
  }

  .metric span {
    font-size: 10px;
  }

  .keyboard-visual {
    display: none;
  }

  .home-page main {
    margin-top: -28px;
    padding-bottom: 56px;
  }

  .library {
    border-radius: 20px;
  }

  .library-head {
    padding: 32px 22px 24px;
  }

  .library-total {
    display: none;
  }

  .search-panel {
    padding: 0 22px 24px;
  }

  .series-filter {
    padding: 0 22px 25px;
  }

  .filter-scroll {
    margin-right: -22px;
    padding-right: 22px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .filter-scroll::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    flex: 0 0 auto;
  }

  .result-bar {
    padding: 0 20px;
  }

  .result-bar > span {
    display: none;
  }

  .library-shell {
    padding: 14px;
    background: var(--paper);
  }

  .manual-table,
  .manual-table tbody {
    display: block;
    width: 100%;
  }

  .manual-table thead {
    display: none;
  }

  .manual-table tbody {
    display: grid;
    gap: 10px;
  }

  .manual-table tbody tr:not([hidden]) {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 14px;
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 5px 15px rgba(22, 33, 62, 0.035);
  }

  .manual-table td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
  }

  .manual-table td:first-child {
    display: none;
  }

  .manual-table td:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    align-self: start;
  }

  .manual-table td:nth-child(3) {
    grid-column: 1;
    grid-row: 1;
    width: auto;
    color: var(--ink);
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.015em;
  }

  .manual-table td:nth-child(4) {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-top: 8px;
    border-top: 1px solid var(--line) !important;
  }

  .manual-table a {
    display: flex;
    justify-content: space-between;
    width: 100%;
    padding-top: 3px;
    font-size: 13px;
  }

  .tag {
    font-size: 9px;
  }

  .empty-state {
    border-radius: 15px;
    background: #fff;
  }

  .site-footer .page-width {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .footer-brand {
    margin-bottom: 5px;
  }

  .site-footer p {
    text-align: left;
  }

  .header {
    padding: 12px 14px;
  }

  .nav-inner {
    width: min(100% - 28px, 1180px);
    min-height: 62px;
    gap: 12px;
  }

  .brand-label {
    display: none;
  }

  .nav-actions {
    gap: 6px;
  }

  .nav-actions .button {
    min-height: 35px;
    padding: 7px 10px;
    font-size: 11px;
  }

  .manual-hero__inner {
    width: min(100% - 28px, 960px);
    padding: 42px 0 46px;
  }

  .manual-hero h1 {
    font-size: clamp(34px, 11vw, 50px);
  }

  .manual-actions {
    align-items: stretch;
  }

  .manual-actions .button {
    flex: 1 1 150px;
  }

  .accuracy-note {
    width: min(100% - 28px, 960px);
    flex-direction: column;
    gap: 3px;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 8px 12px;
  }

  .header h1 {
    flex-basis: calc(100% - 100px);
    font-size: 16px;
  }

  .main {
    width: min(100% - 28px, 960px);
    padding-top: 20px;
  }

  .section {
    padding: 25px 20px;
    border-radius: 14px;
  }

  .section h2 {
    font-size: 20px;
  }

  .main table,
  .manual-content table {
    display: block;
    max-width: 100%;
    border-radius: 10px;
    overflow-x: auto;
    white-space: normal;
  }

  .main th,
  .main td,
  .manual-content th,
  .manual-content td {
    min-width: 120px;
    padding: 9px 11px;
  }

  .detail-layout {
    width: min(100% - 28px, 1210px);
    margin-top: 20px;
  }

  .back-to-top {
    right: 14px;
    bottom: 14px;
  }
}

@media (max-width: 440px) {
  .hero-metrics .metric:last-child {
    display: none;
  }

  .metric:nth-child(2) {
    padding-right: 0;
  }

  .search-shortcut {
    display: none;
  }

  .clear-search {
    margin-right: 8px;
  }

  .manual-table tbody tr:not([hidden]) {
    padding: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  .site-header,
  .detail-nav,
  .search-panel,
  .series-filter,
  .result-bar,
  .site-footer,
  .header,
  .footer,
  .toc,
  .toc-nav,
  .toc-panel,
  .page-tools,
  .source-actions,
  .manual-actions,
  .back-to-top {
    display: none !important;
  }

  body,
  .home-page main {
    margin: 0;
    background: #fff;
  }

  .library,
  .section {
    border-color: #bbb;
    box-shadow: none;
  }

  .manual-table a {
    color: #000;
  }

  .manual-table a::after {
    display: none;
  }

  .detail-layout {
    display: block;
    width: 100%;
    margin: 0;
  }

  .manual-hero__inner,
  .accuracy-note {
    width: 100%;
  }
}
