/* 主题 & 字体 -------------------------------------------------- */
/* 主题 & 字体 -------------------------------------------------- */


:root {
  --primary: #4caf50;
  --primary-dark: #388e3c;
  --secondary: #ff9800;
  --bg: #f7f7f7;
  --text: #333;

  /* 统一绿色渐变色值 */
  --grad-start: #a8e063;
  /* 亮绿 */
  --grad-end: #56ab2f;
  /* 深绿 */
}

@media(prefers-color-scheme:dark) {
  :root {
    --primary: #81c784;
    --primary-dark: #66bb6a;
    --secondary: #ffb74d;
    --bg: #1e1e1e;
    --text: #f0f0f0;

    --grad-start: #8bc34a;
    --grad-end: #4caf50;
  }
}

/* 基础布局 ---------------------------------------------------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0
}

body {
  font-family: "Noto Sans SC", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 90%;
  max-width: 960px;
  margin: 0 auto;
  flex: 1;
  text-align: center
}

/* 头部 -------------------------------------------------------- */
.header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
  margin-bottom: 0;
}

/* 修改：header 和 main 之间的距离由 main.marginTop 控制 */

.logo {
  width: 80px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, .1)
}

h1 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 70px;
  padding: 0 40px;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: .06em;
  background: #333;
  color: #fff;
  border-radius: 6px;
  line-height: 1;
  margin: 0;
}

@media(max-width:600px) {
  .logo {
    width: 60px
  }

  h1 {
    font-size: 1.6rem;
    padding: 10px 24px
  }
}

/* 主内容区 ---------------------------------------------------- */
main {
  margin-top: 20px;
}

/* 筛选栏 ------------------------------------------------------ */
.filter-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 10px 0;
  border-bottom: 1px solid #e0e0e0
}

.category-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px
}

/* 统一按钮基样式（特征 + 一键清空） --------------------------- */
.category-btn,
.primary-btn {
  background: linear-gradient(135deg, var(--grad-start) 0%, var(--grad-end) 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 26px;
  font-size: 15px;
  letter-spacing: .5px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
  transition: background .25s, box-shadow .25s, transform .15s, opacity .25s;
}

.category-btn:hover,
.primary-btn:hover {
  transform: translateY(-2px)
}

.category-btn:focus-visible,
.primary-btn:focus-visible {
  outline: 3px solid rgba(255, 255, 255, .6)
}

/* 【新增】按钮禁用样式 */
.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .1);
}

/* 特征按钮选中态 ------------------------------------------------ */
.category-btn.selected {
  background: var(--secondary);
  box-shadow: 0 0 8px rgba(255, 152, 0, .5);
}

.category-btn.selected::after {
  content: "✓";
  margin-left: .4em
}

/* 操作栏 ------------------------------------------------------ */
.action-bar {
  margin-top: 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px
}

.info-text {
  color: #1976d2;
  font-size: 16px;
  line-height: 1.4;
  margin: 0;
}

/* 新增：移除 action-bar 中链接的下划线 */
.action-bar a.info-text {
  text-decoration: none;
}

.action-bar a.info-text:hover {
  text-decoration: underline;
}

/* 结果栅格 ---------------------------------------------------- */
.results {
  margin-top: 20px
}

#resultList {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
  padding: 0
}

.card {
  background: #fff;
  border-radius: 12px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeIn .3s ease forwards;
  transition: transform 0.2s ease;
  /* 统一 transition */
}

.card:hover {
  transform: translateY(-2px)
}

@media(prefers-color-scheme:dark) {
  .card {
    background: #2b2b2b
  }
}

.animal-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 4px solid var(--primary);
  object-fit: cover;
  transition: transform .3s
}

.animal-avatar:hover {
  transform: scale(1.2)
}

.card span {
  margin-top: 8px;
  font-size: 1.1rem;
  font-weight: 500
}

/* 成就卡片内的小字说明 */
.card small {
  margin-top: 6px;
  opacity: 0.8;
  font-size: 0.85rem;
  /* 调整字体大小以适应卡片 */
}


@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(.95)
  }

  to {
    opacity: 1;
    transform: scale(1)
  }
}

/* 版权 -------------------------------------------------------- */
footer.copyright {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: .9rem;
  padding: 20px 0;
  color: #666;
  background: var(--bg);
  border-top: 1px solid #e0e0e0;
}

footer.copyright a:link,
footer.copyright a:visited {
  color: var(--primary);
  text-decoration: none
}

footer.copyright a:hover,
footer.copyright a:active {
  color: var(--primary-dark);
  text-decoration: underline
}

@media(max-width:600px) {
  footer.copyright {
    font-size: .8rem;
    padding: 15px 0
  }
}

/* --- 响应式适配 --- */
@media (max-width: 768px) {
  /* 移除非标准的 zoom: 0.75，改用流式布局 */

  .container {
    width: 95%;
  }

  /* 头部调整 */
  .header {
    gap: 15px;
    margin-top: 15px;
  }

  .logo {
    width: 50px;
  }

  h1 {
    font-size: 1.5rem;
    height: 50px;
    padding: 0 20px;
  }

  /* 按钮适配 */
  .category-btn,
  .primary-btn {
    padding: 8px 16px;
    font-size: 14px;
  }

  /* 结果列表：手机端改为 2 列或 3 列，视宽度而定，避免太小 */
  #resultList {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
  }

  .card {
    padding: 10px;
  }

  .animal-avatar {
    width: 60px;
    height: 60px;
    border-width: 3px;
  }

  .card span {
    font-size: 0.95rem;
    margin-top: 5px;
  }
}

/* 超小屏幕适配 (iPhone SE 等) */
@media (max-width: 375px) {
  #resultList {
    grid-template-columns: repeat(2, 1fr);
    /* 强制双列 */
  }

  h1 {
    font-size: 1.3rem;
  }
}