/* ============ 喜名网 · 简洁现代风 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.container { max-width: 980px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶栏 ---------- */
.site-header {
  background: var(--card);
  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: 60px; }
.logo { font-size: 22px; font-weight: 700; text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 8px; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
}
/* 头部宣传语：微软正黑、右对齐、两行、字号自适应 */
.header-slogan {
  font-family: "Microsoft JhengHei", "微软正黑体", "Microsoft YaHei", sans-serif;
  text-align: right;
  font-size: clamp(13px, 1.4vw, 17px);
  line-height: 1.55;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 1px;
}

/* PC（≥901px）：夜空背景 + 满屏五角星一闪一闪，文字变白；手机端保持纯色不变 */
@media (min-width: 901px) {
  .header-slogan {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    padding: 8px 18px;
    color: #fbbf24;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
    background:
      radial-gradient(circle at 22% 30%, rgba(96, 165, 250, .4), transparent 55%),
      radial-gradient(circle at 78% 70%, rgba(147, 112, 240, .35), transparent 55%),
      linear-gradient(160deg, #16345f 0%, #24519b 55%, #3263b8 100%);
  }
  /* 两组星星（box-shadow 生成），错开 1.5s 闪烁 */
  .header-slogan::before,
  .header-slogan::after {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 1px; height: 1px;
    pointer-events: none;
    animation: star-twinkle 3s ease-in-out infinite;
  }
  .header-slogan::before {
    box-shadow:
      10px 10px 0 2.25px rgba(255,255,255,.95),
      30px 4px 0 1.65px rgba(255,255,255,.7),
      52px 14px 0 1.8px rgba(255,244,200,.9),
      74px 6px 0 2.25px rgba(255,255,255,.6),
      96px 18px 0 1.65px rgba(255,255,255,.85),
      120px 9px 0 2.25px rgba(255,255,255,.75),
      142px 15px 0 1.8px rgba(255,244,200,.9),
      164px 4px 0 1.65px rgba(255,255,255,.7),
      186px 12px 0 2.25px rgba(255,255,255,.9),
      150px 28px 0 1.65px rgba(255,255,255,.65),
      60px 30px 0 1.8px rgba(255,244,200,.85),
      100px 34px 0 2.25px rgba(255,255,255,.7);
  }
  .header-slogan::after {
    animation-delay: 1.5s;
    box-shadow:
      20px 22px 0 1.65px rgba(255,255,255,.7),
      44px 28px 0 2.25px rgba(255,255,255,.85),
      66px 8px 0 1.65px rgba(255,244,200,.8),
      88px 26px 0 2.4px rgba(255,255,255,.6),
      112px 20px 0 2.25px rgba(255,255,255,.8),
      134px 10px 0 1.65px rgba(255,255,255,.7),
      156px 24px 0 1.95px rgba(255,244,200,.9),
      178px 18px 0 1.65px rgba(255,255,255,.65),
      26px 8px 0 2.25px rgba(255,255,255,.6),
      130px 32px 0 2.4px rgba(255,255,255,.75),
      172px 30px 0 1.65px rgba(255,255,255,.6),
      8px 30px 0 1.95px rgba(255,244,200,.85);
  }
}
@keyframes star-twinkle {
  0%, 100% { opacity: .25; }
  50%      { opacity: 1; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  padding: 56px 0 40px; text-align: center;
}
.hero h1 { font-size: 34px; font-weight: 800; letter-spacing: 1px; }
.hero h1 span { color: var(--primary); }
.hero p { color: var(--text-muted); margin-top: 10px; font-size: 16px; }

/* ---------- 板块 Tab ---------- */
.tabs {
  display: flex; gap: 8px; margin: 28px 0 20px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 6px;
  box-shadow: var(--shadow);
}
.tab {
  flex: 1; padding: 12px 0; border: none; background: transparent; cursor: pointer;
  font-size: 16px; font-weight: 600; color: var(--text-muted); border-radius: 8px;
  transition: all .2s;
}
.tab:hover { color: var(--primary); }
.tab.active { background: var(--primary); color: #fff; }

/* ---------- 表单面板 ---------- */
.panel {
  display: none; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
  animation: fadeIn .3s;
}
.panel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.panel h2 { font-size: 20px; margin-bottom: 20px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.field label .tip { font-weight: 400; color: var(--text-muted); font-style: normal; font-size: 12px; }
.field input[type="text"],
.field input[type="month"],
.field select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 15px; background: #fff; color: var(--text); outline: none; transition: border .2s, box-shadow .2s;
}
.field input:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.field-wide { grid-column: 1 / -1; }

.radio-group { display: flex; gap: 12px; }
.radio {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 15px;
  transition: all .2s; background: #fff;
}
.radio input { accent-color: var(--primary); }
.radio:has(input:checked) { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 600; }

.btn {
  display: inline-block; padding: 12px 36px; border: none; border-radius: 8px;
  font-size: 16px; font-weight: 600; cursor: pointer; transition: all .2s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { background: #a5b4fc; cursor: not-allowed; }
.btn-submit { margin-top: 22px; width: 100%; }

/* ---------- 结果区 ---------- */
.result-area { margin: 28px 0 60px; }
.result-meta {
  font-size: 13px; color: var(--text-muted); margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
}
.badge-db { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
.badge-ai { background: var(--primary-light); color: var(--primary); border: 1px solid #c7d2fe; }

.result-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.result-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.result-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.result-name { font-size: 26px; font-weight: 800; color: var(--primary); letter-spacing: 4px; }
.result-tag { margin-top: 4px; font-size: 13px; color: var(--text-muted); }
.result-score { margin-top: 8px; font-size: 13px; color: #b45309; }
.result-meaning { margin-top: 10px; font-size: 14px; color: var(--text); border-top: 1px dashed var(--border); padding-top: 10px; }

/* ---------- 加载动画 ---------- */
.loading { text-align: center; padding: 40px 0; }
.spinner {
  width: 36px; height: 36px; margin: 0 auto 12px; border: 3px solid var(--primary-light);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading p { color: var(--text-muted); font-size: 14px; }

/* ---------- 错误提示 ---------- */
.error-box {
  background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c;
  padding: 16px 20px; border-radius: var(--radius); font-size: 14px;
}

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 22px 0; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; }
}

/* ============ 文章站扩展样式 ============ */

/* 面包屑 */
.breadcrumb { font-size: 13px; color: var(--text-muted); margin: 18px 0; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }

/* 分类列表页 */
.list-title { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.list-desc { color: var(--text-muted); font-size: 14px; margin-bottom: 22px; }

/* 文章列表 */
.article-list { list-style: none; }
.article-item {
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 12px; background: var(--card); transition: border-color .2s, transform .2s;
}
.article-item:hover { border-color: var(--primary); transform: translateX(3px); }
.article-item h2, .article-item h3, .article-item h4 { font-size: 15px; font-weight: 600; line-height: 1.5; }
.article-item a { color: var(--text); text-decoration: none; }
.article-item a:hover { color: var(--primary); }
.article-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* 分页 */
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 24px 0; font-size: 14px; color: var(--text-muted); }
.pager a { color: var(--primary); text-decoration: none; }

/* 空列表 / CTA */
.empty-list { background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); padding: 40px; text-align: center; color: var(--text-muted); }
.empty-list a { color: var(--primary); }

/* 分享栏（文章页）：移动端醒目入口按钮，PC 文末按钮排 */
.share-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 14px 0 4px; padding: 10px 0;
  border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border);
}
.share-bar-bottom { display: none; margin: 22px 0; }
.share-label { font-size: 13px; color: var(--text-muted); }
.share-btn {
  display: inline-block; padding: 4px 12px; font-size: 13px; line-height: 1.6;
  border: 1px solid var(--border); border-radius: 999px; background: var(--card);
  color: var(--text); text-decoration: none; cursor: pointer; transition: all .15s;
}
.share-btn:hover { border-color: var(--primary); color: var(--primary); }
.share-btn.share-wechat:hover { border-color: #09bb07; color: #09bb07; }
.share-btn.share-qq:hover { border-color: #12b7f5; color: #12b7f5; }
.share-btn.share-weibo:hover { border-color: #e6162d; color: #e6162d; }
.share-btn.share-xhs:hover { border-color: #ff2442; color: #ff2442; }
.share-btn.share-dy:hover { border-color: #161823; color: #161823; }
.share-btn.share-copy:hover { border-color: var(--primary); }

/* 移动端醒目分享入口按钮 */
.share-open-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 12px 16px; font-size: 15px; font-weight: 600;
  color: #fff; background: linear-gradient(135deg, #f59e0b, #f97316);
  border: none; border-radius: 10px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(249, 115, 22, .35);
}
.share-open-btn:active { transform: scale(.98); }

/* 移动端分享面板（底部滑出） */
.share-panel { position: fixed; inset: 0; z-index: 1000; }
.share-panel[hidden] { display: none; }
.share-panel-mask { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); }
.share-panel-body {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fff; border-radius: 18px 18px 0 0;
  padding: 18px 16px calc(14px + env(safe-area-inset-bottom));
  animation: panelUp .22s ease-out;
}
@keyframes panelUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.share-panel-title { text-align: center; font-size: 14px; color: var(--text-muted); margin-bottom: 14px; }
.share-panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.share-panel-item {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px; font-size: 15px; text-align: left;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); text-decoration: none; cursor: pointer;
}
.share-panel-item:active { background: #eef2ff; border-color: var(--primary); }
.pi-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  font-size: 13px; font-style: normal; color: #fff; font-weight: 600;
}

/* 分享弹层：全端统一全屏遮罩居中 */
.share-qr {
  position: fixed; inset: 0; z-index: 999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, .55);
}
.share-qr[hidden] { display: none; }
.share-qr-box {
  background: #fff; border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  padding: 28px 30px; text-align: center;
  max-width: 92vw; max-height: 88vh; overflow-y: auto;
}
.share-qr-box img { display: block; width: 160px; height: 160px; }
.share-qr-box p { font-size: 13px; color: var(--text-muted); margin: 10px 0; line-height: 1.7; }
.share-poster-img { display: block; width: 240px; max-width: 100%; border-radius: 10px; box-shadow: 0 4px 20px rgba(0,0,0,.15); }
.share-poster-loading { font-size: 14px; color: var(--text-muted); padding: 30px 10px; }
.share-qr-close {
  padding: 5px 22px; font-size: 13px; border: 1px solid var(--border);
  border-radius: 999px; background: #fff; cursor: pointer; margin-top: 4px;
}
.share-qr-close:hover { border-color: var(--primary); color: var(--primary); }
.share-qr-copy {
  display: block; width: 100%; margin: 4px 0 10px; padding: 9px 16px;
  font-size: 14px; border: none; border-radius: 8px;
  background: #09bb07; color: #fff; cursor: pointer;
}
.share-qr-copy:hover { opacity: .9; }
.share-qr-copy[hidden] { display: none; }

/* PC：分享栏移至文末 + 弹层加大 */
@media (min-width: 900px) {
  .share-bar-top { display: none; }
  .share-bar-bottom { display: flex; }
  .share-qr-box { padding: 36px 44px; }
  .share-qr-box img { width: 260px; height: 260px; }
  .share-qr-box p { font-size: 15px; margin: 14px 0; }
  .share-poster-img { width: 360px; }
  .share-qr-close { font-size: 14px; padding: 6px 30px; }
  .share-qr-copy { font-size: 15px; padding: 11px 16px; }
}
@media (max-width: 899px) {
  .share-qr-box { width: 78%; max-width: 300px; }
}
.cta-box { background: var(--primary-light); border-radius: var(--radius); padding: 22px; text-align: center; margin: 26px 0; }

/* 文章页广告位：容器只管占位与间距，布局完全交给广告JS自适应（勿加 line-height/overflow/子元素样式） */
.article-ad {
  width: 100%;
  margin: 22px 0;
  text-align: center;
}
.article-ad:empty { display: none; }
.article-ad img,
.article-ad iframe { max-width: 100%; }
.cta-box p { margin-bottom: 12px; color: var(--text); font-weight: 600; }

/* 文章详情页：正文占大头，右侧推荐栏收窄 */
.article-page { max-width: 1200px; padding-bottom: 20px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.article { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.article-h1 { font-size: 26px; font-weight: 800; line-height: 1.4; margin-bottom: 12px; }
.meta-tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--primary-light);
  color: var(--primary); font-size: 12px;
}
.article-content { margin-top: 20px; font-size: 15.5px; line-height: 1.9; color: var(--text); }
.article-content h2 { font-size: 20px; margin: 26px 0 12px; padding-left: 12px; border-left: 4px solid var(--primary); }
.article-content h3 { font-size: 17px; margin: 22px 0 8px; color: var(--primary-dark); }
.article-content p { margin: 10px 0; }
.article-content ul, .article-content ol { margin: 10px 0 10px 24px; }
.article-content li { margin: 6px 0; }
.article-content strong { color: var(--primary-dark); }

/* 文章页右侧栏 */
.article-side { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 900px) { .article-side { position: static; } }
.side-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.side-card h3 { font-size: 16px; margin-bottom: 4px; color: var(--text); }
.side-list { list-style: none; }
.side-list li { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.side-list li:last-child { border-bottom: none; }
.side-list a { color: var(--text); text-decoration: none; font-size: 14px; line-height: 1.55; display: block; }
.side-list a:hover { color: var(--primary); }
.side-meta { display: block; font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* 名字速览 */
.names-card, .related { margin-top: 24px; }
.names-card h2, .related h2, .section-head h2 { font-size: 20px; margin-bottom: 14px; }
.related .article-item h3 { font-size: 15px; }

/* 最新文章区 */
.latest-section { margin: 40px 0 60px; }
.section-head { text-align: center; margin-bottom: 24px; }
.section-head p { color: var(--text-muted); font-size: 14px; margin-top: 6px; }
.latest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.latest-col { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.latest-col > h3 { font-size: 17px; margin-bottom: 14px; }
.latest-col > h3 a { color: var(--text); text-decoration: none; display: flex; justify-content: space-between; align-items: center; }
.latest-col > h3 a span { font-size: 13px; color: var(--primary); font-weight: 400; }
.latest-col .article-item { padding: 11px 13px; margin-bottom: 10px; }
.latest-col .article-item h4 { font-size: 14px; }
.latest-col .empty { color: var(--text-muted); font-size: 13px; text-align: center; padding: 16px 0; }
@media (max-width: 860px) {
  .latest-grid { grid-template-columns: 1fr; }
}

/* 结果区（文章化后） */
.result-title { font-size: 16px; font-weight: 700; color: var(--text); }
.result-actions { margin-top: 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.result-actions-tip { font-size: 13px; color: var(--text-muted); width: 100%; }
.result-views { font-size: 13px; color: var(--text-muted); }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
