/* --- Input Area --- */
.input-area {
  display: flex;
  flex-direction: column; /* 垂直排列 toolbar 与输入框 */
  align-items: stretch;   /* 子元素宽度撑满 */
  gap: var(--padding-sm);  /* 上下间距 */
  padding: var(--padding-md) 24px; /* 调整内边距 */
  
  border-radius: var(--radius-lg); /* 底部工具栏圆角37px */
  background: transparent;
  
}

#user-input {
  flex-grow: 1;
  padding: 16px 22px; /* 增加内边距 */
  background: var(--unified-glass); /* 统一玻璃背景 */
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1.5px solid var(--unified-border); /* 统一边框 */
  border-radius: var(--radius-lg); /* unified curvature */
  color: #1a1a1a; /* 深色文字确保在白色背景下可见 */
  font-family: var(--font-family-main);
  font-size: 1.05em; /* 增加字体大小 */
  font-weight: 500; /* 增加字体重量，更显眼 */
  min-height: 58px; /* 调整高度 */
  max-height: 180px;
  overflow-y: auto;
  outline: none;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, color 0.3s ease; /* Smooth transitions */
  box-shadow:
    inset 0px 2px 4px rgba(255,255,255,0.25),
    0 12px 30px rgba(0,0,0,0.2); /* Brighter inner highlight & softer outer shadow */
  letter-spacing: 0.3px; /* 增加字间距 */
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  resize: none;
}

#user-input::placeholder {
  color: rgba(26, 26, 26, 0.7); /* 增加占位符对比度 */
  opacity: 1; /* Ensure placeholder is visible */
  font-style: normal;
  font-weight: 500; /* 增加占位符字体重量 */
}

#user-input:focus {
  background: var(--unified-glass); /* 统一聚焦背景 */
  opacity: 0.9;
  border-color: var(--accent); /* 使用主题色 */
  color: var(--unified-text); /* 统一文字色 */
  box-shadow:
    0 0 0 2px rgba(0, 123, 255, 0.25), /* 统一发光效果 */
    inset 0px 1px 2px rgba(255,255,255,0.18),
    0 25px 45px -15px rgba(0,0,0,0.3);
}

/* --- Buttons --- */
#send-button, .icon-button {
  padding: 12px;
  background: var(--accent);
  color: var(--button-text);
  border: none;
  border-radius: var(--radius-lg); /* 圆形按钮改为大圆角 */
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-normal);
  flex-shrink: 0;
  width: 58px; /* 调整尺寸 */
  height: 58px;
  box-shadow: 0 3px 10px rgba(0, 123, 255, 0.25); /* 调整阴影 */
  position: relative;
  overflow: hidden;
}

#send-button::before, .icon-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-hover);
  opacity: 0;
  transition: var(--transition-normal);
}

#send-button:hover::before, .icon-button:hover::before { opacity: 1; }

#send-button:hover, .icon-button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 5px 15px rgba(0, 123, 255, 0.35);
}

.icon-button {
  background: rgba(0, 0, 0, 0.03); /* 图标按钮浅色背景 */
  
  color: var(--text-secondary);
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.icon-button:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-primary);
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.footer-toolbar {
  display: flex;
  align-items: center;
  gap: var(--padding-md);
  width: max-content;      /* 自动内容宽度 */
  margin: 0 auto;          /* 水平居中 */
  padding: 0;              /* 移除额外内边距 */
  background: transparent; /* 去掉背景 */
  border: none;            /* 去掉边框 */
  position: relative;
}

.footer-toolbar > * {
  border-radius: var(--radius-lg);
}

.footer-toolbar select,
.footer-toolbar .icon-button,
.footer-toolbar .mode-switch {
  padding: 6px 12px;
  background: var(--background-solid);
  
  cursor: pointer;
}

.footer-toolbar .pill-active {
  background: var(--accent);
  color: var(--button-text);
}

.footer-input-group {
  width: 100%; /* 文本框区域宽度撑满，位于 toolbar 之下 */
}

.footer-input-group textarea {
  width: 100%;
  
  border-radius: var(--radius-lg);
  padding: var(--padding-sm);
  background: var(--input-bg);
  color: var(--text-primary);
  resize: none;
  font-size: 1em;
}

/* Specific styles for the retry button */
#retry-last-input-button:active {
  transform: scale(0.95); /* Slightly shrink on click, combines with existing hover transform if applicable */
}

#retry-last-input-button svg {
  width: 20px; /* Match button attributes */
  height: 20px; /* Match button attributes */
  display: block; /* Helps with alignment */
  margin: auto; /* Center if button padding is uniform and flex properties are active */
}
