/* Emojipedia 中文站 - 主样式 */
:root {
  --brand: #5661f0;
  --brand-dark: #3f4ae0;
  --bg: #f7f8fc;
  --card: #ffffff;
  --text: #1a1d29;
  --text-2: #6b7280;
  --border: #e5e7eb;
  --radius: 12px;
  --emoji-font: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
code { font-family: ui-monospace, Consolas, monospace; background: #f1f2f7; padding: 2px 6px; border-radius: 6px; font-size: .9em; }

/* 头部 */
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { font-size: 1.15rem; font-weight: 800; color: var(--brand); }
.logo span { color: var(--text); font-weight: 600; }
.top-nav { display: flex; gap: 22px; font-size: .92rem; color: var(--text-2); }
.top-nav a:hover { color: var(--brand); }

/* Hero */
.hero { text-align: center; padding: 56px 0 40px; background: linear-gradient(180deg, #eef0ff 0%, var(--bg) 100%); }
.hero h1 { font-size: clamp(1.5rem, 4vw, 2.3rem); margin-bottom: 10px; }
.hero .sub { color: var(--text-2); margin-bottom: 26px; }
.search-box { position: relative; max-width: 620px; margin: 0 auto; }
.search-box input {
  width: 100%; height: 52px; border: 2px solid var(--brand); border-radius: 14px;
  padding: 0 20px; font-size: 1rem; outline: none; background: #fff;
}
.search-results {
  position: absolute; left: 0; right: 0; top: 58px; background: #fff;
  border-radius: var(--radius); box-shadow: 0 10px 32px rgba(0,0,0,.12);
  max-height: 420px; overflow-y: auto; text-align: left; z-index: 60;
}
.search-results .sr-item { display: flex; align-items: center; gap: 10px; padding: 9px 16px; }
.search-results .sr-item:hover { background: #f3f4ff; }
.search-results .glyph { font-family: var(--emoji-font); font-size: 1.35rem; width: 34px; text-align: center; }
.hot-words { margin-top: 16px; color: var(--text-2); font-size: .9rem; }
.hot-words a { display: inline-block; margin: 0 6px; color: var(--brand); }

/* 分区通用 */
.section { padding: 30px 0 10px; }
.section h2 { font-size: 1.25rem; margin-bottom: 16px; }
.section h2 small { color: var(--text-2); font-weight: 400; font-size: .85em; }

/* 分类宫格 */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.group-card {
  background: var(--card); border-radius: var(--radius); padding: 18px 16px;
  display: flex; flex-direction: column; gap: 4px; border: 1px solid transparent;
  transition: all .15s;
}
.group-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: 0 6px 18px rgba(86,97,240,.12); }
.g-name { font-weight: 700; }
.g-count { font-size: .82rem; color: var(--text-2); }

/* emoji 网格 */
.emoji-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px;
}
.new-hint { font-size: .82rem; color: var(--text-2); margin-bottom: 14px; }
.cv-auto { content-visibility: auto; contain-intrinsic-size: auto 600px; }
.emoji-card {
  background: var(--card); border-radius: var(--radius); padding: 14px 6px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: transform .12s, box-shadow .12s; cursor: pointer;
}
.emoji-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.09); }
.emoji-card .glyph { font-family: var(--emoji-font); font-size: 2.1rem; line-height: 1.15; }
.emoji-card .name {
  font-size: .74rem; color: var(--text-2); text-align: center;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 卡片右上角复制角标 */
.emoji-card { position: relative; }
.copy-badge {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px; border-radius: 8px;
  border: none; background: #eef0ff; color: var(--brand-dark);
  font-size: .82rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s, background .15s;
}
.emoji-card:hover .copy-badge { opacity: 1; }
.copy-badge:hover { background: var(--brand); color: #fff; }
.copy-badge.ok { background: #16a34a; color: #fff; opacity: 1; }
/* 移动端无 hover，常显 */
@media (hover: none) {
  .copy-badge { opacity: 1; }
}

.load-more { text-align: center; margin: 14px 0 24px; }
.btn-more {
  border: 1px solid var(--brand); color: var(--brand); background: #fff;
  padding: 8px 28px; border-radius: 999px; cursor: pointer; font-size: .9rem;
}
.btn-more:hover { background: var(--brand); color: #fff; }
.btn-more[disabled] { opacity: .45; cursor: default; }

/* 详情页 */
.detail-main { padding-top: 30px; }
.showcase { text-align: center; margin-bottom: 26px; }
.glyph-stage {
  font-family: var(--emoji-font);
  font-size: 110px; line-height: 1.2;
  background: #f0f1f7; border-radius: 22px;
  width: 200px; height: 200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.tone-switcher { margin-top: 16px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.tone-btn {
  font-family: var(--emoji-font); font-size: 1.6rem; line-height: 1;
  background: #fff; border: 2px solid var(--border); border-radius: 10px;
  padding: 8px 10px; cursor: pointer;
}
.tone-btn.active { border-color: var(--brand); background: #eef0ff; }
.copy-row { margin-top: 16px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.btn-copy {
  background: var(--brand); color: #fff; border: none; border-radius: 10px;
  padding: 9px 20px; font-size: .88rem; cursor: pointer;
}
.btn-copy:hover { background: var(--brand-dark); }
.btn-copy.ok { background: #16a34a; }

.head-info { text-align: center; margin-bottom: 26px; }
.head-info h1 { font-size: 1.7rem; }
.en-name { color: var(--text-2); margin-top: 4px; }
.kw-chips { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { background: #eef0ff; color: var(--brand-dark); border-radius: 999px; padding: 3px 13px; font-size: .82rem; }

.meta-table { background: var(--card); border-radius: var(--radius); padding: 8px 20px; margin-bottom: 26px; }
.meta-table table { width: 100%; border-collapse: collapse; }
.meta-table th {
  text-align: right; vertical-align: top; padding: 12px 16px; color: var(--text-2);
  font-weight: 500; white-space: nowrap; width: 130px; border-bottom: 1px solid #f1f2f7;
}
.meta-table td { padding: 12px 0; border-bottom: 1px solid #f1f2f7; word-break: break-all; }
.meta-table tr:last-child th, .meta-table tr:last-child td { border-bottom: none; }
.btn-mini {
  border: none; background: #eef0ff; color: var(--brand-dark); font-size: .75rem;
  padding: 3px 10px; border-radius: 6px; cursor: pointer; margin-left: 8px;
}
.btn-mini.ok { background: #dcfce7; color: #15803d; }

.meaning { background: var(--card); border-radius: var(--radius); padding: 20px; margin-bottom: 26px; }
.meaning h2 { font-size: 1.05rem; margin-bottom: 10px; }
.meaning p { color: #374151; margin-bottom: 6px; }

.related h2 { font-size: 1.05rem; margin-bottom: 12px; }
.rel-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: 92px; overflow-x: auto; padding-bottom: 8px; }

/* 页脚 */
.site-footer { border-top: 1px solid var(--border); margin-top: 50px; padding: 26px 0; color: var(--text-2); font-size: .84rem; text-align: center; }
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--brand); }
.footer-links { margin-top: 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; }
.footer-links a { color: var(--text-2); font-size: .8125rem; }
.footer-links a:hover { color: var(--brand); }

@media (max-width: 640px) {
  .top-nav { gap: 14px; font-size: .85rem; }
  .glyph-stage { width: 160px; height: 160px; font-size: 88px; }
}

/* 回到顶部 */
#back-top {
  position: fixed; right: 26px; bottom: 34px; z-index: 90;
  width: 52px; height: 52px; border-radius: 50%;
  border: none; background: #fff; cursor: pointer;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 1.45rem; line-height: 1;
  box-shadow: 0 6px 18px rgba(0,0,0,.16);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: all .25s ease;
}
#back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
#back-top:hover { transform: translateY(-3px); }
