/* ===== 重置 ===== */
:root { --header-h: 67px; }
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
  background: #f8fafc;
  color: #1f2937;
  min-height: 100vh;
}
a { text-decoration: none; color: inherit; }

/* ===== 顶部导航 ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid #e5e7eb;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-emoji { font-size: 28px; -webkit-text-fill-color: initial; }

.search-box {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f9fafb;
  font-size: 14px;
  transition: all 0.2s;
  outline: none;
}
.search-box input:focus {
  border-color: #667eea;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}
.search-box::before {
  content: '🔍';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  opacity: 0.6;
}

/* ===== 分类导航 ===== */
.category-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 99;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}
.category-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.category-inner::-webkit-scrollbar { display: none; }
.category-list {
  display: flex;
  gap: 4px;
  padding: 8px 0;
  min-width: max-content;
}
.category-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  border: 1px solid transparent;
}
.category-item:hover {
  background: #f3f4f6;
  color: #1f2937;
}
.category-item.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(102,126,234,0.3);
}
.category-icon { font-size: 16px; }

/* ===== 主体内容 ===== */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 20px;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}
.section-count {
  background: #eef2ff;
  color: #6366f1;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
}

/* ===== Emoji 卡片网格 ===== */
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.emoji-card {
  background: #fff;
  border: 1px solid #f1f5f9;
  border-radius: 14px;
  padding: 16px 10px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.emoji-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 8px 20px rgba(99,102,241,0.12);
  transform: translateY(-2px);
}
.emoji-char {
  font-size: 36px;
  line-height: 1.2;
  display: block;
  margin-bottom: 10px;
  user-select: none;
  font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', sans-serif;
}
.emoji-name {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 34px;
}
.emoji-card.copied {
  animation: copyPulse 0.5s ease;
}
@keyframes copyPulse {
  0% { background: #fff; }
  30% { background: #dcfce7; border-color: #86efac; transform: scale(1.05); }
  100% { background: #fff; border-color: #f1f5f9; transform: translateY(-2px); }
}
.emoji-card .copied-tip {
  position: absolute;
  inset: 0;
  background: rgba(34,197,94,0.95);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  gap: 6px;
}
.emoji-card.copied .copied-tip {
  opacity: 1;
}

/* ===== 复制提示（toast） ===== */
.toast {
  position: fixed;
  top: 120px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(17,24,39,0.92);
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(10px);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast-emoji {
  font-size: 20px;
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #9ca3af;
}
.empty-state-emoji { font-size: 60px; margin-bottom: 16px; display: block; }
.empty-state-text { font-size: 15px; }

/* ===== 统计条 ===== */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(102,126,234,0.1), rgba(118,75,162,0.1));
  border: 1px solid #e0e7ff;
  border-radius: 14px;
  margin-bottom: 28px;
}
.stats-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #4b5563;
}
.stats-num {
  font-weight: 700;
  color: #6366f1;
}

/* ===== 页脚 ===== */
.footer {
  text-align: center;
  padding: 24px 20px;
  color: #9ca3af;
  font-size: 13px;
  border-top: 1px solid #e5e7eb;
  margin-top: 40px;
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  :root { --header-h: 55px; }
  .header-inner { padding: 12px 14px; }
  .logo { font-size: 18px; }
  .logo-emoji { font-size: 22px; }
  .search-box { max-width: none; }
  .category-inner { padding: 0 14px; }
  .main { padding: 16px 14px 40px; }
  .emoji-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
  }
  .emoji-card { padding: 12px 8px 10px; border-radius: 10px; }
  .emoji-char { font-size: 28px; }
  .emoji-name { font-size: 11px; min-height: 30px; }
  .section-title { font-size: 17px; }
}
