/* ============================================================
   个人云素材库 · 用户端（三端自适应）
   手机态 = 小程序式（底部 TabBar / 单列 / 底部抽屉）
   桌面态 = 大屏布局（顶部导航 / 内容居中 1100px / 多列网格）
   所有布局规则限定在 html[data-view=...] 作用域内，避免串台
   ============================================================ */

/* ---------- 结构骨架 ---------- */
#app { position: relative; z-index: 2; min-height: 100vh; }
.wrap { width: 100%; margin: 0 auto; }

.tabbar { display: none; }
.topnav { display: none; }
.mtop { display: none; }

/* ---------- 通用 ---------- */
.page { padding: var(--s5); }
.sect-title { display: flex; align-items: baseline; gap: var(--s3); margin-bottom: var(--s3); }
.sect-title h2 { font-size: var(--fs-h3); }
.sect-title .sub { font-size: var(--fs-xs); color: var(--text-4); }
.muted { color: var(--text-4); }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: var(--s2); }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.empty { padding: var(--s8) var(--s5); text-align: center; color: var(--text-4); font-size: var(--fs-sm); }
.empty b { display: block; color: var(--text-2); font-size: var(--fs-h3); margin-bottom: var(--s2); }

/* ---------- 认证页 ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: var(--s5); }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-xl); padding: var(--s6); box-shadow: var(--sh3); }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: var(--s5); }
.brand .mk { width: 34px; height: 34px; border-radius: 10px; background: var(--accent);
  box-shadow: var(--sh-accent); display: grid; place-items: center; color: var(--accent-ink); font-weight: 800; font-size: 17px; }
.brand .nm { font-weight: 800; letter-spacing: -.02em; font-size: 17px; }
.brand .nm small { display: block; font-size: 10px; font-weight: 600; letter-spacing: .18em; color: var(--text-4); }

.seg { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; margin-bottom: var(--s5); }
.seg button { flex: 1; min-height: 36px; border-radius: var(--r-xs); font-size: var(--fs-sm); font-weight: 600; color: var(--text-3); }
.seg button.on { background: var(--accent-dim); color: var(--accent-hi); }

.fg { margin-bottom: var(--s4); }
.fg > label { display: block; font-size: var(--fs-xs); color: var(--text-3); margin-bottom: 6px; }
.fg .msg { font-size: var(--fs-2xs); margin-top: 5px; min-height: 15px; }
.fg .msg.ok { color: var(--ok); } .fg .msg.err { color: var(--err); }
.pw-meter { display: flex; gap: 4px; margin-top: 6px; }
.pw-meter i { flex: 1; height: 3px; border-radius: 3px; background: rgba(245,241,234,.1); }
.pw-meter i.on { background: var(--accent); }
.pw-meter.lv2 i.on { background: var(--warn); }
.pw-meter.lv3 i.on { background: var(--ok); }
.agree { display: flex; gap: var(--s2); align-items: flex-start; font-size: var(--fs-xs); color: var(--text-3); margin-bottom: var(--s4); }
.agree input { margin-top: 3px; accent-color: var(--accent); }

/* 分享访问密码门 · 错误态（v1.6.46）：输错密码必须给得出反馈，
   否则访客看到的是一个和刚才一模一样的空密码框，会以为按钮没反应。
   user.css 在 tokens.css 之后加载，`.field.err` 与 `.field:focus` 同权重时后者让位于红框。 */
.field.err { border-color: var(--err); background: var(--err-dim); }
.field.err:focus { border-color: var(--err); }
.share-pw-msg { min-height: 16px; margin-top: var(--s2); font-size: var(--fs-2xs); color: var(--err); }

/* 审核中 / 被拒 */
.state-art { width: 76px; height: 76px; margin: 0 auto var(--s5); border-radius: var(--r-full);
  display: grid; place-items: center; background: var(--warn-dim); color: var(--warn); font-size: 30px; }
.state-art.err { background: var(--err-dim); color: var(--err); }
.state-art.ok { background: var(--ok-dim); color: var(--ok); }

/* ---------- Banner ---------- */
.banner { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2);
  border: 1px solid var(--line); aspect-ratio: 21 / 8; min-height: 118px; }
