:root {
  --navy-950: #101b3e;
  --navy-900: #17306f;
  --navy-800: #1d438e;
  --navy-700: #2c5aa9;
  --teal-600: #157a83;
  --orange-500: #e57a34;
  --orange-100: #fff0e5;
  --green-600: #2f7d57;
  --red-600: #b84343;
  --ink-950: #172033;
  --ink-800: #30384a;
  --ink-650: #515b70;
  --ink-500: #7c8698;
  --line: #dfe4ec;
  --line-strong: #cbd3e0;
  --surface: #ffffff;
  --surface-soft: #f5f7fb;
  --surface-warm: #fbf8f2;
  --shadow: 0 14px 38px rgb(17 31 68 / 10%);
  --header-height: 66px;
  --sidebar-width: 342px;
  --article-size: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink-950);
  background: var(--surface-soft);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: fixed;
  z-index: 40;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  height: var(--header-height);
  padding: 0 24px;
  color: #fff;
  background: var(--navy-950);
  box-shadow: 0 4px 18px rgb(10 21 51 / 20%);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 142px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 6px 16px rgb(4 12 35 / 24%);
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 13px;
  border-radius: 6px;
  color: rgb(255 255 255 / 72%);
  font-size: 14px;
  transition: background 160ms ease, color 160ms ease;
}

.nav-link svg {
  width: 17px;
  height: 17px;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgb(255 255 255 / 10%);
}

.nav-link.active {
  box-shadow: inset 0 -2px 0 var(--orange-500);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 142px;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  color: inherit;
  background: transparent;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.icon-button:hover {
  border-color: rgb(255 255 255 / 16%);
  background: rgb(255 255 255 / 9%);
}

.icon-button.small {
  width: 34px;
  height: 34px;
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.login-button,
.primary-small-button,
.modal-primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  border-radius: 6px;
  font-weight: 700;
}

.login-button {
  padding: 0 14px;
  color: var(--navy-950);
  background: #fff;
}

.login-button.is-logged-in {
  color: #fff;
  background: var(--teal-600);
}

.mobile-menu-button {
  display: none;
}

.workspace {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  padding-top: var(--header-height);
}

.sidebar {
  position: fixed;
  z-index: 25;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  width: var(--sidebar-width);
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #fbfcff;
  scrollbar-width: thin;
}

.sidebar-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.book-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.book-cover {
  width: 76px;
  height: 106px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: 0 8px 18px rgb(22 46 101 / 14%);
}

.book-card h1 {
  margin: 2px 0 7px;
  font-size: 17px;
  line-height: 1.36;
}

.book-summary {
  display: -webkit-box;
  margin: 0 0 10px;
  overflow: hidden;
  color: var(--ink-650);
  font-size: 12.5px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.eyebrow {
  margin: 0;
  color: var(--orange-500);
  font-size: 11px;
  font-weight: 800;
}

.book-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--ink-500);
  font-size: 11px;
}

.book-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.book-meta svg {
  width: 13px;
  height: 13px;
}

.sidebar-section {
  padding: 16px 12px 8px;
}

.sidebar-section + .sidebar-section {
  border-top: 1px solid var(--line);
}

.sidebar-section-title,
.reading-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 8px;
  color: var(--ink-650);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-section-title span:last-child,
.reading-progress-head span:last-child {
  color: var(--ink-500);
  font-weight: 500;
}

.chapter-list,
.outline-list {
  display: grid;
  gap: 3px;
}

.chapter-button,
.outline-button {
  display: grid;
  width: 100%;
  border-radius: 6px;
  color: var(--ink-650);
  text-align: left;
  background: transparent;
}

.chapter-button {
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 42px;
  padding: 7px 8px;
}

.chapter-button:hover,
.chapter-button.active {
  color: var(--navy-800);
  background: #eef3fc;
}

.chapter-button.active {
  font-weight: 800;
}

.chapter-number {
  color: var(--ink-500);
  font-size: 12px;
  font-weight: 700;
}

.chapter-button.active .chapter-number {
  color: var(--orange-500);
}

.chapter-copy {
  min-width: 0;
}

.chapter-copy strong,
.chapter-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chapter-copy strong {
  font-size: 13px;
}

.chapter-copy small {
  margin-top: 1px;
  color: var(--ink-500);
  font-size: 11px;
}

.chapter-lock {
  color: var(--ink-500);
}

.chapter-lock svg {
  width: 14px;
  height: 14px;
}

.outline-button {
  min-height: 30px;
  padding: 5px 8px 5px calc(8px + (var(--level) - 1) * 12px);
  font-size: 12px;
}

.outline-button:hover,
.outline-button.active {
  color: var(--navy-800);
  background: #eef3fc;
}

