/* 首页版心和桌面顶栏共用左右留白。左缘按视口计算，避免有滚动条的页面横向跳动。 */
:root{
  --zs-site-width:1200px;
  --zs-site-gutter:clamp(16px, 3.5vw, 28px);
  --zs-site-padding:var(--zs-site-gutter);
  --zs-topbar-height:56px;
  --zs-topbar-back-height:36px;
}
@media (min-width:760px){
  :root{
    --zs-site-gutter:clamp(28px, calc(8vw - 40px), 60px);
    --zs-site-inset:max(var(--zs-site-gutter), (100vw - var(--zs-site-width)) / 2);
    --zs-site-padding:var(--zs-site-inset) max(var(--zs-site-gutter), 100% - var(--zs-site-inset) - var(--zs-site-width));
  }
}

@media (width > 760px){
  .topbar{
    box-sizing:border-box;
    flex:none;
    height:var(--zs-topbar-height);
    padding-block:0;
  }
  .topbar > .topbar-inner{
    box-sizing:border-box;
    width:100%; height:100%; margin:0;
    display:flex; align-items:center; gap:12px;
    padding-block:0;
    padding-inline:var(--zs-site-padding);
  }
  .topbar > .topbar-inner > .tb-title{
    font-family:"Noto Sans SC","PingFang SC","Microsoft YaHei",sans-serif;
    font-size:15px; font-weight:800; line-height:1.4; letter-spacing:.12em;
    color:#2e2a21; white-space:nowrap;
  }

  /* 定高参与书页排版；触屏沉浸工具栏使用自身的尺寸。 */
  html:not(.zs-imm) body .pf-topbar{
    --ct-btn-h:var(--zs-topbar-back-height);
    box-sizing:border-box;
    height:var(--zs-topbar-height);
    flex-wrap:nowrap;
    padding-block:0;
    padding-inline:var(--zs-site-padding);
    border-bottom:2px solid #CE2326;
  }
  html:not(.zs-imm) .pf-topbar .pf-brand{ gap:12px; }

  :is(.topbar-inner, html:not(.zs-imm) .pf-topbar .pf-brand) > :is(.tb-back, .back, .pf-back){
    box-sizing:border-box;
    display:inline-flex; flex:none; align-items:center; justify-content:flex-start; gap:4px;
    height:var(--zs-topbar-back-height);
    margin:0; padding:0 10px 0 8px;
    border:0; border-radius:999px; background:transparent;
    color:#6f6a5c; text-decoration:none; white-space:nowrap;
    font:13.5px/1 "Noto Sans SC","PingFang SC","Microsoft YaHei",sans-serif;
    letter-spacing:.05em;
    transition:color .15s, background .15s;
  }
  :is(.topbar-inner, html:not(.zs-imm) .pf-topbar .pf-brand) > :is(.tb-back, .back, .pf-back) > :is(svg, .arr){ display:none; }
  :is(.topbar-inner, html:not(.zs-imm) .pf-topbar .pf-brand) > :is(.tb-back, .back, .pf-back)::before{
    content:""; flex:none; width:15px; height:15px;
    background:currentColor;
    mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M10 3L5 8l5 5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  :is(.topbar-inner, html:not(.zs-imm) .pf-topbar .pf-brand) > :is(.tb-back, .back, .pf-back):hover{
    color:#CE2326; background:rgba(206,35,38,.07);
  }
  :is(.topbar-inner, html:not(.zs-imm) .pf-topbar .pf-brand) > :is(.tb-back, .back, .pf-back):focus-visible{
    outline:2px solid #CE2326; outline-offset:2px;
  }
}