.banner img { width: 100%; height: 100%; object-fit: cover; opacity: .92; }
.banner .fallback { position: absolute; inset: 0; padding: var(--s5);
  background: radial-gradient(30rem 18rem at 12% 0%, rgba(255,90,31,.22), transparent 62%); }
.banner .ttl { font-size: var(--fs-h1); letter-spacing: -.03em; }
.banner .ds { color: var(--text-3); font-size: var(--fs-sm); margin-top: 4px; }

.notice { margin-top: var(--s3); display: flex; gap: var(--s2); padding: 10px var(--s4);
  background: var(--warn-dim); border: 1px solid rgba(255,176,32,.24); border-radius: var(--r-sm);
  font-size: var(--fs-xs); color: #FFD37A; }

/* ---------- 解析输入 ---------- */
.parse-box { margin-top: var(--s5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); }
.parse-box textarea { width: 100%; min-height: 92px; resize: vertical; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s3); font-size: var(--fs-sm);
  line-height: 1.7; color: var(--text); }
.parse-box textarea:focus { outline: none; border-color: var(--accent-line); }
.parse-ops { display: flex; gap: var(--s2); margin-top: var(--s3); }
.parse-ops .btn { min-height: 40px; }
.parse-hint { margin-top: var(--s2); font-size: var(--fs-2xs); color: var(--text-4); }

/* ---------- 结果卡片 ---------- */
.res-head { margin-top: var(--s6); }
.res-list { display: grid; gap: var(--s4); }
.res-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  animation: slide-up var(--dur-2) var(--ease); }
.res-card .hd { padding: var(--s4); display: flex; gap: var(--s3); align-items: flex-start; }
.res-card .hd .av { width: 38px; height: 38px; border-radius: var(--r-full); flex: none; object-fit: cover;
  background: var(--surface-3); border: 1px solid var(--line); }