.outline-button.active {
  font-weight: 700;
}

.reading-progress {
  margin: 14px 18px 24px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.reading-progress-head {
  padding: 0 0 8px;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: #e9edf4;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--orange-500);
  transition: width 120ms linear;
}

.reader {
  grid-column: 2;
  min-width: 0;
}

.reader-toolbar {
  position: sticky;
  z-index: 20;
  top: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 9px 30px;
  border-bottom: 1px solid var(--line);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(12px);
}

.breadcrumb,
.reader-actions {
  display: flex;
  align-items: center;
}

.breadcrumb {
  gap: 7px;
  min-width: 0;
  color: var(--ink-500);
  font-size: 13px;
}

.breadcrumb svg {
  width: 14px;
  height: 14px;
}

.breadcrumb strong {
  overflow: hidden;
  color: var(--ink-800);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-actions {
  gap: 6px;
}

.reader-actions .icon-button {
  color: var(--ink-650);
}

.reader-actions .icon-button:hover {
  border-color: var(--line);
  background: var(--surface-soft);
}

.primary-small-button {
  min-height: 34px;
  padding: 0 12px;
  color: #fff;
  background: var(--navy-800);
  font-size: 12px;
}

.primary-small-button:hover {
  background: var(--navy-700);
}

.article {
  width: min(900px, calc(100% - 60px));
  min-height: calc(100vh - 220px);
  margin: 34px auto 0;
  padding: 54px 68px 80px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: var(--article-size);
}

.article.reader-warm {
  color: #2e2a24;
  background: var(--surface-warm);
}

.chapter-heading {
  margin: 0 0 14px;
  color: var(--navy-900);
  font-size: 32px;
  line-height: 1.25;
}

.article-state {
  display: grid;
  min-height: 420px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.article-state-icon {
  display: inline-grid;
  width: 58px;
  height: 58px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 50%;
  color: var(--navy-800);
  background: #e8eef9;
}

.article-state-icon svg {
  width: 26px;
  height: 26px;
}

.article-state h1 {
  margin: 0 0 8px;
  color: var(--ink-950);
  font-size: 22px;
}

.article-state p {
  margin: 0;
  color: var(--ink-650);
}

.article-retry {
  width: auto;
  min-width: 150px;
  margin-top: 18px;
  padding: 0 18px;
}

.chapter-lead {
  margin: 0 0 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-650);
  font-size: 16px;
}

.article h2,
.article h3,
.article h4 {
  scroll-margin-top: 142px;
  color: var(--ink-950);
  line-height: 1.35;
}

.article h2 {
  margin: 44px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--navy-900);
  font-size: 24px;
}

.article h3 {
  margin: 30px 0 12px;
  font-size: 19px;
}

.article h4 {
  margin: 24px 0 10px;
  font-size: 16px;
}

.article p {
  margin: 0 0 16px;
}

.article strong {
  color: #b44c1f;
}

.article a {
  color: var(--navy-700);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article ul,
.article ol {
  margin: 10px 0 20px;
  padding-left: 26px;
}

.article li + li {
  margin-top: 7px;
}

.article blockquote,
.callout {
  margin: 22px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--orange-500);
  border-radius: 0 6px 6px 0;
  background: var(--orange-100);
  color: #70401f;
}

.callout-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
  font-weight: 800;
}

.callout-title svg {
  width: 17px;
  height: 17px;
}

.table-wrap {
  width: 100%;
  margin: 22px 0 28px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.article table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 14px;
}

.article th,
.article td {
  padding: 11px 13px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article th:last-child,
.article td:last-child {
  border-right: 0;
}

.article tr:last-child td {
  border-bottom: 0;
}

.article th {
  color: var(--navy-900);
  background: #f1f5fb;
  font-weight: 800;
}

.figure {
  margin: 28px 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
}

.figure img {
  display: block;
  width: 100%;
  height: auto;
}

.figure figcaption {
  padding: 10px 14px;
  color: var(--ink-500);
  font-size: 12px;
  text-align: center;
}

.figure.qr-figure {
  width: min(100%, 260px);
  margin: 30px auto;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgb(18 37 78 / 12%);
}

.qr-figure img {
  aspect-ratio: 1 / 1;
  padding: 12px;
  object-fit: contain;
  background: #fff;
}

.qr-figure figcaption {
  padding: 0 14px 13px;
  color: var(--navy-700);
  font-weight: 700;
}

.content-video {
  display: block;
  width: 100%;
  max-height: 620px;
  background: #0f172c;
}

.video-card {
  position: relative;
  display: grid;
  min-height: 280px;
  margin: 28px 0;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  color: #fff;
  background: var(--navy-950);
}

.video-card::before,
.video-card::after {
  position: absolute;
  content: "";
  border-radius: 50%;
}

.video-card::before {
  top: -72px;
  right: -42px;
  width: 236px;
  height: 236px;
  background: rgb(229 122 52 / 24%);
}

.video-card::after {
  bottom: -90px;
  left: -55px;
  width: 260px;
  height: 260px;
  background: rgb(21 122 131 / 26%);
}

.video-inner {
  position: relative;
  z-index: 1;
  width: min(620px, 88%);
  text-align: center;
}

.play-button {
  display: inline-grid;
  width: 68px;
  height: 68px;
  margin-bottom: 15px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 34%);
  border-radius: 50%;
  color: #fff;
  background: rgb(255 255 255 / 12%);
}

