/*! v7工作室AI版 · [R77] 锁屏密码浮窗：8 向缩放 + 可选中/可复制（mk-r77-pwdresize.css）
 * ------------------------------------------------------------------
 * 爹的报障：「锁屏密码界面无法自定义放大缩小，而且不能复制的。修复下」
 * 配套脚本：/panel/skin/mk-r77-pwdresize.js （index.html 里同版本号 ?v=r77a）
 * 设计：纯皮肤层，不动 React / 不动 bundle；删掉 index.html 那两行即回退。
 * ------------------------------------------------------------------ */

/* ==================================================================
 * 1) 缩放 —— 8 向手柄（4 边 + 4 角）+ 实时尺寸徽标
 *    老手柄 .mk-pwd-grip（mk-ui.js R93pwd：右下角 20x20 / z6）隐藏：
 *      它只能从右下角拖，且 maxW = innerWidth - left - 10 会把宽度钉死
 *      （浮窗默认贴右时 innerWidth-left-10 ≈ 322 → 往右拖只能涨 2px，
 *        贴边时 Math.max(280,…) 还会把它压小），所以爹的观感是「不能放大」。
 *    新脚本接管 8 个方向，尺寸仍写同一个 localStorage 键 mk_pwd_w / mk_pwd_h。
 * ================================================================== */
html body .ctrl-page .c2-float-panel.mk-float-pwd .mk-pwd-grip { display: none !important; }

/* ★ 关键修复：面板自身 computed `resize: both`（React/应用样式给的），
   Chrome 会在元素右下角渲染原生 ::-webkit-resizer 控件；命中测试里它会把整个
   「右下角」判给面板元素本身，导致 SE 手柄收不到 pointerdown
   （实测：给手柄加 z-index:99 也没用，只有 resize:none 才有效）。
   顺带也彻底关掉了原生 resize（它本来就被 overflow:hidden + 固定尺寸样式压制着，属于僵尸控件）。 */
html body .ctrl-page .c2-float-panel.mk-float-pwd { resize: none !important; }

html body .ctrl-page .c2-float-panel.mk-float-pwd .mk77-rs {
  position: absolute !important;
  left: 0 !important; top: 0 !important; right: 0 !important; bottom: 0 !important;
  pointer-events: none !important;
  z-index: 8 !important;
}
html body .ctrl-page .c2-float-panel.mk-float-pwd .mk77-h {
  position: absolute !important;
  pointer-events: auto !important;
  touch-action: none !important;
  -webkit-user-select: none !important; user-select: none !important;
  background: transparent !important;
  border-radius: 4px !important;
  transition: background .12s linear !important;
}
/* —— 4 条边（贴内沿，浮窗是 overflow:hidden，不能往负值外扩） —— */
html body .ctrl-page .c2-float-panel.mk-float-pwd .mk77-h.mk77-n { top: 0 !important; left: 14px !important; right: 14px !important; height: 6px !important; cursor: ns-resize !important; }
html body .ctrl-page .c2-float-panel.mk-float-pwd .mk77-h.mk77-s { bottom: 0 !important; left: 14px !important; right: 14px !important; height: 6px !important; cursor: ns-resize !important; }
html body .ctrl-page .c2-float-panel.mk-float-pwd .mk77-h.mk77-w { left: 0 !important; top: 14px !important; bottom: 14px !important; width: 6px !important; cursor: ew-resize !important; }
html body .ctrl-page .c2-float-panel.mk-float-pwd .mk77-h.mk77-e { right: 0 !important; top: 14px !important; bottom: 14px !important; width: 6px !important; cursor: ew-resize !important; }
/* —— 4 个角 —— */
html body .ctrl-page .c2-float-panel.mk-float-pwd .mk77-h.mk77-nw { left: 0 !important; top: 0 !important; width: 18px !important; height: 18px !important; cursor: nwse-resize !important; }
html body .ctrl-page .c2-float-panel.mk-float-pwd .mk77-h.mk77-ne { right: 0 !important; top: 0 !important; width: 18px !important; height: 18px !important; cursor: nesw-resize !important; }
html body .ctrl-page .c2-float-panel.mk-float-pwd .mk77-h.mk77-sw { left: 0 !important; bottom: 0 !important; width: 18px !important; height: 18px !important; cursor: nesw-resize !important; }
html body .ctrl-page .c2-float-panel.mk-float-pwd .mk77-h.mk77-se { right: 0 !important; bottom: 0 !important; width: 20px !important; height: 20px !important; cursor: nwse-resize !important; z-index: 9 !important; }