.res-card .hd .who { flex: 1; min-width: 0; }
.res-card .hd .who .nm { font-weight: 600; font-size: var(--fs-sm); }
.res-card .hd .who .id { font-size: var(--fs-2xs); color: var(--text-4); }
.res-card .st { padding: 0 var(--s4) var(--s3); display: flex; gap: 6px; flex-wrap: wrap; }
.res-card .ttl { padding: 0 var(--s4) var(--s3); font-size: var(--fs-sm); color: var(--text-2); font-weight: 600; }
.res-card .desc { padding: 0 var(--s4) var(--s3); font-size: var(--fs-xs); color: var(--text-3); white-space: pre-wrap; }
.res-card .desc.fold { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.res-card .more { font-size: var(--fs-2xs); color: var(--accent-hi); padding: 0 var(--s4) var(--s3); display: inline-block; }
/* 播放舞台：**固定尺寸**的窗口，任何比例的素材都框在里面。
   之前视频是 `width:100%` + 不设高度，竖屏 1080×1920 会把元素撑到几千像素高，
   原生控制条随之被顶到视口外，用户根本点不到 —— 现在容器高度锁定，
   画面用 object-fit:contain 居中（竖屏两侧留黑边是正常的），控制条贴在容器底部。 */
.pl-stage { position: relative; width: 100%; height: 52vh; min-height: 200px; max-height: 420px;
  background: #000; overflow: hidden; }
.pl-stage > video, .pl-stage > img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* 播放静默降级（闭环 6）：换线路时的加载态覆盖层 */
.pl-stage .pl-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  gap: 10px; background: rgba(0,0,0,.45); color: #fff; font-size: var(--fs-sm); z-index: 3; pointer-events: none; }
.pl-stage .pl-loading::before { content: ''; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: plspin .8s linear infinite; }
@keyframes plspin { to { transform: rotate(360deg); } }
.res-media { background: var(--bg-deep); }
.grid9 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.grid9 .cell { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.grid9 .cell img { width: 100%; height: 100%; object-fit: cover; }
.grid9 .cell .gif { position: absolute; right: 5px; top: 5px; }
/* 图集大图查看器内的九宫格（详情抽屉 / 分享页），间距大一点、带序号角标 */
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.album-grid .cell { position: relative; aspect-ratio: 1; overflow: hidden; background: var(--bg-deep);
  border-radius: var(--r-xs); cursor: zoom-in; }
.album-grid .cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-grid .cell .idx { position: absolute; right: 4px; bottom: 4px; padding: 0 5px; border-radius: var(--r-full);
  background: rgba(0,0,0,.6); color: #fff; font-size: 10px; line-height: 16px; }
.live-block { padding: var(--s3) var(--s4); }
.live-block .live-tag { position: absolute; left: 8px; top: 8px; z-index: 2; }
.live-block .box { position: relative; width: 168px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line-2); background: var(--bg-deep); cursor: pointer; }
/* 实况格：静态图垫底 + 动图视频自动循环播放盖在上面（坑 141）。
   视频加载失败被 liveVidFail 摘掉 → 露出静态图，任何网络下都不会黑块。 */
.live-block img { width: 100%; display: block; }
.live-block .box video { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; }
/* 图片九宫格里的「实况静图」小标（与实况格的 LIVE 角标区分） */
.grid9 .still-tag { position: absolute; right: 4px; top: 4px; z-index: 2; font-size: 10px; padding: 1px 6px; opacity: .85; }
.live-note { padding: 0 var(--s4) var(--s3); font-size: var(--fs-2xs); color: var(--text-4); line-height: 1.7; }
.res-foot { padding: var(--s3) var(--s4); display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; border-top: 1px solid var(--line); }
.res-foot .meta { font-size: var(--fs-2xs); color: var(--text-4); margin-right: auto; }
.media-err { padding: var(--s6) var(--s4); text-align: center; color: var(--text-3); font-size: var(--fs-sm); }
.media-err b { display: block; color: var(--text); font-size: var(--fs-h3); margin-bottom: var(--s2); }
/* 海外素材提示条（v1.6.18）：源站在墙外，国内无法直连播放 */
.ovs-tip { padding: var(--s3) var(--s4); font-size: var(--fs-2xs); line-height: 1.7;
  color: var(--text-3); background: var(--surface-2); border-top: 1px solid var(--line); }

/* ---------- 资料库 ---------- */
.lib-toolbar { display: flex; gap: var(--s2); margin-bottom: var(--s4); flex-wrap: wrap; }
.lib-toolbar .field { flex: 1; min-width: 150px; }
.lib-grid { display: grid; gap: var(--s3); }
.lib-item { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.lib-item .th { position: relative; background: var(--bg-deep); cursor: pointer; aspect-ratio: 3 / 4; }
.lib-item .th img { width: 100%; height: 100%; object-fit: cover; }
.lib-item .th .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-4); font-size: var(--fs-2xs); }
.lib-item .th .dur { position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: var(--r-xs);
  background: rgba(16,15,14,.8); color: #F5F1EA; font-family: var(--font-mono); font-size: 10px; }
.lib-item .th .bgs { position: absolute; left: 6px; top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.lib-item .th .bgs .b { padding: 1px 6px; border-radius: var(--r-full); font-size: 10px; font-weight: 700;
  background: rgba(16,15,14,.74); color: #F5F1EA; }
.lib-item .th .bgs .b.acc { background: rgba(255,90,31,.92); color: var(--accent-ink); }
.lib-item .th .bgs .b.ok { background: rgba(61,214,140,.9); color: #10231A; }
.lib-item .body { padding: 10px var(--s3) var(--s3); }
.lib-item .nm { font-size: var(--fs-sm); font-weight: 600; }
.lib-item .sb { margin-top: 4px; font-size: var(--fs-2xs); color: var(--text-4); }
.lib-item .ops { display: flex; gap: var(--s1); margin-top: 9px; }
.lib-item .ops .btn { flex: 1; min-height: 32px; padding: 0 6px; font-size: var(--fs-2xs); }
.pager { display: flex; justify-content: center; align-items: center; gap: var(--s3); padding: var(--s5) 0; font-size: var(--fs-xs); color: var(--text-3); }

/* ---------- 配额条 ---------- */
.quota { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s4); }
.quota .top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s2); }
.quota .top .nm { font-size: var(--fs-sm); font-weight: 600; }
.quota .top .vl { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-3); }
.quota .track > i { background: linear-gradient(90deg, var(--accent), var(--accent-hi)); }
.quota .sub { margin-top: 7px; font-size: var(--fs-2xs); color: var(--text-4); }

/* ---------- 我的 ---------- */
.me-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); }
.me-card .hd { display: flex; gap: var(--s4); align-items: center; }
.me-card .av { width: 54px; height: 54px; border-radius: var(--r-full); background: var(--accent-dim);
  color: var(--accent-hi); display: grid; place-items: center; font-size: 21px; font-weight: 800; flex: none; }
