/* ===== 底部输入栏 ===== */
.composer {
  border-top: 1px solid var(--border);
  padding: 12px;
  background: var(--card-bg-soft);
}

/* ===== Gemini 风格输入区域 ===== */
.composer-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.composer-box:focus-within {
  border-color: rgba(17, 24, 39, 0.25);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.image-preview-area {
  padding: 10px 12px 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.preview-item {
  position: relative;
  display: inline-flex;
}

.preview-item img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
}

.preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.preview-remove:hover {
  background: rgba(0, 0, 0, 0.8);
}

.image-count-badge {
  font-size: 12px;
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.04);
  user-select: none;
  white-space: nowrap;
}

.composer-box textarea#question {
  width: 100%;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  resize: none;
  padding: 12px 12px 4px;
  min-height: 44px;
  max-height: 180px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-main);
  background: transparent;
  border-radius: 0;
}

.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 6px;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 2px;
}

.toolbar-right {
  display: flex;
  align-items: center;
}

.toolbar-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.toolbar-icon-btn:hover {
  background: #f3f4f6;
  color: var(--text-main);
}

.toolbar-icon-btn.active {
  border-color: #2563eb;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.06);
}

.toolbar-icon-btn:disabled,
.toolbar-icon-btn.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.toolbar-icon-btn svg {
  flex-shrink: 0;
}

.send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.06s ease, opacity 0.2s ease;
  flex-shrink: 0;
}

.send-btn:active {
  transform: translateY(1px);
}

.send-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* 兼容旧式表单辅助样式 */
.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.hint {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: rgba(31, 41, 55, 0.55);
}

.kbd {
  border: 1px solid var(--border);
  background: var(--card-bg);
  padding: 2px 6px;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11px;
  color: rgba(31, 41, 55, 0.75);
}

/* 手机：输入框字号 16px，避免 iPhone 聚焦时自动放大页面 */
@media (max-width: 640px) {
  .composer {
    padding: 8px;
  }

  .composer-box textarea#question {
    font-size: 16px;
  }
}
