body {
  font-family: "Segoe UI", sans-serif;
  background: #f9f9f9;
  margin: 0;
  padding: 0;
  color: #333;
}

header {
  background: #fff;
  padding: 1.5em 1em 1em;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

h1 {
  margin-bottom: 1em;
  font-size: 2em;
}

body {
	color: #333;
	font-weight: 400;
	font-family: Arial, Helvetica, sans-serif;
	line-height: 1.6;
	background:url(bg_patt.png)repeat #ededed; 
	}

#search {
  width: 90%;
  max-width: 400px;
  padding-left: 30px;
  padding-right: 30px;
  padding-top: 0.75em;
  padding-bottom: 0.75em;

  font-size: 1em;
  border: none;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 2px 3px rgba(0,0,0,0.05);
  outline: none;
  transition: all 0.3s ease;

  color: #444;
  box-sizing: border-box;
}

.tags {
  margin-top: 1em;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5em;
}

.tag-btn {
  padding: 0.5em 1.5em;          /* 上下0.75em，高度和搜索框一致 */
  font-size: 1em;                 /* 跟搜索框字体大小一致 */
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(6px);
  border: none;
  border-radius: 9999px;
  color: #444;
  cursor: pointer;
  box-shadow: inset 0 2px 3px rgba(0,0,0,0.05);
  transition: background 0.3s ease, box-shadow 0.3s ease;
  box-sizing: border-box;
  white-space: nowrap;
  line-height: normal;            /* 防止字体撑高 */
}

.tag-btn:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}


main {
  padding: 2em 1em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.5em;
  max-width: 1100px;
  margin: 0 auto;
}

.grid-item {
  position: relative;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  text-align: center;
  transition: transform 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.grid-item .label {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  padding: 0.3em 0.5em;
  font-size: clamp(0.7em, 1.5vw, 1em);
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  overflow-wrap: break-word;
  box-sizing: border-box;
}

@media (min-width: 1024px) {
  .grid-item .label {
    font-size: clamp(0.8em, 1.2vw, 1.1em);
  }
}

footer {
  background: #f2f2f2;
  text-align: center;
  padding: 1.2em;
  font-size: 0.9em;
  color: #777;
  margin-top: 2em;
}

/* 模态框样式 */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal-content {
  position: relative;
  background-color: #fff;
  padding: 1em;
  border-radius: 8px;
  max-width: 90%;
  max-height: 90%;
  text-align: center;
}

.modal-content img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 6px;
  margin-bottom: 1em;
}

.modal-content a {
  display: inline-block;
  padding: 0.5em 1em;
  background: #4caf50;
  color: white;
  text-decoration: none;
  border-radius: 5px;
  font-size: 0.9em;
}

.modal-content a:hover {
  background: #45a049;
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 40px;
  height: 40px;
  background: rgba(100, 100, 100, 0.5);
  color: #fff;
  font-size: 24px;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: rgba(100, 100, 100, 0.8);
  transform: scale(1.1);
}


.close-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(100, 100, 100, 0.6);
}


.download-button {
  display: inline-block;
  padding: 0.6em 1.2em;
  font-size: 1em;
  background-color: #007bff;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  transition: background 0.2s;
}

.download-button:hover {
  background-color: #0056b3;
}
