﻿:root {
  color-scheme: light;
  --text: #222;
  --muted: #8d8d8d;
  --line: #ececec;
  --hover: #f3f4f6;
  --accent: #2f7dff;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: #e8edf3;
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  display: grid;
  place-items: center;
}

.panel {
  width: min(460px, 100%);
  height: min(620px, 100%);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(28, 39, 62, 0.14);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  user-select: none;
}

.search-bar {
  padding: 12px 12px 8px;
  background: #fff;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 10px 0 12px;
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  background: #fff;
}

.search-box:focus-within {
  box-shadow: 0 0 0 3px rgba(47, 125, 255, 0.12);
}

.icon-search { color: #9aa0a8; flex: 0 0 auto; }

.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--text);
}

.search-box input::-webkit-search-cancel-button { display: none; }

.clear {
  border: 0;
  background: transparent;
  padding: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.scroller {
  flex: 1;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #d5d5d5 transparent;
}

.scroller::-webkit-scrollbar { width: 6px; }
.scroller::-webkit-scrollbar-thumb {
  background: #d8d8d8;
  border-radius: 99px;
}

.status {
  margin: 0;
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px 4px;
  padding: 4px 10px 12px;
}

.cell {
  aspect-ratio: 1;
  border: 0;
  padding: 4px;
  margin: 0;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
}

.cell:hover, .cell:focus-visible { background: var(--hover); outline: none; }
.cell.pop { transform: scale(0.92); }

.cell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  display: block;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px 8px;
  border-top: 1px solid var(--line);
}

.tab {
  height: 36px;
  min-width: 42px;
  padding: 0 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #4a4a4a;
  cursor: default;
  display: grid;
  place-items: center;
}

.tab.active {
  background: #f2f2f2;
  color: #222;
}

.tab:disabled { opacity: 0.9; }
.tab-gif {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.3px;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 58px;
  transform: translateX(-50%);
  background: rgba(32, 32, 32, 0.82);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: 8px 12px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s ease;
  white-space: nowrap;
}

.toast.show { opacity: 1; }

@media (max-width: 420px) {
  .panel { width: 100%; height: 100%; border-radius: 0; }
  .grid { grid-template-columns: repeat(5, 1fr); }
}
