/* ============================================================
   盘 Hub · 扩展样式
   在 4K世界 原有 style.css 之上补充：
   - 验证码弹层（字母数字 / 滑块拼图）
   - 转存进度浮层
   - 资源页 PC/移动端差异块
   ============================================================ */

/* ---------- 兜底：hidden 属性必须真的隐藏 ----------
   本文件大量用 display:flex / inline-flex 做布局，而 HTML 的 `hidden` 属性
   只是 UA 样式 `[hidden]{display:none}`，**作者样式优先级更高**，会被直接盖掉：
   结果是「带 hidden 的弹层一进页面就常驻显示」（验证码弹层、转存进度浮层都中招）。
   这条 !important 规则是根治手段，别删。 */
[hidden] { display: none !important; }

/* ---------- 弹层 ---------- */
.ph-modal-mask {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.ph-modal {
  width: 100%; max-width: 360px;
  background: #fff; border-radius: 16px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .28);
  padding: 18px 18px 16px;
  animation: phPop .18s ease-out;
}
@keyframes phPop { from { transform: scale(.94); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.ph-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 16px; font-weight: 700; color: var(--text);
}
.ph-modal-close {
  width: 30px; height: 30px; border-radius: 9px; color: var(--muted);
  font-size: 15px;
}
.ph-modal-close:hover { background: #f3f4f6; color: var(--text); }
.ph-modal-tip {
  font-size: 12.5px; color: var(--muted); margin: 6px 0 14px; line-height: 1.55;
}
.ph-modal-foot {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px;
}
.ph-captcha-body { min-height: 118px; }
/* 加载中 / 加载失败：一定要把原因显示出来，不能只留一个空白弹层 */
.ph-cap-note { padding: 26px 0; text-align: center; color: #94a3b8; font-size: 13px; }
.ph-cap-note.ph-cap-err { padding: 18px 0 6px; color: #ef4444; font-weight: 600; }

/* ---------- 字母数字验证码 ---------- */
.ph-cap-row { display: flex; align-items: center; gap: 10px; }
.ph-cap-img {
  flex: 1; height: 52px; border-radius: 10px; border: 1px solid var(--line);
  object-fit: cover; background: #f8fafc;
}
.ph-cap-refresh {
  width: 40px; height: 52px; border-radius: 10px; border: 1px solid var(--line);
  font-size: 19px; color: var(--text-2); background: #fff;
}
.ph-cap-refresh:hover { color: var(--primary); border-color: var(--primary); }
.ph-cap-input {
  width: 100%; height: 46px; margin-top: 12px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 10px;
  font-size: 18px; letter-spacing: 7px; text-align: center; text-transform: uppercase;
}
.ph-cap-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ph-cap-hint { font-size: 12px; color: var(--muted); margin-top: 8px; }

/* ---------- 滑块拼图 ---------- */
.ph-slider {
  position: relative; width: 100%; max-width: 320px; margin: 0 auto;
  border-radius: 12px; overflow: hidden; line-height: 0;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .12);
  user-select: none; touch-action: none;
}
.ph-slider-bg { width: 100%; display: block; }
.ph-slider-piece {
  position: absolute; width: 50px; height: 50px; left: 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45));
  cursor: grab;
}
.ph-slider-track {
  position: relative; height: 44px; margin-top: 12px;
  background: #f1f5f9; border-radius: 999px; border: 1px solid var(--line);
}
.ph-slider-thumb {
  position: absolute; top: 3px; left: 0; width: 60px; height: 36px;
  background: var(--grad-accent); color: #fff; border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; letter-spacing: 1px; cursor: grab;
  box-shadow: 0 3px 10px rgba(37, 99, 235, .35);
}
.ph-slider-thumb:active { cursor: grabbing; }

/* ---------- 转存进度浮层 ---------- */
.ph-busy-box {
  position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%);
  z-index: 990; display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px; border-radius: 999px;
  background: rgba(17, 24, 39, .92); color: #fff; font-size: 13px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .3);
  max-width: 88vw;
}
.ph-spin {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: phSpin .7s linear infinite;
}
@keyframes phSpin { to { transform: rotate(360deg) } }

/* ---------- 进度条状态 ----------
   检索途中用「不确定进度」的流光动画，宽度停在中间（绝不满格）。
   注意 transition:none —— style.css 给 .progress-bar i 设了 width 1.2s 过渡，
   从满格退回中间时会先卡在 100% 一秒多，正是「明明还在搜却显示 100%」的观感来源。 */
.progress-bar i.ph-bar-indet {
  transition: none;
  background-image: linear-gradient(90deg,
    #34d399 0%, #10b981 20%, #a7f3d0 40%, #10b981 60%, #34d399 100%);
  background-size: 220% 100%;
  animation: phIndet 1.1s linear infinite;
}
@keyframes phIndet {
  from { background-position: 0 0; }
  to { background-position: -220% 0; }
}
.progress-bar i.ph-bar-err {
  transition: none;
  background: linear-gradient(90deg, #f87171, #dc2626);
}
.ph-retry-wrap { margin-top: 10px; }
.ph-bar-run { animation: phBar 1.4s ease-in-out infinite; }
@keyframes phBar {
  0% { opacity: .55 } 50% { opacity: 1 } 100% { opacity: .55 }
}

/* ---------- 资源页 ---------- */
.ph-verified {
  margin-left: auto; font-size: 11px; font-weight: 600;
  color: #047857; background: var(--green-soft);
  padding: 3px 9px; border-radius: 999px;
}
.ph-passcode {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 4px 0 14px; font-size: 14px; color: var(--text-2);
}
.ph-passcode b { color: var(--primary); letter-spacing: 2px; font-size: 16px; }
.ph-mobile-guide { display: flex; flex-direction: column; gap: 10px; }
.ph-mobile-tip {
  font-size: 13px; color: #047857; background: var(--green-soft);
  border-radius: 10px; padding: 9px 12px; margin-bottom: 2px;
}
.ph-qr-fallback { padding: 10px 0; }
.ph-expire {
  margin-top: 14px; font-size: 12.5px; color: var(--gold);
  background: #fffbeb; border-radius: 10px; padding: 8px 12px; text-align: center;
}
.ph-back { margin-top: 14px; text-align: center; font-size: 13px; color: var(--muted); }
.ph-back a { color: var(--accent); font-weight: 600; }

/* ---------- 详情页 ---------- */
.ph-pan-row {
  width: 100%; text-align: left; display: flex; align-items: center;
  gap: 12px; padding: 14px 16px; background: #fff; border: none;
  border-radius: var(--radius-sm); cursor: pointer;
}
.ph-pan-row:hover { background: var(--accent-soft); }

/* 网盘资源列表（需求 5：信息与「获取资源」分开，不要挤在一起） */
.pan-box .pan-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 13px 14px; margin-bottom: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  text-align: left; text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.pan-box .pan-row:last-child { margin-bottom: 0; }
.pan-box .pan-row:hover {
  border-color: var(--accent); box-shadow: 0 6px 18px rgba(37, 99, 235, .1);
}
.pan-box .pan-row .pan-logo { flex: none; }
.pan-row-info { flex: 1; min-width: 0; }
.pan-row-info .pan-name {
  font-size: 14.5px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pan-row-info .pan-desc { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.pan-box .pan-row .pan-go {
  flex: none; margin-left: auto;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 700; color: var(--accent);
}
/* 需求 5：网盘行里「获取资源」用橙色高亮（含箭头，svg 走 currentColor） */
.pan-box .pan-row .pan-go.pan-ok { color: #f97316; }
.pan-count-tag {
  font-size: 11.5px; font-weight: 600; color: #1d4ed8;
  background: var(--accent-soft); padding: 2px 8px; border-radius: 999px;
}
.pan-row-link { cursor: pointer; }

.ph-body { font-size: 14px; line-height: 1.9; color: var(--text-2); word-break: break-word; }

/* ---------- 顶部 Logo 可换成图片（需求 2）---------- */
.logo.logo-img { display: inline-flex; align-items: center; }
.logo.logo-img img { height: 32px; width: auto; display: block; }
.drawer-head .logo.logo-img img { height: 30px; }

/* ---------- 页脚可自定义（需求 1）---------- */
.footer-custom { font-size: 12.5px; line-height: 1.8; }
.footer-custom a { color: var(--accent); }
.footer-custom .footer-links { display: flex; gap: 14px; justify-content: center; margin-top: 6px; }

/* ---------- PC 二维码：禁止拖动（需求 9）---------- */
/* style.css 把 .qr-img-wrap 写死 216x216，而模板把「扫码提示」也放在这个框里，
   固定高度会把提示挤出框外、叠在下面的 .qr-note 上（线上踩过）。
   这里放开高度、给 img 定尺寸。 */
.qr-img-wrap {
  width: auto; height: auto; min-width: 216px;
}
.qr-img-wrap img.qr-nodrag {
  display: block; width: 196px; height: 196px; margin: 0 auto;
  -webkit-user-drag: none;
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  pointer-events: none;   /* 彻底防拖/防复制到解码站 */
}
.qr-scan-tip {
  margin-top: 12px; font-size: 13px; color: var(--text-2);
  font-weight: 600; text-align: center;
}

/* ---------- 结果项补充 ---------- */
.src-tag.local { background: var(--green-soft); color: #047857; }
.result-link-btn .btn:disabled { opacity: .7; cursor: wait; }
.rank-item { cursor: pointer; }
a.rank-item:hover .rank-name { color: var(--primary); }

/* ---------- 后台 ---------- */
.adm-tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
}
.adm-tag.ok { background: var(--green-soft); color: #047857; }
.adm-tag.warn { background: #fffbeb; color: #b45309; }
.adm-tag.err { background: #fef2f2; color: #b91c1c; }
.adm-tag.gray { background: #f1f5f9; color: #475569; }
.adm-tag.blue { background: var(--accent-soft); color: #1d4ed8; }
