* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
  color: #263238;
  background: #f4f7f9;
}

a {
  color: #0f6cbd;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.header {
  position: fixed;
  z-index: 1000;
  inset: 0 0 auto 0;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  color: #fff;
  background: #155e75;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
}

.logo:hover {
  color: #fff;
  text-decoration: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.header-right a {
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
}

.site-search {
  position: relative;
  flex: 0 1 360px;
  width: min(34vw, 360px);
}

.site-search-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 2px 5px 2px 13px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.site-search-bar:focus-within {
  background: #fff;
  border-color: #fff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
}

.site-search-input {
  flex: 1 1 auto;
  min-width: 96px;
  height: 30px;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 0;
  outline: none;
  font: 14px/1.4 "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

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

.site-search-input::placeholder {
  color: rgba(255, 255, 255, 0.78);
}

.site-search-bar:focus-within .site-search-input {
  color: #1f2933;
}

.site-search-bar:focus-within .site-search-input::placeholder {
  color: #98a2b3;
}

.site-search-clear {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  transition: background 0.16s, color 0.16s, opacity 0.16s;
  visibility: hidden;
  font-size: 22px;
  line-height: 1;
}

.site-search-clear.show {
  visibility: visible;
}

.site-search-bar:focus-within .site-search-clear {
  color: #344054;
}

.site-search-clear:not(:disabled):hover {
  background: rgba(15, 23, 42, 0.08);
}

.site-search-clear:disabled {
  opacity: 0.38;
  cursor: default;
}

.site-search-results {
  display: none;
  position: absolute;
  top: 42px;
  right: 0;
  width: min(520px, calc(100vw - 32px));
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: 8px;
  background: #fff;
  border: 1px solid #d8e1e8;
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.18);
  z-index: 1200;
}

.site-search-results.show {
  display: block;
}

.site-search-result {
  display: block;
  padding: 10px 12px;
  color: #263238;
  border-radius: 8px;
}

.site-search-result:hover {
  color: #0f5060;
  background: #ecfeff;
  text-decoration: none;
}

.site-search-result strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  line-height: 1.4;
}

.site-search-result span,
.site-search-empty {
  display: block;
  color: #667085;
  font-size: 12px;
  line-height: 1.6;
}

.site-search-empty {
  padding: 12px;
}

