/* 容器居中，最大宽度，留白 */
body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background-color: #fafafa;
  margin: 0;
  padding: 20px 10px;
  color: #333;
}
.container {
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  padding: 25px 30px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.1);
}
h1 {
  margin-bottom: 10px;
  font-weight: 700;
  color: #ff4c4c;
}
h2 {
  margin-top: 0;
  font-weight: 600;
  color: #444;
}

/* 搜索框 */
.search-form {
  display: flex;
  margin-bottom: 15px;
}
.search-form input[type="text"] {
  flex: 1;
  padding: 10px 15px;
  font-size: 16px;
  border: 2px solid #ff4c4c;
  border-radius: 4px 0 0 4px;
  outline: none;
  transition: border-color 0.3s ease;
}
.search-form input[type="text"]:focus {
  border-color: #e63946;
}
.search-form button {
  padding: 10px 20px;
  border: none;
  background-color: #ff4c4c;
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 0 4px 4px 0;
  transition: background-color 0.3s ease;
}
.search-form button:hover {
  background-color: #e63946;
}

/* 结果网格 */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(140px,1fr));
  gap: 20px;
  margin-top: 10px;
}

/* 卡片样式 */
.result-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: #333;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.result-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 15px rgb(0 0 0 / 0.15);
}
.img-box {
  width: 100%;
  padding-top: 140%; /* 纵横比 1:1.4 */
  position: relative;
  overflow: hidden;
}
.img-box img {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-bottom: 1px solid #eee;
  border-radius: 8px 8px 0 0;
  transition: transform 0.3s ease;
}
.result-card:hover .img-box img {
  transform: scale(1.05);
}
.title {
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 无结果 */
.no-result {
  text-align: center;
  font-size: 18px;
  color: #999;
  margin-top: 30px;
}

/* 响应式 */
@media (max-width: 480px) {
  .result-grid {
    grid-template-columns: repeat(auto-fill,minmax(120px,1fr));
  }
  .search-form {
    flex-direction: column;
  }
  .search-form input[type="text"],
  .search-form button {
    border-radius: 4px;
    width: 100%;
  }
  .search-form button {
    margin-top: 10px;
  }
}
