/* ============ 页头与搜索 ============ */
.cat-toolbar .page-head { margin-bottom: 0; }

.cat-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: #fff;
  border: 1px solid var(--line);
  min-width: 220px;
  transition: border-color var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease);
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 107, 255, .12); }
.search-box .ic { width: 17px; height: 17px; color: var(--muted); }
.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
}
.search-box input::placeholder { color: #9AAABD; }
@media (max-width: 767px) {
  .search-box { width: 100%; min-width: 0; }
}

/* ============ 分类板块 ============ */
.cat-section {
  padding-top: 30px;
  margin-top: 34px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 88px;
}
.cat-section:first-of-type { border-top: 0; margin-top: 24px; padding-top: 0; }

.cat-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }

.cat-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 13px;
  display: grid;
  place-items: center;
}
.cat-icon .ic { width: 24px; height: 24px; }

.cat-section[data-type="idle"] .cat-icon { background: var(--primary-soft); color: var(--primary); }
.cat-section[data-type="click"] .cat-icon { background: #FFEBDD; color: #D96A14; }
.cat-section[data-type="raise"] .cat-icon { background: #E2F3E8; color: #1F7A4C; }
.cat-section[data-type="puzzle"] .cat-icon { background: #EAE7FF; color: #4B3FBF; }
.cat-section[data-type="level"] .cat-icon { background: #FFE7EA; color: #BC3B57; }

.cat-title { font-size: 19px; color: var(--primary-deep); }
.cat-note { margin-top: 2px; font-size: 12px; color: var(--muted); }

.cat-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.cat-count strong { color: var(--primary-deep); font-weight: 600; }

@media (max-width: 767px) {
  .cat-icon { width: 40px; height: 40px; border-radius: 11px; }
  .cat-icon .ic { width: 21px; height: 21px; }
  .cat-title { font-size: 17px; }
  .cat-section { padding-top: 24px; margin-top: 26px; }
}

/* 从首页跳进来时的高亮 */
.cat-section.is-target { animation: cat-flash 1.8s var(--ease); }
@keyframes cat-flash {
  0% { box-shadow: 0 0 0 0 rgba(47, 107, 255, 0); }
  22% { box-shadow: 0 -0 0 12px rgba(47, 107, 255, .10); }
  100% { box-shadow: 0 0 0 0 rgba(47, 107, 255, 0); }
}

/* ============ 卡片网格 ============ */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 1023px) { .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .game-grid { grid-template-columns: 1fr; }
  .game-card { padding: 16px; gap: 10px; }
  .gc-desc { min-height: 0; }
  .gc-icon { width: 42px; height: 42px; border-radius: 11px; }
  .gc-icon .ic { width: 23px; height: 23px; }
  .gc-name { font-size: 15px; }
}

.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border-radius: var(--r-card);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  transition: transform var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease), border-color var(--t-mid) var(--ease);
  animation: card-in var(--t-slow) var(--ease) both;
}
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-2);
  border-color: #A9CBFF;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.gc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }

.gc-icon {
  width: 48px; height: 48px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #EDF4FF, #DAE8FF);
  color: var(--primary);
  transition: transform var(--t-mid) var(--ease);
}
.gc-icon .ic { width: 26px; height: 26px; }
.game-card:hover .gc-icon { transform: translateY(-1px) scale(1.04); }

.fav-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  color: #A9B9CC;
  transition: color var(--t-mid) var(--ease), background-color var(--t-mid) var(--ease);
  position: relative;
  z-index: 2;
}
.fav-btn .ic { width: 18px; height: 18px; }
.fav-btn:hover { background: #F2F7FF; color: var(--primary); }
.fav-btn.is-on { color: var(--accent); }
.fav-btn.is-on .ic { fill: rgba(255, 122, 26, .12); }

.gc-name { font-size: 16px; font-weight: 600; color: var(--primary-deep); }
.gc-desc {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
  min-height: 44px;
}

.gc-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.dots { display: inline-flex; align-items: center; gap: 4px; }
.dots i {
  width: 9px; height: 9px;
  border-radius: 3px;
  background: #E3ECFA;
  border: 1px solid #D2E0F5;
}
.dots i.on { background: var(--primary); border-color: var(--primary); }
.dots .dot-label { font-size: 11px; color: var(--muted); margin-left: 4px; }

.gc-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--r-card);
}

.no-result { padding: 56px 16px; text-align: center; color: var(--muted); font-size: 13px; }