.menu-toggle {
  display: none;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.layout {
  display: flex;
  min-height: 100vh;
  padding-top: 56px;
}

.sidebar {
  position: fixed;
  top: 56px;
  bottom: 0;
  left: 0;
  width: 292px;
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid #d8e1e8;
}

.sidebar-header {
  padding: 16px 20px;
  color: #155e75;
  font-size: 14px;
  font-weight: 700;
  background: #eef7fa;
  border-bottom: 1px solid #d8e1e8;
}

.sidebar-nav {
  padding: 8px 0;
}

.nav-group {
  border-bottom: 1px solid #eef2f5;
}

.nav-group-title {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.nav-group-title.current {
  color: #0e7490;
  background: #ecfeff;
}

.nav-title-text {
  min-width: 0;
}

.nav-status {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  vertical-align: 1px;
}

.nav-status.completed {
  color: #166534;
  background: #dcfce7;
}

.nav-status.pending {
  color: #92400e;
  background: #fef3c7;
}

.arrow {
  margin-left: auto;
  color: #78909c;
  font-size: 10px;
  transition: transform 0.2s;
}

.nav-group-title.active .arrow {
  transform: rotate(90deg);
}

.nav-sub {
  display: none;
  margin: 0;
  padding: 0 0 8px;
  list-style: none;
}

.nav-sub.show {
  display: block;
}

.nav-sub a {
  display: block;
  padding: 6px 18px 6px 36px;
  color: #52616b;
  font-size: 13px;
  line-height: 1.5;
  border-left: 3px solid transparent;
}

.nav-sub a:hover {
  color: #0e7490;
  background: #f2fbfd;
  text-decoration: none;
}

.nav-sub a.active {
  color: #0f5060;
  background: #e0f2fe;
  border-left-color: #0e7490;
  font-weight: 700;
}

.main-content {
  width: calc(100% - 292px);
  max-width: 1280px;
  min-width: 0;
  margin-left: 292px;
  padding: 30px 40px 56px;
}

.home-hero {
  padding: 36px 0 30px;
  border-bottom: 1px solid #d8e1e8;
  margin-bottom: 28px;
}

.home-hero h1 {
  margin: 0 0 10px;
  color: #12313f;
  font-size: 30px;
  line-height: 1.25;
}

.home-hero p {
  max-width: 760px;
  margin: 0;
  color: #52616b;
  line-height: 1.8;
}

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.chapter-card {
  display: block;
  min-height: 132px;
  padding: 18px;
  color: #263238;
  background: #fff;
  border: 1px solid #d8e1e8;
  border-radius: 8px;
}

.chapter-card:hover {
  border-color: #0e7490;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  text-decoration: none;
}

.chapter-card.disabled {
  cursor: default;
}

.chapter-card.disabled:hover {
  border-color: #d8e1e8;
  box-shadow: none;
}

.card-label,
.chapter-badge {
  display: inline-block;
  padding: 3px 10px;
  color: #fff;
  background: #0e7490;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.completed {
  color: #166534;
  background: #dcfce7;
}

.status-pill.pending {
  color: #92400e;
  background: #fef3c7;
}

.chapter-card h3 {
  margin: 12px 0 10px;
  font-size: 16px;
  line-height: 1.5;
}

.card-meta {
  color: #6b7c86;
  font-size: 13px;
}

.chapter-title {
  margin: 0 0 16px;
  color: #12313f;
  font-size: 28px;
  line-height: 1.35;
}

.pdf-pages {
  display: grid;
  gap: 18px;
}

.pdf-page {
  margin: 0;
  padding: 12px;
  background: #fff;
  border: 1px solid #d8e1e8;
  border-radius: 8px;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.06);
}

.pdf-page img {
  display: block;
  width: 100%;
  height: auto;
}

.pdf-page figcaption {
  padding: 8px 2px 0;
  color: #6b7c86;
  font-size: 12px;
  text-align: right;
}

.section-heading {
  margin: 46px 0 22px;
  padding: 14px 18px;
  background: #ecfeff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  scroll-margin-top: 78px;
}

.section-heading h2 {
  margin: 0;
  color: #0f5060;
  font-size: 24px;
  line-height: 1.35;
}

.chapter-title-inline {
  margin: 28px 0 14px;
  color: #12313f;
  font-size: 24px;
  line-height: 1.35;
}

.subsection-heading {
  margin: 30px 0 14px;
  padding: 0 0 8px;
  color: #0e7490;
  font-size: 19px;
  line-height: 1.4;
  border-bottom: 1px solid #d8e1e8;
}

.subsection-heading.numbered-heading {
  padding-left: 0;
  text-indent: 0;
}

.content-text {
  margin: 0 0 18px;
  color: #263238;
  font-size: 17px;
  line-height: 2.12;
  letter-spacing: 0.025em;
  text-indent: 2em;
}

.content-text,
.note-box,
.content-table,
.code-block,
.result-block,
.inline-figure,
.table-caption,
.subsection-heading {
  scroll-margin-top: 78px;
}

.search-hit {
  border-radius: 6px;
  outline: 3px solid rgba(14, 116, 144, 0.24);
  background-color: rgba(236, 254, 255, 0.72);
  transition: background-color 0.2s ease, outline-color 0.2s ease;
}

.content-text.list-like {
  position: relative;
  margin-left: 2.2em;
  padding-left: 30px;
  text-indent: 0;
  line-height: 2.08;
}

.content-text.list-like::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0.92em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0e7490;
}

h4.subsection-heading {
  margin: 26px 0 14px;
  padding: 0;
  color: #075985;
  background: transparent;
  border: 0;
  font-size: 18px;
  font-weight: 700;
}

h4.subsection-heading::before {
  content: none;
}

.minor-section {
  margin: 28px 0 34px 2em;
  padding-left: 22px;
  background: transparent;
  border-left: 0;
}

.numbered-section {
  margin: 24px 0 34px;
  padding-left: 0;
  border-left: 0;
}

