/* 阅读器使用本机字体，避免下载大型中文字体与作品图片争用带宽。 */
:root { color-scheme: light; font-family: "PingFang SC", "Noto Sans SC", sans-serif; background: #f4f5f7; color: #20242a; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f4f5f7; font-family: "PingFang SC", "Noto Sans SC", sans-serif; font-weight: 600; }
/* 隐藏系统滚动条两端的上下箭头，保留滚动本身。 */
::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
button, a { font: inherit; }
button { cursor: pointer; }
.topbar { height: 52px; border-bottom: 1px solid #e3e6eb; display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 0 12px; background: rgba(255,255,255,.92); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(18px); }
.brand { justify-self: start; display: flex; align-items: center; gap: 10px; width: fit-content; height: 30px; color: #262a30; text-decoration: none; }
.brand-logo { width: 30px; height: 24px; flex: 0 0 auto; object-fit: contain; object-position: center; }.logo-dark { display: none; }.theme-dark .logo-light { display: none; }.theme-dark .logo-dark { display: block; }
.brand-title { margin: 0; font-family: "PingFang SC", "Noto Sans SC", sans-serif; font-size: 14px; font-weight: 600; line-height: 1; white-space: nowrap; }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 12px; color: #7b8491; font-size: 12px; font-variant-numeric: tabular-nums; }
.header-icon-button { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: #f0f1f3; color: #3a3a3a; text-decoration: none; transition: background .16s, color .16s, transform .12s; }
.header-icon-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }.header-icon-button:hover { background: #e2e3e6; color: #111; }.header-icon-button:active { transform: scale(.92); background: #dce0e4; }
.theme-toggle { display: flex; align-items: center; padding: 2px; background: #edf0f4; border-radius: 7px; }
.theme-button { min-width: 78px; height: 30px; border: 0; border-radius: 5px; background: transparent; color: #a7afbb; font-weight: 600; font-size: 14px; transition: background .18s, box-shadow .18s, color .18s, transform .12s; }.theme-icon { display: inline-block; width: 16px; height: 16px; margin-right: 3px; object-fit: contain; vertical-align: -3px; }.theme-button.is-active { color: #304461; background: #fff; box-shadow: 0 1px 3px rgba(38,48,62,.14); }.theme-button:hover { color: #303841; background: rgba(255,255,255,.58); }.theme-button:active { transform: scale(.96); background: #e1e5e9; }
.reader { min-height: calc(100vh - 52px); display: grid; grid-template-columns: 230px minmax(0, 1fr); }
.sidebar { overflow-y: auto; height: calc(100vh - 52px); border-right: 1px solid #e0e4e9; background: rgba(255,255,255,.8); padding: 12px 14px 0 12px; position: sticky; top: 52px; scroll-padding-bottom: 12px; scrollbar-width: thin; scrollbar-color: #d8d8d8 transparent; }
.sidebar::-webkit-scrollbar { width: 10px; }.sidebar::-webkit-scrollbar-track { background: transparent; }.sidebar::-webkit-scrollbar-thumb { background: #d8d8d8; border: 2px solid transparent; background-clip: padding-box; border-radius: 999px; }
.sidebar::-webkit-scrollbar-button, .sidebar::-webkit-scrollbar-button:single-button, .sidebar::-webkit-scrollbar-button:vertical:decrement, .sidebar::-webkit-scrollbar-button:vertical:increment { display: none !important; width: 0 !important; height: 0 !important; -webkit-appearance: none; }
/* Chromium 本地预览会强制绘制系统箭头，因此隐藏缩略图栏的整条视觉滚动条。 */
.sidebar { scrollbar-width: none; }
.sidebar::-webkit-scrollbar { display: none; width: 0; height: 0; }
.sidebar-scrollbar { position: fixed; z-index: 12; width: 5px; border-radius: 999px; background: #fff; cursor: pointer; }
.sidebar-scrollbar[hidden] { display: none; }
.sidebar-scrollbar-thumb { width: 100%; min-height: 36px; border-radius: inherit; background: #aeb8c5; cursor: grab; touch-action: none; transition: background .16s ease; }
.sidebar-scrollbar-thumb:hover { background: #7f8b9a; }
.sidebar-scrollbar-thumb:active { cursor: grabbing; }
.theme-dark .sidebar-scrollbar { background: rgba(112, 124, 139, .45); }
.theme-dark .sidebar-scrollbar-thumb { background: #697687; }
.theme-dark .sidebar-scrollbar-thumb:hover { background: #9aa8ba; }
.thumbnail-list { display: grid; gap: 12px; padding: 0 4px 0 0; }
.thumbnail-list::after { content: ""; display: block; height: 12px; pointer-events: none; }
.thumbnail { position: relative; display: block; width: 100%; border: 1px solid #e2e6eb; padding: 0; background: #fff; border-radius: 5px; overflow: hidden; box-shadow: none; }
.thumbnail img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; opacity: .72; transition: opacity .18s, transform .18s; }.thumbnail span { position: absolute; left: 7px; bottom: 6px; width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(25,31,38,.08); border-radius: 8px; background: rgba(239,241,244,.88); color: #252a31; font-size: 10px; font-variant-numeric: tabular-nums; text-align: center; backdrop-filter: blur(8px) saturate(130%); -webkit-backdrop-filter: blur(8px) saturate(130%); }
.thumbnail:hover img { opacity: .95; transform: scale(1.02); }.thumbnail.is-active { border: 2px solid #2f80ed; box-shadow: none; }
.thumbnail.is-active img { opacity: 1; }
.stage { min-height: calc(100vh - 52px); position: relative; display: grid; place-items: center; padding: 20px 42px 78px; overflow: hidden; background: radial-gradient(circle at 50% 40%, #fff 0, #f7f8fa 50%, #edf0f4 100%); }
/* 按可用宽高自适应：完整展示、不裁切，也不强行铺满造成贴边。 */
.page-frame { margin: 0; display: grid; place-items: center; position: relative; }
.page-frame img { display: block; width: auto; height: auto; max-width: calc(100vw - 230px - 84px); max-height: calc(100vh - 52px - 126px); object-fit: contain; border: 1px solid rgba(23,31,42,.15); border-radius: 2px; box-shadow: none; background: transparent; transform-origin: center; transition: transform .18s ease; }
.edge-button { position: absolute; top: calc(50% - 26px); width: 44px; height: 52px; border: 1px solid #e0e5eb; border-radius: 10px; background: rgba(255,255,255,.78); color: #53606f; font-size: 38px; font-weight: 200; line-height: 1; transition: background .18s, opacity .18s; box-shadow: 0 3px 9px rgba(45,54,66,.06); }
.edge-button:hover:not(:disabled) { background: #eff5ff; color: #1f65ca; }
.edge-button:disabled { opacity: .25; cursor: default; }
.previous { left: 24px; }.next { right: 24px; }
.reader-controls { position: absolute; bottom: 22px; left: 50%; z-index: 2; transform: translateX(-50%); display: flex; align-items: center; gap: 7px; padding: 8px 14px; background: rgba(255,255,255,.91); border: 1px solid #e0e5eb; backdrop-filter: blur(12px); border-radius: 12px; box-shadow: 0 5px 14px rgba(31,42,56,.11); }
.tool-button { width: 25px; height: 27px; padding: 0; color: #303030; background: transparent; border: 0; border-radius: 8px; font-size: 16px; line-height: 1; transition: background .16s, color .16s, transform .12s; }.tool-button svg { display:block; width:16px; height:16px; margin:auto; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }.tool-button:hover:not(:disabled) { color: #000; background: #f0f0f0; }.tool-button:active:not(:disabled) { transform: scale(.9); color: #000; background: #e4e4e4; }.tool-button.arrow svg { width:16px; height:16px; stroke-width:1.8; }.tool-button:disabled { opacity: .35; cursor: default; }.tool-page { min-width: 54px; text-align: center; color: #303030; font-size: 14px; font-variant-numeric: tabular-nums; }.tool-divider { width: 1px; height: 22px; margin: 0 5px; background: #ddd; }.zoom-range { width:78px; height:18px; margin:0 2px; appearance:none; -webkit-appearance:none; background:transparent; cursor:pointer; }.zoom-range::-webkit-slider-runnable-track { height:3px; border-radius:9px; background:#d6d6d6; }.zoom-range::-webkit-slider-thumb { appearance:none; -webkit-appearance:none; width:10px; height:10px; margin-top:-3.5px; border-radius:50%; border:0; background:#111; box-shadow:0 1px 2px rgba(0,0,0,.22); }.zoom-range::-moz-range-track { height:3px; border-radius:9px; background:#d6d6d6; }.zoom-range::-moz-range-thumb { width:10px; height:10px; border:0; border-radius:50%; background:#111; }

/* 全屏时仅保留作品页，仍可通过 Esc 退出、方向键或滚轮翻页。 */
:fullscreen { background: #f4f5f7; }
:fullscreen .topbar,
:fullscreen .sidebar,
:fullscreen .reader-controls,
:fullscreen .project-nav { display: none; }
:fullscreen,
:fullscreen body { overflow: hidden; }
:fullscreen .reader { display: block; min-height: 100vh; }
:fullscreen .stage { min-height: 100vh; width: 100vw; padding: 0; background: #0d1118; overflow: hidden; }
:fullscreen .page-frame { width: 100vw; height: 100vh; overflow: hidden; isolation: isolate; background: #0d1118; }
:fullscreen .page-frame::before { content: ""; position: absolute; inset: -30px; z-index: -2; background: var(--page-background) center / cover no-repeat; filter: blur(28px) saturate(.8) brightness(.5); transform: scale(1.08); }
:fullscreen .page-frame::after { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(8,12,18,.24); }
:fullscreen .page-frame img { position: relative; z-index: 1; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; border-radius: 0; box-shadow: none; transform: none !important; cursor: auto; }

/* 深色主题：沿用作品集的深蓝黑底与低饱和蓝色高亮。 */
.theme-dark body { background: #111; color: #e6e6e6; }.theme-dark .topbar { background: #171717; border-color: #2c2c2c; }.theme-dark .brand { color: #e6e6e6; }.theme-dark .theme-toggle { background: #292929; }.theme-dark .theme-button { color: #929292; }.theme-dark .theme-button.is-active { background: #414141; color: #fff; box-shadow: 0 1px 5px rgba(0,0,0,.3); }.theme-dark .sidebar { background: #171717; border-color: #2c2c2c; scrollbar-color: #555 transparent; }.theme-dark .sidebar::-webkit-scrollbar-thumb { background: #555; }.theme-dark .thumbnail { background: #222; border-color: #2c2c2c; box-shadow: 0 2px 6px rgba(0,0,0,.22); }.theme-dark .thumbnail span { background: rgba(34,34,34,.92); color: #e6e6e6; }.theme-dark .thumbnail.is-active { border-color: #aaa; box-shadow: 0 0 0 2px rgba(255,255,255,.12); }.theme-dark .stage { background: #111; }.theme-dark .page-frame img { box-shadow: 0 5px 18px rgba(0,0,0,.32); }.theme-dark .reader-controls { background: #292929; border-color: #353535; box-shadow: 0 6px 18px rgba(0,0,0,.25); }.theme-dark .tool-button,.theme-dark .tool-page { color: #d0d0d0; }.theme-dark .tool-button:hover:not(:disabled) { color: #fff; background: #3a3a3a; }.theme-dark .tool-button:active:not(:disabled) { color: #fff; background: #454545; }.theme-dark .tool-divider { background: #555; }.theme-dark .zoom-range::-webkit-slider-runnable-track { background: #555; }.theme-dark .zoom-range::-webkit-slider-thumb { background: #aaa; box-shadow: none; }.theme-dark .zoom-range::-moz-range-track { background: #555; }.theme-dark .zoom-range::-moz-range-thumb { background: #aaa; }
@media (max-width: 820px) { .topbar { grid-template-columns: 1fr auto; padding: 0 12px; }.reader { display: block; }.sidebar { position: fixed; z-index: 9; left: 0; top: 52px; bottom: 0; width: 224px; transform: translateX(-100%); transition: transform .2s; }.sidebar.is-open { transform: translateX(0); }.stage { min-height: calc(100vh - 52px); padding: 16px 16px 72px; }.page-frame img { max-width: calc(100vw - 32px); max-height: calc(100vh - 52px - 104px); }.edge-button { display: none; }.reader-controls { max-width: calc(100% - 24px); gap: 4px; bottom: 16px; }.tool-divider,.zoom-range { margin: 0 2px; }.zoom-range { width: 52px; }.brand:after { content: "  · 目录"; color: #7d8794; font-family: Inter, sans-serif; font-size: 11px; font-weight: 500; letter-spacing: .04em; }.brand { cursor: pointer; } }
@media (max-width: 480px) { .top-actions span { display: none; }.page-frame figcaption { font-size: 11px; }.reader-controls { gap: 8px; padding: 8px; }.reader-controls button { font-size: 11px; } }

/* 工具栏以明确的数字缩放取代滑杆；阅读器整体采用无投影的扁平层级。 */
.zoom-label { min-width: 46px; color: #60656b; text-align: center; font-size: 14px; font-variant-numeric: tabular-nums; }
.fit-button svg { width: 17px; height: 17px; }
.theme-button.is-active,
.edge-button { box-shadow: none; }
.theme-dark .header-icon-button { background: #292929; color: #d0d0d0; }
.theme-dark .header-icon-button:hover { background: #3a3a3a; color: #fff; }
.theme-dark .thumbnail { box-shadow: none; }
.theme-dark .thumbnail span { background: rgba(239,241,244,.88); border-color: rgba(255,255,255,.2); color: #252a31; }
.theme-dark .thumbnail.is-active { border: 2px solid #2f80ed; box-shadow: none; }
.theme-dark .page-frame img { border-color: rgba(255,255,255,.14); box-shadow: none; }
.theme-dark .reader-controls { box-shadow: 0 5px 14px rgba(0,0,0,.3); }
.theme-dark .theme-button.is-active { box-shadow: none; }
.theme-dark .tool-button,
.theme-dark .tool-page,
.theme-dark .zoom-label { color: #d0d0d0; }
.theme-dark .header-icon-button:active { background: #4a4a4a; }
.theme-dark .theme-button:hover { color: #fff; background: #383838; }
.theme-dark .theme-button:active { background: #4a4a4a; }

/* 右侧项目目录：保持四个一级项目的快速跳转，不引入页面级目录。 */
@media (min-width: 1041px) {
  .reader { grid-template-columns: 230px minmax(0, 1fr) 172px; }
  .page-frame img { max-width: calc(100vw - 402px - 84px); }
  .project-nav { position: sticky; top: 52px; height: calc(100vh - 52px); display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 0 26px 0 20px; border-left: 1px solid #e0e4e9; background: rgba(255,255,255,.7); }
}
.project-nav-label { color: #8b95a2; font-size: 11px; font-weight: 600; letter-spacing: .08em; }
.project-nav-list { display: grid; gap: 8px; }
.project-nav-item { display: flex; align-items: center; gap: 9px; width: 100%; min-height: 32px; padding: 7px 8px; border: 0; border-radius: 7px; background: transparent; color: #7b8491; text-align: left; font-size: 12px; font-weight: 600; transition: background .16s, color .16s, transform .12s; }
.project-nav-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 999px; background: #c1c7d0; transition: background .16s, transform .16s; }
.project-nav-item:hover { background: #eef1f5; color: #303b48; }.project-nav-item:hover .project-nav-dot { background: #6f7d8f; }.project-nav-item:active { transform: scale(.98); }.project-nav-item.is-active { background: #e7f0ff; color: #2468c4; }.project-nav-item.is-active .project-nav-dot { background: #2f80ed; transform: scale(1.25); }
@media (max-width: 1040px) { .project-nav { display: none; } }

/* 深色模式恢复为有层次的深灰蓝画布，并统一顶部控件的图标对比度。 */
.theme-dark body { background: #15191f; }
.theme-dark .topbar { background: #20252d; border-color: #343b46; }
.theme-dark .sidebar { background: #20252d; border-color: #343b46; scrollbar-color: #596372 transparent; }
.theme-dark .sidebar::-webkit-scrollbar-thumb { background: #596372; }
.theme-dark .stage { background: radial-gradient(circle at 50% 40%, #222a35 0, #1b212a 52%, #15191f 100%); }
.theme-dark .project-nav { background: #20252d; border-color: #343b46; }
.theme-dark .project-nav-label { color: #9aa5b5; }.theme-dark .project-nav-item { color: #abb5c3; }.theme-dark .project-nav-dot { background: #687485; }
.theme-dark .project-nav-item:hover { color: #fff; background: #2d3540; }.theme-dark .project-nav-item.is-active { background: #2a405d; color: #a8d0ff; }.theme-dark .project-nav-item.is-active .project-nav-dot { background: #7bb7ff; }
.theme-dark .header-icon-button { background: #313842; color: #dbe5f2; }.theme-dark .header-icon-button:hover { background: #3d4754; color: #fff; }.theme-dark .header-icon-button:active { background: #4b5868; }
.theme-dark .theme-toggle { background: #313842; }.theme-dark .theme-button.is-active { background: #4b5665; color: #fff; }.theme-dark .theme-button:hover { background: #3d4754; }
.theme-dark .theme-icon { filter: invert(92%) sepia(8%) saturate(455%) hue-rotate(174deg) brightness(104%) contrast(93%); }.theme-dark .theme-button:not(.is-active) .theme-icon { opacity: .72; }

/* 右侧目录默认仅展示刻度；悬停时才显示项目预览。 */
@media (min-width: 1041px) {
  .reader { grid-template-columns: 230px minmax(0, 1fr) 52px; }
  .page-frame img { max-width: calc(100vw - 282px - 84px); }
  .project-nav { position: sticky; top: 52px; width: 52px; height: calc(100vh - 52px); display: grid; place-items: center; padding: 0; border-left: 1px solid #e0e4e9; background: rgba(255,255,255,.7); overflow: visible; }
}
.project-nav-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.project-nav-list { display: grid; gap: 18px; width: 100%; }
.project-nav-item { position: relative; display: grid; place-items: center; width: 100%; height: 4px; min-height: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; }
.project-nav-dot { width: 4px; height: 18px; border-radius: 999px; background: #c6ccd4; transform: none; }
.project-nav-preview { pointer-events: none; position: absolute; z-index: 20; right: calc(100% + 24px); top: 50%; display: grid; gap: 7px; width: 172px; padding: 8px; border: 1px solid #e3e7ed; border-radius: 9px; background: rgba(255,255,255,.98); color: #303946; box-shadow: 0 8px 22px rgba(33,42,54,.12); opacity: 0; visibility: hidden; transform: translate(8px, -50%); transition: opacity .16s ease, transform .16s ease, visibility .16s; }
.project-nav-preview img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 5px; }
.project-nav-preview span { font-size: 12px; font-weight: 600; line-height: 1.35; }
.project-nav-item:hover { background: transparent; color: inherit; }.project-nav-item:hover .project-nav-dot { background: #708096; transform: none; }.project-nav-item:hover .project-nav-preview, .project-nav-item:focus-visible .project-nav-preview { opacity: 1; visibility: visible; transform: translate(0, -50%); }
.project-nav-item:focus-visible { outline: 2px solid #5c9df2; outline-offset: -2px; }.project-nav-item.is-active { background: transparent; color: inherit; }.project-nav-item.is-active .project-nav-dot { background: #2f80ed; transform: none; }
.theme-dark .project-nav { background: #20252d; border-color: #343b46; }.theme-dark .project-nav-dot { background: #647080; }.theme-dark .project-nav-item:hover { background: transparent; }.theme-dark .project-nav-item:hover .project-nav-dot { background: #a8b9ce; }.theme-dark .project-nav-item.is-active .project-nav-dot { background: #7bb7ff; }.theme-dark .project-nav-preview { border-color: #3b4552; background: rgba(38,46,56,.98); color: #edf3fa; box-shadow: 0 8px 22px rgba(0,0,0,.32); }

/* 对齐参考样式：横向短线刻度，导航轨道透明且不分隔阅读区。 */
@media (min-width: 1041px) {
  .project-nav { background: transparent; border-left: 0; }
}
.project-nav-dot { width: 12px; height: 4px; border-radius: 1px; }
.theme-dark .project-nav { background: transparent; border-left: 0; }

/* 右侧轨道与阅读画布共用同一底色，避免透明轨道露出不同页面底。 */
body { background: #f4f6f8; }
.stage { background: #f4f6f8; }
.project-nav-list { gap: 8px; }
.theme-dark .stage { background: #15191f; }

/* 深色主题中的页码标签与主题切换图标。 */
.theme-dark .thumbnail span { background: rgba(58, 68, 81, .96); border-color: rgba(166, 181, 200, .22); color: #edf2f7; }
.theme-dark .theme-icon { filter: brightness(0) invert(1); opacity: .58; }
.theme-dark .theme-button.is-active .theme-icon { opacity: 1; }

/* 当前项目（含其目录页）的刻度状态。 */
.project-nav-item.is-active .project-nav-dot { background: #15191f; }
.theme-dark .project-nav-item.is-active .project-nav-dot { background: #f3f6fa; }

/* 目录刻度的悬停突出态。 */
.project-nav-dot { transform-origin: right center; transition: background .16s ease, transform .16s ease; }
.project-nav-item:hover .project-nav-dot, .project-nav-item:focus-visible .project-nav-dot { width: 12px; background: #15191f; transform: scaleX(2); }
.theme-dark .project-nav-item:hover .project-nav-dot, .theme-dark .project-nav-item:focus-visible .project-nav-dot { background: #f3f3f3; }

/* 顶部主题切换保持单一、居中的图标按钮。 */
.theme-toggle { padding: 2px; }
.theme-button { width: 42px; min-width: 42px; padding: 0; display: grid; place-items: center; }
.theme-icon { display: block; margin: 0; }

/* 最终移动端覆盖：置于文件末尾，优先于既有的桌面目录样式。 */
@media (max-width: 820px) {
  .topbar { position: fixed !important; top: 0; right: 0; left: 0; z-index: 50; }
  .reader { padding-top: 52px; }
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
  .topbar { height: 52px; padding: 0 12px; }
  .brand { gap: 7px; min-width: 0; }
  .brand-logo { width: 24px; height: 20px; }
  .brand-title { max-width: 168px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
  .brand:after { display: none; }
  .top-actions { gap: 6px; }
  .header-icon-button { width: 34px; height: 34px; }
  .theme-toggle { padding: 2px; }
  .theme-button { width: 34px; min-width: 34px; height: 30px; padding: 0; justify-content: center; }
  .theme-button span { display: none; }
  .theme-icon { margin: 0; }

  .reader { display: block; width: 100%; min-height: calc(100svh - 52px); }
  .stage { width: 100%; height: calc(100svh - 52px); min-height: calc(100svh - 52px); padding: 12px 12px 122px; }
  .page-frame { max-width: 100%; }
  .page-frame img { max-width: calc(100vw - 24px); max-height: calc(100svh - 186px); }
  .page-frame img.is-zoomed { touch-action: none; }

  .sidebar { position: fixed; top: 52px; bottom: 0; left: 0; z-index: 30; width: min(292px, 86vw); height: auto; padding: 14px 10px 18px 12px; background: #fff; border-right: 1px solid #dfe4ea; box-shadow: 10px 0 28px rgba(27, 37, 48, .16); transform: translateX(-105%); transition: transform .22s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .thumbnail-list { grid-template-columns: 1fr; gap: 10px; padding-bottom: 12px; }
  .thumbnail { min-height: 0; }
  .sidebar-backdrop { display: block; position: fixed; z-index: 29; inset: 52px 0 0; border: 0; background: rgba(18, 24, 31, .24); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .22s ease, visibility .22s; }
  .sidebar.is-open + .sidebar-backdrop { opacity: 1; visibility: visible; pointer-events: auto; }
  .theme-dark .sidebar { background: #202020; border-color: #393939; box-shadow: 10px 0 28px rgba(0, 0, 0, .42); }
  .theme-dark .sidebar-backdrop { background: rgba(0, 0, 0, .48); }

  .project-nav { position: fixed; z-index: 8; left: 12px; right: 12px; bottom: 72px; display: block; width: auto; height: auto; padding: 0; border: 0; background: transparent; }
  .project-nav-list { display: flex; gap: 4px; width: 100%; padding: 4px; overflow-x: auto; scrollbar-width: none; border: 1px solid rgba(217, 223, 231, .95); border-radius: 11px; background: rgba(255, 255, 255, .94); box-shadow: 0 5px 18px rgba(34, 45, 58, .1); }
  .project-nav-list::-webkit-scrollbar { display: none; }
  .project-nav-item { display: block; flex: 1 0 auto; width: auto; height: 32px; min-height: 32px; padding: 0 9px; border-radius: 7px; color: #687482; }
  .project-nav-item::before, .project-nav-dot, .project-nav-label { display: none; }
  .project-nav-preview { position: static; display: block; width: auto; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; box-shadow: none; opacity: 1; visibility: visible; transform: none; transition: none; }
  .project-nav-preview img { display: none; }
  .project-nav-preview span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 650; line-height: 32px; text-align: center; }
  .project-nav-item:hover, .project-nav-item:focus-visible, .project-nav-item.is-active { background: #20252b; color: #fff; outline: 0; }
  .project-nav-item:hover .project-nav-preview, .project-nav-item:focus-visible .project-nav-preview { transform: none; }
  .theme-dark .project-nav { background: transparent; }
  .theme-dark .project-nav-list { border-color: #414141; background: rgba(38, 38, 38, .96); box-shadow: 0 5px 18px rgba(0, 0, 0, .32); }
  .theme-dark .project-nav-item { color: #b9b9b9; }
  .theme-dark .project-nav-item:hover, .theme-dark .project-nav-item:focus-visible, .theme-dark .project-nav-item.is-active { background: #f2f2f2; color: #1d1d1d; }

  .reader-controls { z-index: 9; bottom: 12px; min-height: 46px; padding: 6px 8px; gap: 3px; }
  .reader-controls .tool-button { width: 32px; height: 32px; }
  .tool-page { min-width: 50px; font-size: 11px; }
  .zoom-label { min-width: 42px; font-size: 11px; }
  .tool-divider { height: 20px; margin: 0 1px; }
  .download-notice { top: 60px; right: 12px; }
}
@media (max-width: 430px) {
  .brand-title { max-width: 142px; }
  .project-nav { left: 8px; right: 8px; }
  .project-nav-list { gap: 2px; padding: 3px; }
  .project-nav-item { padding: 0 7px; }
  .project-nav-preview span { font-size: 10px; }
  .reader-controls { max-width: calc(100% - 12px); }
  .fit-button { display: none; }
}

.site-filing {
  position: fixed;
  z-index: 7;
  left: 12px;
  bottom: 8px;
  color: #c4c4c4;
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
}
.site-filing:hover, .site-filing:focus-visible { color: #666; text-decoration: underline; outline: 0; }
.theme-dark .site-filing { color: #c4c4c4; }
.theme-dark .site-filing:hover, .theme-dark .site-filing:focus-visible { color: #d5d9df; }
@media (min-width: 821px) {
  .sidebar { height: calc(100vh - 52px); padding-bottom: 40px; scroll-padding-bottom: 40px; background: #fdfdfd; }
  .thumbnail-list::after { display: none; }
  .site-filing { left: 0; bottom: 0; width: var(--filing-sidebar-width, 230px); height: 28px; display: flex; align-items: center; padding: 0 12px; background: #fdfdfd; border-right: 1px solid #e0e4e9; }
  .theme-dark .site-filing { background: #202020; border-right-color: #343434; }
}
@media (max-width: 820px) {
  /* 手机端作为整份作品集后的页脚，不悬浮在图片上方。 */
  .site-filing { position: static; display: block; box-sizing: border-box; width: 100%; padding: 14px 12px calc(14px + env(safe-area-inset-bottom)); transform: none; background: #e9edf1; font-size: 10px; line-height: 1.3; text-align: center; white-space: nowrap; }
  .theme-dark .site-filing { background: #171717; }
}

/* 连续阅读时保持吸顶，并以轻量玻璃层和内容区分。 */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92); border-bottom-color: rgba(213, 220, 228, .82); -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%); }
.theme-dark .topbar { background: rgba(29, 29, 29, .72); border-bottom-color: rgba(92, 92, 92, .5); }
.topbar.is-scrolled { background: rgba(255, 255, 255, .92); border-bottom-color: rgba(213, 220, 228, .72); box-shadow: 0 8px 20px rgba(31, 42, 56, .1); }
.theme-dark .topbar.is-scrolled { background: rgba(28, 28, 28, .62) !important; border-bottom-color: rgba(104, 104, 104, .46); box-shadow: 0 8px 20px rgba(0, 0, 0, .26); }

/* 主题已改为单按钮，移除旧分组留下的第二层底色。 */
.header-icon-button, .theme-button, .theme-button.is-active { background: #f0f1f3; box-shadow: none; }
.theme-toggle { padding: 0; background: transparent; }
.theme-button:hover, .theme-button.is-active:hover { background: #e8eaed; }
.theme-dark .header-icon-button, .theme-dark .theme-button, .theme-dark .theme-button.is-active { background: #303030; }
.theme-dark .theme-toggle { background: transparent; }
.theme-dark .header-icon-button:hover, .theme-dark .theme-button:hover, .theme-dark .theme-button.is-active:hover { background: #3d3d3d; }

/* 桌面操作采用图标加文字，按钮不保留浏览器默认描边。 */
.header-icon-button { width: auto; min-width: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 11px; border: 0; font-size: 13px; font-weight: 600; }
.header-icon-button:focus, .header-icon-button:focus-visible { outline: 0; }
.header-icon-button svg { flex: 0 0 auto; margin: 0; }
#share-portfolio svg, #download-current svg { width: 18px; height: 18px; stroke-width: 2; }
html:not(.theme-dark) .header-icon-button { background: rgba(255, 255, 255, .42) !important; border: 1px solid #cfd6df; }
html:not(.theme-dark) .header-icon-button:hover { background: #f7f8fa !important; border-color: #bcc6d1; }
@media (max-width: 820px) {
  .header-icon-button { width: 34px !important; min-width: 34px; padding: 0; }
  .header-icon-button span { display: none; }
  html:not(.theme-dark) .header-icon-button { background: rgba(255, 255, 255, .42) !important; border: 1px solid #cfd6df; }
  .theme-dark .header-icon-button { background: transparent !important; border: 1px solid #505050; }
}

/* 桌面沿用完整浅色/深色分段；手机才折叠为一个切换图标。 */
.theme-switch { display: none; }
.theme-choice { width: auto; min-width: 78px; display: inline-flex; align-items: center; justify-content: center; }
.theme-choice .theme-icon { display: inline-block; margin-right: 3px; }
@media (max-width: 820px) {
  .theme-choice { display: none; }
  .theme-switch { display: grid; box-sizing: border-box; width: 34px; min-width: 34px; height: 34px; }
  .theme-switch, .theme-switch.is-active { background: #f0f1f3 !important; }
  .theme-switch .theme-icon { filter: brightness(0) saturate(100%) !important; opacity: 1 !important; }
  .theme-dark .theme-switch, .theme-dark .theme-switch.is-active { background: #303030 !important; }
  .theme-dark .theme-switch .theme-icon { filter: brightness(0) invert(1) !important; }
}
@media (min-width: 821px) {
  .theme-toggle { display: flex; padding: 2px; background: #edf0f4; border-radius: 7px; }
  .theme-choice { height: 30px; border-radius: 5px; background: transparent; color: #a7afbb; }
  .theme-choice.is-active { background: #fff; color: #304461; }
  .theme-choice:hover { background: rgba(255, 255, 255, .58); color: #303841; }
  .theme-dark .theme-toggle { background: #303030; }
  .theme-dark .theme-choice { background: transparent; color: #a9a9a9; }
  .theme-dark .theme-choice.is-active { background: #4a4a4a; color: #fff; }
  .theme-dark .theme-choice:hover { background: #3d3d3d; color: #fff; }
}

/* 移动端单页大图预览。 */
.mobile-preview { display: none; }
@media (max-width: 820px) {
  .mobile-page { cursor: zoom-in; }
  .mobile-preview.is-open { position: fixed; z-index: 60; inset: 0; display: grid; place-items: center; padding: 16px; overflow: hidden; overscroll-behavior: contain; touch-action: none; background: rgba(0, 0, 0, .92); }
  .mobile-preview img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; transform-origin: center; will-change: transform; backface-visibility: hidden; }
  .mobile-preview img.is-zoomed { cursor: grab; }
  .mobile-preview img.is-gesturing { transition: none; }
  .mobile-preview-close { position: absolute; z-index: 1; top: 14px; right: 14px; width: 42px; height: 42px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; }
  .mobile-preview-close svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  html:has(body.mobile-preview-open) { overflow: hidden; overscroll-behavior: none; }
  body.mobile-preview-open { position: fixed; width: 100%; overflow: hidden; }
}

/* 手机采用连续长卷阅读，与常见作品集移动端浏览方式一致。 */
.mobile-pages { display: none; }
.page-load-status { display: none; }
.page-frame.is-loading { background: #e8ebef; }
.page-frame.is-loading #page-image { opacity: 0; }
.page-frame.is-loading .page-load-status { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: #8a8a8a; font-size: 13px; font-weight: 400; }
.page-load-retry, .mobile-load-retry { position: absolute; left: 50%; top: calc(50% + 24px); transform: translateX(-50%); padding: 7px 14px; border: 1px solid #ccc; border-radius: 6px; background: #fff; color: #555; font-size: 12px; }
.page-load-retry[hidden], .mobile-load-retry[hidden] { display: none; }
.mobile-page-card { position: relative; aspect-ratio: 16 / 9; width: 100%; background: #e8ebef; overflow: hidden; }
.mobile-page-card .mobile-page { opacity: 0; }
.mobile-page-card[data-state="ready"] .mobile-page { opacity: 1; }
.mobile-load-status { position: absolute; inset: 0; display: grid; place-items: center; color: #8a8a8a; font-size: 12px; font-weight: 400; pointer-events: none; }
.mobile-page-card[data-state="ready"] .mobile-load-status { display: none; }
.theme-dark .page-frame.is-loading, .theme-dark .mobile-page-card { background: #252525; }
/* 固定宽度的三点逐个出现，循环时文字位置不跳动。 */
.page-frame.is-loading .page-load-status, .mobile-load-status { display: flex; align-items: center; justify-content: center; }
.page-frame.is-loading:not(.has-error) .page-load-status::after,
.mobile-page-card:is([data-state="idle"], [data-state="queued"], [data-state="loading"]) .mobile-load-status::after {
  content: "..."; display: inline-block; width: 1.5em; margin-left: 3px; letter-spacing: 2px; text-align: left;
  animation: loading-dots 1.4s steps(4, end) infinite;
}
@keyframes loading-dots { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) {
  .page-load-status::after, .mobile-load-status::after { animation: none !important; }
}
@media (max-width: 820px) {
  .reader { display: block; min-height: 0; background: #e9edf1; }
  .sidebar, .sidebar-backdrop, .stage, .project-nav { display: none !important; }
  .mobile-pages { display: grid; gap: 8px; width: 100%; padding: 0 0 8px; background: #e9edf1; }
  .mobile-page { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: contain; background: #fff; }
  .theme-dark .reader, .theme-dark .mobile-pages { background: #171717; }
  .theme-dark .mobile-page { background: #222; }
}

/* 移动端阅读器：缩略图抽屉、项目切换与紧凑工具栏。 */
.sidebar-backdrop { display: none; }
@media (max-width: 820px) {
  body { overflow-x: hidden; }
  .topbar { height: 52px; padding: 0 12px; }
  .brand { gap: 7px; min-width: 0; }
  .brand-logo { width: 24px; height: 20px; }
  .brand-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
  .brand:after { display: none; }
  .top-actions { gap: 6px; }
  .header-icon-button { width: 34px; height: 34px; }
  .theme-toggle { padding: 2px; }
  .theme-button { width: 34px; min-width: 34px; height: 30px; padding: 0; justify-content: center; }
  .theme-button span { display: none; }
  .theme-icon { margin: 0; }

  .reader { min-height: calc(100svh - 52px); }
  .stage { height: calc(100svh - 52px); min-height: calc(100svh - 52px); padding: 12px 12px 122px; }
  .page-frame img { max-width: calc(100vw - 24px); max-height: calc(100svh - 186px); }
  .page-frame img.is-zoomed { touch-action: none; }

  .sidebar { top: 52px; bottom: 0; width: min(292px, 86vw); height: auto; padding: 14px 10px 18px 12px; z-index: 30; background: #fff; border-right: 1px solid #dfe4ea; box-shadow: 10px 0 28px rgba(27, 37, 48, .16); transform: translateX(-105%); transition: transform .22s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .thumbnail-list { grid-template-columns: 1fr; gap: 10px; padding-bottom: 12px; }
  .thumbnail { min-height: 0; }
  .sidebar-backdrop { display: block; position: fixed; z-index: 29; inset: 52px 0 0; border: 0; background: rgba(18, 24, 31, .24); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .22s ease, visibility .22s; }
  .sidebar.is-open + .sidebar-backdrop { opacity: 1; visibility: visible; pointer-events: auto; }
  .theme-dark .sidebar { background: #202020; border-color: #393939; box-shadow: 10px 0 28px rgba(0, 0, 0, .42); }
  .theme-dark .sidebar-backdrop { background: rgba(0, 0, 0, .48); }

  .project-nav { position: fixed; z-index: 8; left: 12px; right: 12px; bottom: 72px; display: block; height: auto; padding: 0; border: 0; background: transparent; }
  .project-nav-list { display: flex; gap: 4px; width: 100%; padding: 4px; overflow-x: auto; scrollbar-width: none; border: 1px solid rgba(217, 223, 231, .95); border-radius: 11px; background: rgba(255, 255, 255, .94); box-shadow: 0 5px 18px rgba(34, 45, 58, .1); }
  .project-nav-list::-webkit-scrollbar { display: none; }
  .project-nav-item { display: block; flex: 1 0 auto; width: auto; height: 32px; min-height: 32px; padding: 0 9px; border-radius: 7px; color: #687482; }
  .project-nav-item::before { display: none; }
  .project-nav-dot, .project-nav-label { display: none; }
  .project-nav-preview { position: static; display: block; width: auto; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; box-shadow: none; opacity: 1; visibility: visible; transform: none; transition: none; }
  .project-nav-preview img { display: none; }
  .project-nav-preview span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 650; line-height: 32px; text-align: center; }
  .project-nav-item:hover, .project-nav-item:focus-visible, .project-nav-item.is-active { background: #20252b; color: #fff; outline: 0; }
  .project-nav-item:hover .project-nav-preview, .project-nav-item:focus-visible .project-nav-preview { transform: none; }
  .theme-dark .project-nav { background: transparent; }
  .theme-dark .project-nav-list { border-color: #414141; background: rgba(38, 38, 38, .96); box-shadow: 0 5px 18px rgba(0, 0, 0, .32); }
  .theme-dark .project-nav-item { color: #b9b9b9; }
  .theme-dark .project-nav-item:hover, .theme-dark .project-nav-item:focus-visible, .theme-dark .project-nav-item.is-active { background: #f2f2f2; color: #1d1d1d; }

  .reader-controls { z-index: 9; bottom: 12px; min-height: 46px; padding: 6px 8px; gap: 3px; }
  .reader-controls .tool-button { width: 32px; height: 32px; }
  .tool-page { min-width: 50px; font-size: 11px; }
  .zoom-label { min-width: 42px; font-size: 11px; }
  .tool-divider { height: 20px; margin: 0 1px; }
  .download-notice { top: 60px; right: 12px; }
}

@media (max-width: 430px) {
  .brand-title { max-width: 142px; }
  .project-nav { left: 8px; right: 8px; }
  .project-nav-list { gap: 2px; padding: 3px; }
  .project-nav-item { padding: 0 7px; }
  .project-nav-preview span { font-size: 10px; }
  .reader-controls { max-width: calc(100% - 12px); }
  .fit-button { display: none; }
}

/* 深色模式统一使用中性黑灰，移除蓝灰倾向。 */
.theme-dark body, .theme-dark .stage { background: #171717; }
.theme-dark .topbar, .theme-dark .sidebar { background: #202020; border-color: #343434; }
.theme-dark .sidebar::-webkit-scrollbar-thumb { background: #5a5a5a; }
.theme-dark .thumbnail { background: #292929; border-color: #383838; }
.theme-dark .header-icon-button, .theme-dark .theme-toggle { background: #303030; color: #ededed; }
.theme-dark .header-icon-button:hover, .theme-dark .theme-button:hover { background: #3d3d3d; }
.theme-dark .header-icon-button:active { background: #4a4a4a; }
.theme-dark .theme-button { color: #a9a9a9; }.theme-dark .theme-button.is-active { background: #4a4a4a; color: #fff; }
.theme-dark .reader-controls { background: #303030; border-color: #414141; }
.theme-dark .tool-button:hover:not(:disabled) { background: #414141; }.theme-dark .tool-button:active:not(:disabled) { background: #505050; }
.theme-dark .project-nav-dot { background: #737373; }

/* 放大后可抓取画布查看细节。 */
.page-frame img.is-zoomed { cursor: grab; touch-action: none; }
.page-frame img.is-zoomed.is-dragging { cursor: grabbing; transition: none; user-select: none; }

.download-notice { position: fixed; z-index: 30; top: 64px; right: 30px; padding: 9px 12px; border-radius: 8px; background: #252a31; color: #fff; font-size: 12px; font-weight: 600; opacity: 0; pointer-events: none; transform: translateY(-6px); transition: opacity .16s ease, transform .16s ease; }
.download-notice.is-visible { opacity: 1; transform: translateY(0); }
#share-notice { top: 108px; }
.theme-dark .download-notice { background: #f2f2f2; color: #202020; }

/* 桌面端分享面板：只提供当前链接与复制操作。 */
.share-panel { --share-arrow-left: 50%; position: fixed; z-index: 55; top: 62px; display: none; padding: 12px; border: 1px solid rgba(213, 220, 228, .9); border-radius: 12px; background: rgba(255, 255, 255, .98); box-shadow: 0 12px 30px rgba(31, 42, 56, .14); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.share-panel.is-open { display: flex; }
.share-panel::before { content: ""; position: absolute; top: -8px; left: var(--share-arrow-left); width: 14px; height: 14px; border-top: 1px solid rgba(213, 220, 228, .9); border-left: 1px solid rgba(213, 220, 228, .9); background: rgba(255, 255, 255, .98); transform: translateX(-50%) rotate(45deg); }
.share-link-input { min-width: 0; flex: 1; height: 38px; padding: 0 10px; border: 1px solid #dbe0e7; border-right: 0; border-radius: 7px 0 0 7px; outline: 0; background: #fafbfc; color: #5b6470; font: 12px/1.2 Inter, "PingFang SC", sans-serif; }
.share-copy-button { flex: 0 0 auto; height: 38px; padding: 0 14px; border: 1px solid #dbe0e7; border-radius: 0 7px 7px 0; background: #f0f1f3; color: #2f3742; font-size: 13px; font-weight: 600; }
.share-copy-button:hover { background: #e6e8eb; }
.theme-dark .share-panel { border-color: #474747; background: rgba(35, 35, 35, .98); box-shadow: 0 12px 30px rgba(0, 0, 0, .32); }.theme-dark .share-panel::before { border-color: #474747; background: rgba(35, 35, 35, .98); }.theme-dark .share-link-input { border-color: #494949; background: #292929; color: #d5d5d5; }.theme-dark .share-copy-button { border-color: #494949; background: #383838; color: #f0f0f0; }.theme-dark .share-copy-button:hover { background: #474747; }
@media (max-width: 820px) { .share-panel { display: none !important; } }

.mobile-share-sheet { display: none; }
@media (max-width: 820px) {
  .mobile-share-sheet.is-open { position: fixed; z-index: 100; inset: 0; display: block; }
  .mobile-share-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(10, 13, 18, .46); }
  .mobile-share-card { position: absolute; right: 0; bottom: 0; left: 0; box-sizing: border-box; padding: 12px 20px calc(24px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; background: #fff; box-shadow: 0 -12px 36px rgba(0, 0, 0, .14); }
  .mobile-share-handle { width: 34px; height: 4px; margin: 0 auto 14px; border-radius: 99px; background: #d7dce3; }
  .mobile-share-card h2 { margin: 0 0 7px; color: #1b2027; font-size: 17px; line-height: 1.35; }
  .mobile-share-card p { margin: 0 0 15px; color: #697382; font-size: 13px; line-height: 1.45; }
  .mobile-share-close { position: absolute; top: 19px; right: 16px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: #f1f3f5; color: #505966; font-size: 24px; font-weight: 300; line-height: 25px; }
  .mobile-share-link { box-sizing: border-box; width: 100%; height: 42px; padding: 0 11px; border: 1px solid #d9dfe7; border-radius: 8px; outline: 0; background: #f8f9fb; color: #596678; font: 12px/1.2 Inter, "PingFang SC", sans-serif; }
  .mobile-share-copy { width: 100%; height: 42px; margin-top: 10px; border: 1px solid #c6cfda; border-radius: 8px; background: #fff; color: #27313d; font-size: 14px; font-weight: 650; }
  .theme-dark .mobile-share-card { background: #23272d; }.theme-dark .mobile-share-handle { background: #525a65; }.theme-dark .mobile-share-card h2 { color: #f3f5f7; }.theme-dark .mobile-share-card p { color: #aeb6c2; }.theme-dark .mobile-share-close { background: #353b44; color: #e0e4e8; }.theme-dark .mobile-share-link { border-color: #4a525e; background: #2c3139; color: #d9dee5; }.theme-dark .mobile-share-copy { border-color: #5d6876; background: #2c3139; color: #f2f4f6; }
}

/* 右侧目录的相邻联动刻度：默认 12px，悬停项 18px，相邻项 16px。 */
@media (min-width: 1041px) {
  .project-nav-item { display: flex; justify-content: flex-end; align-items: center; }
  .project-nav-item::before { content: ""; position: absolute; inset: -5px -6px; }
  .project-nav-dot { width: 12px; height: 4px; transform: none; transform-origin: right center; transition: width .18s ease, background .16s ease; }
  .project-nav-item.is-active .project-nav-dot { width: 12px; }
  #project-nav-list .project-nav-item[data-proximity="2"] .project-nav-dot { width: 12px !important; transform: none !important; }
  #project-nav-list .project-nav-item[data-proximity="1"] .project-nav-dot { width: 16px !important; transform: none !important; background: #c6ccd4 !important; }
  #project-nav-list .project-nav-item[data-proximity="0"] .project-nav-dot { width: 18px !important; transform: none !important; background: #15191f; }
  .project-nav-list.is-hovering .project-nav-item.is-active .project-nav-dot { background: #c6ccd4; }
  .theme-dark #project-nav-list .project-nav-item[data-proximity="1"] .project-nav-dot { background: #647080 !important; }
  .theme-dark .project-nav-item[data-proximity="0"] .project-nav-dot { background: #f3f3f3; }
  .theme-dark .project-nav-list.is-hovering .project-nav-item.is-active .project-nav-dot { background: #647080; }
}

/* 手机端最终优先级覆盖。 */
@media (max-width: 820px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
  .topbar { height: 52px; padding: 0 12px; }
  .brand { gap: 7px; min-width: 0; }
  .brand-logo { width: 24px; height: 20px; }
  .brand-title { max-width: 168px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
  .brand:after { display: none; }
  .top-actions { gap: 6px; }
  .header-icon-button { width: 34px; height: 34px; }
  .theme-toggle { padding: 2px; }
  .theme-button { width: 34px; min-width: 34px; height: 30px; padding: 0; justify-content: center; }
  .theme-button span { display: none; }
  .theme-icon { margin: 0; }
  .reader { display: block; width: 100%; min-height: calc(100svh - 52px); }
  .stage { width: 100%; height: calc(100svh - 52px); min-height: calc(100svh - 52px); padding: 12px 12px 122px; }
  .page-frame { max-width: 100%; }
  .page-frame img { max-width: calc(100vw - 24px); max-height: calc(100svh - 186px); }
  .page-frame img.is-zoomed { touch-action: none; }
  .sidebar { position: fixed; top: 52px; bottom: 0; left: 0; z-index: 30; width: min(292px, 86vw); height: auto; padding: 14px 10px 18px 12px; background: #fff; border-right: 1px solid #dfe4ea; box-shadow: 10px 0 28px rgba(27, 37, 48, .16); transform: translateX(-105%); transition: transform .22s ease; }
  .sidebar.is-open { transform: translateX(0); }
  .thumbnail-list { grid-template-columns: 1fr; gap: 10px; padding-bottom: 12px; }
  .thumbnail { min-height: 0; }
  .sidebar-backdrop { display: block; position: fixed; z-index: 29; inset: 52px 0 0; border: 0; background: rgba(18, 24, 31, .24); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .22s ease, visibility .22s; }
  .sidebar.is-open + .sidebar-backdrop { opacity: 1; visibility: visible; pointer-events: auto; }
  .theme-dark .sidebar { background: #202020; border-color: #393939; box-shadow: 10px 0 28px rgba(0, 0, 0, .42); }
  .theme-dark .sidebar-backdrop { background: rgba(0, 0, 0, .48); }
  .project-nav { position: fixed; z-index: 8; left: 12px; right: 12px; bottom: 72px; display: block; width: auto; height: auto; padding: 0; border: 0; background: transparent; }
  .project-nav-list { display: flex; gap: 4px; width: 100%; padding: 4px; overflow-x: auto; scrollbar-width: none; border: 1px solid rgba(217, 223, 231, .95); border-radius: 11px; background: rgba(255, 255, 255, .94); box-shadow: 0 5px 18px rgba(34, 45, 58, .1); }
  .project-nav-list::-webkit-scrollbar { display: none; }
  .project-nav-item { display: block; flex: 1 0 auto; width: auto; height: 32px; min-height: 32px; padding: 0 9px; border-radius: 7px; color: #687482; }
  .project-nav-item::before, .project-nav-dot, .project-nav-label { display: none; }
  .project-nav-preview { position: static; display: block; width: auto; padding: 0; border: 0; border-radius: 0; background: transparent; color: inherit; box-shadow: none; opacity: 1; visibility: visible; transform: none; transition: none; }
  .project-nav-preview img { display: none; }
  .project-nav-preview span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; font-weight: 650; line-height: 32px; text-align: center; }
  .project-nav-item:hover, .project-nav-item:focus-visible, .project-nav-item.is-active { background: #20252b; color: #fff; outline: 0; }
  .project-nav-item:hover .project-nav-preview, .project-nav-item:focus-visible .project-nav-preview { transform: none; }
  .theme-dark .project-nav { background: transparent; }
  .theme-dark .project-nav-list { border-color: #414141; background: rgba(38, 38, 38, .96); box-shadow: 0 5px 18px rgba(0, 0, 0, .32); }
  .theme-dark .project-nav-item { color: #b9b9b9; }
  .theme-dark .project-nav-item:hover, .theme-dark .project-nav-item:focus-visible, .theme-dark .project-nav-item.is-active { background: #f2f2f2; color: #1d1d1d; }
  .reader-controls { z-index: 9; bottom: 12px; min-height: 46px; padding: 6px 8px; gap: 3px; }
  .reader-controls .tool-button { width: 32px; height: 32px; }
  .tool-page { min-width: 50px; font-size: 11px; }
  .zoom-label { min-width: 42px; font-size: 11px; }
  .tool-divider { height: 20px; margin: 0 1px; }
  .download-notice { top: 60px; right: 12px; }
}

/* 手机端主题切换与分享、下载保持同一正方形尺寸；必须置于所有旧移动端规则之后。 */
@media (max-width: 820px) {
  .theme-button.theme-switch { box-sizing: border-box !important; width: 34px !important; min-width: 34px !important; height: 34px !important; }
}
@media (max-width: 430px) {
  .brand-title { max-width: 142px; }
  .project-nav { left: 8px; right: 8px; }
  .project-nav-list { gap: 2px; padding: 3px; }
  .project-nav-item { padding: 0 7px; }
  .project-nav-preview span { font-size: 10px; }
  .reader-controls { max-width: calc(100% - 12px); }
  .fit-button { display: none; }
}
