/* 附件预览容器 */
.wk-attachment-preview {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--wk-sp-2);
}

/* 滚动按钮 */
.wk-attachment-scroll-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--wk-sp-6);
  height: var(--wk-sp-6);
  min-width: var(--wk-sp-6);
  border: none;
  border-radius: var(--wk-r-circle);
  background: var(--wk-bg-elevated);
  color: var(--wk-icon-default);
  cursor: pointer;
  transition: background-color var(--wk-dur-fast), color var(--wk-dur-fast);
  flex-shrink: 0;
}

.wk-attachment-scroll-btn:hover {
  background: var(--wk-bg-hover);
  color: var(--wk-text-strong);
}

/* 附件列表 - 滚动容器 */
.wk-attachment-preview-list {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: var(--wk-sp-4);
  overflow-x: auto;
  overflow-y: hidden;
  flex: 1;
  min-width: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.wk-attachment-preview-list::-webkit-scrollbar {
  display: none;
}

/* 单个附件卡片 */
.wk-attachment-preview-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: var(--wk-sp-2);
  background: var(--wk-bg-elevated);
  border-radius: var(--wk-r-md);
  padding: var(--wk-sp-1) var(--wk-sp-3) var(--wk-sp-2) var(--wk-sp-1);
  width: 224px;
  min-width: 224px;
  height: 56px;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* 文件图标容器 */
.wk-attachment-preview-icon {
  width: var(--wk-sp-12);
  height: var(--wk-sp-12);
  min-width: var(--wk-sp-12);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wk-attachment-preview-icon img {
  width: var(--wk-sp-12);
  height: var(--wk-sp-12);
  object-fit: contain;
}

/* 文件信息区域 */
.wk-attachment-preview-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--wk-sp-0-5);
  margin-top: var(--wk-sp-2);
  overflow: hidden;
}

/* 文件名 + 删除按钮一行 */
.wk-attachment-preview-name-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--wk-sp-2);
}

.wk-attachment-preview-name {
  flex: 1;
  min-width: 0;
  font-size: var(--wk-text-size-md);
  color: var(--wk-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  font-weight: var(--wk-font-regular);
}

.wk-attachment-preview-size {
  font-size: var(--wk-text-size-md);
  color: var(--wk-text-tertiary);
  line-height: 1.3;
}

/* 关闭按钮 */
.wk-attachment-preview-remove {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wk-icon-muted);
  transition: color var(--wk-dur-fast);
  flex-shrink: 0;
  width: var(--wk-sp-4);
  height: var(--wk-sp-4);
}

.wk-attachment-preview-remove:hover {
  color: var(--wk-text-strong);
}

.wk-attachment-preview-remove svg {
  width: var(--wk-sp-4);
  height: var(--wk-sp-4);
}
