/* 极简主义：灰色背景 + 黑色线条 - 美化版 - 纯 Flex 布局 */
.input-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
  height: 100%;
  padding: clamp(10px, 2.5cqw, 18px);
  box-sizing: border-box;
  container-type: inline-size;
  font-size: clamp(13px, 2.5cqw, 16px);
  gap: clamp(8px, 2cqw, 12px);
}

/* 输入框 - 响应式缩放 - 长方形 - 宽度90% - 自动缩放 - Flex 布局 */
.input-text {
  flex: 1;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: clamp(32px, 6cqw, 40px);
  min-height: clamp(32px, 6cqw, 40px);
  background: #ffffff;
  color: #0f0f0f;
  border: 2px solid #0f0f0f;
  border-radius: clamp(2px, 0.5cqw, 4px);
  padding: 0 clamp(3em, 5cqw, 3.5em) 0 clamp(3em, 5cqw, 3.5em);
  font-size: clamp(12px, 2.2cqw, 16px);
  line-height: clamp(32px, 6cqw, 40px);
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
}

.input-text::placeholder {
  color: #999;
  font-size: 1em;
  opacity: 0.7;
}

.input-text:focus {
  border-color: #000;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.input-text:hover:not(:focus) {
  border-color: #333;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* 发送按钮现在直接在容器中，不需要单独的容器 */

/* 上传按钮 - 小回形针图标 - Flex 布局 - 无边框 */
.upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(32px, 6cqw, 40px);
  height: clamp(32px, 6cqw, 40px);
  min-width: clamp(32px, 6cqw, 40px);
  min-height: clamp(32px, 6cqw, 40px);
  aspect-ratio: 1;
  padding: 0;
  border: none;
  background: transparent;
  color: #0f0f0f;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
  box-sizing: border-box;
  box-shadow: none;
  flex-shrink: 0;
  overflow: hidden;
  outline: none;
  position: absolute;
  left: clamp(12px, 2.5cqw, 16px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.upload-btn svg {
  width: clamp(12px, 2cqw, 14px);
  height: clamp(12px, 2cqw, 14px);
  flex-shrink: 0;
}

/* 发送按钮 - 圆形图标按钮 - Flex 布局 - 自动缩放 - 纵向对齐 */
.send-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(32px, 6cqw, 40px);
  height: clamp(32px, 6cqw, 40px);
  min-width: clamp(32px, 6cqw, 40px);
  min-height: clamp(32px, 6cqw, 40px);
  padding: 0;
  border-radius: 50%;
  border: 2px solid #0f0f0f;
  background: #ffffff;
  color: #0f0f0f;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
  overflow: hidden;
  aspect-ratio: 1;
  position: absolute;
  right: clamp(12px, 2.5cqw, 16px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.upload-btn svg,
.send-btn svg {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.send-btn svg {
  width: clamp(14px, 2.5cqw, 18px);
  height: clamp(14px, 2.5cqw, 18px);
  flex-shrink: 0;
}

.upload-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.send-btn:hover {
  background: #f8f8f8;
  border-color: #000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.upload-btn:hover svg,
.send-btn:hover svg {
  transform: scale(1.1);
}

.upload-btn:active {
  background: rgba(0, 0, 0, 0.1);
}

.send-btn:active {
  background: #f0f0f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.send-btn:disabled {
  color: #aaa;
  border-color: #ccc;
  background: #f5f5f5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.6;
}

.send-btn:not(:disabled) {
  background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%);
}

.send-btn:not(:disabled):hover {
  background: linear-gradient(135deg, #f8f8f8 0%, #f0f0f0 100%);
}

.file-input {
  display: none;
}

/* 按钮文字样式优化 - 自动缩放 */
.upload-btn span {
  font-weight: 500;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 焦点可见性增强 */
.input-text:focus-visible,
.upload-btn:focus-visible,
.send-btn:focus-visible {
  outline: 2px solid #0f0f0f;
  outline-offset: 2px;
}

/* 加载状态（未来可扩展） */
.send-btn:disabled::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.05);
  border-radius: inherit;
}

/* 平滑滚动 */
.input-container {
  scroll-behavior: smooth;
}

/* 响应式：小屏幕优化 - 自动缩放 - Flex 布局 */
@media (max-width: 480px) {
  .input-text {
    flex: 1;
    width: 100%;
    max-width: 100%;
    padding: 0 clamp(2.6em, 4.5cqw, 3em) 0 clamp(2.6em, 4.5cqw, 3em);
    font-size: clamp(11px, 2cqw, 15px);
  }
  
  .upload-btn {
    width: clamp(28px, 5.5cqw, 36px);
    height: clamp(28px, 5.5cqw, 36px);
    min-width: clamp(28px, 5.5cqw, 36px);
    min-height: clamp(28px, 5.5cqw, 36px);
    left: clamp(10px, 2cqw, 14px);
  }
  
  .upload-btn svg {
    width: clamp(10px, 1.8cqw, 12px);
    height: clamp(10px, 1.8cqw, 12px);
  }
  
  .send-btn {
    width: clamp(28px, 5.5cqw, 36px);
    height: clamp(28px, 5.5cqw, 36px);
    min-width: clamp(28px, 5.5cqw, 36px);
    min-height: clamp(28px, 5.5cqw, 36px);
    right: clamp(10px, 2cqw, 14px);
  }
  
  .send-btn svg {
    width: clamp(12px, 2.2cqw, 16px);
    height: clamp(12px, 2.2cqw, 16px);
  }
}

/* 超小屏幕：只显示图标 */
@media (max-width: 320px) {
  .upload-btn,
  .send-btn {
    padding: 0.7em;
  }
}
