关于「置顶栏的视口税:浏览器、安全区、横幅与浮窗的叠加」,《拇指热区与首屏留存工程》给出的定量结论是什么?

结论:视口税要按可视高度算。按本章假设的浏览器栏高度,390×844 第一次来访时只有 664 像素可用,360×780 只有 628 像素。A 版第一次来访的固定层占可视高度的 0.319 与 0.338,阅读时仍有 0.139 与 0.146;文字放大到 2.0 倍时,钉住的两条横条吃掉 0.277。100vh 会把首图底部的按钮藏到浏览器栏后面,svh 不会;dvh 会让内容在栏收起时跳动 86 像素。滚动隐藏的页头把阅读时的占用降到一半以下,切换阈值要在 24 像素以上,否则手指一抖页头就闪。晚到的横幅插进文档流会产生布局偏移,一条 120 像素的 Cookie 条从顶部插入就是 0.181。聊天浮窗若保留默认位置,会盖住操作栏按钮的 0.197。固定层还会遮住获得焦点的控件,用 scroll-padding 预留即可解决。

数据口径:全部品牌与数字都是虚构样本,由书中程序算出;涉及隐私同意与无障碍的法规只写一般框架,不是法律意见。 书中以标注框区分证据、计算、原典与假说,每条假说都写明什么结果会推翻它;原典考辨取《考工记》「天有时,地有气,材有美,工有巧」的良工四条件。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.139, 0.146, 0.181, 0.277, 0.319, 0.338

390x844 visible 664 expanded / 750 collapsed; bottom inset 34
state fixed px tax exp tax col net exp content px exp corner budget
A first visit212 0.319 0.283 0.319 452 0.022 over
A answered, scrolling92 0.139 0.123 0.139 572 0.022 over
B first visit218 0.328 0.291 0.181 446 0.000 ok
B scrolling down98 0.148 0.131 0.000 566 0.000 ok
B scrolling up146 0.220 0.195 0.072 518 0.000 ok
360x780 visible 628 expanded / 724 collapsed; bottom inset 24
state fixed px tax exp tax col net exp content px exp corner budget
A first visit212 0.338 0.293 0.338 416 0.026 over
A answered, scrolling92 0.146 0.127 0.146 536 0.026 over
B first visit208 0.331 0.287 0.191 420 0.000 ok
B scrolling down88 0.140 0.122 0.000 540 0.000 ok
B scrolling up136 0.217 0.188 0.076 492 0.000 ok
390x844 expanded, as the text setting grows (fixed layers in rem, inset not scaled)
text scale 1.0: A pinned92.0 px, tax 0.139; B up-scroll 146.0 px, tax 0.220
text scale 1.3: A pinned 119.6 px, tax 0.180; B up-scroll 179.6 px, tax 0.270
text scale 1.5: A pinned 138.0 px, tax 0.208; B up-scroll 202.0 px, tax 0.304
text scale 2.0: A pinned 184.0 px, tax 0.277; B up-scroll 258.0 px, tax 0.389
查看完整验算程序
# Chapter 3. p30: The viewport tax of Nightamber's fixed layers once the browser bars are counted.
# Chapter 1 (p10) took the whole screen as the page; here the browser's own bars take their share first.
# Visible page heights are assumed values for this sample (Chapter 6 uses the same expanded values);
# measure yours with window.innerHeight and window.visualViewport.height on the target phones:
#   390x844: 664 px with the browser bars expanded, 750 px with them collapsed
#   360x780: 628 px expanded, 724 px collapsed
# Fixed layers (CSS px at text scale 1.0, sized in rem so they grow with the text setting):
#   layout A (current): promo bar 36 + header 56 pinned; cookie bar 120 on a first visit; chat bubble
#   60 x 60 plus a 16 px margin (a 76 x 76 corner block, not full width)
#   layout B (redesign, Chapter 8): header 48 that hides while scrolling down; action bar 64 plus the
#   bottom inset (34 at 390 wide, 24 at 360); cookie sheet 72 on a first visit
# Tax = height of full-width fixed layers / visible height. Corner = corner block / visible area.
# "net" leaves out the action bar, which carries the price and the add-to-bag button (working pixels).
# Budget proposed in the text: net tax <= 0.20 on a first visit, <= 0.10 while reading (bars expanded,
# text scale 1.0), <= 0.30 at text scale 2.0. Text scale matters for WCAG 2.1 SC 1.4.4 (resize text to
# 200%) and SC 1.4.10 (reflow at 320 CSS px).
import math

VIS = {"390x844": (390, 664, 750, 34), "360x780": (360, 628, 724, 24)}
STATES = [
    ("A first visit", ["promo", "header", "cookie"], 1),
    ("A answered, scrolling", ["promo", "header"], 1),
    ("B first visit", ["headerB", "bar", "sheet"], 0),
    ("B scrolling down", ["bar"], 0),
    ("B scrolling up", ["headerB", "bar"], 0),
]
H = {"promo": 36, "header": 56, "cookie": 120, "headerB": 48, "bar": 64, "sheet": 72}


def fixed(dev, layers, scale=1.0):
    inset = VIS[dev][3]
    return math.fsum(H[k] * scale + (inset if k == "bar" else 0) for k in layers)


if __name__ == "__main__":
    for dev, (w, ex, co, inset) in VIS.items():
        print("   {}  visible {} expanded / {} collapsed; bottom inset {}".format(dev, ex, co, inset))
        print("   state                      fixed px  tax exp  tax col  net exp  content px exp  corner  "
              "budget")
        for name, layers, chat in STATES:
            f = fixed(dev, layers)
            corner = chat * 76 * 76 / (w * ex)
            net = f - fixed(dev, [k for k in layers if k == "bar"])
            cap = 0.20 if "first" in name else 0.10
            print("   {:<26s} {:8.0f} {:8.3f} {:8.3f} {:8.3f} {:15.0f} {:7.3f}  {}".format(
                name, f, f / ex, f / co, net / ex, ex - f, corner, "ok" if net / ex <= cap else "over"))
    print("   390x844 expanded, as the text setting grows (fixed layers in rem, inset not scaled)")
    for s in (1.0, 1.3, 1.5, 2.0):
        a = fixed("390x844", ["promo", "header"], s)
        b = fixed("390x844", ["headerB", "bar"], s)
        line = "     text scale {:.1f}: A pinned {:5.1f} px, tax {:.3f}; B up-scroll {:5.1f} px, tax {:.3f}"
        print(line.format(s, a, a / 664, b, b / 664))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《移动端拇指热区动力学、暗黑奢品微交互与首屏视觉留存工程》第 3 章「置顶栏的视口税:浏览器、安全区、横幅与浮窗的叠加」(版本 0.1.0). 5D Library. DOI 待发布

DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-137 · v0.1.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026137,
  author    = {Fan, Yafu},
  title     = {Mobile Thumb-Zone Kinetics, Dark-Luxury Micro-Interactions and Above-the-Fold Visual Retention Engineering},
  year      = {2026},
  publisher = {5D Library},
  edition   = {0.1.0},
  note      = {DOI pending}
}

本书其他章节结论