.wk-message-file {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  min-width: 200px;
  max-width: 280px;
  gap: 12px;
  background: rgba(28, 28, 35, 0.05);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.15s, box-shadow 0.15s;
}

/* 可点击的文件卡片 hover 效果 */
.wk-message-file--clickable:hover {
  background: rgba(28, 28, 35, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.wk-message-file--clickable:active {
  background: rgba(28, 28, 35, 0.12);
}

/* 激活态（正在预览） */
.wk-message-file--active {
  border: 1px solid var(--wk-color-theme);
  background: var(--wk-brand-tint-06);
}

.wk-message-file--active:hover {
  border-color: var(--wk-color-theme);
  background: var(--wk-brand-tint-06);
}

.wk-message-file-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.wk-message-file-icon-label {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.wk-message-file-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wk-message-file-name {
  font-size: 14px;
  font-weight: 500;
  color: rgba(28, 28, 35, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.wk-message-file-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(28, 28, 35, 0.4);
}

.wk-message-file-ext {
  padding: 0 4px;
  border-radius: 2px;
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--wk-color-theme);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.6;
}

.wk-message-file-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.wk-message-file-action {
  min-width: 44px;
  min-height: 44px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--wk-color-theme);
  transition: background-color 0.2s;
}

.wk-message-file-action:hover {
  background-color: rgba(99, 102, 241, 0.1);
}

.wk-message-base-bubble-box.send .wk-message-file-name {
  color: var(--wk-text-primary);
}

.wk-message-base-bubble-box.send .wk-message-file-meta {
  color: var(--wk-text-tertiary);
}

.wk-message-base-bubble-box.send .wk-message-file-ext {
  background-color: rgba(0, 180, 148, 0.1);
  color: var(--wk-color-theme);
}

.wk-message-base-bubble-box.send .wk-message-file-action {
  color: var(--wk-color-theme);
}

.wk-message-base-bubble-box.send .wk-message-file-action:hover {
  background-color: rgba(0, 180, 148, 0.08);
}

.wk-message-file-caption {
  padding: 4px 8px 8px;
  font-size: 14px;
  color: var(--wk-text-item);
  word-break: break-word;
  line-height: 1.4;
}

.wk-message-base-bubble-box.send .wk-message-file-caption {
  color: var(--wk-text-primary);
}

/* 上传进度条 */
.wk-message-file--uploading,
.wk-message-file--failed {
  opacity: 0.9;
}

.wk-message-file-progress-bar {
  height: 4px;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin: 6px 0 2px;
}

.wk-message-file-progress-fill {
  height: 100%;
  background-color: var(--wk-color-primary, #1c1c23);
  border-radius: 2px;
  transition: width 0.2s ease;
}

.wk-message-file-progress-text {
  font-size: 11px;
  color: var(--wk-text-item-second, #999);
}

.wk-message-base-bubble-box.send .wk-message-file-progress-bar {
  background-color: rgba(0, 180, 148, 0.15);
}

.wk-message-base-bubble-box.send .wk-message-file-progress-fill {
  background-color: var(--wk-color-theme);
}

.wk-message-base-bubble-box.send .wk-message-file-progress-text {
  color: var(--wk-text-tertiary);
}

/* 失败状态文案 */
.wk-message-file-failed-text {
  color: #ef4444;
}

.wk-message-file-retry-hint {
  font-size: 11px;
  color: #ef4444;
  margin-top: 2px;
}

/* 发送方气泡里失败文案 */
.wk-message-base-bubble-box.send .wk-message-file-failed-text {
  color: #ef4444;
}

.wk-message-base-bubble-box.send .wk-message-file-retry-hint {
  color: #ef4444;
}

/* Text file preview modal */
.wk-text-file-preview {
  max-height: 70vh;
  overflow-y: auto;
  padding: 8px;
}

.wk-text-file-preview-plain {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}