.me-list { margin-top: var(--s4); border-top: 1px solid var(--line); }
.me-row { display: flex; align-items: center; gap: var(--s3); padding: 13px 0; border-bottom: 1px solid var(--line);
  font-size: var(--fs-sm); width: 100%; text-align: left; }
.me-row .k { flex: 1; color: var(--text-2); }
.me-row .v { color: var(--text-3); font-size: var(--fs-xs); }
.me-row.danger .k { color: var(--err); }

/* ---------- 抽屉 / 弹窗 ---------- */
.sheet { position: fixed; inset: 0; z-index: 150; display: none; }
.sheet.on { display: block; }
.sheet .mask { position: absolute; inset: 0; background: rgba(4,4,3,.66); backdrop-filter: blur(3px); }
.sheet .panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto;
  background: var(--surface); border-top: 1px solid var(--line-2); border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: var(--s5); animation: slide-up var(--dur-2) var(--ease); }
.sheet .bar { width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 0 auto var(--s4); }
.viewer { position: fixed; inset: 0; z-index: 170; display: none; background: rgba(4,4,3,.94); }
.viewer.on { display: grid; place-items: center; }
.viewer img { max-width: 96vw; max-height: 84vh; object-fit: contain; touch-action: pan-y; -webkit-user-drag: none; user-select: none; cursor: grab; }
.viewer .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: var(--r-full);
  background: rgba(245,241,234,.08); color: var(--text); display: grid; place-items: center; font-size: 20px; }
.viewer .nav.l { left: 12px; } .viewer .nav.r { right: 12px; }
.viewer .close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: var(--r-full);
  background: rgba(245,241,234,.08); color: var(--text); }
.viewer .cap { position: absolute; bottom: 26px; left: 0; right: 0; text-align: center; color: var(--text-3); font-size: var(--fs-xs); }
/* 实况弹窗（v1.6.37）：复用 .viewer 黑底容器，视频居中 + 底部保存按钮 */
#liveModal video { max-width: 96vw; max-height: 76vh; border-radius: var(--r-md); background: #000; }
#liveModal .live-act { position: absolute; bottom: 24px; left: 0; right: 0; display: flex; justify-content: center; }
.album-grid .cell .live-tag { position: absolute; left: 6px; top: 6px; z-index: 1; font-size: var(--fs-2xs); padding: 1px 6px; }

/* ---------- 悬浮进度框 ---------- */
.pfloat { position: fixed; right: var(--s4); bottom: calc(var(--s4) + 62px); z-index: 140; width: 306px; max-width: calc(100vw - 32px);
  background: rgba(20,19,18,.93); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--sh3);
  backdrop-filter: blur(18px); overflow: hidden; animation: slide-up var(--dur-2) var(--ease); }
.pfloat .hd { display: flex; align-items: center; gap: var(--s2); padding: 10px var(--s4); border-bottom: 1px solid var(--line); }
.pfloat .hd .t { flex: 1; font-size: var(--fs-xs); font-weight: 700; }
.pfloat .hd .c { font-size: var(--fs-2xs); color: var(--text-4); }
.pfloat .bd { max-height: 40vh; overflow-y: auto; }
.pfloat.fold .bd, .pfloat.fold .ft { display: none; }
.ptask { padding: 9px var(--s4); border-bottom: 1px solid var(--line); }
.ptask:last-child { border-bottom: none; }
.ptask .l1 { display: flex; gap: var(--s2); font-size: var(--fs-xs); margin-bottom: 6px; align-items: center; }
.ptask .l1 .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptask .l1 .st { font-size: var(--fs-2xs); color: var(--text-4); flex: none; }
.ptask .track { height: 4px; }
.ptask .track > i { background: var(--accent); }
.ptask.fail .track > i { background: var(--err); }
.ptask.ok .track > i { background: var(--ok); }
.ptask .err { font-size: var(--fs-2xs); color: var(--err); margin-top: 5px; }
.pfloat .ft { display: flex; gap: var(--s2); padding: 9px var(--s4); border-top: 1px solid var(--line); }
.pfloat .ft .btn { min-height: 30px; font-size: var(--fs-2xs); padding: 0 10px; flex: 1; }

