/* ===== xd-tools.css · 悬浮控件收纳入「工具台」卡片页 + 窄屏完整显示 + 应用图标 ===== */

/* 1) 隐藏所有浮动控件（功能全部搬到侧栏「工具台」） */
.xd-own-fab,
#xd-theme-toggle,
#zq-castq,
#owner-entry-btn,
.xd-own-fab * { display: none !important; }

/* 2) 应用图标（注入到应用/注入列表的应用名列） */
.xd-appico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; min-width: 20px; border-radius: 6px;
  font: 700 11px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #fff; letter-spacing: .2px; flex: 0 0 20px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .28), inset 0 0 0 1px rgba(255, 255, 255, .16);
  overflow: hidden; user-select: none; vertical-align: middle;
}
html.xd-dark .xd-appico { box-shadow: 0 1px 3px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .10); }
td:has(> .xd-appico) { display: flex; align-items: center; gap: 6px; min-width: 0; }
td:has(> .xd-appico) > span:last-child,
td:has(> .xd-appico) > div { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 3) 窄屏完整显示：宽内容可横向滚动，且滚动条可见（原样式把滚动条全局隐藏了） */
@media (max-width: 1100px) {
  main table { min-width: 520px; }
  main table.table-fixed { table-layout: auto; }
  main td, main th { white-space: nowrap; }
  main [role="tablist"] { flex-wrap: nowrap !important; overflow-x: auto; }
  main [role="tablist"] > * { flex: 0 0 auto !important; }
  main button { max-width: 100%; }

  /* 滚动条重新显现：能滑的地方看得见，不再“显示不全” */
  main .overflow-auto,
  main .overflow-x-auto,
  main [class*="overflow-x-auto"] {
    overflow-x: auto !important;
    scrollbar-width: thin !important;
    -ms-overflow-style: auto !important;
  }
  main .overflow-auto::-webkit-scrollbar,
  main .overflow-x-auto::-webkit-scrollbar,
  main [class*="overflow-x-auto"]::-webkit-scrollbar {
    width: 8px !important; height: 8px !important; display: block !important;
  }
  main .overflow-auto::-webkit-scrollbar-thumb,
  main .overflow-x-auto::-webkit-scrollbar-thumb,
  main [class*="overflow-x-auto"]::-webkit-scrollbar-thumb {
    background: rgba(120, 140, 180, .55) !important; border-radius: 4px !important;
  }
  main .overflow-auto::-webkit-scrollbar-track,
  main .overflow-x-auto::-webkit-scrollbar-track { background: transparent !important; }

  /* 多列网格在窄屏收成单列，避免整块被撑出屏幕 */
  main .grid[class*="grid-cols-"] { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important; }
}
@media (max-width: 767px) {
  main table { min-width: 480px; font-size: 11.5px; }
  main { padding-bottom: 12px; }
  main td, main th { padding-left: 6px !important; padding-right: 6px !important; }
  main .grid[class*="grid-cols-"] { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important; }
}

/* 4) 工具台页面 */
#xd-tools-page {
  position: fixed; inset: 0; z-index: 2147482600; display: none;
  background: #f2f4f7; color: #1f2328; overflow: auto;
  -webkit-overflow-scrolling: touch;
}
html.xd-dark #xd-tools-page { background: #070c18; color: #e8ecf5; }
#xd-tools-page.on { display: block; }
.xd-tools-wrap { max-width: 1080px; margin: 0 auto; padding: 16px 14px 40px; }
.xd-tools-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.xd-tools-title { font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.xd-tools-sub { font-size: 12px; opacity: .6; margin-top: 2px; }
.xd-tools-x {
  margin-left: auto; border: 1px solid rgba(128, 128, 128, .3); background: transparent; color: inherit;
  border-radius: 10px; padding: 7px 13px; font-size: 13px; cursor: pointer;
}
.xd-tools-x:hover { background: rgba(128, 128, 128, .14); }
.xd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.xd-card {
  border-radius: 14px; padding: 14px; background: #fff; border: 1px solid #d8dee6;
  box-shadow: 0 2px 10px rgba(16, 24, 40, .05);
}
html.xd-dark .xd-card {
  background: linear-gradient(165deg, #131b2d, #0c1322 60%, #101a2e);
  border-color: rgba(150, 170, 220, .22);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
}
.xd-card-t { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.xd-card-d { font-size: 12px; opacity: .62; margin-top: 5px; line-height: 1.5; }
.xd-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.xd-btn {
  border: 1px solid rgba(100, 140, 220, .42); background: rgba(90, 140, 235, .12); color: inherit;
  border-radius: 9px; padding: 8px 12px; font-size: 13px; cursor: pointer; line-height: 1;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.xd-btn:hover { background: rgba(90, 140, 235, .24); }
.xd-btn.on { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; border-color: transparent; font-weight: 600; }
.xd-kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 5px 0; border-bottom: 1px dashed rgba(128, 128, 128, .22); }
.xd-kv:last-child { border-bottom: 0; }
.xd-kv b { font-weight: 600; }
.xd-tools-toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(12, 18, 32, .92); color: #fff; padding: 9px 16px; border-radius: 10px;
  font-size: 13px; z-index: 2147482700; border: 1px solid rgba(255, 255, 255, .16);
}

/* 5) 侧栏「工具台」入口 */
.xd-tools-entry svg { width: 16px; height: 16px; flex: 0 0 16px; }
