/* EVE 梗指南 —— 单文件样式：默认亮色，支持单按钮切暗色 */
:root {
  --bg: #f7f8fa;
  --bg-soft: #ffffff;
  --bg-card: #ffffff;
  --line: #dde3ea;
  --fg: #1b2430;
  --fg-dim: #5a6775;
  --fg-faint: #8b98a6;
  --accent: #1668b3;
  --accent-fg: #ffffff;
  --accent-soft: #e3eef8;
  --ok: #2f7d52;
  --warn: #9a6a10;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 20px rgba(16, 24, 40, .08);
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
}

/* 暗色模式：点击右上角图标切换 */
:root[data-theme="dark"] {
  --bg: #0d1117;
  --bg-soft: #151b23;
  --bg-card: #171e27;
  --line: #263140;
  --fg: #e6edf3;
  --fg-dim: #9aa7b4;
  --fg-faint: #6b7885;
  --accent: #58b0f0;
  --accent-fg: #06131f;
  --accent-soft: #1e3a52;
  --ok: #6cc08b;
  --warn: #e0b055;
  --shadow: 0 1px 0 rgba(255, 255, 255, .03), 0 8px 24px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.75 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 860px; margin: 0 auto; padding: 24px 18px 64px; }

/* ---------- 页眉 / 页脚 ---------- */
.site-head {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between;
  max-width: 860px; margin: 0 auto; padding: 18px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.brand:hover { text-decoration: none; }
.seal {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 8px;
  background: var(--accent); color: var(--accent-fg); font-weight: 700; font-size: 20px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 17px; letter-spacing: .02em; }
.brand-text small { color: var(--fg-dim); font-size: 12px; }
.head-right { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 14px; }
.site-nav a { color: var(--fg-dim); }
.site-nav a:hover { color: var(--accent); }

/* ---------- 关于作者 ---------- */
.about-block { margin: 26px 0; }
.about-block h2 { font-size: 17px; margin: 0 0 8px; color: var(--fg); }
.about-block ul { margin: 8px 0 0; padding-left: 20px; }
.about-block li { margin: 5px 0; color: var(--fg-dim); }
.about-block li b, .about-block p b { color: var(--fg); }
/* 角色截图：三张一排，窄屏自动换行 */
.about-shots { display: flex; flex-wrap: wrap; gap: 14px; margin: 18px 0 8px; }
.about-shot { margin: 0; flex: 1 1 200px; max-width: 240px; }
.about-shot img {
  display: block; width: 100%; height: auto; border-radius: 8px;
  border: 1px solid var(--line); background: #0b0e13;
}
.about-shot figcaption { margin-top: 6px; font-size: 12.5px; line-height: 1.6; color: var(--fg-faint); }
.about-shotnote { font-size: 13px; color: var(--fg-faint); margin: 4px 0 0; }

.site-foot {
  max-width: 860px; margin: 0 auto; padding: 24px 18px 48px;
  border-top: 1px solid var(--line); color: var(--fg-faint); font-size: 13px;
}
.site-foot code { font-family: var(--mono); font-size: 12px; background: var(--bg-soft); padding: 1px 5px; border-radius: 4px; }

/* ---------- 通用块 ---------- */
.intro { margin: 8px 0 20px; }
.intro h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: .01em; }
.intro p { margin: 6px 0; color: var(--fg-dim); font-size: 15px; }
.intro-note { font-size: 13.5px; color: var(--fg-faint); }
.empty { color: var(--fg-faint); }
.big-link { display: inline-block; margin-right: 14px; font-size: 16px; }

