/* ============================================
   FileListPanel - 侧边文件列表面板样式
   类名前缀: wk-file-list-panel
   ============================================ */

.wk-file-list-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--wk-bg-surface);
  border-right: 1px solid var(--wk-border-default);
}

/* ============================================
   Header
   ============================================ */

.wk-file-list-panel__header {
  display: flex;
  align-items: center;
  gap: var(--wk-sp-2);
  padding: var(--wk-sp-3);
  border-bottom: 1px solid var(--wk-border-default);
  flex-shrink: 0;
}

.wk-file-list-panel__title {
  font-size: var(--wk-text-size-base);
  font-weight: 600;
  color: var(--wk-text-primary);
}

.wk-file-list-panel__count {
  font-size: var(--wk-text-size-xs);
  font-weight: 500;
  color: var(--wk-text-tertiary);
  background: var(--wk-bg-hover);
  padding: var(--wk-sp-0-5) var(--wk-sp-1-5);
  border-radius: var(--wk-r-full);
}

.wk-file-list-panel__close-btn {
  margin-left: auto;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  border-radius: var(--wk-r-sm);
  cursor: pointer;
  color: var(--wk-text-tertiary);
  transition: background 0.15s, color 0.15s;
}

.wk-file-list-panel__close-btn:hover {
  background: var(--wk-bg-hover);
  color: var(--wk-text-primary);
}

/* ============================================
   文件列表
   ============================================ */

.wk-file-list-panel__list {
  flex: 1;
  overflow-y: auto;
  padding: var(--wk-sp-2) 0;
}

.wk-file-list-panel__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--wk-sp-2);
  height: 160px;
  color: var(--wk-text-tertiary);
}

.wk-file-list-panel__empty-icon {
  color: var(--wk-text-quaternary);
}

.wk-file-list-panel__empty-text {
  font-size: var(--wk-text-size-sm);
}

/* ============================================
   文件项
   ============================================ */

.wk-file-list-panel__item {
  display: flex;
  align-items: center;
  gap: var(--wk-sp-2);
  padding: var(--wk-sp-2) var(--wk-sp-3);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.wk-file-list-panel__item:hover {
  background: var(--wk-bg-hover);
}

.wk-file-list-panel__item--active {
  background: var(--wk-bg-active);
}

.wk-file-list-panel__item--active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--wk-color-primary);
  border-radius: 0 2px 2px 0;
}

/* 文件图标 */
.wk-file-list-panel__item-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  color: var(--wk-text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 文件类型图标（SVG 图片） */
.wk-file-list-panel__item-file-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

/* 缩略图模式 */
.wk-file-list-panel__item-icon--thumbnail {
  width: 40px;
  height: 40px;
  border-radius: var(--wk-r-sm);
  overflow: hidden;
  background: var(--wk-bg-elevated);
}

.wk-file-list-panel__item-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 文件信息 */
.wk-file-list-panel__item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--wk-sp-0-5);
}

.wk-file-list-panel__item-name {
  font-size: var(--wk-text-size-base);
  color: var(--wk-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wk-file-list-panel__item--active .wk-file-list-panel__item-name {
  font-weight: 500;
}

/* 元信息行 */
.wk-file-list-panel__item-meta {
  display: flex;
  align-items: center;
  gap: var(--wk-sp-2);
  font-size: var(--wk-text-size-xs);
  color: var(--wk-text-tertiary);
}

.wk-file-list-panel__item-sender {
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wk-file-list-panel__item-size {
  flex-shrink: 0;
}

.wk-file-list-panel__item-time {
  flex-shrink: 0;
}

/* 加载更多 */
.wk-file-list-panel__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--wk-sp-3);
  color: var(--wk-text-tertiary);
  font-size: var(--wk-text-size-sm);
}

/* 没有更多数据 */
.wk-file-list-panel__no-more {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--wk-sp-3);
  color: var(--wk-text-quaternary);
  font-size: var(--wk-text-size-xs);
}

/* 分隔符 */
.wk-file-list-panel__item-meta > span:not(:last-child)::after {
  content: "·";
  margin-left: var(--wk-sp-2);
  color: var(--wk-text-quaternary);
}
