/* ============================================================
   /tools/sherlock 用户名跨平台查找
   ★ 变量必须挂在 :root：toast / 弹窗 / 抽屉是 .sh 的兄弟节点，
     挂在 .sh 上会解析不到（本仓库已多次踩坑）。
   ★ 站点 body{overflow-y:scroll} 会让页内 sticky 全部失效，
     本页必须 body.page-sherlock-full{overflow:visible}。
   ============================================================ */
:root {
  color-scheme: dark;
  --sh-bg: var(--bg-primary, #0f1419);
  --sh-card: var(--bg-secondary, #161b21);
  --sh-card-2: #1b2128;
  --sh-line: var(--border-color, #2f3336);
  --sh-line-2: rgba(127, 127, 127, .28);
  --sh-fg: var(--text-primary, #e7e9ea);
  --sh-sub: #9aa7b4;          /* 对卡片底 ≈ 6.5:1，AA 通过 */
  --sh-faint: #8b98a5;        /* 旧值 #6b7683 只有 ≈3.5:1，次要文字不达标 */
  --sh-accent: var(--accent, #1d9bf0);
  --sh-accent-fill: #0f7ac4;  /* 白字填充专用：#1d9bf0 上白字仅 3.3:1，不达 AA */
  --sh-accent-soft: rgba(29, 155, 240, .10);
  --sh-ok: #3fb950;
  --sh-ok-soft: rgba(63, 185, 80, .13);
  --sh-warn: #e3a008;
  --sh-warn-soft: rgba(227, 160, 8, .13);
  --sh-err: #f4212e;
  --sh-err-soft: rgba(244, 33, 46, .13);
  --sh-link: #8ab4f8;
  --sh-zebra: rgba(127, 127, 127, .055);
  --sh-shadow: 0 4px 20px rgba(0, 0, 0, .22);
  --sh-shadow-sm: 0 2px 8px rgba(0, 0, 0, .16);
  --sh-r-lg: 16px;
  --sh-r-md: 12px;
  --sh-r-sm: 8px;
  --sh-maxw: 1720px;
}
[data-theme="light"] {
  color-scheme: light;
  --sh-bg: #ffffff;
  --sh-card: #f7f9f9;
  --sh-card-2: #eef2f4;
  --sh-line: #d8dee4;
  --sh-line-2: rgba(15, 20, 25, .16);
  --sh-fg: #0f1419;
  --sh-sub: #4a5865;
  --sh-faint: #5c6672;
  --sh-accent-fill: #1263a8;
  --sh-accent-soft: rgba(18, 99, 168, .07);
  --sh-ok: #1a7f37;
  --sh-ok-soft: rgba(26, 127, 55, .10);
  --sh-warn: #9a6700;
  --sh-warn-soft: rgba(154, 103, 0, .10);
  --sh-err: #c81e2b;
  --sh-err-soft: rgba(200, 30, 43, .08);
  --sh-link: #1a56b8;
  --sh-zebra: rgba(15, 20, 25, .038);
  --sh-shadow: 0 4px 20px rgba(15, 20, 25, .09);
  --sh-shadow-sm: 0 2px 8px rgba(15, 20, 25, .07);
}
body.page-sherlock-full { overflow: visible; }
body.page-sherlock-full .app,
body.page-sherlock-full .main-content,
body.page-sherlock-full .page-container { max-width: 100%; }
body.page-sherlock-full .main-content { width: 100%; border-right: 0; }

.sh { max-width: var(--sh-maxw); margin: 0 auto; padding: 22px 26px 72px; color: var(--sh-fg); box-sizing: border-box; }
.sh *, .sh *::before, .sh *::after { box-sizing: border-box; }
.sh [hidden], .sh-mask[hidden], .sh-toast[hidden] { display: none !important; }
.sh button, .sh input, .sh select, .sh textarea { font-family: inherit; }
.sh button { cursor: pointer; }
.sh a { color: var(--sh-accent); }
.sh :focus-visible { outline: 2px solid var(--sh-accent); outline-offset: 2px; }

/* ---------- hero ---------- */
.sh-hero { position: relative; padding: 20px 22px 18px; border: 1px solid var(--sh-line); border-radius: var(--sh-r-lg); background: linear-gradient(135deg, color-mix(in srgb, var(--sh-accent) 10%, var(--sh-card)), var(--sh-card)); box-shadow: var(--sh-shadow-sm); margin-bottom: 16px; }
.sh-hero-top { display: flex; align-items: flex-start; gap: 14px; }
.sh-hero-ic { flex: 0 0 auto; width: 50px; height: 50px; display: grid; place-items: center; border-radius: 14px; font-size: 26px; background: var(--sh-card-2); border: 1px solid var(--sh-line-2); }
.sh-hero-t { flex: 1 1 auto; min-width: 0; }
.sh-hero h1 { margin: 1px 0 6px; font-size: 24px; font-weight: 700; letter-spacing: .2px; }
.sh-hero-sub { margin: 0; color: var(--sh-sub); font-size: 13.5px; line-height: 1.65; max-width: 78ch; }
.sh-hero-extra { margin-top: 14px; }
.sh-hero.is-collapsed .sh-hero-extra { display: none; }
.sh-hero-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.sh-tag { font-size: 11.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--sh-line-2); background: var(--sh-card-2); color: var(--sh-sub); white-space: nowrap; }
.sh-stat { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--sh-line); border-radius: var(--sh-r-md); overflow: hidden; background: var(--sh-card); }
.sh-stat-i { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sh-stat-i + .sh-stat-i { border-left: 1px solid var(--sh-line); }
.sh-stat-i b { font-size: 19px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.sh-stat-i:nth-child(5) b { color: var(--sh-link); }
.sh-stat-i:nth-child(6) b { color: var(--sh-ok); }
.sh-stat-i em { font-style: normal; font-size: 11.5px; color: var(--sh-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-notice { display: flex; gap: 9px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border-radius: var(--sh-r-sm); border: 1px dashed var(--sh-line-2); background: var(--sh-warn-soft); }
.sh-notice-ic { font-size: 14px; line-height: 1.5; }
.sh-notice p { margin: 0; font-size: 12px; line-height: 1.65; color: var(--sh-sub); }

/* ---------- 卡片通用 ---------- */
.sh-card { border: 1px solid var(--sh-line); border-radius: var(--sh-r-lg); background: var(--sh-card); box-shadow: var(--sh-shadow-sm); margin-bottom: 16px; overflow: hidden; }
.sh-card-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--sh-line); min-height: 52px; }
.sh-card-head h2 { margin: 0; font-size: 15px; font-weight: 700; flex: 0 0 auto; }
.sh-head-acts { margin-left: auto; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.sh-head-note { font-size: 12px; color: var(--sh-sub); }
.sh-card-body { padding: 16px; }
.sh-card.is-collapsed .sh-card-body { display: none; }
.sh-fold { flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: var(--sh-r-sm); background: transparent; color: var(--sh-sub); padding: 0; }
.sh-fold:hover { background: var(--sh-card-2); color: var(--sh-fg); }
.sh-fold svg { width: 15px; height: 15px; transition: transform .16s ease; }
.sh-fold[aria-expanded="false"] svg { transform: rotate(-90deg); }
.sh-mini { border: 1px solid var(--sh-line-2); background: var(--sh-card-2); color: var(--sh-fg); border-radius: var(--sh-r-sm); padding: 6px 10px; font-size: 12px; min-height: 32px; white-space: nowrap; }
.sh-mini:hover { border-color: var(--sh-accent); }
.sh-badge { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 999px; background: var(--sh-accent); color: #fff; font-size: 10px; line-height: 16px; }
.sh-btn { border-radius: var(--sh-r-sm); min-height: 38px; padding: 8px 14px; font-size: 13px; font-weight: 600; border: 1px solid var(--sh-line-2); white-space: nowrap; }
.sh-btn-pri { background: var(--sh-accent); border-color: var(--sh-accent); color: #fff; }
.sh-btn-ghost { background: var(--sh-card-2); color: var(--sh-fg); }
.sh-btn-danger { background: var(--sh-err-soft); color: var(--sh-err); border-color: var(--sh-err); }
.sh-btn:disabled { opacity: .55; cursor: not-allowed; }
.sh-btn-ghost:hover { border-color: var(--sh-accent); }
.sh-sel, .sh-in, .sh-user-in { border: 1px solid var(--sh-line-2); background: var(--sh-bg); color: var(--sh-fg); border-radius: var(--sh-r-sm); padding: 7px 10px; font-size: 13px; min-height: 36px; }
.sh-sel-sm { min-height: 32px; padding: 5px 8px; font-size: 12px; }
.sh-in { width: 100%; }
.sh-in:focus, .sh-user-in:focus, .sh-sel:focus { border-color: var(--sh-accent); outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--sh-accent) 18%, transparent); }
.sh-sel { max-width: 100%; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.sh-lbl { display: block; font-size: 12.5px; color: var(--sh-sub); margin: 0 0 7px; }
.sh-seg { display: inline-flex; border: 1px solid var(--sh-line-2); border-radius: var(--sh-r-sm); overflow: hidden; background: var(--sh-bg); }
.sh-seg button { border: 0; background: transparent; color: var(--sh-sub); padding: 6px 11px; font-size: 12px; min-height: 32px; }
.sh-seg button + button { border-left: 1px solid var(--sh-line-2); }
.sh-seg button.is-on { background: var(--sh-accent); color: #fff; }

/* ---------- 输入工作台 ---------- */
.sh-user-row { display: flex; gap: 12px; align-items: stretch; }
.sh-user-in { flex: 1 1 auto; min-width: 0; resize: vertical; line-height: 1.6; font-size: 14px; }
.sh-user-btns { flex: 0 0 auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-content: start; }
.sh-user-btns .sh-btn { min-width: 116px; }
.sh-user-hint { min-height: 18px; margin-top: 6px; font-size: 12px; color: var(--sh-sub); }
.sh-user-hint.is-err { color: var(--sh-err); }
.sh-quick { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.sh-quick-l { font-size: 12px; color: var(--sh-faint); margin-right: 2px; }
.sh-chip { border: 1px solid var(--sh-line-2); background: var(--sh-card-2); color: var(--sh-sub); border-radius: 999px; padding: 5px 11px; font-size: 12px; min-height: 30px; }
.sh-chip:hover { border-color: var(--sh-accent); color: var(--sh-fg); }
.sh-chip-quiet { border-style: dashed; }
.sh-opts { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: center; padding: 12px 0 6px; border-top: 1px dashed var(--sh-line-2); }
.sh-opt { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--sh-sub); }
.sh-opt .sh-sel { min-width: 132px; }
.sh-opt-chk { cursor: pointer; }
.sh-opt-chk input { width: 16px; height: 16px; accent-color: var(--sh-accent); }
.sh-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.sh-cats .sh-chip.is-on { background: var(--sh-accent); border-color: var(--sh-accent); color: #fff; }

/* ---------- 进度 / 错误 ---------- */
.sh-progress { border: 1px solid var(--sh-accent); border-radius: var(--sh-r-md); background: var(--sh-card); padding: 12px 14px; margin-bottom: 16px; }
.sh-prog-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.sh-prog-head b { color: var(--sh-fg); }
.sh-prog-head span { color: var(--sh-sub); font-variant-numeric: tabular-nums; }
.sh-prog-bar { height: 8px; border-radius: 999px; background: var(--sh-card-2); overflow: hidden; margin: 10px 0 8px; }
.sh-prog-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--sh-accent), var(--sh-ok)); transition: width .2s ease; }
.sh-prog-foot { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--sh-faint); }
.sh-err { display: flex; align-items: center; gap: 10px; border: 1px solid var(--sh-err); background: var(--sh-err-soft); color: var(--sh-err); border-radius: var(--sh-r-sm); padding: 9px 12px; font-size: 12.5px; margin-bottom: 14px; }
.sh-err button { margin-left: auto; border: 0; background: transparent; color: inherit; font-size: 13px; }
/* ---------- 结果统计 / 过滤 ---------- */
.sh-rstat { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; border: 1px solid var(--sh-line); border-radius: var(--sh-r-md); overflow: hidden; margin-bottom: 14px; }
.sh-rstat-i { padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sh-rstat-i + .sh-rstat-i { border-left: 1px solid var(--sh-line); }
.sh-rstat-i b { font-size: 18px; font-variant-numeric: tabular-nums; }
.sh-rstat-i em { font-style: normal; font-size: 11.5px; color: var(--sh-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-rstat-i.is-found b { color: var(--sh-ok); }
.sh-rstat-i.is-none b { color: var(--sh-sub); }
.sh-rstat-i.is-unknown b { color: var(--sh-warn); }
.sh-rstat-i.is-link b { color: var(--sh-link); }
.sh-rstat-i.is-skip b { color: var(--sh-faint); }
.sh-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.sh-filters .sh-in { flex: 1 1 190px; min-width: 120px; max-width: 300px; }
.sh-status { max-width: 100%; overflow-x: auto; }

/* ---------- 结果卡片 ---------- */
.sh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 10px; }
.sh-rcard { position: relative; border: 1px solid var(--sh-line); border-radius: var(--sh-r-md); background: var(--sh-bg); padding: 11px 12px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sh-rcard.is-claimed { border-color: color-mix(in srgb, var(--sh-ok) 55%, var(--sh-line)); background: var(--sh-ok-soft); }
.sh-rcard.is-unknown { border-color: color-mix(in srgb, var(--sh-warn) 45%, var(--sh-line)); }
.sh-rcard.is-skipped { opacity: .72; }
.sh-rcard-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sh-ico { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; overflow: hidden; position: relative; }
.sh-ico img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sh-rcard-name { flex: 1 1 auto; min-width: 0; font-size: 13px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-fav-btn { flex: 0 0 auto; width: 26px; height: 26px; border: 0; background: transparent; color: var(--sh-faint); font-size: 14px; padding: 0; }
.sh-fav-btn.is-on { color: var(--sh-warn); }
.sh-rcard-meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.sh-pill { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--sh-line-2); color: var(--sh-sub); white-space: nowrap; }
.sh-pill.is-ok { background: var(--sh-ok-soft); color: var(--sh-ok); border-color: transparent; }
.sh-pill.is-warn { background: var(--sh-warn-soft); color: var(--sh-warn); border-color: transparent; }
.sh-pill.is-err { background: var(--sh-err-soft); color: var(--sh-err); border-color: transparent; }
.sh-rcard-user { font-size: 12px; color: var(--sh-sub); overflow-wrap: anywhere; }
.sh-rcard-user b { color: var(--sh-fg); font-weight: 600; }
.sh-rcard-url { font-size: 11px; color: var(--sh-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sh-rcard-acts { display: flex; gap: 6px; margin-top: auto; }
.sh-rcard-acts button, .sh-rcard-acts a { flex: 1 1 0; text-align: center; border: 1px solid var(--sh-line-2); background: var(--sh-card-2); color: var(--sh-fg); border-radius: 6px; font-size: 11.5px; padding: 5px 4px; min-height: 30px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-rcard-acts a.is-pri { background: var(--sh-accent); border-color: var(--sh-accent); color: #fff; }
.sh-rcard-acts button:hover, .sh-rcard-acts a:hover { border-color: var(--sh-accent); }
.sh-empty { padding: 34px 16px; text-align: center; color: var(--sh-sub); font-size: 13px; border: 1px dashed var(--sh-line-2); border-radius: var(--sh-r-md); }

/* ---------- 结果表格 ---------- */
.sh-table-wrap { overflow: auto; max-height: min(62vh, 620px); border: 1px solid var(--sh-line); border-radius: var(--sh-r-md); scrollbar-width: thin; overscroll-behavior: contain; }
.sh-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.sh-table th, .sh-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--sh-line); border-right: 1px solid var(--sh-line); white-space: nowrap; }
.sh-table th { position: sticky; top: 0; z-index: 2; background: var(--sh-card); font-size: 11.5px; color: var(--sh-sub); font-weight: 650; }
.sh-table tbody tr:nth-child(even) { background: var(--sh-zebra); }
.sh-table tbody tr:hover { background: color-mix(in srgb, var(--sh-accent) 7%, transparent); }
.sh-table td:last-child, .sh-table th:last-child { border-right: 0; }
.sh-table a { text-decoration: none; }
.sh-table .sh-cell-link { overflow-wrap: anywhere; white-space: normal; max-width: 260px; }

.sh-pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 14px; font-size: 12.5px; color: var(--sh-sub); }
.sh-pg { border: 1px solid var(--sh-line-2); background: var(--sh-card-2); color: var(--sh-fg); border-radius: var(--sh-r-sm); min-height: 32px; padding: 5px 12px; font-size: 12px; }
.sh-pg:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 站点库 ---------- */
.sh-lib-bar { padding-bottom: 12px; border-bottom: 1px dashed var(--sh-line-2); }
.sh-lib-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 8px; margin-top: 12px; }
.sh-li { display: flex; align-items: center; gap: 8px; border: 1px solid var(--sh-line); border-radius: var(--sh-r-sm); background: var(--sh-bg); padding: 7px 9px; min-width: 0; }
.sh-li.is-off { opacity: .55; }
.sh-li.is-sel { border-color: var(--sh-accent); }
.sh-li input[type="checkbox"] { flex: 0 0 auto; width: 16px; height: 16px; accent-color: var(--sh-accent); }
.sh-li-name { flex: 1 1 auto; min-width: 0; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-li-acts { flex: 0 0 auto; display: flex; gap: 3px; }
.sh-li-acts button { width: 24px; height: 24px; border: 0; background: transparent; color: var(--sh-faint); font-size: 12px; padding: 0; border-radius: 5px; }
.sh-li-acts button:hover { background: var(--sh-card-2); color: var(--sh-fg); }
.sh-li-acts button.is-on { color: var(--sh-warn); }
.sh-lib-more { text-align: center; margin-top: 12px; }

/* ---------- 帮助 ---------- */
.sh-help-card { padding: 0; }
.sh-help { padding: 0; }
.sh-help-t { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 16px; font-size: 14px; font-weight: 700; cursor: pointer; list-style: none; min-height: 48px; }
.sh-help-t::-webkit-details-marker { display: none; }
.sh-help-t::marker { content: ''; }
.sh-help-caret { width: 15px; height: 15px; color: var(--sh-sub); transition: transform .16s ease; }
.sh-help[open] .sh-help-caret { transform: rotate(180deg); }
.sh-help-body { padding: 0 16px 16px; border-top: 1px solid var(--sh-line); }
.sh-help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-top: 14px; }
.sh-help-box { border: 1px solid var(--sh-line); border-radius: var(--sh-r-md); background: var(--sh-bg); padding: 12px 14px; }
.sh-help-box h3 { margin: 0 0 7px; font-size: 13px; }
.sh-help-box p { margin: 0; font-size: 12px; line-height: 1.75; color: var(--sh-sub); }
.sh-help-warn { border-style: dashed; border-color: var(--sh-warn); background: var(--sh-warn-soft); }
.sh-help-foot { margin: 12px 0 0; font-size: 11.5px; color: var(--sh-faint); line-height: 1.6; }

/* ---------- 抽屉 / 弹窗 / toast ---------- */
.sh-mask { position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, .55); }
.sh-drawer { position: absolute; right: 0; top: 0; bottom: 0; width: min(420px, 92vw); display: flex; flex-direction: column; background: var(--sh-card); border-left: 1px solid var(--sh-line); box-shadow: var(--sh-shadow); }
.sh-drawer-head, .sh-modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--sh-line); }
.sh-drawer-head h2, .sh-modal-head h2 { margin: 0; font-size: 15px; }
.sh-x { margin-left: auto; border: 0; background: transparent; color: var(--sh-sub); font-size: 15px; width: 30px; height: 30px; border-radius: 6px; }
.sh-x:hover { background: var(--sh-card-2); color: var(--sh-fg); }
.sh-drawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px 16px; scrollbar-width: thin; }
.sh-drawer-foot, .sh-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--sh-line); }
.sh-hitem { border: 1px solid var(--sh-line); border-radius: var(--sh-r-sm); background: var(--sh-bg); padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.sh-hitem:hover { border-color: var(--sh-accent); }
.sh-hitem-t { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.sh-hitem-t b { overflow-wrap: anywhere; }
.sh-hitem-m { margin-top: 4px; font-size: 11.5px; color: var(--sh-faint); }
.sh-modal { width: min(470px, 100%); max-height: min(88vh, 700px); display: flex; flex-direction: column; background: var(--sh-card); border: 1px solid var(--sh-line); border-radius: var(--sh-r-lg); box-shadow: var(--sh-shadow); }
.sh-modal-body { padding: 14px 16px; overflow-y: auto; }
.sh-modal-body .sh-lbl { margin-top: 12px; }
.sh-modal-body .sh-lbl:first-child { margin-top: 0; }
.sh-modal-tip { margin: 12px 0 0; font-size: 11.5px; color: var(--sh-warn); line-height: 1.6; }
.sh-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 100010; max-width: min(90vw, 520px); padding: 10px 16px; border-radius: 999px; background: var(--sh-card-2); color: var(--sh-fg); border: 1px solid var(--sh-line-2); box-shadow: var(--sh-shadow); font-size: 12.5px; text-align: center; }
.sh-toast.is-err { border-color: var(--sh-err); color: var(--sh-err); }
body.sh-modal-open { overflow: hidden; }

/* ============================================================
   v2 视觉与交互增强：对比度 / 状态区分 / 吸顶 / 骨架 / 触控
   ============================================================ */
/* 填充型强调色统一用 --sh-accent-fill（白字达 AA），文字与边框仍用 --sh-accent */
.sh-btn-pri, .sh-seg button.is-on, .sh-cats .sh-chip.is-on,
.sh-rcard-acts a.is-pri, .sh-badge {
  background: var(--sh-accent-fill); border-color: var(--sh-accent-fill);
}
.sh-btn-pri:hover { filter: brightness(1.08); }
.sh-cats .sh-chip.is-on { border-color: var(--sh-accent-fill); }

/* 旧版 skipped 用 opacity:.72 把正文对比度一起拉低；unknown 只有边框色 */
.sh-rcard { contain: layout style; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.sh-rcard.is-unknown { background: var(--sh-warn-soft); }
.sh-rcard.is-skipped { opacity: 1; background: var(--sh-card-2); }
.sh-rcard:hover { border-color: var(--sh-accent); box-shadow: var(--sh-shadow-sm); transform: translateY(-1px); }
.sh-li { contain: layout style; }
.sh-ico { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); font-size: 13.5px; }
.sh-link-off { color: var(--sh-faint); font-size: 11.5px; padding: 0 4px; white-space: nowrap; }

.sh-pill { font-size: 11.5px; line-height: 1.5; }
.sh-rcard-name { font-size: 13.5px; }
.sh-rcard-url { font-size: 11.5px; }
.sh-stat-i:nth-child(1) b { color: var(--sh-accent); }
.sh-stat-i:nth-child(2) b { color: var(--sh-link); }
.sh-stat-i:nth-child(3) b { color: var(--sh-warn); }
.sh-loading { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 16px;
  border: 1px dashed var(--sh-line-2); border-radius: var(--sh-r-md); color: var(--sh-sub);
  font-size: 12.5px; background: var(--sh-card); }
.sh-spinner { width: 16px; height: 16px; flex: 0 0 auto; border: 2px solid var(--sh-line-2);
  border-top-color: var(--sh-accent); border-radius: 50%; animation: sh-spin .8s linear infinite; }
@keyframes sh-spin { to { transform: rotate(360deg); } }
.sh-err { flex-wrap: wrap; }
.sh-err button { margin-left: 0; }
.sh-err #shDataErrClose { margin-left: auto; }
.sh-err .sh-mini { padding: 4px 10px; min-height: 30px; border-color: var(--sh-err);
  background: transparent; color: var(--sh-err); }
.sh-notice { border-style: solid; border-left: 3px solid var(--sh-warn); }
.sh-status { scrollbar-width: thin; mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 20px), transparent 100%); }

/* 结果卡头部吸顶：滚动 48+ 条结果时视图/导出/筛选始终可达。
   overflow:clip 不创建滚动容器，sticky 才会相对页面生效（overflow:hidden 会让它失效）；
   不支持 clip 的老浏览器自动降级为「不吸顶」，不破坏任何布局。 */
.sh-card { overflow: hidden; overflow: clip; }
.sh-result-card .sh-card-head { position: sticky; top: 0; z-index: 5;
  background: var(--sh-card); box-shadow: 0 1px 0 var(--sh-line); }

/* ---------- 响应式（断点按 1600→1400→1100→900→767→420 降序，后者覆盖前者） ---------- */
@media (min-width: 1600px) {
  .sh { padding-left: 36px; padding-right: 36px; }
  .sh-grid { grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); }
  .sh-help-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1400px) {
  .sh { padding: 20px 20px 64px; }
  .sh-grid { grid-template-columns: repeat(auto-fill, minmax(218px, 1fr)); }
  .sh-help-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .sh-stat { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sh-stat-i:nth-child(4) { border-left: 0; }
  .sh-stat-i:nth-child(n+4) { border-top: 1px solid var(--sh-line); }
  .sh-rstat { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sh-rstat-i:nth-child(4) { border-left: 0; }
  .sh-rstat-i:nth-child(n+4) { border-top: 1px solid var(--sh-line); }
  .sh-user-row { flex-direction: column; }
  .sh-user-btns { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .sh-user-btns .sh-btn { min-width: 0; }
  .sh-lib-list { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}
@media (max-width: 900px) {
  .sh { padding: 16px 14px 60px; }
  .sh-help-grid { grid-template-columns: minmax(0, 1fr); }
  .sh-hero { padding: 16px 14px; }
  .sh-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .sh-user-btns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sh-card-body { padding: 13px; }
  .sh-filters .sh-in { max-width: none; flex-basis: 100%; }
  /* iPad / 窄窗也用 16px，避免 iOS 聚焦时自动放大页面；触控目标统一 40px */
  .sh-user-in, .sh-in, .sh-sel, .sh-sel-sm, .sh-modal-body .sh-in { font-size: 16px; min-height: 42px; }
  .sh-btn, .sh-mini, .sh-chip, .sh-pg, .sh-seg button, .sh-x, .sh-fold { min-height: 40px; }
}
@media (max-width: 767px) {
  .sh { padding: 12px 10px 72px; }
  .sh-hero-ic { display: none; }
  .sh-hero h1 { font-size: 20px; }
  .sh-hero-sub { font-size: 12.5px; }
  .sh-stat { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sh-stat-i:nth-child(odd) { border-left: 0; }
  .sh-stat-i:nth-child(n+3) { border-top: 1px solid var(--sh-line); }
  .sh-rstat { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sh-rstat-i:nth-child(odd) { border-left: 0; }
  .sh-rstat-i:nth-child(n+3) { border-top: 1px solid var(--sh-line); }
  .sh-card-head { flex-wrap: wrap; padding: 10px 12px; }
  .sh-head-acts { width: 100%; margin-left: 0; }
  /* ★ 手机上 155px 的双列卡片会把平台名/URL 截断、三个按钮挤成两行且卡片高度不齐。
     改为单列：信息完整、按钮一行、高度一致；配合每页 24 条，滚动长度反而更短。 */
  .sh-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .sh-result-card .sh-card-head { position: static; }
  .sh-rcard { padding: 11px; }
  .sh-rcard-name { font-size: 13.5px; }
  .sh-lib-list { grid-template-columns: minmax(0, 1fr); }
  /* 手机端在 ≤900 的 40px 基础上再加到 44px */
  .sh-btn { min-height: 44px; }
  .sh-fold { width: 40px; }
  .sh-rcard-acts button, .sh-rcard-acts a { min-height: 40px; }
  .sh-status { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .sh-status::-webkit-scrollbar { display: none; }
  .sh-status button { flex: 0 0 auto; }
  .sh-mask { padding: 0; align-items: flex-end; }
  .sh-drawer { width: 100%; max-height: 88vh; top: auto; border-left: 0; border-top: 1px solid var(--sh-line); border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .sh-modal { width: 100%; max-width: none; max-height: 92vh; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .sh-table-wrap { max-height: 56vh; }
  .sh-toast { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
  .sh-notice { padding: 9px 10px; }
}
@media (max-width: 420px) {
  .sh-hero-tags { gap: 5px; }
  .sh-tag { font-size: 11px; padding: 3px 8px; }
  .sh-stat-i b { font-size: 16px; }
  .sh-user-btns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sh-grid { grid-template-columns: minmax(0, 1fr); }
  .sh-rcard-acts { flex-wrap: nowrap; }
  .sh-rcard-acts button, .sh-rcard-acts a { flex: 1 1 0; }
  .sh-rcard-acts .sh-link-off { flex: 0 0 auto; }
  .sh-filters > .sh-sel { flex: 1 1 calc(50% - 4px); }
  .sh-opts { gap: 10px; }
  .sh-opt { width: 100%; }
  .sh-opt .sh-sel { flex: 1 1 auto; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .sh-hero { margin-bottom: 10px; }
  .sh-table-wrap { max-height: 52vh; }
}
@media (hover: none) {
  .sh-rcard:hover { transform: none; box-shadow: none; border-color: var(--sh-line); }
  .sh-btn-pri:hover { filter: none; }
}
@media (min-width: 1900px) {
  .sh-grid { grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }
  .sh-lib-list { grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); }
  .sh-help-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .sh *, .sh *::before, .sh *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .sh-spinner { animation: none; border-color: var(--sh-accent); }
  .sh-rcard:hover { transform: none; }
}
@media print {
  .sh-input-card, .sh-lib-card, .sh-progress, .sh-head-acts, .sh-filters, .sh-pager,
  .sh-toast, .sh-mask, .sh-loading, .sh-err, .sh-notice { display: none !important; }
  .sh-result-card .sh-card-head { position: static; }
  .sh { padding: 0; }
  .sh-card { box-shadow: none; break-inside: avoid; }
}