.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  font-size: 12px; line-height: 1.7; border: 1px solid var(--line); color: var(--fg-dim);
  white-space: nowrap;
}
.badge-cat { border-color: var(--accent-soft); color: var(--accent); background: var(--accent-soft); }
.badge-已确认 { border-color: transparent; background: color-mix(in srgb, var(--ok) 18%, transparent); color: var(--ok); }
.badge-社区流传 { border-color: transparent; background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.badge-scope { font-weight: 600; }
.badge-scope-端游 { border-color: transparent; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.badge-scope-手游 { border-color: transparent; background: color-mix(in srgb, #c07be0 18%, transparent); color: #a35cc4; }
.badge-scope-通用 { border-color: transparent; background: color-mix(in srgb, var(--fg-dim) 16%, transparent); color: var(--fg-dim); }
.badge-server { font-family: var(--mono); font-size: 11.5px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; margin: 0 6px 6px 0;
  border: 1px solid var(--line); border-radius: 999px; background: var(--bg-soft);
  color: var(--fg-dim); font-size: 13px; cursor: pointer;
}
.chip small { color: var(--fg-faint); font-size: 11px; }
.chip:hover { color: var(--fg); border-color: var(--accent); text-decoration: none; }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.chip.is-active small { color: color-mix(in srgb, var(--accent-fg) 75%, transparent); }

/* ---------- 工具栏 ---------- */
/* 工具栏：桌面端搜索框限宽，手机端整条不换行（搜索框让位、按钮不被压扁） */
.toolbar { display: flex; flex-wrap: nowrap; align-items: stretch; gap: 8px; margin: 18px 0 10px; }
.toolbar input[type="search"] {
  flex: 1 1 auto; min-width: 0; max-width: 420px; padding: 9px 12px; font-size: 15px;
  background: var(--bg-soft); color: var(--fg); border: 1px solid var(--line); border-radius: var(--radius);
}
.toolbar input[type="search"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.toolbar button {
  flex: none; white-space: nowrap;
  padding: 9px 12px; font-size: 14px; background: var(--bg-soft); color: var(--fg-dim);
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
}
.toolbar button:hover { color: var(--fg); border-color: var(--accent); }
.toolbar button.is-active, .toolbar button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.tag-wrap { margin: 6px 0 4px; }
.tag-bar { display: flex; flex-wrap: wrap; gap: 0; margin-bottom: 4px; }
.filter-status { margin: 10px 0 4px; color: var(--fg-faint); font-size: 13px; }
.tag-cloud { line-height: 2.4; }

/* ---------- 卡片列表 ---------- */
.cards { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 720px) { .cards { grid-template-columns: 1fr 1fr; } }
/* 宽屏容得下 3 张等宽卡片（保持单卡约 407px，3×407 + 2×10 + 36 = 1277px）时全站同步放宽并切为 3 列 */
@media (min-width: 1260px) {
  .site-head,
  .wrap,
  .site-foot { max-width: 1277px; }
  .cards { grid-template-columns: repeat(3, 1fr); }
}
.card { margin: 0; }
.card[hidden] { display: none; }
.card-link {
  display: block; height: 100%; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--bg-card); box-shadow: var(--shadow); color: inherit;
}
.card-link:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.card-title { margin: 0 0 6px; font-size: 17px; }
.card-summary { margin: 0 0 10px; color: var(--fg-dim); font-size: 14px; line-height: 1.7; }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.card-src { margin-left: auto; color: var(--fg-faint); font-size: 12px; font-family: var(--mono); }

/* ---------- 词条页 ---------- */
.back { margin: 4px 0 14px; font-size: 14px; }
.meme-head { margin-bottom: 18px; }
.meme-kicker { margin: 0 0 8px; display: flex; gap: 6px; }
.meme-title { margin: 0 0 8px; font-size: 30px; line-height: 1.3; letter-spacing: .01em; }
.meme-aliases { margin: 0 0 8px; color: var(--fg-dim); font-size: 14px; }
.meme-aliases span { color: var(--fg); }
.meme-tags { margin: 0; }
.meme-foot {
  margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line);
  color: var(--fg-faint); font-size: 13px;
}
.meme-meta { margin: 0 0 8px; font-family: var(--mono); font-size: 12.5px; }
.related { font-size: 13.5px; color: var(--fg-dim); }
.related a { margin-right: 2px; }

.prose { font-size: 16.5px; }
.prose h2 {
  margin: 30px 0 10px; padding-bottom: 6px; font-size: 19px;
  border-bottom: 1px solid var(--line);
}
.prose h2::before { content: "▍"; color: var(--accent); margin-right: 6px; }
.prose p { margin: 10px 0; }
.prose ul, .prose ol { margin: 10px 0; padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose li > a { word-break: break-all; }
.prose blockquote {
  margin: 12px 0; padding: 8px 14px; border-left: 3px solid var(--accent);
  background: var(--bg-soft); color: var(--fg-dim); border-radius: 0 var(--radius) var(--radius) 0;
}
.prose code { font-family: var(--mono); font-size: 14px; background: var(--bg-soft); padding: 1px 5px; border-radius: 4px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; margin: 14px 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.prose th { background: var(--bg-soft); color: var(--fg-dim); font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

/* ---------- 索引表 ---------- */
.lex-table, .src-table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14.5px; }
.lex-table th, .lex-table td, .src-table th, .src-table td {
  border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top;
}
.lex-table th, .src-table th { color: var(--fg-dim); font-weight: 600; font-size: 13px; }
.lex-alias { font-family: var(--mono); color: var(--fg); }
/* 黑话索引：术语、年份、分组、来源、词条固定占比，释义吃掉剩余空间 */
.lex-table th:nth-child(1), .lex-table td:nth-child(1) { width: 16%; }
.lex-table th:nth-child(3), .lex-table td:nth-child(3) { width: 7%; }
.lex-table th:nth-child(4), .lex-table td:nth-child(4) { width: 11%; }
.lex-table th:nth-child(5), .lex-table td:nth-child(5) { width: 15%; }
.lex-table th:nth-child(6), .lex-table td:nth-child(6) { width: 13%; }
.lex-table .lex-year { font-family: var(--mono); color: var(--fg-dim); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.lex-table .lex-desc { color: var(--fg); }
.lex-table .lex-src { color: var(--fg-faint); font-size: 12.5px; }
.lex-count { color: var(--fg-faint); font-size: 13px; align-self: center; }
.src-host { color: var(--fg-faint); font-family: var(--mono); font-size: 12.5px; }
.src-table a { word-break: break-all; }
.src-count {
  display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent); font-size: 12px; white-space: nowrap;
}

/* ---------- 翻页 ---------- */
.pager {
  display: flex; align-items: center; gap: 10px; justify-content: space-between;
  margin: 28px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px;
}
.pager a { display: flex; flex-direction: column; max-width: 42%; }
.pager small { color: var(--fg-faint); font-size: 11.5px; }
.pager-next { text-align: right; }

/* ---------- 搜索页 ---------- */
.search-box { --pagefind-ui-scale: .95; --pagefind-ui-primary: var(--accent); --pagefind-ui-text: var(--fg);
  --pagefind-ui-background: var(--bg-card); --pagefind-ui-border: var(--line); --pagefind-ui-tag: var(--bg-soft);
  --pagefind-ui-border-radius: var(--radius); --pagefind-ui-font: inherit; }

/* ---------- 首访确认弹窗 ---------- */
html.consent-open, html.consent-open body { overflow: hidden; }
.consent {
  position: fixed; inset: 0; z-index: 999; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(6, 9, 14, .72); backdrop-filter: blur(3px);
}
.consent[hidden] { display: none; }
.consent-box {
  width: 100%; max-width: 520px; background: var(--bg); color: var(--fg);
  border: 1px solid var(--line); border-radius: 12px; padding: 26px 26px 20px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .45);
}
.consent-box h2 { margin: 0 0 12px; font-size: 19px; }
.consent-box p { margin: 0 0 10px; font-size: 14.5px; line-height: 1.75; color: var(--fg-dim); }
.consent-box b { color: var(--fg); }
.consent-sub { font-size: 13px !important; color: var(--fg-faint) !important; }
.consent-check {
  display: flex; gap: 9px; align-items: flex-start; margin: 16px 0 18px;
  font-size: 14px; line-height: 1.7; color: var(--fg-dim); cursor: pointer;
}
.consent-check input { margin: 4px 0 0; width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
.consent-actions { display: flex; align-items: center; gap: 16px; }
.consent-actions button {
  font: inherit; font-size: 14.5px; padding: 8px 18px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
}
.consent-actions button[disabled] { opacity: .45; cursor: not-allowed; }
.consent-actions a { font-size: 14px; color: var(--fg-faint); }

/* 条款页的「同意并进入」按钮 */
.terms-cta { margin: 16px 0 0; }
.terms-cta button {
  font: inherit; font-size: 14.5px; padding: 8px 18px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
}
.terms-cta button:hover { filter: brightness(1.08); }

/* ---------- 右下角浮动按钮（返回顶部 / 暂隐的投稿梗素材） ---------- */
.fab-submit,
.fab-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 999px;
  font: inherit; font-size: 14px; line-height: 1.4;
  transition: transform .15s ease, opacity .18s ease, filter .12s ease, border-color .12s ease, color .12s ease;
}
.fab-submit {
  background: var(--accent); color: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
}
.fab-submit:hover { text-decoration: none; filter: brightness(1.08); transform: translateY(-1px); }
.fab-top {
  border: 1px solid var(--line);
  background: var(--bg-card); color: var(--fg-dim);
  box-shadow: var(--shadow); cursor: pointer;
  opacity: 0; pointer-events: none; transform: translateY(8px);
}
.fab-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.fab-top:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.fab-top:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fab-icon { font-size: 15px; line-height: 1; flex: none; }
/* 弹窗打开时收起来，免得压在遮罩下面若隐若现 */
html.consent-open .fab-submit,
html.consent-open .fab-top { display: none; }
@media (max-width: 520px) {
  .fab-submit,
  .fab-top { right: 12px; bottom: 12px; padding: 8px 12px; font-size: 13px; }
  .fab-submit .fab-icon,
  .fab-top .fab-icon { font-size: 14px; }
}
@media print {
  .fab-submit,
  .fab-top { display: none; }
}

/* 页脚的 GitHub / 反馈 / 联系与关于作者入口 */
.site-foot .foot-note {
  margin: 10px 0 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0;
}
.site-foot .foot-gh {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--fg-dim); font-size: 13px;
}
.site-foot .foot-gh:hover { color: var(--accent); text-decoration: none; }
.site-foot .foot-gh svg { flex: none; opacity: .85; }

.site-foot .foot-sep { margin: 0 10px; color: var(--line); }

/* 热度档位徽章（按播放量 + 引用数排名）：夯 / 顶级 / 人上人 / NPC / 拉完了 */
.badge-tier { border-color: transparent; font-weight: 600; white-space: nowrap; }
.badge-tier[data-tier="夯"] { background: #f8cbad; color: #7a3a14; }
.badge-tier[data-tier="顶级"] { background: #ffe699; color: #6b5308; }
.badge-tier[data-tier="人上人"] { background: #e2efda; color: #3f6b2c; }
.badge-tier[data-tier="NPC"] { background: #ddebf7; color: #2b5876; }
.badge-tier[data-tier="拉完了"] { background: #f2f2f2; color: #7a7a7a; }

/* 手机端工具栏：搜索框不设上限，按钮收紧，挤在一行不换行 */
@media (max-width: 520px) {
  .toolbar { gap: 5px; margin: 14px 0 8px; }
  .toolbar input[type="search"] { max-width: none; font-size: 14px; padding: 8px 9px; }
  .toolbar button { padding: 8px 7px; font-size: 12.5px; }
}

/* ---------- 筛选区：收起露第一行，右侧展开 / 收起 ---------- */
.filter-panel {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 12px 0 4px;
}
.filter-rows { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.filter-panel .tag-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.filter-panel .chip { margin: 0; height: 28px; padding: 0 10px; line-height: 1; }
.filter-panel:not(.is-open) .filter-primary { max-height: 30px; overflow: hidden; }
.filter-panel:not(.is-open) .filter-extra { display: none; }
.filter-extra { display: flex; flex-direction: column; gap: 8px; }
.filter-more {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  height: 28px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-soft); color: var(--fg-dim);
  font: inherit; font-size: 13px; line-height: 1; white-space: nowrap; cursor: pointer;
}
.filter-more:hover { color: var(--fg); border-color: var(--accent); }
.filter-more.has-active { border-color: var(--accent); color: var(--accent); }
.filter-more-arrow { font-size: 11px; opacity: .85; }

/* ---------- 右上角单图标主题切换（亮色显弯月，暗色显太阳） ---------- */
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; padding: 0;
  border: 1px solid transparent; border-radius: 8px;
  background: transparent; color: var(--fg-dim); cursor: pointer;
}
.theme-toggle:hover { color: var(--fg); background: var(--bg-soft); border-color: var(--line); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.theme-toggle .i-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }

/* ---------- 首页访问人数统计（参考 modeldial.com） ---------- */
.visit-counter {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px;
  margin-top: 14px;
}
.visit-counter[hidden] { display: none; }
.visit-counter-total,
.visit-counter-today {
  display: inline-flex; align-items: baseline; gap: 7px;
}
.visit-counter-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok); align-self: center; flex: none;
}
.visit-counter-value {
  font-size: 26px; font-weight: 700; line-height: 1.1;
  letter-spacing: -0.02em; color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.visit-counter-label {
  font-size: 13px; color: var(--fg-dim); white-space: nowrap;
}
.visit-counter-sep {
  width: 1px; height: 15px; background: var(--line);
  align-self: center; flex: none;
}
.visit-counter-today { gap: 6px; cursor: help; }
.visit-counter-today-value {
  font-size: 14.5px; font-weight: 600; color: var(--fg);
  font-variant-numeric: tabular-nums;
}

/* ---------- 友情链接页（/links/） ---------- */
.friend-links {
  list-style: none; margin: 20px 0 0; padding: 0;
  display: grid; gap: 12px;
}
@media (min-width: 640px) { .friend-links { grid-template-columns: repeat(2, 1fr); } }
.friend-item { margin: 0; }
.friend-card {
  display: flex; flex-direction: column; height: 100%;
  padding: 16px 18px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--bg-card); box-shadow: var(--shadow);
  color: inherit; transition: border-color .12s ease, transform .12s ease;
}
a.friend-card:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.friend-card.is-pending { border-style: dashed; opacity: .88; }
.friend-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.friend-card-title { margin: 0; font-size: 17px; color: var(--fg); }
.friend-card-ext { color: var(--accent); font-size: 16px; line-height: 1; }
.friend-card-desc { margin: 0 0 10px; color: var(--fg-dim); font-size: 14px; line-height: 1.7; }
.friend-card-url {
  margin: auto 0 0; color: var(--fg-faint); font-size: 12.5px;
  font-family: var(--mono); word-break: break-all;
}