.play-button.is-playing {
  color: var(--navy-950);
  background: #fff;
}

.play-button svg {
  width: 28px;
  height: 28px;
}

.video-title {
  margin: 0 0 7px;
  font-size: 20px;
  font-weight: 800;
}

.video-caption {
  margin: 0;
  color: rgb(255 255 255 / 70%);
  font-size: 13px;
}

.video-progress {
  height: 4px;
  margin-top: 22px;
  overflow: hidden;
  border-radius: 99px;
  background: rgb(255 255 255 / 20%);
}

.video-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--orange-500);
}

.video-card.is-playing .video-progress span {
  width: 72%;
  transition: width 4s linear;
}

.prompt-box {
  margin: 24px 0;
  padding: 17px 18px;
  overflow-x: auto;
  border: 1px solid #cbd7ec;
  border-radius: 6px;
  color: #dce8ff;
  background: #152443;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 28px;
}

.step-card {
  min-height: 132px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcff;
}

.step-card i {
  display: inline-grid;
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  place-items: center;
  border-radius: 6px;
  color: var(--navy-800);
  background: #e8eef9;
}

.step-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-950);
}

.step-card p {
  margin: 0;
  color: var(--ink-650);
  font-size: 13px;
}

.locked-section {
  position: relative;
  margin-top: 52px;
  padding: 38px 24px;
  border: 1px solid #e6d7c8;
  border-radius: 7px;
  background: #fffaf4;
  text-align: center;
}

.locked-section .lock-badge {
  display: inline-grid;
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 50%;
  color: #a75a22;
  background: #fbe3cf;
}

.locked-section h2 {
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  font-size: 20px;
}

.locked-section p {
  max-width: 520px;
  margin: 0 auto 18px;
  color: var(--ink-650);
}

.chapter-pagination {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  width: min(900px, calc(100% - 60px));
  margin: 20px auto 54px;
}

.page-link {
  min-height: 80px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink-650);
  background: #fff;
  text-align: left;
  box-shadow: 0 8px 24px rgb(26 43 76 / 6%);
}

.page-link:hover:not(:disabled) {
  border-color: #a9bce0;
  color: var(--navy-800);
}

.page-link:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.page-link.next {
  text-align: right;
}

.page-link small,
.page-link strong {
  display: block;
}

.page-link small {
  margin-bottom: 5px;
  color: var(--ink-500);
}

.search-panel,
.modal-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: grid;
  padding: 80px 20px 20px;
  place-items: start center;
  background: rgb(10 18 40 / 46%);
  backdrop-filter: blur(4px);
}

.search-dialog {
  width: min(640px, 100%);
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgb(6 15 38 / 34%);
}

.search-input-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.search-input-wrap > svg {
  width: 19px;
  height: 19px;
  color: var(--ink-500);
}

.search-input-wrap input {
  width: 100%;
  height: 42px;
  border: 0;
  outline: 0;
  color: var(--ink-950);
  background: transparent;
}

.search-input-wrap .icon-button {
  color: var(--ink-650);
}

.search-input-wrap .icon-button:hover {
  border-color: var(--line);
  background: var(--surface-soft);
}

.search-results {
  max-height: min(520px, 65vh);
  overflow-y: auto;
  padding: 8px;
}

.search-result {
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: 6px;
  color: var(--ink-800);
  text-align: left;
  background: transparent;
}

.search-result:hover {
  background: var(--surface-soft);
}

.search-result strong,
.search-result small {
  display: block;
}

.search-result small {
  margin-top: 3px;
  color: var(--ink-500);
}

.search-empty {
  padding: 36px 16px;
  color: var(--ink-500);
  text-align: center;
}

.modal-backdrop {
  padding-top: 18vh;
  place-items: start center;
}

.modal {
  position: relative;
  width: min(430px, 100%);
  padding: 30px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgb(6 15 38 / 34%);
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--ink-500);
}

.modal-close:hover {
  border-color: var(--line);
  background: var(--surface-soft);
}

