/* 附件：待发送、消息里的附件 */
/* 待发送的附件 */
.att-tray { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 0; }
.att-tray[hidden] { display: none; }
.att-chip {
  position: relative; flex-shrink: 0; height: 60px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg); display: flex; align-items: center; overflow: hidden;
}
.att-chip img { width: 60px; height: 60px; object-fit: cover; display: block; }
.att-chip:not(:has(img)) { padding: 0 30px 0 10px; gap: 8px; max-width: 220px; }
.att-chip.uploading img, .att-chip.uploading .att-name { opacity: .45; }
.att-chip.error { border-color: var(--danger); }
.att-ico { color: var(--accent); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--accent-soft); flex-shrink: 0; }
.att-name { display: grid; min-width: 0; font-size: 13px; line-height: 1.35; }
.att-name, .att-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-name small { color: var(--faint); font-size: 11px; }
.att-x {
  position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); color: #fff;
}
.att-x svg { width: 12px; height: 12px; }
.att-spin {
  position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, var(--accent) 25%, transparent); border-top-color: var(--accent); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 消息里的附件 */
.msg-att { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: flex-end; margin-bottom: 6px; max-width: min(85%, 640px); }
.att-img { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--border); background: var(--hover); }
.att-img img { display: block; width: 140px; height: 140px; object-fit: cover; }
.msg-att .att-img:only-child img { width: auto; height: auto; max-width: min(280px, 70vw); max-height: 320px; }
.att-file {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-radius: 14px; max-width: 260px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text); text-decoration: none;
}
.att-file:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.composer:focus-within {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 10%, transparent), var(--shadow-sm);
}
.composer textarea {
  flex: 1; border: 0; outline: none; resize: none; background: transparent; max-height: 40vh;
  min-height: 24px; padding: 6px 0; line-height: 1.5; font-size: 16px;
}
.send-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent-2), var(--accent)); color: var(--accent-text); flex-shrink: 0;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 35%, transparent); transition: transform .12s, background .2s;
}
.send-btn:active { transform: scale(.9); }
.send-btn:disabled { background: var(--active); color: var(--faint); box-shadow: none; cursor: default; }
.send-btn.stop { background: var(--text); color: var(--bg); }
.composer-note { max-width: 820px; margin: 6px auto 0; text-align: center; font-size: 12px; color: var(--faint); }