.numbered-section > .numbered-heading {
  margin: 34px 0 18px;
  padding: 0 0 10px;
  color: #0f5060;
  border: 0;
  border-bottom: 1px solid #d8e1e8;
  font-size: 20px;
  line-height: 1.45;
}

.numbered-section > .content-text,
.numbered-section > .note-box,
.numbered-section > .code-block,
.numbered-section > .result-block,
.numbered-section > .content-table,
.numbered-section > .inline-figure,
.numbered-section > .table-caption {
  max-width: none;
}

.minor-section > .subsection-heading {
  margin: 0 0 14px -22px;
  padding: 0 0 8px;
  color: #075985;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #e2edf3;
  font-size: 18px;
  line-height: 1.5;
}

.minor-section > .content-text {
  margin-bottom: 14px;
}

.minor-section .content-text.list-like {
  margin-left: 0.8em;
}

.minor-section > .content-text:last-child,
.minor-section > .content-table:last-child,
.minor-section > .inline-figure:last-child {
  margin-bottom: 10px;
}

.term-label {
  color: #0f5060;
  font-weight: 700;
}

.inline-code {
  padding: 1px 5px;
  color: #0f5060;
  background: #eef7fb;
  border: 1px solid #d8e8ef;
  border-radius: 4px;
  font-family: "Cascadia Mono", "Consolas", "Microsoft YaHei UI", monospace;
  font-size: 0.92em;
}

.note-box {
  display: flex;
  gap: 14px;
  margin: 22px 0 26px;
  padding: 18px 22px;
  color: #334155;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-left: 5px solid #0e7490;
  border-radius: 8px;
  font-size: 16px;
  line-height: 2;
  letter-spacing: 0.02em;
}

.note-icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #fff;
  background: #0e7490;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 700;
}

.note-text {
  flex: 1 1 auto;
  min-width: 0;
}

.ocr-content {
  max-width: 1040px;
  margin: 0 auto;
  padding: 46px 64px;
  background: #fff;
  border: 1px solid #d8e1e8;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.ocr-content.preserve-lines {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 44px 34px;
  border-color: #e6e6e6;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.ocr-content.preserve-lines .content-text {
  white-space: normal;
  font-size: 16px;
  line-height: 1.95;
  padding-left: 0;
  text-indent: 2em;
  letter-spacing: 0;
  margin-bottom: 16px;
}

.ocr-content.preserve-lines .content-text.list-like {
  padding-left: 24px;
  text-indent: 0;
}

.ocr-content.preserve-lines .chapter-title-inline {
  margin: 4px 0 24px;
  padding-bottom: 14px;
  color: #333;
  font-size: 30px;
  border-bottom: 1px solid #e6e6e6;
}

.ocr-content.preserve-lines .section-heading {
  margin: 42px 0 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e6e6e6;
}

.ocr-content.preserve-lines .subsection-heading {
  margin: 30px 0 16px;
  padding: 0 0 0 12px;
  font-size: 20px;
  color: #333;
  border-left: 4px solid #16a34a;
}

.ocr-content .code-block {
  margin: 18px 0 24px;
  padding: 42px 20px 16px;
  color: #eeffff;
  background: #263238;
  border-radius: 6px;
  font-family: "Cascadia Mono", "Consolas", "Source Code Pro", "Fira Code", "Microsoft YaHei UI", monospace;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  position: relative;
  white-space: pre;
  text-indent: 0;
  letter-spacing: 0;
}

.ocr-content .code-block code {
  display: block;
  min-width: max-content;
  font: inherit;
}

.ocr-content.preserve-lines .code-block {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}

.ocr-content .result-block {
  margin: 16px 0 24px;
  padding: 42px 18px 16px;
  color: #334155;
  background: #fafafa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-family: "Cascadia Mono", "Consolas", "Source Code Pro", "Fira Code", "Microsoft YaHei UI", monospace;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  overflow-wrap: anywhere;
  position: relative;
  white-space: pre-wrap;
  text-indent: 0;
  letter-spacing: 0;
}

