/* Skills 产品切换 + 表格 */
.topbar { gap: 10px; min-width: 0; }
.layout, .content, .sidebar, #skillPane { min-width: 0; }
.brand-wrap {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; white-space: nowrap;
}
.brand { display: none; }
.product-switch { display: flex; align-items: center; background: transparent; padding: 0; gap: 4px; flex-shrink: 0; }
.product-switch button {
  display: inline-flex; align-items: center; gap: 8px;
  border: none; background: transparent; color: var(--muted);
  padding: 4px 10px; border-radius: 8px; font-size: 18px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.product-switch button:hover { color: var(--text); }
.product-switch button.on { box-shadow: 0 1px 2px rgba(26, 115, 232, .18); }
.product-switch .ic { width: 24px; height: 24px; flex-shrink: 0; }
#btnViewDocs.on {
  background: #174ea6;
  color: #fff;
}
#btnViewDocs.on .ic { color: #fff; }
#btnViewSkills.on {
  background: #d2e3fc;
  color: #174ea6;
}
#btnViewSkills.on .ic { color: #1967d2; }
.topbar-right { min-width: 0; flex: 1; justify-content: flex-end; }
.topbar-search {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  max-width: 240px;
  overflow: hidden;
}
.topbar-search input { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.role-badge { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-settings { white-space: nowrap; flex-shrink: 0; }
.userbox { flex-shrink: 0; min-width: 0; }

.sidebar { transition: width .18s ease, padding .18s ease; }
.sidebar-title-actions { display: flex; align-items: center; gap: 6px; }
.btn-sidebar-toggle {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 7px; width: 26px; height: 26px; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.btn-sidebar-toggle:hover { background: #f1f3f4; color: var(--text); }
.btn-sidebar-toggle svg { width: 14px; height: 14px; display: block; }
body.sidebar-collapsed .sidebar { width: 40px; padding: 12px 6px; overflow: hidden; }
body.sidebar-collapsed .sidebar-title { padding-left: 0; margin-bottom: 0; justify-content: center; }
body.sidebar-collapsed .sidebar-title > span,
body.sidebar-collapsed .btn-newdept,
body.sidebar-collapsed .tree,
body.sidebar-collapsed .tree-hidden,
body.sidebar-collapsed .skill-public-row { display: none !important; }
body.sidebar-collapsed .skill-tree-panel {
  border: none !important;
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
}

.skill-public-row {
  display: none;
  width: 100%;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  margin: 0 0 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  font-family: inherit;
}
.skill-public-row .ic {
  width: 16px; height: 16px; flex-shrink: 0;
  stroke: currentColor; fill: none; stroke-width: 1.8;
}
.skill-public-row span {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.skill-public-row:hover { background: #f1f3f4; }
.skill-public-row.selected {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 1px 2px rgba(26, 115, 232, .35);
}
body.view-skills .skill-public-row { display: flex; }
body.view-docs .skill-public-row { display: none !important; }

body.view-skills .skill-tree-panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 8px 6px 10px;
  min-width: 0;
}
body.view-skills .skill-tree-panel .sidebar-title {
  margin-bottom: 8px;
}
body.view-skills.skills-scope-tree .skill-tree-panel {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
  background: #f8fbff;
}
body.view-skills.skills-scope-tree .skill-tree-panel .sidebar-title {
  color: var(--blue-dark);
  font-weight: 700;
}
body.view-skills.skills-scope-public .skill-tree-panel {
  opacity: .78;
}
body.view-skills.skills-scope-public .skill-tree-panel .sidebar-title {
  color: var(--muted);
  font-weight: 400;
}
body.view-docs .skill-tree-panel {
  border: none;
  background: transparent;
  padding: 0;
  box-shadow: none;
}
body.sidebar-collapsed .sidebar-title-actions { width: 100%; justify-content: center; }
body.sidebar-collapsed .btn-sidebar-toggle svg { transform: rotate(180deg); }

body.view-skills #tree > .tnode > .children > .tnode > .children { display: none !important; }
body.view-skills #tree > .tnode > .children > .tnode > .trow .chevwrap {
  visibility: hidden;
  pointer-events: none;
}
#tree .ficon { display: none !important; }

body.view-skills #btnParse,
body.view-skills #btnGraph,
body.view-skills #btnKg,
body.view-skills #btnNewFolder,
body.view-skills #btnUpload,
body.view-skills #btnUploadMineru,
body.view-skills #selectBar,
body.view-skills #grid { display: none !important; }

body.view-docs #btnUploadSkill,
body.view-docs #skillPane { display: none !important; }

.skill-bc-hub {
  border: none; background: none; padding: 0; cursor: pointer;
  font: inherit; color: inherit;
}
.skill-bc-hub:hover { text-decoration: underline; }

.skill-hub {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 8px 0 24px;
}
.skill-hub-card {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 20px;
  cursor: pointer;
  font-family: inherit;
  background: #f7f9ff;
  box-shadow: 0 1px 2px rgba(26, 115, 232, .06);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.skill-hub-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(26, 115, 232, .12);
  border-color: #c5d8f8;
}
.skill-hub-card.company { background: linear-gradient(180deg, #eef3ff 0%, #f7f9ff 100%); }
.skill-hub-card.github { background: linear-gradient(180deg, #eaf7ef 0%, #f6fbf8 100%); }
.skill-hub-ic {
  width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.skill-hub-card.company .skill-hub-ic { background: #1a73e8; color: #fff; }
.skill-hub-card.github .skill-hub-ic { background: #137333; color: #fff; }
.skill-hub-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.skill-hub-card.github .skill-hub-ic svg { fill: currentColor; stroke: none; }
.skill-hub-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.skill-hub-title { font-size: 16px; font-weight: 700; color: var(--text); }
.skill-hub-desc { font-size: 13px; color: var(--muted); line-height: 1.45; }
.skill-hub-arrow { font-size: 22px; color: var(--faint); flex-shrink: 0; }

.skill-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.skill-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.skill-table th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 12px;
  padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap;
}
.skill-table th.skill-th-sort { cursor: pointer; user-select: none; }
.skill-table th.skill-th-sort:hover,
.skill-table th.skill-th-sort.on { color: var(--text); }
.skill-th-sort-mark { margin-left: 4px; font-size: 10px; color: var(--blue); }
.skill-table td { padding: 12px; border-bottom: 1px solid #f1f3f4; vertical-align: middle; }
.skill-table tbody tr:hover { background: #f7f9fc; }
.skill-table-compact td, .skill-table-compact th { padding: 8px 10px; }
.skill-name { border: none; background: none; color: var(--blue-dark); font-weight: 600; font-size: 14px; cursor: pointer; padding: 0; }
.skill-name:hover { text-decoration: underline; }
.skill-name-cell { white-space: nowrap; }
.skill-ver { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.skill-note { max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.skill-acts { white-space: nowrap; }
.skill-link {
  border: none; background: none; color: var(--blue); cursor: pointer;
  font-size: 12.5px; padding: 0 6px 0 0;
}
.skill-link:hover { text-decoration: underline; }
.skill-link.danger { color: #c5221f; }
.skill-warn { font-size: 11px; color: #b06000; background: #feefe3; border-radius: 6px; padding: 1px 6px; }
.skill-pin {
  font-size: 11px; color: #8a5a00; background: #fff3cd; border-radius: 6px;
  padding: 1px 6px; margin-right: 6px; font-weight: 600;
}
.skill-tags { max-width: 220px; white-space: normal; }
.skill-tag {
  display: inline-block;
  font-size: 11px; color: var(--blue-dark); background: #e8f0fe;
  border-radius: 6px; padding: 1px 7px; margin: 0 4px 4px 0; font-weight: 600;
}
.skill-row-pinned { background: #fffcf5; }
.skill-row-pinned:hover { background: #fff8e8; }
.skill-cur { font-size: 11px; color: #137333; background: #e6f4ea; border-radius: 6px; padding: 1px 6px; margin-left: 4px; }
.muted { color: var(--faint); font-size: 12px; }

.skill-drawer {
  margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 16px 18px;
}
.skill-detail-row > td {
  padding: 10px 12px 14px;
  background: #fff;
  white-space: normal !important;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.skill-detail-row .skill-drawer {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 16px 18px;
}
.skill-card-drawer {
  margin-top: 8px;
}
.skill-drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.skill-drawer-title { font-size: 16px; font-weight: 600; }
.skill-banner { background: #feefe3; color: #b06000; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 12px; }
.skill-drawer-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.skill-tab {
  border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 12px;
  font-size: 13px; cursor: pointer; color: var(--muted);
}
.skill-tab.on { background: var(--blue-bg); border-color: #cfe0fb; color: var(--blue-dark); font-weight: 600; }
.skill-files { list-style: none; font-size: 13px; line-height: 1.7; max-height: 320px; overflow: auto; }
.skill-md { font-size: 14px; line-height: 1.6; max-height: 480px; overflow: auto; }
.skill-md h1, .skill-md h2, .skill-md h3 { margin: 12px 0 6px; }
.skill-md p { margin: 6px 0; }
.skill-md code { background: #f1f3f4; border-radius: 4px; padding: 0 4px; font-size: 12.5px; }

#skillUploadModal .modal-box {
  width: 440px;
  max-width: calc(100vw - 32px);
  height: auto;
  max-height: calc(100vh - 40px);
}
#skillUploadModal .modal-body {
  flex: none;
  overflow: auto;
  background: #fff;
}
#skillUploadModal .modal-head { padding: 12px 16px; }

.skill-form { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px 16px; }
.skill-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.skill-form input, .skill-form textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; color: var(--text);
  font-family: inherit; background: #fff;
}
.skill-form input:focus, .skill-form textarea:focus {
  outline: none; border-color: #aecbfa; box-shadow: 0 0 0 3px #e8f0fe;
}
.skill-form textarea { min-height: 72px; resize: vertical; }
.skill-form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.skill-form-actions .btn-primary {
  background: var(--blue); color: #fff; border: none; border-radius: 8px; padding: 8px 16px; cursor: pointer; font-size: 13px;
}
.skill-form-actions .btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.skill-form-actions .btn-upload { padding: 8px 14px; font-size: 13px; }
.skill-err { color: #c5221f; font-size: 13px; min-height: 0; }
.skill-meta { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }

.skill-filepick {
  border: 1px dashed #cfd4da; border-radius: 10px; padding: 14px 12px;
  background: #fafbfc; cursor: pointer; text-align: center;
}
.skill-filepick:hover, .skill-filepick.drag { border-color: #8ab4f8; background: #f3f8ff; }
.skill-filepick-title { font-size: 13px; color: var(--text); font-weight: 600; }
.skill-fileinfo { margin-top: 4px; font-size: 12px; color: var(--muted); word-break: break-all; }
.skill-file-label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.skill-inspect { margin-top: 8px; font-size: 12.5px; border-radius: 8px; padding: 7px 10px; text-align: left; }
.skill-inspect.warn { background: #feefe3; color: #b06000; }
.skill-inspect.ok { background: #e6f4ea; color: #137333; }

.skill-table { table-layout: auto; }
.skill-name-cell { display: table-cell; }
.skill-name { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; }
.skill-table td { white-space: nowrap; }
.skill-table td.skill-note { white-space: nowrap; max-width: 240px; }
.content-head { gap: 10px; min-width: 0; }
.breadcrumb { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#btnUploadSkill { flex-shrink: 0; white-space: nowrap; }
#skillPane { min-width: 0; }
body.view-skills .dropzone { padding: 22px 16px; }
.skill-cards { display: none; }
.btn-nav { display: none; }
.nav-overlay { display: none; }
.sidebar { overflow-x: hidden; overflow-y: auto; }
.tree, .tree-hidden { width: 100% !important; min-width: 0; max-width: 100%; }
.trow { min-width: 0; max-width: 100%; }
.trow .label {
  flex: 1 1 0 !important;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.skill-table-wrap,
.skill-hist-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: #c5cad1 transparent;
}
.skill-table-wrap::-webkit-scrollbar,
.skill-hist-wrap::-webkit-scrollbar {
  height: 6px;
  width: 6px;
}
.skill-table-wrap::-webkit-scrollbar-track,
.skill-hist-wrap::-webkit-scrollbar-track {
  background: transparent;
  margin: 0 8px;
}
.skill-table-wrap::-webkit-scrollbar-thumb,
.skill-hist-wrap::-webkit-scrollbar-thumb {
  background: #d0d5dc;
  border-radius: 6px;
}
.skill-table-wrap::-webkit-scrollbar-thumb:hover,
.skill-hist-wrap::-webkit-scrollbar-thumb:hover {
  background: #9aa3ad;
}
.skill-table-wrap::-webkit-scrollbar-button,
.skill-hist-wrap::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

@media (max-width: 1180px) {
  .brand .ic { width: 20px; height: 20px; }
  .brand { font-size: 15px; gap: 6px; }
  .product-switch button { padding: 4px 8px; font-size: 16px; }
  .product-switch .ic { width: 20px; height: 20px; }
  .topbar { padding: 0 12px; }
  .topbar-right { gap: 8px; }
  .btn-settings { padding: 6px 8px; }
  .sidebar { width: 220px; }
}

@media (max-width: 980px) {
  .brand span { display: none; }
  .topbar-search { min-width: 96px; max-width: 180px; }
  .role-badge { display: none; }
  .topbar .btn-settings {
    padding: 6px; font-size: 0; gap: 0; min-width: 32px; justify-content: center;
  }
  .topbar .btn-settings .ic { width: 18px; height: 18px; }
  .sidebar { width: 196px; padding: 14px 10px; }
  .content { padding: 14px; }
}

@media (max-width: 760px) {
  html, body { height: 100%; overflow: hidden; }
  .topbar {
    height: auto;
    min-height: 48px;
    flex-wrap: wrap;
    padding: 8px 10px 6px;
    row-gap: 8px;
  }
  .brand-wrap { width: 100%; gap: 8px; }
  .brand span { display: none; }
  .product-switch { margin-left: auto; }
  .product-switch button { padding: 4px 8px; font-size: 16px; }
  .product-switch .ic { width: 20px; height: 20px; }
  .btn-nav {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; padding: 0; flex-shrink: 0;
    border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer;
  }
  .btn-nav .ic { width: 20px; height: 20px; }
  .topbar-right {
    width: 100%;
    justify-content: flex-start;
    gap: 4px;
    flex-wrap: nowrap;
  }
  .topbar-search {
    flex: 1 1 0;
    min-width: 72px;
    max-width: none;
    width: auto;
    padding: 6px 8px;
  }
  .role-badge { display: none; }
  .topbar .btn-settings {
    padding: 0; font-size: 0; gap: 0;
    width: 32px; min-width: 32px; height: 32px; justify-content: center; flex-shrink: 0;
  }
  .topbar .btn-settings .ic { width: 16px; height: 16px; }
  .userbox { gap: 0; flex-shrink: 0; }
  .avatar { width: 32px; height: 32px; font-size: 13px; }
  .upload-progress { display: none; }

  .layout { position: relative; min-height: 0; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(86vw, 320px);
    z-index: 40;
    background: #fff;
    transform: translateX(-105%);
    transition: transform .2s ease;
    box-shadow: none;
    padding: 56px 12px 16px;
  }
  body.nav-open .sidebar { transform: translateX(0); box-shadow: 8px 0 24px rgba(0,0,0,.12); }
  .nav-overlay {
    display: none;
    position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 35;
  }
  body.nav-open .nav-overlay { display: block; }

  .content { padding: 12px; min-width: 0; }
  .content-head {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
  }
  .breadcrumb {
    flex: 1 1 100%;
    white-space: nowrap;
    font-size: 14px;
  }
  #btnUploadSkill, #btnUpload, #btnNewFolder, #btnUploadMineru {
    padding: 7px 10px; font-size: 13px;
  }

  .skill-table-wrap { display: none; }
  .skill-hub { grid-template-columns: 1fr; gap: 12px; }
  .skill-hub-card { padding: 16px 14px; }
  .skill-cards { display: flex; flex-direction: column; gap: 10px; }
  .skill-card {
    border: 1px solid var(--line); border-radius: 12px; background: #fff;
    padding: 12px 14px;
  }
  .skill-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .skill-card-top .skill-name {
    max-width: none; white-space: normal; overflow: visible; text-overflow: clip;
    font-size: 15px; text-align: left;
  }
  .skill-card-note {
    margin-top: 6px; font-size: 13px; color: var(--muted);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .skill-card-meta { margin-top: 6px; font-size: 12px; color: var(--faint); }
  .skill-card-acts { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 10px; }

  body.view-skills .dropzone { display: none !important; }
  body.view-docs #btnParse,
  body.view-docs #btnGraph,
  body.view-docs #btnKg { display: flex !important; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .dropzone { padding: 16px 12px; font-size: 13px; }
  .ic-cloud { width: 28px; height: 28px; }
  .card { height: 104px; }
  #skillUploadModal { padding: 12px; align-items: flex-end; }
  #skillUploadModal .modal-box {
    width: 100%;
    max-width: none;
    max-height: calc(100vh - 24px);
    border-radius: 16px 16px 8px 8px;
  }
  .skill-form-actions { position: sticky; bottom: 0; background: #fff; padding-bottom: 4px; }
  .skill-drawer { padding: 12px; overflow-x: hidden; }
  .skill-drawer-tabs { overflow-x: auto; }
  .skill-table-compact th:nth-child(5),
  .skill-table-compact td:nth-child(5),
  .skill-table-compact th:nth-child(6),
  .skill-table-compact td:nth-child(6) { display: none; }
}

/* sidebar-resize 20260825 */
.sidebar { width: var(--sidebar-w, 280px) !important; overflow-x: auto; overflow-y: auto; }
body.sidebar-collapsed .sidebar { width: 40px !important; overflow: hidden; }
.sidebar-resizer {
  width: 6px;
  flex-shrink: 0;
  cursor: col-resize;
  background: transparent;
  position: relative;
  z-index: 8;
  margin-left: -3px;
  margin-right: -3px;
}
.sidebar-resizer:hover,
body.sidebar-resizing .sidebar-resizer { background: var(--blue); opacity: .45; }
body.sidebar-resizing { cursor: col-resize; user-select: none; }
body.sidebar-resizing .sidebar { transition: none; }
body.sidebar-collapsed .sidebar-resizer { display: none; }
