
/* ==========================================================================
   详情页：技能文件内容模块（文件清单 + 预览双栏）
   ========================================================================== */
.sh-files-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.sh-files-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  color: var(--sh-muted);
  font-variant-numeric: tabular-nums;
}

.sh-files-dot {
  opacity: 0.5;
}

.sh-files-body {
  display: grid;
  grid-template-columns: minmax(240px, 38%) 1fr;
  gap: 0.875rem;
  padding: 0.875rem 1rem 0;
}

/* ---------- 左侧文件清单 ---------- */
.sh-files-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-height: 460px;
  padding: 0.375rem;
  border: 1px solid var(--sh-border);
  border-radius: 10px;
  background: var(--sh-surface-soft);
}

.sh-files-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  overflow-y: auto;
  scrollbar-width: thin;
}

.sh-files-scroll > * {
  flex: 0 0 auto;
}

.sh-files-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4375rem 0.5rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.sh-files-item:hover {
  background: rgba(var(--tblr-primary-rgb), 0.07);
}

.sh-files-item.is-active {
  background: var(--sh-surface);
  box-shadow: inset 0 0 0 1px rgba(var(--tblr-primary-rgb), 0.28);
  color: var(--tblr-primary);
  font-weight: 600;
}

.sh-files-item:focus-visible {
  outline: 2px solid var(--tblr-primary);
  outline-offset: -2px;
}

.sh-file-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.125rem;
  padding: 0 0.25rem;
  border-radius: 4px;
  font-size: 0.5625rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  background: rgba(100, 116, 139, 0.14);
  color: #55617a;
}

.sh-file-badge--markdown {
  background: rgba(47, 111, 224, 0.13);
  color: #2f6fe0;
}

.sh-file-badge--code {
  background: rgba(15, 158, 168, 0.14);
  color: #0b7f87;
}

.sh-file-badge--data {
  background: rgba(214, 154, 26, 0.16);
  color: #9a6a06;
}

.sh-file-badge--image {
  background: rgba(122, 75, 208, 0.14);
  color: #6f43c2;
}

.sh-file-badge--binary {
  background: rgba(100, 116, 139, 0.16);
  color: #4b5563;
}

.sh-files-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
}

.sh-files-size {
  flex: 0 0 auto;
  font-size: 0.6875rem;
  color: var(--sh-muted);
  font-variant-numeric: tabular-nums;
}

.sh-files-truncated {
  margin: 0.375rem 0.5rem;
  font-size: 0.6875rem;
  color: var(--sh-muted);
}

.sh-files-foot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
  margin-top: 0.375rem;
  padding: 0.5rem 0.25rem 0.125rem;
  border-top: 1px solid var(--sh-border);
}

.sh-files-download {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
}

.sh-files-zip {
  margin-left: auto;
  font-size: 0.6875rem;
  color: var(--sh-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- 右侧预览 ---------- */
.sh-files-preview {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--sh-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--sh-surface);
}

.sh-files-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--sh-border);
  background: var(--sh-surface-soft);
  font-size: 0.75rem;
}

.sh-files-preview-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sh-files-preview-meta {
  flex: 0 0 auto;
  font-size: 0.6875rem;
  color: var(--sh-muted);
  font-family: var(--tblr-font-monospace, ui-monospace, SFMono-Regular, Menlo, monospace);
}

.sh-files-preview-body {
  flex: 1 1 auto;
  max-height: 420px;
  overflow: auto;
  scrollbar-width: thin;
}

/* Tabler 的 pre 默认使用深色底 + 浅色字，且 code 会覆盖为深色字导致不可读，
   这里显式指定浅色代码块外观（与文件列表同一套表面色）。 */
.sh-files-code,
.sh-files-code code {
  background: transparent;
  color: var(--tblr-body-color);
}

.sh-files-code {
  margin: 0;
  padding: 0.875rem 1rem;
  border: 0;
  border-radius: 0;
  font-family: var(--tblr-font-monospace, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.75rem;
  line-height: 1.7;
  white-space: pre;
  tab-size: 2;
  overflow: visible;
}

.sh-files-code code {
  font: inherit;
  color: inherit;
  padding: 0;
}

.sh-files-empty {
  margin: 0;
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--sh-muted);
}

.sh-files-notice {
  margin: 0;
  padding: 0.5rem 1rem;
  border-top: 1px dashed var(--sh-border);
  font-size: 0.6875rem;
  color: var(--sh-muted);
}

.sh-files-note {
  margin: 0.75rem 0 0;
  padding: 0.625rem 1rem 0.875rem;
  border-top: 1px dashed var(--sh-border);
  font-size: 0.6875rem;
  line-height: 1.6;
  color: var(--sh-muted);
}

@media (max-width: 991.98px) {
  .sh-files-body {
    grid-template-columns: 1fr;
  }

  .sh-files-list {
    max-height: 260px;
  }

  .sh-files-preview-body {
    max-height: 340px;
  }
}

@media (max-width: 575.98px) {
  .sh-files-body {
    padding: 0.75rem 0.75rem 0;
  }

  .sh-files-code {
    font-size: 0.6875rem;
    padding: 0.75rem;
  }

  .sh-files-summary {
    font-size: 0.6875rem;
  }
}

.theme-dark .sh-files-list {
  background: rgba(255, 255, 255, 0.04);
}

.theme-dark .sh-files-item.is-active {
  background: rgba(var(--tblr-primary-rgb), 0.18);
  box-shadow: inset 0 0 0 1px rgba(var(--tblr-primary-rgb), 0.42);
  color: #a8c8ff;
}

.theme-dark .sh-file-badge {
  background: rgba(255, 255, 255, 0.09);
  color: #b7c1d1;
}

.theme-dark .sh-file-badge--markdown {
  background: rgba(122, 169, 255, 0.18);
  color: #a8c8ff;
}

.theme-dark .sh-file-badge--code {
  background: rgba(72, 210, 220, 0.18);
  color: #86e2e9;
}

.theme-dark .sh-file-badge--data {
  background: rgba(243, 193, 90, 0.18);
  color: #f7d488;
}

.theme-dark .sh-file-badge--image {
  background: rgba(177, 140, 255, 0.18);
  color: #c3a4ff;
}

.theme-dark .sh-files-preview-head {
  background: rgba(255, 255, 255, 0.04);
}