.ocr-content .result-block::before {
  content: "运行结果";
  position: absolute;
  top: 0;
  left: 0;
  padding: 7px 14px;
  color: #fff;
  background: #ff8f00;
  border-radius: 0 0 6px 0;
  font: 700 13px/1 "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}

.ocr-content .result-block code {
  display: block;
  font: inherit;
}

.code-copy-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 4px;
  background: rgba(255,255,255,0.09);
  color: #e8f5e9;
  font: 700 12px/1 "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  padding: 7px 10px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.code-copy-button:hover {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.32);
}

.code-copy-button.copied {
  background: #43a047;
  border-color: #66bb6a;
  color: #fff;
}

.result-block .code-copy-button {
  border-color: #d8e1e8;
  background: #fff;
  color: #0f5060;
}

.result-block .code-copy-button:hover {
  background: #f1f5f9;
  border-color: #b6c7d3;
}

.result-block .code-copy-button.copied {
  background: #43a047;
  border-color: #66bb6a;
  color: #fff;
}

.code-block .line-num {
  color: #546e7a;
  user-select: none;
  display: inline-block;
  width: 28px;
  text-align: right;
  margin-right: 16px;
}

.ocr-content.preserve-lines .content-table {
  margin: 14px 0 24px;
  background: #fff;
  box-shadow: none;
}

.ocr-content.preserve-lines .content-table thead th {
  background: #f5f5f5;
  color: #333;
  border-bottom-color: #d6d6d6;
}

.content-table {
  width: 100%;
  margin: 16px 0 26px;
  border-collapse: collapse;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 15px;
  line-height: 1.75;
}

.content-table th,
.content-table td {
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  vertical-align: top;
}

.content-table thead th {
  color: #12313f;
  background: #eaf4f8;
  font-weight: 700;
}

.content-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.ocr-content.preserve-lines .table-caption {
  margin-top: 18px;
  color: #333;
  font-size: 15px;
}

.figure-caption,
.table-caption {
  margin: 10px 0 18px;
  color: #546e7a;
  font-size: 13px;
  text-align: center;
}

.inline-figure {
  display: block;
  clear: both;
  margin: 24px auto 30px;
  padding: 12px;
  width: min(100%, 720px);
  background: #f8fafc;
  border: 1px solid #d8e1e8;
  border-radius: 8px;
  text-align: center;
}

.ocr-content.preserve-lines .inline-figure {
  max-width: 700px;
}

.inline-figure img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 620px;
  object-fit: contain;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}

.inline-figure figcaption {
  margin-top: 8px;
  color: #546e7a;
  font-size: 13px;
}

.table-caption {
  color: #0f5060;
  font-weight: 700;
}

.source-pages {
  margin-top: 28px;
}

.source-pages summary {
  cursor: pointer;
  color: #0f5060;
  font-weight: 700;
}

.text-extract {
  margin-top: 28px;
  padding: 16px;
  background: #fff;
  border: 1px solid #d8e1e8;
  border-radius: 8px;
}

.text-extract summary {
  cursor: pointer;
  color: #0f5060;
  font-weight: 700;
}

.text-extract pre {
  max-height: 520px;
  overflow: auto;
  white-space: pre-wrap;
  font: 13px/1.7 "Cascadia Mono", Consolas, "Microsoft YaHei UI", monospace;
}

.chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
}

.chapter-nav a {
  max-width: 48%;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid #d8e1e8;
  border-radius: 6px;
}

.footer {
  margin-left: 292px;
  padding: 22px 40px;
  color: #6b7c86;
  font-size: 13px;
}

.overlay {
  display: none;
}

.back-to-top {
  position: fixed;
  right: 28px;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  z-index: 850;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 16px;
  color: #f8fafc;
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.96), rgba(15, 80, 96, 0.96));
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(10px);
  -webkit-tap-highlight-color: transparent;
}

.back-to-top svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: linear-gradient(135deg, #0891b2, #155e75);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.back-to-top:focus-visible {
  outline: 3px solid rgba(14, 116, 144, 0.28);
  outline-offset: 3px;
}