.modal-icon {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  place-items: center;
  border-radius: 50%;
  color: var(--navy-800);
  background: #e8eef9;
}

.modal-icon svg {
  width: 25px;
  height: 25px;
}

.modal h2 {
  margin: 0 0 8px;
  color: var(--ink-950);
  font-size: 22px;
}

.modal p {
  margin: 0 0 20px;
  color: var(--ink-650);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 0 0 18px;
  padding: 4px;
  border-radius: 6px;
  background: var(--surface-soft);
}

.auth-tab {
  min-height: 36px;
  border-radius: 5px;
  color: var(--ink-650);
  background: transparent;
  font-weight: 700;
}

.auth-tab.active {
  color: var(--navy-900);
  background: #fff;
  box-shadow: 0 3px 10px rgb(21 44 91 / 9%);
}

.auth-form {
  display: grid;
  gap: 13px;
  text-align: left;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--ink-800);
  font-size: 13px;
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  outline: 0;
  color: var(--ink-950);
  background: #fff;
}

.auth-form input:focus {
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px rgb(44 90 169 / 12%);
}

.auth-error {
  min-height: 20px;
  margin: 0 !important;
  color: var(--red-600) !important;
  font-size: 12px;
}

.modal-primary-button {
  width: 100%;
  min-height: 44px;
  color: #fff;
  background: var(--navy-800);
}

.modal-primary-button:hover {
  background: var(--navy-700);
}

.modal-primary-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.modal-note {
  margin: 12px 0 0 !important;
  color: var(--ink-500) !important;
  font-size: 11px;
}

.toast {
  position: fixed;
  z-index: 120;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100vw - 36px));
  padding: 11px 14px;
  border-radius: 6px;
  color: #fff;
  background: var(--ink-950);
  box-shadow: 0 14px 38px rgb(8 18 43 / 26%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

[hidden] {
  display: none !important;
}

@media (max-width: 1120px) {
  :root {
    --sidebar-width: 318px;
  }

  .main-nav .nav-link span {
    display: none;
  }

  .nav-link {
    width: 42px;
    justify-content: center;
    padding: 0;
  }

  .article,
  .chapter-pagination {
    width: calc(100% - 40px);
  }

  .article {
    padding: 46px 48px 70px;
  }
}

@media (max-width: 820px) {
  :root {
    --header-height: 58px;
  }

  .topbar {
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 8px;
    padding: 0 13px;
  }

  .mobile-menu-button {
    display: inline-grid;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
  }

  .brand > span:last-child {
    display: none;
  }

  .figure.qr-figure {
    width: min(100%, 220px);
    margin: 26px auto;
  }

  .main-nav {
    justify-content: flex-start;
    overflow: hidden;
  }

  .topbar-actions {
    min-width: 0;
  }

  .login-button {
    width: 38px;
    padding: 0;
  }

  .login-button span {
    display: none;
  }

  .workspace {
    display: block;
  }

  .sidebar {
    top: 0;
    width: min(88vw, 350px);
    box-shadow: 20px 0 60px rgb(7 18 42 / 25%);
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

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

  .sidebar-head {
    display: flex;
  }

  .reader {
    min-height: 100vh;
  }

  .reader-toolbar {
    top: var(--header-height);
    padding: 8px 14px;
  }

  .reader-actions .primary-small-button span,
  .reader-actions .primary-small-button {
    width: 34px;
    padding: 0;
  }

  .reader-actions .primary-small-button span {
    display: none;
  }

  .article {
    width: calc(100% - 24px);
    margin-top: 18px;
    padding: 34px 23px 56px;
    border-radius: 6px;
    font-size: 16px;
    box-shadow: 0 10px 28px rgb(17 31 68 / 8%);
  }

  .chapter-heading {
    font-size: 26px;
  }

  .chapter-pagination {
    width: calc(100% - 24px);
    grid-template-columns: 1fr;
  }

  .step-grid {
    grid-template-columns: 1fr;
  }

  .video-card {
    min-height: 230px;
  }

  .search-panel {
    padding: 70px 10px 10px;
  }
}

@media (max-width: 520px) {
  .main-nav .nav-link:nth-child(n + 4) {
    display: none;
  }

  .reader-toolbar .icon-button:nth-child(2) {
    display: none;
  }

  .article {
    padding: 30px 18px 48px;
  }

  .book-card {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .book-cover {
    width: 68px;
    height: 96px;
  }
}

@media print {
  .topbar,
  .sidebar,
  .reader-toolbar,
  .chapter-pagination,
  .search-panel,
  .modal-backdrop,
  .toast {
    display: none !important;
  }

  .workspace {
    display: block;
    padding: 0;
  }

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