/* 右下角：可见的斜纹抓手（替代老 .mk-pwd-grip 的观感，一眼看出能拖） */
html body .ctrl-page .c2-float-panel.mk-float-pwd .mk77-h.mk77-se::after {
  content: "" !important;
  position: absolute !important;
  right: 2px !important; bottom: 2px !important;
  width: 15px !important; height: 15px !important;
  opacity: .5 !important;
  background: linear-gradient(135deg, transparent 0 38%, #94a3b8 38% 46%, transparent 46% 54%, #94a3b8 54% 62%, transparent 62% 70%, #94a3b8 70% 78%, transparent 78%) no-repeat !important;
  transition: opacity .12s linear !important;
}
html body .ctrl-page .c2-float-panel.mk-float-pwd:hover .mk77-h.mk77-se::after { opacity: .92 !important; }
html body .ctrl-page .c2-float-panel.mk-float-pwd .mk77-h.mk77-se:hover::after { opacity: 1 !important; }

/* hover 高亮：告诉爹「这条边能拖」 */
html body .ctrl-page .c2-float-panel.mk-float-pwd .mk77-h:hover { background: rgba(17, 24, 39, .13) !important; }
html body .ctrl-page .c2-float-panel.mk-float-pwd .mk77-h.mk77-se:hover { background: transparent !important; }

/* 拖拽中 / 复原时的实时尺寸徽标 */
html body .ctrl-page .c2-float-panel.mk-float-pwd .mk77-badge {
  position: absolute !important;
  right: 12px !important; bottom: 42px !important;
  z-index: 11 !important;
  pointer-events: none !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  background: rgba(17, 24, 39, .93) !important;
  color: #ffffff !important;
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Courier New", monospace !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  letter-spacing: .4px !important;
  box-shadow: 0 10px 24px -12px rgba(15, 23, 42, .85) !important;
  border: none !important;
  white-space: nowrap !important;
}
html body .ctrl-page .c2-float-panel.mk-float-pwd .mk77-badge-flash { animation: mk77BdgIn .34s ease-out 1 both !important; }
@keyframes mk77BdgIn {
  from { transform: translateY(6px) scale(.94); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* —— 尺寸生效：比 mk-ui.css:3573 那条多一个类，权重更高；
       mk-r164-pwd.css:32 的「:not(.mk-pwd-sized) 固定 375px」也被排除 —— */
html body .ctrl-page .c2-float-panel.mk-float-pwd.mk77-sized,
html body .ctrl-page .c2-float-panel.mk-float-pwd.mk-pwd-sized {
  width: var(--mk-pw, 320px) !important;
  height: var(--mk-ph, 420px) !important;
  max-height: var(--mk-ph, 420px) !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
/* 拉高/拉矮后，列表区自己滚（.c2-float-body 是 flex:1 1 0%） */
html body .ctrl-page .c2-float-panel.mk-float-pwd .c2-float-body { min-height: 0 !important; }

/* ==================================================================
 * 2) 复制 —— 面板是 http 明文（非 secure context），Chrome 里
 *    navigator.clipboard 是 undefined，所以原生「复制」按钮必报「复制失败」。
 *    脚本用 execCommand 打了兜底；这里只负责：文字可选中 + 每条一个「⧉」。
 * ================================================================== */
html body .ctrl-page .c2-float-panel.mk-float-pwd,
html body .ctrl-page .c2-float-panel.mk-float-pwd .c2-pwd-entry,
html body .ctrl-page .c2-float-panel.mk-float-pwd .c2-pwd-display,
html body .ctrl-page .c2-float-panel.mk-float-pwd .c2-pwd-meta {
  -webkit-user-select: text !important;
  user-select: text !important;
}
html body .ctrl-page .c2-float-panel.mk-float-pwd .c2-pwd-display { cursor: text !important; }
/* 选中的高亮别太淡（默认在深色底下几乎看不见） */
html body .ctrl-page .c2-float-panel.mk-float-pwd .c2-pwd-display::selection,
html body .ctrl-page .c2-float-panel.mk-float-pwd .c2-pwd-meta::selection { background: rgba(79, 70, 229, .28) !important; }

/* 每条记录右侧的「⧉」一键复制（插在删除按钮左边，样式对齐 .c2-pwd-del） */
html body .ctrl-page .c2-float-panel.mk-float-pwd .c2-pwd-entry .mk77-copy {
  width: 24px !important; height: 24px !important;
  flex: 0 0 24px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #c3c9d4 !important;
  font-size: 13px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  opacity: 0 !important;
  transition: opacity .15s, background .15s, color .15s !important;
}
html body .ctrl-page .c2-float-panel.mk-float-pwd .c2-pwd-entry:hover .mk77-copy { opacity: 1 !important; }
html body .ctrl-page .c2-float-panel.mk-float-pwd .c2-pwd-entry .mk77-copy:hover { background: #eef2ff !important; color: #4338ca !important; }
html body .ctrl-page .c2-float-panel.mk-float-pwd .c2-pwd-entry .mk77-copy:active { background: #e0e7ff !important; }

/* ==================================================================
 * 3) 深色主题（面板支持 data-theme="dark" / body[data-mkdark]）
 * ================================================================== */
html[data-theme="dark"] body .ctrl-page .c2-float-panel.mk-float-pwd .mk77-h:hover,
body[data-mkdark] .ctrl-page .c2-float-panel.mk-float-pwd .mk77-h:hover { background: rgba(226, 232, 240, .16) !important; }
html[data-theme="dark"] body .ctrl-page .c2-float-panel.mk-float-pwd .mk77-h.mk77-se:hover,
body[data-mkdark] .ctrl-page .c2-float-panel.mk-float-pwd .mk77-h.mk77-se:hover { background: transparent !important; }
html[data-theme="dark"] body .ctrl-page .c2-float-panel.mk-float-pwd .mk77-h.mk77-se::after,
body[data-mkdark] .ctrl-page .c2-float-panel.mk-float-pwd .mk77-h.mk77-se::after {
  background: linear-gradient(135deg, transparent 0 38%, #64748b 38% 46%, transparent 46% 54%, #64748b 54% 62%, transparent 62% 70%, #64748b 70% 78%, transparent 78%) no-repeat !important;
}
html[data-theme="dark"] body .ctrl-page .c2-float-panel.mk-float-pwd .mk77-badge,
body[data-mkdark] .ctrl-page .c2-float-panel.mk-float-pwd .mk77-badge { background: rgba(248, 250, 252, .95) !important; color: #0f172a !important; }
html[data-theme="dark"] body .ctrl-page .c2-float-panel.mk-float-pwd .c2-pwd-entry .mk77-copy,
body[data-mkdark] .ctrl-page .c2-float-panel.mk-float-pwd .c2-pwd-entry .mk77-copy { color: #4b5563 !important; }
html[data-theme="dark"] body .ctrl-page .c2-float-panel.mk-float-pwd .c2-pwd-entry .mk77-copy:hover,
body[data-mkdark] .ctrl-page .c2-float-panel.mk-float-pwd .c2-pwd-entry .mk77-copy:hover { background: #1f2937 !important; color: #a5b4fc !important; }

/* 打印/截图时别露出手柄（爹导出报告用） */
@media print {
  html body .ctrl-page .c2-float-panel.mk-float-pwd .mk77-rs { display: none !important; }
}