/* ---------- 最近解析（首页） ---------- */
.hist-list { display: grid; gap: 2px; }
.hist-item { display: flex; align-items: center; gap: var(--s3); padding: 11px var(--s3);
  border-radius: var(--r-sm); border: 1px solid transparent; }
.hist-item:hover { background: var(--surface); border-color: var(--line); }
.hist-item .pmark { width: 30px; height: 30px; flex: none; border-radius: var(--r-sm); display: grid; place-items: center;
  font-size: var(--fs-xs); font-weight: 800; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }
.hist-item .pmark[data-p="douyin"] { background: rgba(255,90,31,.16); color: #FF8A5B; border-color: rgba(255,90,31,.3); }
.hist-item .pmark[data-p="tiktok"], .hist-item .pmark[data-p="twitter"], .hist-item .pmark[data-p="instagram"], .hist-item .pmark[data-p="youtube"] { background: rgba(90,140,255,.14); color: #8FB2FF; border-color: rgba(90,140,255,.28); }
.hist-item .txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.hist-item .txt .t { font-size: var(--fs-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-item .txt .s { font-size: var(--fs-2xs); color: var(--text-4); }
.hist-item .m { font-size: var(--fs-2xs); color: var(--text-4); flex: none; font-family: var(--font-mono); }

/* ---------- 资料库（页头 / 筛选栏） ---------- */
.lib-head { align-items: flex-start; gap: var(--s4); }
.lib-h1 { font-size: var(--fs-h1); letter-spacing: -.03em; }
.lib-sub { color: var(--text-3); font-size: var(--fs-sm); margin-top: 6px; }
.lib-head-rt { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.lib-bar { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin: var(--s4) 0; }
.seg.seg-sm { margin: 0; }
.seg.seg-sm button { min-height: 30px; padding: 0 11px; flex: none; font-size: var(--fs-2xs); }
.search-box { position: relative; display: flex; align-items: center; flex: 1; min-width: 160px; }
.search-box svg { position: absolute; left: 10px; color: var(--text-4); pointer-events: none; }
.search-box .field { padding-left: 32px; }
.lib-bar .sel { flex: none; width: 132px; }
.view-toggle { display: flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); }
.view-toggle button { width: 32px; height: 28px; border-radius: var(--r-xs); display: grid; place-items: center; color: var(--text-4); }
.view-toggle button.on { background: var(--accent-dim); color: var(--accent-hi); }
.filter-tip { display: flex; align-items: center; gap: var(--s2); padding: 9px var(--s3); margin-bottom: var(--s3);
  background: var(--accent-dim); border: 1px solid var(--accent-line); border-radius: var(--r-sm);
  font-size: var(--fs-2xs); color: var(--text-2); }
.filter-tip b { color: var(--accent-hi); }
.filter-tip .btn { margin-left: auto; min-height: 26px; padding: 0 10px; }

/* 卡片上的播放按钮 + 悬浮快捷操作（桌面 hover / 触摸长按走菜单） */
.lib-item .th .play-btn { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 42px; height: 42px; border-radius: var(--r-full); display: grid; place-items: center;
  background: rgba(16,15,14,.62); color: #F5F1EA; border: 1px solid rgba(245,241,234,.24); backdrop-filter: blur(6px); }
.lib-item .th .quick { position: absolute; inset: auto 0 0 0; display: flex; gap: 2px; padding: 6px;
  background: linear-gradient(180deg, transparent, rgba(4,4,3,.82)); opacity: 0; transition: opacity var(--dur-1) var(--ease); }
.lib-item:hover .th .quick, .lib-item:focus-within .th .quick { opacity: 1; }
.lib-item .th .qbtn { flex: 1; height: 30px; border-radius: var(--r-xs); display: grid; place-items: center;
  background: rgba(245,241,234,.1); color: #F5F1EA; }
.lib-item .th .qbtn.accent { background: var(--accent); color: var(--accent-ink); }
.lib-item .th .qbtn:hover { background: rgba(245,241,234,.2); }
.name-tag { display: inline-block; margin-left: 6px; padding: 0 5px; border-radius: var(--r-xs); font-size: 10px;
  font-weight: 600; vertical-align: 1px; }
.name-tag.auto { background: var(--surface-3); color: var(--text-4); }
.name-tag.edited { background: var(--accent-dim); color: var(--accent-hi); }

/* ---------- 资料库列表视图 ---------- */
.lib-list { display: grid; gap: 6px; }
.lib-row { display: flex; align-items: center; gap: var(--s3); padding: 9px var(--s3);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.lib-row:hover { border-color: var(--line-2); }
.lib-row .th { position: relative; width: 54px; height: 54px; flex: none; border-radius: var(--r-xs);
  overflow: hidden; background: var(--bg-deep); }
.lib-row .th img { width: 100%; height: 100%; object-fit: cover; }
.lib-row .th .tp { position: absolute; left: 3px; bottom: 3px; width: 15px; height: 15px; border-radius: var(--r-full);
  border: 1px solid rgba(245,241,234,.5); background: rgba(16,15,14,.6); }
.lib-row .th .tp.video { background: rgba(255,90,31,.9); }
.lib-row .th .tp.live { background: rgba(90,140,255,.9); }
.lib-row .mid { flex: 1; min-width: 0; display: grid; gap: 2px; }
.lib-row .mid .nm { font-size: var(--fs-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-row .mut { font-size: var(--fs-2xs); color: var(--text-4); }
.lib-row .c { flex: none; width: 92px; }
.lib-row .rt { flex: none; display: flex; gap: 4px; }
.tf-icon { width: 28px; height: 28px; border-radius: var(--r-xs); display: grid; place-items: center;
  color: var(--text-3); border: 1px solid transparent; }
.tf-icon:hover { background: var(--surface-2); border-color: var(--line); color: var(--text); }

/* 快捷操作菜单（长按 / 右键） */
.quick-menu { display: grid; gap: 2px; }
.quick-menu .qm { padding: 13px var(--s3); text-align: left; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.quick-menu .qm:hover { background: var(--surface-2); }
.quick-menu .qm.danger { color: var(--err); }

/* ---------- 我的：统计 + 菜单 ---------- */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); margin-top: var(--s4); }
.stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px var(--s3); }
.stat .k { font-size: var(--fs-2xs); color: var(--text-4); }
.stat .v { font-size: var(--fs-h3); font-weight: 700; margin-top: 3px; font-family: var(--font-mono); }
.stat .v small { font-size: var(--fs-2xs); color: var(--text-4); font-weight: 500; margin-left: 2px; font-family: var(--font); }
.menu-item { border-top: 1px solid var(--line); }
.menu-item:first-child { border-top: none; }
.menu-item .v { color: var(--text-4); }
.share-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.share-row .l1 { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-sm); font-weight: 600; }
.share-row .mut { font-size: var(--fs-2xs); color: var(--text-4); margin-top: 3px; }

/* ---------- 手机态：资料库筛选栏与列表换行 ---------- */
html[data-view="mobile"] .lib-bar { gap: 6px; }
html[data-view="mobile"] .lib-bar .search-box { order: -1; flex: 1 1 100%; }
html[data-view="mobile"] .lib-bar .sel { flex: 1; width: auto; }
html[data-view="mobile"] .lib-row .c, html[data-view="mobile"] .lib-row .mid .mut + .mut { display: none; }
html[data-view="mobile"] .lib-row .c.keep { display: block; }
html[data-view="mobile"] .stat-row { grid-template-columns: repeat(2, 1fr); }
html[data-view="mobile"] .stat .v { font-size: var(--fs-h2); }
html[data-view="mobile"] .lib-head { flex-direction: column; align-items: stretch; }
html[data-view="mobile"] .lib-h1 { font-size: var(--fs-h2); }

/* ============================================================
   手机态
   ============================================================ */
html[data-view="mobile"] .wrap { max-width: 640px; padding: 0 0 76px; }
html[data-view="mobile"] .mtop { display: flex; position: sticky; top: 0; z-index: 60;
  align-items: center; gap: var(--s3); padding: 10px var(--s5);
  background: rgba(11,10,9,.86); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
html[data-view="mobile"] .mtop .nm { font-weight: 800; font-size: 15px; letter-spacing: -.02em; }
html[data-view="mobile"] .mtop .q { margin-left: auto; font-size: var(--fs-2xs); color: var(--text-4); }
html[data-view="mobile"] .page { padding: var(--s4); }
html[data-view="mobile"] .tabbar {
  display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(14,13,12,.92); backdrop-filter: blur(20px); border-top: 1px solid var(--line);
}
html[data-view="mobile"] .tabbar button { flex: 1; padding: 9px 0 11px; display: grid; gap: 3px; justify-items: center;
  color: var(--text-4); font-size: 10px; font-weight: 600; }
html[data-view="mobile"] .tabbar button.on { color: var(--accent-hi); }
html[data-view="mobile"] .lib-grid { grid-template-columns: repeat(2, 1fr); }
html[data-view="mobile"] .lib-item .th { aspect-ratio: 3 / 4; }
html[data-view="mobile"] .banner .ttl { font-size: var(--fs-h2); }
html[data-view="mobile"] .pfloat { left: var(--s4); right: var(--s4); width: auto; }

/* ============================================================
   桌面态
   ============================================================ */
html[data-view="desktop"] .wrap { max-width: 1100px; padding: 0 var(--s5) var(--s7); }
html[data-view="desktop"] .topnav { display: flex; position: sticky; top: 0; z-index: 60; align-items: center; gap: var(--s5);
  padding: 0 var(--s5); height: var(--nav-h); margin: 0 calc(-1 * var(--s5));
  background: rgba(11,10,9,.84); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
html[data-view="desktop"] .topnav .navs { display: flex; gap: var(--s2); }
html[data-view="desktop"] .topnav .navs button { padding: 8px 14px; border-radius: var(--r-full); font-size: var(--fs-sm);
  font-weight: 600; color: var(--text-3); }
html[data-view="desktop"] .topnav .navs button.on { background: var(--accent-dim); color: var(--accent-hi); }
html[data-view="desktop"] .topnav .rt { margin-left: auto; display: flex; align-items: center; gap: var(--s3); }
html[data-view="desktop"] .page { padding: var(--s6) 0 0; }
html[data-view="desktop"] .banner { aspect-ratio: 21 / 7; }
html[data-view="desktop"] .home-cols { display: grid; grid-template-columns: minmax(0, 1fr) 336px; gap: var(--s5); margin-top: var(--s5); align-items: start; }
html[data-view="desktop"] .home-cols .side { display: grid; gap: var(--s5); }
html[data-view="desktop"] .parse-box { margin-top: 0; }
html[data-view="desktop"] .res-list { grid-template-columns: 1fr; }
html[data-view="desktop"] .lib-grid { grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); }
html[data-view="desktop"] .lib-item .th { aspect-ratio: 3 / 4; }
html[data-view="desktop"] .sheet .panel { left: 50%; right: auto; width: 620px; max-width: 92vw;
  border-radius: var(--r-xl); bottom: auto; top: 50%;
  transform: translateX(-50%) translateY(-50%);
  animation: pop-center var(--dur-2) var(--ease); }
@keyframes pop-center {
  from { opacity: 0; transform: translateX(-50%) translateY(-47%) scale(.985); }
  to   { opacity: 1; transform: translateX(-50%) translateY(-50%); }
}
html[data-view="desktop"] .sheet .bar { display: none; }
/* 「我的」页整列统一宽度（v1.6.21 坑 83）：此前只有 .me-card 限宽 560px，
   配额卡/会员卡不限宽 → 同页卡片一窄一宽像错乱。改为整列统一 680px 居中 */
html[data-view="desktop"] .me-wrap { max-width: 680px; margin: 0 auto; }

/* 手机态不显示桌面浮窗偏移问题：进度框贴在 TabBar 上方 */
@media (max-width: 720px) {
  .pfloat { bottom: calc(env(safe-area-inset-bottom) + 72px); }
}
