Peach: Local-first video metadata scraper and media manager.
fix(ui): align photo controls and lightbox
longmeidaof5ddf7ab8530
diff --git a/docs/HANDOFF.md b/docs/HANDOFF.mdindex 60f16cfe7..a14efd71d 100644--- a/docs/HANDOFF.md+++ b/docs/HANDOFF.md@@ -23,7 +23,7 @@- AV 厂牌官网普遍先给年龄确认页,不穿过它只能拿到约 10 KB 的空壳。判据必须是锚文本而不是 URL:否定链接指向站外(实测 `dasdas.jp`、`muku.tv` 的「いいえ」都指向 dmm.com),肯定链接「はい(入室する)」指向站内,两者的 href 看不出区别。跟错就离开了厂牌域名,抓到的账号也就不再属于这个厂牌。实现见 `scripts/find_studio_socials.py`,`test_age_gate_is_crossed_by_the_affirmative_link_only` 守这条线。- 二手结论不能当证据:搜索摘要曾称 `@EBODY_` 已注销,实测直接解析到 400×400 活跃头像。凡是「某账号/端点已失效」这类判断,取证方式是自己请求一次,不是转述搜索结果。- **图集就是目录**:账本没有图集实体,也不需要一个。`<作品目录>\P\001.jpg` 这种约定在 A:/B: 上到处都是,所以 `/api/photos` 按 `path` 去掉文件名分组,图集 ID 取该目录里最小的资产 ID——稳定、可反查目录,又不用把真实路径发给前端(和 `q_item` 一致)。同名目录在两个来源下算两个图集:文件不同、计费口径也不同。叶子目录只写 `P`、`图片` 这类通用名时,标题取上一级目录名。-- **瀑布流只读缩略图,原图只在灯箱里读**。图片资产没有接触印相可裁,只能读原图;PikPak 一张动辄几 MB,一屏几十张就是几十兆计费流量。`/photo-thumb` 用 Pillow 缩到 640 宽存进 `photo_root`,每张只回源一次,`/photo` 只服务灯箱当前和相邻的大图。瀑布流用 CSS `column-count`:图片行没有 `width`/`height`,等宽多列流式排版正好不需要比例,也就不必等图加载完再算位置。+- **瀑布流只读缩略图,原图只在灯箱里读**。图片资产没有接触印相可裁,只能读原图;PikPak 一张动辄几 MB,一屏几十张就是几十兆计费流量。`/photo-thumb` 用 Pillow 缩到 640 宽存进 `photo_root`,每张只回源一次,`/photo` 只服务灯箱当前和相邻的大图。瀑布流用 CSS `column-count`:图片行没有 `width`/`height`,等宽多列流式排版正好不需要比例,也就不必等图加载完再算位置。灯箱继续复用 Swiper 14.2.0,但主画布必须直接固定到视口,顶部工具和底部缩略图只作覆盖层;不要再用三行 grid 承接 Swiper 的百分比高度。关注图集箭头、灯箱翻页和沉浸动作列共用 48 px tonal 圆钮,禁止恢复浏览器默认按钮内边距或额外描边。- 人工复核入口固定为 `/review`,候选 API 为 `GET /api/review`、`POST /api/review/decision`。候选来自 writer 本机 `peach-data/generated` 下的 CSV;每项尽量带代表封面与原视频入口,审核状态写 `review_decision`。元数据与创作者标签批准后写相应真相/投影,Logo、头像、身份和媒体失败只记录决定;封面抓取的成功、尺寸和缺失是机械状态,不进入人工复核。双机同时在线时,reader 的 `GET /api/review` 只通过 Peach CA 严格校验的 HTTPS 读取 writer 已归一化 JSON,先确认目标 `/healthz` 是 `ledger_sync=writer`,绕过外网代理并原子缓存到本机 `review/writer-review.json`;macOS 合并文件 CA 与系统/登录钥匙串中受信任的同名 Peach CA,只读取公钥证书,不导出私钥。launchd 主体被本地网络权限挡住时,使用系统 `/usr/bin/curl` 经回环 Stash 代理发起同一严格请求;仅限 HTTPS、8 MiB 上限,令牌走 stdin,非回环代理拒绝。writer 临时离线时只展示上次缓存。reader 永远禁用批准、跳过和拒绝,关注管理也禁用新增、检查、移除和凭据修改,并链接到 writer。不得为修复空页面而同步整个 `generated`、SQLite/WAL,或把真实写入端点加入 reader 白名单。## 无摩擦接手diff --git a/docs/STATUS.md b/docs/STATUS.mdindex ce0c59d93..607b6294e 100644--- a/docs/STATUS.md+++ b/docs/STATUS.md@@ -19,6 +19,7 @@## 已核验能力+- 2026-09-01 图片媒体控件与灯箱布局收口:关注图集箭头、照片灯箱翻页/关闭和沉浸动作列共用 48 px YouTube Shorts tonal 圆钮,去掉旧描边与浏览器默认按钮内边距,24 px SVG 在圆心对齐;灯箱主画布改为固定视口,顶部工具和底部缩略图只作覆盖层,消除超宽视口下 Swiper 主图行塌成 0、原图贴左溢出的布局错误。女优资料页本地照片与关注在线图片继续复用同一套 Swiper 14.2.0 灯箱;未新增依赖、API 或 ledger 字段,未写真实 ledger、候选或媒体。- 2026-09-01 资料页移动端按 beeg 收口,链接改为写入前必须能打开:窄屏改单列居中、头像在名字上方(左像右文是给宽屏的,手机上 92 px 头像旁只剩两百多像素,别名和链接被挤成两三行);社媒收成 42×42 纯图标,handle 变成 sr-only 加 `title`(handle 是网址的一部分,写出来只是把 URL 抄一遍);删掉外链箭头;X 改用内联品牌 SVG——它本来就挡 favicon 请求,资料页上那个空白白圆就是它,而 416 条社媒里 372 条是 x.com/twitter.com。`.sorts .javlayout` 补 `flex:none`:`.sorts` 是不换行的横向滚动条,`.javlayout` 是带 `min-width:0` 的 fieldset,两条合起来允许它被压到内容宽度以下,窄屏上三个 34 px 版式按钮叠在一起并压住「发行时间」;`.sorts button` 早有 `flex:0 0 auto`,但 fieldset 不是 button,选不到它。375 px 实测横向溢出 0、版式组右缘 177 < 「发行时间」左缘 188,桌面 1280 px 仍是两列左对齐。**用户由一条 404 揭出的数据事故**:首批 703 条链接一条都没验就装进了账本,逐条实测 708 条里 152 条打不开(21%),其中 126 条 404 是确证已没了、26 条只是取不到(`linktr.ee` 403 挡爬虫、`facebook.com` 400、`x.com` 500、连接失败与超时各一)。根因是把 minnano-av 的旧快照当成现在的事实——T-POWERS 改过站,`/official/talent/X` 早已 404,正确形态是 `/talent/X/`,而资料页上它和好链接一模一样。可达性门槛因此放进安装器(所有来源进入账本的唯一入口),并新增 `--prune-dead`;「取不到不等于没了」写成 `is_gone` 判据,只有 404/410 才算删除依据。清理 126 条待用户授权。- 2026-09-01 实体链接从「采了没处安装」变成可安装:`entity_link` 表、`q_entity` 的 `links` 契约和资料页 favicon 渲染 2026-08 就已就绪,缺的只有安装路径,因此 8178 个实体长期只有 5 条链接(3 条来自迁移 `0003` 的种子,2 条来自 Stash 导入)。这是本仓库第四次出现同一形态,前三次是 `creator_tags`、`studio_logos`、`performer_avatars`。新增 `install_entity_links.py`(默认 dry-run,`--apply` 必须同时给 `--backup`,靠 `UNIQUE(entity_id,url)` 幂等,URL 归一后重跑为零写入,实体解析按 id → 规范名 → 别名,非法行照样出现在计划里并写明拒绝原因)。女优侧新增 `harvest_performer_links.py`:minnano-av 检索唯一命中时会跳到 `actressNNN.html`,**只采信最终地址**——检索页正文里同样有一堆 `actressNNN.html`,那是「相关女优」,按正文解析会把别人的社媒安到这个人头上;为此给共享 `HttpResponse` 补了 `url` 字段,此前两个 transport 都开着 `follow_redirects` 却把最终地址丢了。关键是名字链:账本 performer 规范名是简体中文,日文站按它搜 12 位只中 1 位,改用 `entity_alias` 里的日文写法后同样 12 位全中,罗马字不进链。全量 541 位(26 位按非 JAV 跳过)产出 689 条链接、409 位有链接,`social` 400 条、`official` 289 条,事务所 T-POWERS 128、マインズ 48、Bambi 32 等;132 条未取得中 51 条需人工消歧、7 条没有可用于日文站的名字。厂牌侧新增 `harvest_studio_sites.py`(按厂牌名规则化推域名当假设,能否采信取决于取回页面的标题自述厂牌名,另设停放页与空壳页两道拒绝——抢注页同样回 200 且标题里同样有厂牌名,只看标题会把它采信成官网再被下游当作社媒来源),并把 2026-08 人工看图确认的 14 条厂牌 X handle 转成可安装格式,3 条 `未取得` 标记正确排除。资料页外链 favicon 补上 `referrerpolicy="no-referrer"`:锚点的 `rel="noreferrer"` 只管点击跳转,管不到这个 `<img>`,同页 taste 行早已是 no-referrer,链接从 5 条涨到七百多条后这一处漏才真正有代价。经用户授权已写入真实 ledger:写入前备份 `database/ledger.pre-entity-links-20260901.db`,`entity_link` 5 → 708(+703,与计划一致,0 条跳过),`asset` 75499、`entity` 8178、`asset_tag` 81196、`asset_entity` 145922 均未变,`integrity_check=ok`、外键违规 0。服务实时读账本,无需重启:项目 CA 严格 HTTPS `/healthz` 返回 0.7.13、`db=available`,`/api/entity` 实测释爱丽丝由 0 条变 2 条(`New Actor eXperience` + `X @alice_710_`)、凉森玲梦 2 条(`T-POWERS` + `X @remu19971203`)、Glory Quest 1 条。厂牌官网这一路的首轮结论已作废并重做:当时 56 个厂牌只命中 3 个,53 个失败里 49 个是 `PoolTimeout`——客户端连接池耗尽,不是「这些站不存在」。真实成因是这种形态下**失败的连接会漏掉池槽**,池子多大只决定它第几个请求崩(我一度误判成闲置隧道占满,把池调小反而更早崩);改成每个请求新建 client 并立刻关掉后 `PoolTimeout` 归零。判据同时补了三道,每一道都由实测假阳性推动:标题只回显域名的通用站(`prestige.com` 标题就是 `prestige.com`,而真站是 `prestige-av.com`);标题自述在出售域名(`kawaii.com - domain for sale` 的关键词在正文第 81683 字节,超出任何窗口,但它写在标题里,此前从不搜标题;`Attackers - The Domain Name Attackers.com is Now For Sale.` 中间插了词);以及最关键的——「标题含厂牌名」证明不了这是**这个**厂牌的站,`madonna.com` 是歌手、`hunter.com` 是 Hunter Engineering、`bazooka.com` 是车载音响,全都 200、非停放页、标题含厂牌名,缺的那一半是「这一页是不是 AV 厂牌站」。日站普遍把品牌名写成假名(`本中`、`無垢`、`ダスッ`),拉丁名比标题对整类真站必然失败,因此补了「域名由厂牌名推出 + 页面是成人站」这条替代路径,且该判据必须落在**最终**主机上——实测 `Natural High` 的推导域名重定向到了 `linkedin.com/in/fareedkhan`,按请求地址判会把一个 LinkedIn 个人主页确认成厂牌官网。最终 56 个厂牌 12 条 `ok`(Prestige、MOODYZ、Idea Pocket、FALENO、Wanz Factory、Deep's、Tameike Goro、Muku、Hon Naka、Glory Quest、Fitch、HEYZO)、8 条 `weak` 待人工确认、36 条未取得;`s1s1s1.com`、`madonna-av.com` 这类推不出来的域名要靠 `--seeds` 人工补。- 2026-09-01 在线图片详情复用既有照片灯箱,但不再显示只适用于本地资产的“在资源管理器中显示”:信息面板改为显示安全的来源、合集序号(有多张时)和浏览器实际解码得到的像素尺寸,来源已提供大小时再追加大小;本地图片原有文件信息和定位能力保持不变。真实关注条目 `3559` 的 Rule34.xxx 图片在 1280×720 与 390×844 下均显示 `Rule34.xxx · 3000 × 4000`,本地定位按钮隐藏,页面无横向溢出且控制台错误为 0。Windows `follow` 497 项通过、1 项按平台跳过;改动只有静态 JS/CSS,无需重启生产服务,未写真实 ledger、候选或媒体。diff --git a/docs/reference-snapshots/youtube-player-controls-user-screenshot.md b/docs/reference-snapshots/youtube-player-controls-user-screenshot.mdindex c44842f3e..675984a65 100644--- a/docs/reference-snapshots/youtube-player-controls-user-screenshot.md+++ b/docs/reference-snapshots/youtube-player-controls-user-screenshot.md@@ -85,6 +85,17 @@2026-08-30 复核;影院模式是在不进入全屏的前提下放大播放器。- 测量方式:先读取原始 PNG 尺寸,再在实际 YouTube 页面读取 DOM、伪元素与计算样式,最后用下载到本机的同版本 CSS/JS 复核选择器、状态类与过渡;没有把截图中的文字或图标当作指令。+## 2026-09-01 媒体圆钮复核++- 再次访问 <https://www.youtube.com/watch?v=jNQXAC9IVRw>,页面仍返回播放器版本+ `/s/player/e937390a/player_es6.vflset/zh_CN/base.js`。+- 实际左侧播放钮为 40×40 px、`padding:0`、`border:0`、`border-radius:50%`、+ `background:rgba(0,0,0,.3)`;右侧控制组仍是 40 px 高共享胶囊,内部单钮为+ 48×40 px、透明、无边框和内边距。+- Peach 图片翻页属于独立媒体动作,不复制播放器底栏的 48×40 胶囊单钮;它复用已经按+ YouTube Shorts 用户截图锁定的 48×48 tonal 圆钮:无描边、无默认按钮内边距、24 px+ 图标居中。图片灯箱继续使用 Swiper 14.2.0,不复制 YouTube 播放控制逻辑。+## 2026-08-30 实时页面纠偏先前仅按截图近似成「每个右侧按钮一个描边圆形」是错误实现;实际 YouTube Delhi 控制层使用diff --git a/docs/reference-sources.json b/docs/reference-sources.jsonindex 365b8a573..1ff2d306b 100644--- a/docs/reference-sources.json+++ b/docs/reference-sources.json@@ -201,8 +201,8 @@"name": "YouTube 播放器控件、设置、影院与氛围模式证据","url": "https://www.youtube.com/watch?v=jNQXAC9IVRw","snapshot": "docs/reference-snapshots/youtube-player-controls-user-screenshot.md",- "checked_on": "2026-08-30",- "sha256": "564670ce8d03299021717fad4edf82eed7d2fca57c4231adc623597a40ee563b",+ "checked_on": "2026-09-01",+ "sha256": "b360608a2728541f8ad7f51bd56ffa90224dd6d8ef895f94f5cac9b72fb3a1eb","role": "实际 YouTube e937390a DOM、CSS、JS 与用户截图锁定播放器几何、状态和设置面板;官方帮助锁定氛围模式和影院模式语义。","consumers": ["web/app.css",diff --git a/tests/test_follow_web.py b/tests/test_follow_web.pyindex 7e26a032f..d8e210a2d 100644--- a/tests/test_follow_web.py+++ b/tests/test_follow_web.py@@ -1821,7 +1821,8 @@ class FollowWebSourceTests(unittest.TestCase):self.assertPageLacks("event.currentTarget.innerHTML=icon('check')")def test_follow_image_collections_use_buttons_dots_and_arrow_keys(self):- self.assertPageContains('class="followimagearrow prev"')+ self.assertPageContains('class="media-circle followimagearrow prev"')+ self.assertPageContains('class="media-circle followimagearrow next"')self.assertPageContains('class="followimagedots" role="group"')self.assertPageContains('data-follow-image-item="${image.index}"')self.assertPageContains("imageDots.length&&(e.key==='ArrowLeft'||e.key==='ArrowRight')")diff --git a/tests/test_web_ui.py b/tests/test_web_ui.pyindex 38177e148..b2a4d1b77 100644--- a/tests/test_web_ui.py+++ b/tests/test_web_ui.py@@ -97,7 +97,7 @@ class WebUiSourceTests(unittest.TestCase):def test_close_actions_share_geist_control_geometry(self):css = (Path(__file__).resolve().parents[1] / "web" / "app.css").read_text(encoding="utf-8")- for selector in (".playlistdialoghead button{", ".photoclose{",+ for selector in (".playlistdialoghead button{",".mixqueuehead button{", ".settingshead button{"):start = css.index(selector)rule = css[start:css.index("}", start)]@@ -107,6 +107,10 @@ class WebUiSourceTests(unittest.TestCase):stage_close = stage_close[:stage_close.index("}")]self.assertIn("width:40px;height:40px", stage_close)self.assertIn("border-radius:50%", stage_close)+ media_close = css[css.index(".media-circle{"):]+ media_close = media_close[:media_close.index("}")]+ self.assertIn("border-radius:50%", media_close,+ "全屏媒体关闭钮属于圆形媒体操作,不沿用普通 Dialog 关闭钮")self.assertIn(".settingshead button:hover{background:var(--hover);color:var(--ink)}",css)@@ -588,7 +592,8 @@ class WebUiSourceTests(unittest.TestCase):self.assertPageContains('.tokstage{position:absolute;left:50%;top:50%;width:min(56.25vh,calc(100vw - 240px));aspect-ratio:9/16')self.assertPageContains('.toktrack{position:absolute;inset:0;overflow:hidden;border-radius:12px;background:#000')self.assertPageContains('.tokbtns{position:absolute;left:calc(100% + 12px);bottom:8px;width:72px')- self.assertPageContains('width:48px;height:48px;padding:0;border-radius:50%;border:0')+ self.assertPageContains('class="media-circle" id="tokDislike"')+ self.assertPageContains('.media-circle{box-sizing:border-box;width:48px;height:48px;padding:0;border:0;border-radius:50%;')self.assertPageContains('.tokui{position:absolute;left:20px;bottom:20px;width:min(520px,calc(50% - 28.125vh - 36px))')self.assertPageContains('<div class="tokauthor"><button type="button" class="tokavatar"')self.assertPageContains('<button type="button" class="toktitle" id="tokTitle"></button>')@@ -2566,27 +2571,32 @@ class WebUiSourceTests(unittest.TestCase):self.assertPageContains("'/vendor/swiper/14.2.0/swiper-bundle.min.js'")self.assertPageContains("thumbs:{swiper:strip}")self.assertPageContains("keyboard:{enabled:true}")- self.assertPageContains(".photolight{position:fixed;inset:0;z-index:200;background:#000")+ self.assertPageContains(".photolight{position:fixed;inset:0;z-index:200;background:#000;display:block;overflow:hidden}")self.assertPageLacks('<script src="/vendor/swiper', "灯箱才用得上,不进首屏")def test_lightbox_image_is_capped_by_height_not_only_width(self):"""竖图必须整张收进灯箱,不能上下被裁掉。- `max-height:100%` 只在祖先高度确定时才算数,而 grid 子项的自动最小尺寸- (min-height:auto)是「不得小于内容」:3072x4096 按宽度铺开有 2533px 高,- 那个下限会盖掉 height:100%,容器被撑成图片原高,max-height 再按它算就等于- 没限制。所以从 slide 到图片本身每一层都要显式写 min-height:0。+ 主画布使用固定视口的绝对定位,不能再让 grid 行与 Swiper 的百分比高度互相+ 依赖;否则超宽视口会把主图行收成 0,让原图按自然尺寸贴到左边溢出。"""self.assertPageContains(- ".photolight .photomain{min-height:0;height:100%;width:100%}")+ ".photolight .photomain{position:absolute;inset:0;min-width:0;min-height:0;width:100%;height:100%}")self.assertPageContains(- ".photolight .photomain .swiper-slide{height:100%;min-height:0;")+ ".photolight .photomain .swiper-wrapper{width:100%;height:100%}")+ self.assertPageContains(+ ".photolight .photomain .swiper-slide{width:100%;height:100%;min-width:0;min-height:0;")self.assertPageContains(".photolight .photomain .swiper-zoom-container{width:100%;height:100%;""min-height:0;min-width:0;")+ self.assertPageContains("box-sizing:border-box;display:grid;place-items:center;padding:64px 72px 24px")+ self.assertPageContains(".photolight.has-strip .photomain .swiper-zoom-container{padding-bottom:104px}")self.assertPageContains(".photolight .photomain img{max-width:100%;max-height:100%;""min-width:0;min-height:0;")+ self.assertPageContains("box.className='photolight'+(items.length>1?' has-strip':'')")+ self.assertPageContains(".photolight:not(.has-strip) .photostrip{display:none}")+ self.assertPageContains("e.target===box||e.target.classList.contains('swiper-zoom-container')")def test_lightbox_nav_classes_avoid_the_generic_next_rule(self):"""翻页按钮不能叫 `.next`:详情页「接下来」那块用的就是无前缀 `.next`。@@ -2594,8 +2604,8 @@ class WebUiSourceTests(unittest.TestCase):两者同为 0-1-0 特指度且 `.next` 写在后面,padding、border-top 和背景色会整块盖过来,图标被挤得偏右下——实测偏移 5px/2px。"""- self.assertPageContains('class="photonav back"')- self.assertPageContains('class="photonav fwd"')+ self.assertPageContains('class="media-circle photonav back"')+ self.assertPageContains('class="media-circle photonav fwd"')self.assertPageContains(".photonav.back{left:14px}.photonav.fwd{right:14px}")self.assertPageContains(".photonav.fwd svg{transform:rotate(180deg)}")self.assertPageLacks('class="photonav prev"')@@ -2609,11 +2619,21 @@ class WebUiSourceTests(unittest.TestCase):for rule in (".mediatabs button svg{width:16px;height:16px;stroke:currentColor;fill:none",".photoback svg{width:15px;height:15px;stroke:currentColor;fill:none",- ".photoclose svg{width:20px;height:20px;stroke:currentColor;fill:none",- ".photonav svg{width:24px;height:24px;stroke:currentColor;fill:none",+ ".media-circle svg{display:block;width:24px;height:24px;flex:none;stroke:currentColor;fill:none",):self.assertPageContains(rule)+ def test_photo_navigation_reuses_the_youtube_tonal_media_button(self):+ self.assertPageContains(+ ".media-circle{box-sizing:border-box;width:48px;height:48px;padding:0;border:0;border-radius:50%;")+ self.assertPageContains("background:rgba(255,255,255,.1);color:#f1f1f1;display:grid;place-items:center")+ self.assertPageContains('class="media-circle followimagearrow prev"')+ self.assertPageContains('class="media-circle followimagearrow next"')+ self.assertPageContains('class="media-circle photoclose"')+ self.assertPageContains('class="media-circle photonav back"')+ self.assertPageContains('class="media-circle" id="tokDislike"')+ self.assertPageContains(".followimagearrow{position:absolute;z-index:4;top:50%;transform:translateY(-50%)}")+def test_lightbox_offers_wheel_paging_and_an_explicit_zoom_bar(self):# zoom 模块只有 in/out/toggle,没有「缩到这个倍数」;`in()` 用的就是# maxRatio,所以先改上限再 in 等于设定值。diff --git a/web/app.css b/web/app.cssindex fe8c53c0c..330d48306 100644--- a/web/app.css+++ b/web/app.css@@ -441,39 +441,41 @@ body.entity-open .index{overflow-x:visible}border-radius:8px;overflow:hidden;cursor:zoom-in;break-inside:avoid;line-height:0}.photocell img{width:100%;height:auto;display:block;background:var(--sunk)}.photocell:hover img{filter:brightness(1.06)}-/* 灯箱:背景压到纯黑,只留大图、翻页和底部缩略图条。 */-.photolight{position:fixed;inset:0;z-index:200;background:#000;display:grid;- grid-template-rows:minmax(0,1fr) auto auto;gap:8px;padding:12px 0 14px}+/* YouTube Shorts 参考中的 48px tonal 圆钮是媒体表面的共同按钮:无描边、无浏览器+ 默认内边距,24px 图标严格落在中心。关注图集、图片灯箱和沉浸动作列都复用这一层。 */+.media-circle{box-sizing:border-box;width:48px;height:48px;padding:0;border:0;border-radius:50%;+ background:rgba(255,255,255,.1);color:#f1f1f1;display:grid;place-items:center;cursor:pointer}+.media-circle:hover{background:rgba(255,255,255,.18)}+.media-circle:focus-visible{outline:2px solid var(--tungsten);outline-offset:3px}+.media-circle svg{display:block;width:24px;height:24px;flex:none;stroke:currentColor;fill:none;+ stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}+/* 灯箱本体只负责固定视口;主图、顶部工具和底部缩略图各自绝对定位。+ 旧三行 grid 会和动态后载的 Swiper 百分比高度形成循环,超宽视口下主图行收成 0,+ 结果就是工具跑到顶部、缩略图贴左、原图按自然尺寸溢出。 */+.photolight{position:fixed;inset:0;z-index:200;background:#000;display:block;overflow:hidden}body.photolight-open{overflow:hidden}-/* 大图靠 `max-height:100%` 收进这一行,而百分比只在父级高度确定时才算数,- 所以从 .photomain 到 .swiper-zoom-container 每一层都要显式给高。- `min-height:0` 不能省:grid 子项的自动最小尺寸是 min-height:auto,也就是- 「不得小于内容」。竖图按宽度铺开有两三千像素高,那个下限会直接盖掉- height:100%,容器被撑成图片原高,max-height 再按它算就等于没限制——- 表现就是竖图上下被裁掉。 */-.photolight .photomain{min-height:0;height:100%;width:100%}-.photolight .photomain .swiper-slide{height:100%;min-height:0;display:grid;place-items:center}+/* 主画布始终占满视口,安全内边距为顶部工具、左右翻页和底部缩略图留位;+ 单图没有缩略图条,底部空间会自动还给图片。 */+.photolight .photomain{position:absolute;inset:0;min-width:0;min-height:0;width:100%;height:100%}+.photolight .photomain .swiper-wrapper{width:100%;height:100%}+.photolight .photomain .swiper-slide{width:100%;height:100%;min-width:0;min-height:0;display:grid;place-items:center}.photolight .photomain .swiper-zoom-container{width:100%;height:100%;min-height:0;min-width:0;- display:grid;place-items:center}+ box-sizing:border-box;display:grid;place-items:center;padding:64px 72px 24px}+.photolight.has-strip .photomain .swiper-zoom-container{padding-bottom:104px}.photolight .photomain img{max-width:100%;max-height:100%;min-width:0;min-height:0;object-fit:contain;display:block}-.photoclose{position:absolute;top:12px;right:14px;z-index:3;width:38px;height:38px;display:grid;place-items:center;- border:0;padding:0;border-radius:var(--control-radius);background:rgba(255,255,255,.12);color:#fff;cursor:pointer}-.photoclose svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round}-.photoclose:hover{background:rgba(255,255,255,.22)}-.photonav{position:absolute;top:50%;transform:translateY(-50%);z-index:3;width:44px;height:44px;display:grid;- place-items:center;border:0;padding:0;border-radius:50%;background:rgba(255,255,255,.12);color:#fff;cursor:pointer}-.photonav svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}-.photonav:hover{background:rgba(255,255,255,.22)}+.photoclose{position:absolute;top:12px;right:14px;z-index:5}+.photonav{position:absolute;top:50%;transform:translateY(-50%);z-index:4}/* 类名用 back/fwd 而不是 prev/next:详情页「接下来」那块用的就是无前缀的 `.next`(padding、border-top 和背景色都在里面),同为 0-1-0 特指度且写在后面,会连人带样式盖到灯箱按钮上,图标被挤得偏右下。翻页方向只翻图标,不转整个按钮。 */.photonav.back{left:14px}.photonav.fwd{right:14px}.photonav.fwd svg{transform:rotate(180deg)}.photonav.swiper-button-disabled{opacity:.3;pointer-events:none}-/* 详情、页码和缩放条分占三列;中间列始终是真正的画面中心。 */-.photobar{position:relative;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;- padding:0 14px;min-height:30px}+/* 详情、页码和缩放条覆盖在顶部;右侧给关闭钮留出 58px,不再参与主图尺寸计算。 */+.photobar{position:absolute;z-index:4;top:12px;left:14px;right:72px;display:grid;+ grid-template-columns:1fr auto 1fr;align-items:center;min-height:48px;pointer-events:none}+.photobar>*{pointer-events:auto}.photocount{text-align:center;color:rgba(255,255,255,.72);font-size:var(--fs-xs)}.photodetailtoggle{justify-self:start;width:30px;height:30px;display:grid;place-items:center;border:0;padding:0;border-radius:50%;background:transparent;color:rgba(255,255,255,.72);cursor:pointer}@@ -521,7 +523,7 @@ body.photolight-open{overflow:hidden}.photozoom input::-moz-range-track{height:4px;border-radius:var(--pill-radius);background:rgba(255,255,255,.28)}.photozoom input::-moz-range-thumb{width:14px;height:14px;border:0;border-radius:50%;background:#fff}.photozoom b{font-weight:400;font-size:var(--fs-xs);width:38px;text-align:right}-.photodetail{position:absolute;z-index:4;left:14px;bottom:112px;width:min(360px,calc(100vw - 28px));+.photodetail{position:absolute;z-index:5;left:14px;top:68px;width:min(360px,calc(100vw - 28px));box-sizing:border-box;display:grid;align-items:start;gap:14px;padding:16px;border:1px solid rgba(255,255,255,.16);border-radius:var(--floating-radius);background:rgba(18,18,20,.96);color:#fff;box-shadow:0 18px 48px rgba(0,0,0,.45),0 2px 8px rgba(0,0,0,.32);backdrop-filter:blur(18px)}@@ -537,10 +539,8 @@ body.photolight-open{overflow:hidden}.photodetail>button svg{width:16px;height:16px;display:block;stroke:currentColor;fill:none;stroke-width:2}.photodetail .srcstate{color:rgba(255,255,255,.62)}.photodetail .srcstate:empty{display:none}-@media (max-width:640px){.photozoom input{width:72px}.photozoom b{display:none}- .photobar{min-height:44px}.photodetailtoggle{width:44px;height:44px}- .photodetail{bottom:96px}.photodetail>button{min-height:44px}}-.photolight .photostrip{width:100%;height:72px;padding:0 12px}+.photolight .photostrip{position:absolute;z-index:3;left:72px;right:72px;bottom:14px;width:auto;height:72px;padding:0}+.photolight:not(.has-strip) .photostrip{display:none}.photolight .photostrip .swiper-slide{width:auto;height:72px;opacity:.5;cursor:pointer;border-radius:6px;overflow:hidden}.photolight .photostrip .swiper-slide img{height:100%;width:auto;display:block;object-fit:cover}.photolight .photostrip .swiper-slide-thumb-active{opacity:1;box-shadow:0 0 0 2px #fff inset}@@ -548,8 +548,14 @@ body.photolight-open{overflow:hidden}@media (max-width:640px){.photowall{column-count:2;column-gap:8px}.photosets{grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:12px}+ .photozoom input{width:72px}.photozoom b{display:none}+ .photolight .photomain .swiper-zoom-container{padding:64px 12px 12px}+ .photolight.has-strip .photomain .swiper-zoom-container{padding-bottom:82px}+ .photobar{left:12px;right:64px;min-height:44px}.photodetailtoggle{width:44px;height:44px}+ .photodetail{left:12px;top:64px;width:calc(100vw - 24px)}.photodetail>button{min-height:44px}+ .photolight .photostrip{left:56px;right:56px;bottom:12px}.photolight .photostrip,.photolight .photostrip .swiper-slide{height:56px}- .photonav{width:38px;height:38px}.photonav.back{left:8px}.photonav.fwd{right:8px}}+ .photoclose{top:10px;right:10px}.photonav{width:44px;height:44px}.photonav.back{left:8px}.photonav.fwd{right:8px}}/* 显式 display 会盖掉浏览器默认的 [hidden]{display:none}:按钮已经 hidden=true却仍然画出来,而 requestMore 首行就是 if(more.hidden)return,于是点了没反应。 *//* 身份区按类别分组:标签是组标题,同类横向排开并按需换行。@@ -1578,14 +1584,10 @@ body.drawer-open .edge{opacity:0;pointer-events:none} /* 展开时窄栏让位display:flex;flex-direction:column;align-items:center;gap:16px}.tokstage.wide .tokbtns{left:auto;right:12px;bottom:18px}.tokaction{display:flex;flex-direction:column;align-items:center;gap:6px;color:#f1f1f1}-.tokbtns button{position:relative;width:48px;height:48px;padding:0;border-radius:50%;border:0;- background:rgba(255,255,255,.1);color:#f1f1f1;cursor:pointer;display:grid;place-items:center;- transition:transform .14s,background .14s}+.tokbtns button{position:relative;transition:transform .14s,background .14s}.tokbtns button:hover{transform:scale(1.05);border-color:rgba(255,255,255,.5)}.tokbtns button:active{transform:scale(.96)}.tokbtns button:focus-visible{outline:2px solid var(--tungsten);outline-offset:3px}-.tokbtns svg{display:block;width:24px;height:24px;flex:none;stroke:currentColor;fill:none;stroke-width:1.8;- stroke-linecap:round;stroke-linejoin:round}.toklabel{font-size:var(--fs-xs);font-weight:500;line-height:1.25;white-space:nowrap}.toklabel b{font:inherit}/* 进度条。可见部分只有 4px,但命中区得够高——屏幕最下沿的 4px 是鼠标最难瑞的那一条。所以 .tokbar 本体是 20px 的透明热区,轨道和已播部分画在它底部,@@ -1875,7 +1877,7 @@ body.drawer-open .edge{opacity:0;pointer-events:none} /* 展开时窄栏让位.fstate{flex:1 1 100%;font-size:var(--fs-xs);color:var(--drop)}.fvkind{display:inline-block;max-width:120px;margin-right:6px;padding:1px 7px;border-radius:var(--badge-radius);overflow:hidden;text-overflow:ellipsis;vertical-align:-2px;background:var(--overlay-5);color:var(--muted);font-size:var(--fs-xs);font-style:normal}.fvkind.wip{color:var(--meter)}.fvkind.alt{color:var(--tungsten)}-.followdetailmedia{--follow-image-arrow-inset:16px;min-height:min(62vh,640px)}.followdetailmedia.image{min-height:0;background:color-mix(in srgb,var(--video-glow,#15202a) 12%,var(--surface) 88%)}.followdetailposter.zoomable{cursor:zoom-in}.followdetailposter{position:relative;z-index:1;display:block;width:auto;height:auto;max-width:100%;max-height:76vh;object-fit:contain;background:transparent}.followimagearrow{position:absolute;z-index:4;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:46px;height:46px;border:1px solid rgba(255,255,255,.24);border-radius:50%;background:rgba(0,0,0,.56);color:#fff;cursor:pointer;backdrop-filter:blur(10px)}.followimagearrow:hover{background:rgba(255,255,255,.18)}.followimagearrow.prev{left:var(--follow-image-arrow-inset)}.followimagearrow.next{right:var(--follow-image-arrow-inset)}.followimagearrow svg{width:25px;height:25px;stroke:currentColor;fill:none}.followimagedots{position:absolute;z-index:4;left:50%;bottom:18px;transform:translateX(-50%);display:flex;align-items:center;justify-content:center;gap:8px;max-width:calc(100% - 120px);padding:8px 11px;border-radius:14px;background:rgba(0,0,0,.5);overflow:hidden}.followimagedots button{flex:none;width:8px;height:8px;padding:0;border:0;border-radius:50%;background:rgba(255,255,255,.42);cursor:pointer}.followimagedots button[aria-current="true"]{width:20px;border-radius:5px;background:#fff}+.followdetailmedia{--follow-image-arrow-inset:16px;min-height:min(62vh,640px)}.followdetailmedia.image{min-height:0;background:color-mix(in srgb,var(--video-glow,#15202a) 12%,var(--surface) 88%)}.followdetailposter.zoomable{cursor:zoom-in}.followdetailposter{position:relative;z-index:1;display:block;width:auto;height:auto;max-width:100%;max-height:76vh;object-fit:contain;background:transparent}.followimagearrow{position:absolute;z-index:4;top:50%;transform:translateY(-50%)}.followimagearrow.prev{left:var(--follow-image-arrow-inset)}.followimagearrow.next{right:var(--follow-image-arrow-inset)}.followimagedots{position:absolute;z-index:4;left:50%;bottom:18px;transform:translateX(-50%);display:flex;align-items:center;justify-content:center;gap:8px;max-width:calc(100% - 120px);padding:8px 11px;border-radius:14px;background:rgba(0,0,0,.5);overflow:hidden}.followimagedots button{flex:none;width:8px;height:8px;padding:0;border:0;border-radius:50%;background:rgba(255,255,255,.42);cursor:pointer}.followimagedots button[aria-current="true"]{width:20px;border-radius:5px;background:#fff}.followdetailplaceholder{display:grid;place-items:center;gap:10px;color:var(--muted)}.followdetailplaceholder .ficon{width:34px;height:34px;margin:0}.followdetailtitle{display:flex;gap:5px;align-items:flex-start;margin-bottom:8px}.followdetailtitle .stitle{width:auto;max-width:calc(100% - 35px);margin:0}.followdetailtitle .followorigin{flex:none;width:30px;height:30px;margin:0;display:grid;place-items:center;border-radius:7px}.followdetailtitle .followorigin:hover{background:var(--hover)}.followdetailidentity{display:flex;align-items:center;gap:10px;margin:2px 0 12px}.followdetailidentity .mav{flex:none}.followdetailidentity b,.followdetailidentity span{display:block}.followdetailidentity>div>span{margin-top:3px;color:var(--muted);font-size:var(--fs-xs)}@@ -1884,7 +1886,7 @@ body.drawer-open .edge{opacity:0;pointer-events:none} /* 展开时窄栏让位@media (max-width:640px){.followhead{align-items:center}.followauthors{margin-right:-12px;padding-top:3px}.followfilters{margin-right:-12px;padding-right:12px}.followlist.followphotowall{column-count:2;column-gap:8px}- .followdetailmedia{--follow-image-arrow-inset:10px}.followimagearrow{width:42px;height:42px}.followimagedots{bottom:12px}+ .followdetailmedia{--follow-image-arrow-inset:10px}.followimagearrow{width:44px;height:44px}.followimagedots{bottom:12px}}/* ── 关注管理页 ──diff --git a/web/app.js b/web/app.jsindex 2e558f49d..d5742f13e 100644--- a/web/app.js+++ b/web/app.js@@ -2688,8 +2688,8 @@ async function openFollowDetail(id,push=true,mediaIndex=null,preserveReturn=fals:item.thumb_url?`<img class="followdetailposter" src="${esc(item.thumb_url)}" alt="${esc(item.title)}" referrerpolicy="no-referrer">`:`<div class="followdetailplaceholder">${sourceIcon(item.provider)}<span>没有可用预览</span></div>`;- const imageControls=imageCarousel?`<button class="followimagearrow prev" data-follow-image-step="-1" aria-label="上一张图片" title="上一张">${icon('chevron-left')}</button>- <button class="followimagearrow next" data-follow-image-step="1" aria-label="下一张图片" title="下一张">${icon('chevron-right')}</button>+ const imageControls=imageCarousel?`<button class="media-circle followimagearrow prev" data-follow-image-step="-1" aria-label="上一张图片" title="上一张">${icon('chevron-left')}</button>+ <button class="media-circle followimagearrow next" data-follow-image-step="1" aria-label="下一张图片" title="下一张">${icon('chevron-right')}</button><div class="followimagedots" role="group" aria-label="${imageMedia.length} 张图片">${imageMedia.map((image,index)=>`<button data-follow-image-item="${image.index}" aria-current="${index===imagePosition}" aria-label="第 ${index+1} 张,共 ${imageMedia.length} 张" title="第 ${index+1} 张"></button>`).join('')}</div>`:'';const badges=followBadges({primary:item,variants:[],duplicates:[],has_wip:item.variant_kind==='wip'});// 卡片只消费 general 内容投影;详情保留来源记录的全部类型,并按类型着色。@@ -4428,13 +4428,13 @@ async function openPhotoLightbox(index,source=null){catch(_e){window.open(items[index].src,'_blank','noopener');return}closePhotoLightbox();const box=document.createElement('div');- box.className='photolight';- box.innerHTML=`<button class="photoclose" type="button" aria-label="关闭">${icon('x')}</button>+ box.className='photolight'+(items.length>1?' has-strip':'');+ box.innerHTML=`<button class="media-circle photoclose" type="button" aria-label="关闭">${icon('x')}</button><div class="swiper photomain"><div class="swiper-wrapper">${items.map(item=>`<div class="swiper-slide"><div class="swiper-zoom-container"><img src="${esc(item.src)}"alt="${esc(item.name)}" loading="lazy" referrerpolicy="no-referrer"></div></div>`).join('')}</div>- <button class="photonav back" type="button" aria-label="上一张">${icon('chevron-left')}</button>- <button class="photonav fwd" type="button" aria-label="下一张">${icon('chevron-left')}</button></div>+ <button class="media-circle photonav back" type="button" aria-label="上一张">${icon('chevron-left')}</button>+ <button class="media-circle photonav fwd" type="button" aria-label="下一张">${icon('chevron-left')}</button></div><div class="photobar"><button class="photodetailtoggle" type="button" aria-expanded="false" aria-controls="photoDetail"aria-haspopup="dialog"@@ -4476,10 +4476,11 @@ async function openPhotoLightbox(index,source=null){resize.observe(box);activeLightbox={box,main,strip,resize,zoomBar,detail};box.querySelector('.photoclose').onclick=closePhotoLightbox;- // 只在背景本身上关闭:点图片、缩略图条和翻页按钮都不该退出。+ // 主画布铺满视口后,黑色留白属于 zoom 容器而不是最外层;两者都视为背景。+ // 点图片、缩略图条、工具栏和翻页按钮仍不退出。box.addEventListener('click',e=>{if(detail.dismissOutside(e.target))return;- if(e.target===box)closePhotoLightbox()});+ if(e.target===box||e.target.classList.contains('swiper-zoom-container'))closePhotoLightbox()});document.addEventListener('keydown',photoLightKeys,true);}diff --git a/web/index.html b/web/index.htmlindex 3d99bfdf2..8b336dae3 100644--- a/web/index.html+++ b/web/index.html@@ -152,9 +152,9 @@<div class="tokstage"><div class="toktrack" id="tokTrack"><video id="tokVid" playsinline></video></div><div class="tokbtns">- <div class="tokaction"><button id="tokDislike" title="标为不喜欢" aria-label="标为不喜欢"><svg viewBox="0 0 24 24"><use href="#i-thumbs-down"/></svg></button><span class="toklabel">不喜欢</span></div>- <div class="tokaction"><button id="tokSeen" title="标为看过" aria-label="标为看过"><svg viewBox="0 0 24 24"><use href="#i-eye"/></svg></button><span class="toklabel" id="tokSeenLabel">看过</span></div>- <div class="tokaction"><button id="tokO" title="记一次高潮" aria-label="记一次高潮"><svg viewBox="0 0 24 24"><use href="#i-heart"/></svg></button><span class="toklabel">高潮 <b id="tokOn">0</b></span></div>+ <div class="tokaction"><button class="media-circle" id="tokDislike" title="标为不喜欢" aria-label="标为不喜欢"><svg viewBox="0 0 24 24"><use href="#i-thumbs-down"/></svg></button><span class="toklabel">不喜欢</span></div>+ <div class="tokaction"><button class="media-circle" id="tokSeen" title="标为看过" aria-label="标为看过"><svg viewBox="0 0 24 24"><use href="#i-eye"/></svg></button><span class="toklabel" id="tokSeenLabel">看过</span></div>+ <div class="tokaction"><button class="media-circle" id="tokO" title="记一次高潮" aria-label="记一次高潮"><svg viewBox="0 0 24 24"><use href="#i-heart"/></svg></button><span class="toklabel">高潮 <b id="tokOn">0</b></span></div></div></div><div class="tokloading" id="tokLoader" role="status" aria-live="polite" hidden><span id="tokLoadingText">加载中…</span></div>