* {
  margin: 0;
  padding: 0;
  outline: none;
  box-sizing: border-box;
}

body {
  background-color: #FFF;
}

/* 
  #search-form 是整个搜索表单的外层容器。
  通过设置它的 width、text-align和 padding 属性，我们让它居中显示在浏览器窗口中。
*/
#search-form {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 39%;
  height: 38px;
  background-color: #ffffff7c;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/*
  #search-engine, #search-keyword, #search-button 分别是搜索引擎选择下拉菜单、搜索关键字输入框和搜索按钮。
  通过设置它们的 display 属性，并给它们设置相应的宽度，我们将它们做成一个单一的容器，使它们一起居中显示
*/
#search-engine,
#search-keyword,
#search-button {
  display: inline-block;
  width: 15%;
  border: 1px solid #ccc;
  border-radius: 20px;
  padding: 10px;
  transition: all 1s;
}
#search-engine{
  background-color: rgba(255,255,255,0);
  border: none;
}

/*
  #search-keyword 元素是搜索关键字输入框。
  通过给它设置 flex:1 属性，
  我们让它随着其它兄弟元素的变化而自动调整宽度.
  通过给它设置 transition 属性，
  我们让它在修改宽度时，有一个平滑的过渡效果
*/
#search-keyword {
  width: 60%;
  transition: all 1s;
  border-radius: 0px;
  opacity: 0.8;
  background-color: rgba(0, 0, 0, 0.5);
  margin: 0 auto;
}

#search-button {
  background-color: rgba(0, 0, 0, 0);
}

/*
#search-keyword:hover 元素是鼠标悬停在 #search-keyword 元素上时的样式。
通过给它设置 width 和 background-color 属性，
我们让它的宽度在鼠标悬停时从 30% 增长到 250px，
同时背景色从 rgba(0, 0, 0, 0.5) 增强到 rgba(255, 255, 255, 0.5)，
有渐变的效果。
*/
#search-keyword:hover {
  width: 260px;
  background-color: rgba(255, 255, 255, 0.5);
  transform: scaleX(1.2);
  }

