#files-panel {
  width: min(640px, calc(100vw - 24px));
  max-height: calc(100dvh - 48px);
  box-sizing: border-box;
  overflow: auto;
  padding: 20px;
  color: #e4e9f2;
  background: rgba(12, 17, 28, .97);
  border: 1px solid rgba(180, 195, 220, .22);
  border-radius: 18px;
}
#files-panel::backdrop { background: rgba(0, 0, 0, .65); }
.files-heading, .files-path { display: flex; gap: 12px; align-items: center; }
.files-heading { justify-content: space-between; }
.files-heading h2 { margin: 0; font-size: 18px; }
#files-panel p { font-size: 13px; line-height: 1.6; color: #b7c2d3; overflow-wrap: anywhere; }
#file-browse { display: grid; gap: 8px; margin-top: 20px; }
#file-browse label { font-size: 13px; }
#file-browse input, #file-browse select { min-width: 0; width: 100%; box-sizing: border-box; padding: 10px; color: #e4e9f2; background: #151d2a; border: 1px solid #465168; border-radius: 8px; }
#file-list { display: grid; gap: 6px; margin-block: 12px; }
#file-list button { width: 100%; text-align: left; overflow-wrap: anywhere; min-height: 44px; background: rgba(125, 148, 181, .10); color: #e4e9f2; border: 1px solid rgba(180, 195, 220, .15); }
#files-panel button:focus-visible { outline: 2px solid #91bdff; outline-offset: 3px; }
.conversation.file-drag-over::after {
  content: "松开以上传附件";
  position: absolute;
  inset: 12px;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1px dashed #91bdff;
  border-radius: 12px;
  background: rgba(12, 17, 28, .88);
  color: #e4e9f2;
  font-size: 16px;
  line-height: 1.6;
  text-align: center;
  pointer-events: none;
}
.file-transfer-status {
  order: 2;
  grid-column: 1 / -1;
  min-width: 0;
  color: #b7c2d3;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.file-attachments {
  display: flex;
  order: 2;
  grid-column: 1 / -1;
  gap: 8px;
  overflow-x: auto;
  padding-block: 2px 6px;
  margin-bottom: 4px;
  max-width: 100%;
}
.file-attachment {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
  width: 240px;
  max-width: 100%;
  padding: 6px 2px 6px 8px;
  border: 1px solid rgba(194, 220, 255, .18);
  border-radius: 10px;
  background: rgba(194, 220, 255, .04);
}
.file-attachment-preview {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(194, 220, 255, .08);
  color: #c3d0e1;
  font-size: 11px;
  font-weight: 650;
}
.file-attachment-preview canvas { display: block; width: 40px; height: 40px; }
.file-attachment-details { flex: 1; min-width: 0; display: grid; gap: 4px; }
.file-attachment-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #e4e9f2; font-size: 13px; line-height: 1.3; }
.file-attachment-meta { color: #b7c2d3; font-size: 11px; line-height: 1.3; }
.file-attachment-remove {
  flex: 0 0 36px;
  min-width: 36px;
  min-height: 40px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #b7c2d3;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  box-shadow: none;
}
.file-attachment-remove:hover { background: rgba(194, 220, 255, .1); color: #fff; }
.file-attachment-remove:focus-visible { outline: 2px solid #91bdff; outline-offset: -2px; }
.file-attachment-remove:disabled { opacity: .4; cursor: wait; }
.file-attachment-retry { font-size: 12px; font-weight: 600; }
.message-file-attachment {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  padding: 7px 10px;
  margin: 0 6px 6px 0;
  border: 1px solid rgba(194, 220, 255, .18);
  border-radius: 8px;
  color: #e4e9f2;
  font-size: 13px;
  line-height: 1.4;
}
.message-file-download {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  max-width: 100%;
  min-height: 44px;
  margin-block: 4px;
  padding: 8px 12px;
  border: 1px solid rgba(194, 220, 255, .18);
  border-radius: 8px;
  background: rgba(194, 220, 255, .04);
  color: #e4e9f2;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: none;
}
.message-file-download-name { min-width: 0; overflow-wrap: anywhere; }
.message-file-download-status { flex-shrink: 0; color: #b7c2d3; font-size: 12px; }
.message-file-download:hover { background: rgba(194, 220, 255, .1); }
.message-file-download:focus-visible { outline: 2px solid #91bdff; outline-offset: 2px; }
.message-file-download:disabled { opacity: .65; cursor: wait; }
@media (max-width: 760px) {
  .file-attachment { width: 218px; }
  .file-attachment-remove { min-width: 44px; min-height: 44px; flex-basis: 44px; }
}
