/*
Theme Name: 雅名录
Theme URI: https://your-domain.com
Author: 雅名录
Author URI: https://your-domain.com
Description: 新生儿取名、宝宝取名字的内容站主题，含名字库自定义类型与小程序引流二维码。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Text Domain: yml
*/

/* ============ 基础 ============ */
:root {
  --bg: #faf9f7;
  --text: #292524;
  --muted: #78716c;
  --border: #e7e5e4;
  --accent: #e11d48;
  --accent-dark: #be123c;
  --card: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }

.container {
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ============ 顶部导航 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(231, 229, 228, 0.8);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  padding-bottom: 10px;
}
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand-name { font-size: 20px; font-weight: 700; color: #1c1917; }
.brand-sub { display: none; font-size: 12px; color: var(--muted); }
.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.main-nav a {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: #44403c;
}
.main-nav a:hover { background: #f5f5f4; color: #1c1917; }
@media (min-width: 640px) { .brand-sub { display: inline; } }

/* ============ 面包屑 + 右侧二维码 ============ */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.page-head-main { min-width: 0; }
.breadcrumb { font-size: 14px; color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: #1c1917; }
.breadcrumb .sep { margin: 0 6px; color: #d6d3d1; }

/* ============ 二维码卡片 ============ */
.qr-card {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--card);
  border: 1px solid #ffe4e6;
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.qr-card svg { display: block; width: 80px; height: auto; border-radius: 6px; }
.qr-card .qr-title { margin-top: 8px; font-size: 12px; font-weight: 600; color: #1c1917; white-space: nowrap; }
.qr-card .qr-sub { margin-top: 2px; font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ============ Hero ============ */
.hero {
  position: relative;
  border-radius: 24px;
  background: linear-gradient(135deg, #fff1f2 0%, #ffffff 45%, #fffbeb 100%);
  padding: 48px 24px;
  text-align: center;
}
.hero .hero-qr { position: absolute; right: 16px; top: 16px; display: none; }
.hero h1 { margin: 0; font-size: 30px; font-weight: 700; color: #1c1917; }
.hero .hero-sub { margin-top: 12px; font-size: 16px; color: #57534e; }
.hero .hero-desc { margin: 16px auto 0; max-width: 640px; font-size: 14px; color: var(--muted); }
.hero .hero-actions { margin-top: 28px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
@media (min-width: 640px) {
  .hero h1 { font-size: 36px; }
  .hero .hero-qr { display: block; }
}

/* ============ 按钮 ============ */
.btn { display: inline-flex; align-items: center; padding: 10px 24px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.btn-dark { background: #1c1917; color: #fff; }
.btn-dark:hover { background: #44403c; color: #fff; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }

/* ============ 区块 ============ */
.section { margin-top: 40px; }
.section-title { margin: 0; font-size: 18px; font-weight: 700; color: #1c1917; }
.section-head { display: flex; align-items: center; justify-content: space-between; }
.section-more { font-size: 14px; color: var(--accent); }

/* ============ 名字网格 / 卡片 ============ */
.name-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.name-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.name-card:hover { border-color: #fda4af; box-shadow: 0 6px 16px rgba(0,0,0,.06); transform: translateY(-2px); color: inherit; }
.name-card .nc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.name-card .nc-name { font-size: 24px; font-weight: 700; color: #1c1917; }
.name-card:hover .nc-name { color: var(--accent); }
.name-card .nc-gender { flex: 0 0 auto; padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.name-card .nc-pinyin { margin-top: 4px; font-size: 12px; color: #a8a29e; }
.name-card .nc-meaning { margin-top: 8px; font-size: 14px; color: #57534e; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.name-card .nc-tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.name-card .nc-tag { padding: 2px 8px; border-radius: 6px; background: #f5f5f4; font-size: 12px; color: var(--muted); }
.g-male { background: #e0f2fe; color: #0369a1; }
.g-female { background: #ffe4e6; color: #be123c; }
.g-neutral { background: #f5f5f4; color: #57534e; }
@media (min-width: 768px) { .name-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .name-grid { grid-template-columns: repeat(4, 1fr); } }

/* ============ 文章卡片 ============ */
.article-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
.article-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.article-card:hover { border-color: #fda4af; box-shadow: 0 6px 16px rgba(0,0,0,.06); transform: translateY(-2px); color: inherit; }
.article-card .ac-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #a8a29e; }
.article-card .ac-cat { padding: 2px 8px; border-radius: 6px; background: #f5f5f4; color: var(--muted); }
.article-card .ac-title { margin-top: 8px; font-size: 18px; font-weight: 600; color: #1c1917; }
.article-card:hover .ac-title { color: var(--accent); }
.article-card .ac-summary { margin-top: 6px; font-size: 14px; color: #57534e; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 640px) { .article-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============ 页面标题 ============ */
.page-title { margin: 16px 0 0; font-size: 24px; font-weight: 700; color: #1c1917; }
.page-desc { margin: 8px 0 0; font-size: 14px; color: var(--muted); }

/* ============ 筛选 / 分类 chips ============ */
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: center; }
.chips-label { font-size: 14px; color: var(--muted); }
.chip {
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 14px;
  color: #57534e;
}
.chip:hover { border-color: #fda4af; color: var(--accent); }
.chip.current { background: #1c1917; color: #fff; border-color: #1c1917; }

/* ============ 首页「按需求选名字」分类卡片 ============ */
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
.cat-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
.cat-male { background: #f0f9ff; border-color: #e0f2fe; color: #0369a1; }
.cat-female { background: #fff1f2; border-color: #ffe4e6; color: #be123c; }
.cat-plain { background: #ffffff; border-color: var(--border); color: #44403c; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }

/* ============ 首页「出处 / 热门」标签 ============ */
.home-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.home-chips .label { font-size: 14px; color: var(--muted); }
.home-chip { padding: 3px 12px; border-radius: 999px; font-size: 12px; }
.home-chip.gray { background: #f5f5f4; color: #57534e; }
.home-chip.hot { background: #fff1f2; color: #e11d48; }
.home-chip:hover { opacity: 0.85; }

/* ============ 名字详情 ============ */
.name-detail-head {
  margin-top: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
}
.name-detail-head h1 { margin: 0; font-size: 36px; font-weight: 700; color: #1c1917; }
.name-detail-head .nd-pinyin { font-size: 16px; color: #a8a29e; }
.name-detail-head .nd-badges { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.nd-badge { padding: 4px 12px; border-radius: 999px; background: #f5f5f4; color: #57534e; }
.nd-badge.wuxing { background: #fef3c7; color: #b45309; }
.name-detail-head .nd-meaning { margin-top: 20px; font-size: 18px; color: #44403c; }

.name-info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 16px; }
.name-info { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }
.name-info .ni-label { font-size: 12px; color: #a8a29e; }
.name-info .ni-value { margin-top: 2px; font-size: 14px; font-weight: 500; color: #292524; }

.name-section { margin-top: 16px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 24px; }
.name-section h2 { margin: 0; font-size: 18px; font-weight: 700; color: #1c1917; }
.name-section .ns-body { margin-top: 12px; color: #44403c; white-space: pre-line; line-height: 1.9; }

/* ============ 小程序 CTA ============ */
.mini-cta {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  background: linear-gradient(135deg, #fff1f2 0%, #ffffff 50%, #fffbeb 100%);
  border: 1px solid #ffe4e6;
  border-radius: 16px;
  padding: 24px;
}
.mini-cta .mc-text { text-align: center; }
.mini-cta .mc-text h2 { margin: 0; font-size: 20px; font-weight: 700; color: #1c1917; }
.mini-cta .mc-text p { margin: 8px 0 0; font-size: 14px; color: #57534e; }
.mini-cta .mc-text a { margin-top: 16px; }
@media (min-width: 640px) {
  .mini-cta { flex-direction: row; justify-content: space-between; }
  .mini-cta .mc-text { text-align: left; }
}

/* ============ 文章正文 ============ */
.prose { margin-top: 32px; font-size: 16px; color: #292524; line-height: 1.9; }
.prose h2 { margin: 28px 0 12px; font-size: 22px; font-weight: 700; color: #1c1917; }
.prose h3 { margin: 24px 0 10px; font-size: 18px; font-weight: 700; color: #1c1917; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 24px; }
.prose li { margin: 4px 0; }
.prose a { color: var(--accent); }
.prose a:hover { text-decoration: underline; }
.prose strong { color: #1c1917; }
.prose blockquote { margin: 16px 0; padding: 8px 16px; border-left: 3px solid var(--accent); background: #fff1f2; color: #57534e; }

/* ============ 单篇文章头 ============ */
.post-head { margin-top: 24px; }
.post-head .ph-meta { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #a8a29e; }
.post-head .ph-cat { padding: 2px 10px; border-radius: 6px; background: #f5f5f4; color: #57534e; }
.post-head h1 { margin: 12px 0 0; font-size: 30px; line-height: 1.4; font-weight: 700; color: #1c1917; }
.post-head .ph-summary { margin-top: 12px; font-size: 16px; color: var(--muted); }

/* ============ 分页 ============ */
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 40px; }
.pagination .page-numbers { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); font-size: 14px; color: #57534e; }
.pagination .page-numbers.current { background: #1c1917; color: #fff; border-color: #1c1917; }
.pagination .page-numbers:hover { background: #f5f5f4; color: #1c1917; }

/* ============ 页脚 ============ */
.site-footer { margin-top: 64px; border-top: 1px solid var(--border); background: #fafaf9; }
.site-footer .footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  padding: 40px 16px;
}
.site-footer h3 { margin: 0 0 12px; font-size: 16px; font-weight: 700; color: #1c1917; }
.site-footer .footer-about p { margin: 4px 0; font-size: 14px; color: var(--muted); }
.site-footer .footer-nav a { display: block; margin: 6px 0; font-size: 14px; color: #57534e; }
.site-footer .footer-copy { border-top: 1px solid var(--border); padding: 16px; text-align: center; font-size: 12px; color: #a8a29e; }
@media (min-width: 640px) { .site-footer .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; } }

/* ============ 其他 ============ */
.screen-reader-text { border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; }
.aligncenter { display: block; margin: 0 auto; }