@media (max-width: 820px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .header {
    gap: 10px;
    padding: 0 14px;
  }

  .menu-toggle {
    display: block;
    flex: 0 0 auto;
    padding: 4px 6px;
  }

  .logo {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 16px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .logo-icon {
    flex: 0 0 auto;
  }

  .header-right {
    flex: 1 1 250px;
    min-width: 0;
    margin-left: 0;
  }

  .header-right a {
    white-space: nowrap;
    font-size: 13px;
  }

  .header-right > a {
    display: none;
    white-space: nowrap;
    font-size: 13px;
  }

  .site-search {
    width: 100%;
    min-width: 0;
  }

  .site-search-results {
    position: fixed;
    top: 56px;
    left: 8px;
    right: 8px;
    width: auto;
    max-height: 60vh;
  }

  .sidebar {
    z-index: 950;
    width: min(86vw, 292px);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .overlay.show {
    display: block;
    position: fixed;
    z-index: 900;
    inset: 56px 0 0;
    background: rgba(15, 23, 42, 0.35);
  }

  .main-content,
  .footer {
    margin-left: 0;
  }

  .main-content {
    width: 100%;
    max-width: none;
    padding: 22px 16px 44px;
  }

  .home-hero {
    padding: 24px 0 22px;
    margin-bottom: 22px;
  }

  .home-hero h1,
  .chapter-title {
    font-size: 24px;
    line-height: 1.35;
  }

  .home-hero p {
    font-size: 15px;
    line-height: 1.75;
  }

  .chapter-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .chapter-card {
    min-height: auto;
    padding: 16px;
  }

  .ocr-content,
  .ocr-content.preserve-lines {
    width: 100%;
    max-width: none;
    padding: 22px 18px 30px;
    border-radius: 6px;
  }

  .content-text,
  .ocr-content.preserve-lines .content-text {
    font-size: 16px;
    line-height: 1.9;
    letter-spacing: 0;
  }

  .section-heading {
    margin: 34px 0 18px;
    padding: 12px 14px;
    scroll-margin-top: 72px;
  }

  .section-heading h2 {
    font-size: 21px;
  }

  .chapter-title-inline,
  .ocr-content.preserve-lines .chapter-title-inline {
    font-size: 22px;
  }

  .numbered-section {
    margin: 20px 0 28px;
  }

  .numbered-section > .numbered-heading {
    font-size: 18px;
  }

  .minor-section {
    margin-left: 1em;
    padding-left: 14px;
  }

  .minor-section > .subsection-heading {
    margin-left: -14px;
  }

  .note-box {
    gap: 10px;
    padding: 14px 16px;
    font-size: 15px;
    line-height: 1.85;
  }

  .content-table {
    display: block;
    overflow-x: auto;
    font-size: 14px;
  }

  .ocr-content .code-block,
  .ocr-content .result-block {
    margin-left: -4px;
    margin-right: -4px;
    padding-left: 14px;
    padding-right: 14px;
    font-size: 12px;
  }

  .inline-figure {
    width: 100%;
    padding: 8px;
  }

  .back-to-top {
    right: 16px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    width: 46px;
    height: 46px;
    border-radius: 15px;
  }

  .back-to-top svg {
    width: 21px;
    height: 21px;
  }
}

@media (max-width: 420px) {
  .header {
    gap: 8px;
    padding: 0 10px;
  }

  .logo {
    flex: 0 1 94px;
    font-size: 15px;
  }

  .logo-icon {
    display: none;
  }

  .header-right {
    flex: 1 1 auto;
    min-width: 0;
  }

  .site-search-bar {
    min-height: 32px;
    gap: 2px;
    padding: 2px 3px 2px 9px;
  }

  .site-search-input {
    min-width: 62px;
    height: 28px;
    font-size: 13px;
  }

  .site-search-clear {
    width: 24px;
    height: 24px;
    border-radius: 7px;
  }

  .site-search-clear {
    font-size: 20px;
  }

  .main-content {
    padding: 20px 12px 40px;
  }

  .ocr-content,
  .ocr-content.preserve-lines {
    padding: 20px 14px 28px;
  }

  .content-text,
  .ocr-content.preserve-lines .content-text {
    font-size: 15.5px;
    line-height: 1.86;
  }

  .chapter-title {
    font-size: 22px;
  }
}

@media (max-width: 360px) {
  .logo {
    display: none;
  }
}
