.home { max-width: 960px; margin: 0 auto; padding: 32px 16px 64px; }
.home h1 { text-align: center; margin: 0 0 24px; font-size: 1.8rem; color: #3d3226; }

.search-wrap {
  position: relative;
  max-width: 520px;
  margin: 0 auto 8px;
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  line-height: 1;
  pointer-events: none;
  opacity: .7;
}
#search {
  display: block;
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1px solid #ddcfb3;
  border-radius: 12px;
  background: #f9f3e3;
  color: #3d3226;
  font-size: 1rem;
  transition: border-color .15s, box-shadow .15s;
}
#search::placeholder { color: #8a7a5f; }
#search:focus {
  outline: none;
  border-color: #b08a5a;
  box-shadow: 0 0 0 3px rgba(176, 138, 90, .22);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
}
.tabs button {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #ddcfb3;
  background: #f9f3e3;
  color: #6b5d47;
  font-size: .85rem;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.tabs button:hover { border-color: #c4b48f; }
.tabs button.active {
  background: #8a5a2b;
  border-color: #8a5a2b;
  color: #fdf8ec;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: 14px;
}
.card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px;
  border: 1px solid #ddcfb3;
  border-radius: 14px;
  background: #f9f3e3;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s, transform .15s, background .15s;
  /* 保证卡片在网格中高度对齐 */
  min-height: 120px; 
}
.card:hover {
  border-color: #b08a5a;
  background: #fdf8ec;
  box-shadow: 0 6px 20px rgba(138, 90, 43, .12);
  transform: translateY(-2px);
}
.card[hidden] { display: none; }

.emoji { font-size: 1.8rem; line-height: 1; margin-bottom: 2px; }

.name { 
  font-weight: 600; 
  font-size: 1rem; 
  color: #3d3226; 
  width: 100%;
  /* 标题强制单行，超出显示省略号 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desc { 
  font-size: .82rem; 
  color: #6b5d47; 
  width: 100%;
  /* 描述限制双行，超出显示省略号 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

#empty { text-align: center; color: #8a7a5f; margin-top: 32px; }

/* 优化搜索框右侧自带的小叉号颜色 */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  height: 14px;
  width: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238a7a5f'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'/%3E%3C/svg%3E") no-repeat center;
  cursor: pointer;
}

@media (max-width: 420px) {
  #search { font-size: .92rem; padding-left: 38px; }
  .search-icon { left: 12px; font-size: .95rem; }
}