/* Hellraiser: Revival Wiki 模板样式 | 移动端优先，响应式 */
:root {
  --theme: hsl(0, 85%, 40%);
  --theme-dark: hsl(0, 80%, 35%);
  --theme-light: hsl(0, 85%, 50%);
  --text: #1f2937;
  --muted: #6b7280;
  --bg: #ffffff;
  --bg-soft: #f9fafb;
  --border: #e5e7eb;
  --radius: 8px;
  --max-w: 1100px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  font-size: 16px;
  padding-top: 50px; /* 给顶部固定广告留位 */
}
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 16px; }
a { color: var(--theme); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- 顶部固定广告 ---------- */
.ad-sticky-top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: var(--bg-soft); border-bottom: 1px solid var(--border);
  display: flex; justify-content: center; align-items: center;
  min-height: 50px;
}
.ad-sticky-top iframe { display: block; max-width: 100%; }
.ad-close {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: 1px solid var(--border); border-radius: 50%;
  background: #fff; color: var(--muted); font-size: 18px; line-height: 1;
  cursor: pointer;
}
.ad-close:hover { color: var(--text); }

/* ---------- 页头导航 ---------- */
.site-header {
  background: var(--theme); color: #fff;
  position: sticky; top: 50px; z-index: 900;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { color: #fff; font-size: 1.25rem; font-weight: 700; }
.logo span { font-weight: 400; opacity: .85; }
.logo:hover { text-decoration: none; }
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }
.main-nav ul { display: flex; list-style: none; gap: 4px; }
.main-nav a { color: #fff; padding: 8px 12px; border-radius: 6px; font-size: .95rem; }
.main-nav a:hover, .main-nav a.active { background: var(--theme-dark); text-decoration: none; }

/* ---------- 布局 ---------- */
.layout { display: grid; grid-template-columns: 1fr; gap: 24px; padding-top: 24px; padding-bottom: 24px; }
.content { min-width: 0; }
.sidebar { display: none; }

/* ---------- 首页 ---------- */
.hero { background: linear-gradient(135deg, var(--theme-light), var(--bg-soft)); border-radius: var(--radius); padding: 32px 28px; margin-bottom: 24px; position: relative; overflow: hidden; }
.hero .eyebrow { display: inline-block; background: var(--theme); color: #fff; font-size: .78rem; font-weight: 600; padding: 4px 12px; border-radius: 20px; margin-bottom: 12px; text-transform: uppercase; letter-spacing: .5px; }
.hero h1 { font-size: 2rem; margin-bottom: 8px; line-height: 1.2; }
.hero .tagline { color: var(--muted); font-size: 1.05rem; margin-bottom: 16px; max-width: 640px; }
.hero .hook { font-size: 1.15rem; font-weight: 700; margin-bottom: 16px; color: var(--text); }
.hero-stats { display: flex; flex-wrap: wrap; gap: 16px; margin: 16px 0; }
.hero-stats .stat { text-align: center; min-width: 80px; }
.hero-stats .stat b { display: block; font-size: 1.5rem; color: var(--theme); }
.hero-stats .stat span { font-size: .8rem; color: var(--muted); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.btn { display: inline-block; padding: 10px 20px; border-radius: var(--radius); font-weight: 600; font-size: .95rem; }
.btn-primary { background: var(--theme); color: #fff; }
.btn-primary:hover { background: var(--theme-dark); text-decoration: none; }
.btn-secondary { border: 2px solid var(--theme); color: var(--theme); }
.btn-secondary:hover { background: var(--theme-light); text-decoration: none; }
.game-info { margin-bottom: 24px; }
.game-info h2, .latest h2, .categories h2, .related h2 { font-size: 1.4rem; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--theme); }
.game-info dl > div { display: flex; padding: 8px 0; border-bottom: 1px solid var(--border); }
.game-info dt { width: 110px; flex-shrink: 0; color: var(--muted); }
.cards { display: grid; grid-template-columns: 1fr; gap: 16px; }
.card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: #fff; transition: transform .15s, box-shadow .15s; position: relative; }
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.card .badge { display: inline-block; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--theme); background: var(--theme-light); padding: 3px 10px; border-radius: 12px; margin-bottom: 8px; }
.card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--theme); }
.card p { color: var(--muted); font-size: .92rem; margin-bottom: 8px; }
.card .read-more { font-size: .88rem; font-weight: 600; }
.card time { font-size: .8rem; color: var(--muted); }
.cat-list { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cat-list a { display: block; padding: 12px; background: var(--bg-soft); border-radius: var(--radius); }

/* ---------- 文章页 ---------- */
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 16px; }
article h1 { font-size: 1.8rem; margin-bottom: 8px; line-height: 1.3; }
.article-meta { color: var(--muted); font-size: .85rem; margin-bottom: 20px; }
article h2 { font-size: 1.4rem; margin: 28px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--theme); }
article h3 { font-size: 1.15rem; margin: 20px 0 10px; }
article p { margin-bottom: 14px; }
article ul, article ol { margin: 0 0 14px 24px; }
article li { margin-bottom: 6px; }
article img { max-width: 100%; height: auto; border-radius: var(--radius); }
article table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: .92rem; }
article th, article td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
article th { background: var(--bg-soft); }

/* ---------- 广告位 ---------- */
.ad-sidebar-wrap { position: sticky; top: 120px; margin-bottom: 20px; text-align: center; }
.ad-inarticle, .ad-bottom { display: flex; justify-content: center; margin: 24px 0; }
.ad-inarticle iframe, .ad-bottom iframe { max-width: 100%; }
.widget { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; }
.widget h3 { font-size: 1rem; margin-bottom: 10px; }
.widget ul { list-style: none; }
.widget li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.widget li:last-child { border-bottom: none; }

/* ---------- 页脚 ---------- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding: 24px 0; margin-top: 12px; font-size: .88rem; color: var(--muted); text-align: center; }
.site-footer nav { margin-bottom: 10px; }

/* ---------- 法律页面 ---------- */
.legal h1 { font-size: 1.8rem; margin-bottom: 16px; }
.legal h2 { font-size: 1.25rem; margin: 22px 0 10px; }
.legal p { margin-bottom: 12px; }

/* ---------- FAQ手风琴（手册第1课官方首页结构） ---------- */
.faq { margin-bottom: 24px; }
.faq h2 { font-size: 1.4rem; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--theme); }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; background: #fff; }
.faq-item summary { padding: 14px 16px; cursor: pointer; font-weight: 600; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "+ "; color: var(--theme); }
.faq-item[open] summary::before { content: "− "; }
.faq-item p { padding: 0 16px 14px; color: var(--text); }

/* ---------- 站内搜索 ---------- */
.header-search { position: relative; }
.header-search input { padding: 8px 12px; border: 1px solid rgba(255,255,255,.3); border-radius: 6px; background: rgba(255,255,255,.15); color: #fff; width: 180px; }
.header-search input::placeholder { color: rgba(255,255,255,.7); }
.search-results { position: absolute; top: 100%; right: 0; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); min-width: 240px; max-height: 320px; overflow-y: auto; z-index: 1000; box-shadow: 0 4px 12px rgba(0,0,0,.15); }
.search-results a { display: block; padding: 10px 14px; color: var(--text); border-bottom: 1px solid var(--border); }
.search-results a:hover { background: var(--bg-soft); text-decoration: none; }

/* ---------- 文章目录TOC（手册第2课） ---------- */
.toc { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 20px; }
.toc strong { display: block; margin-bottom: 8px; }
.toc ul { margin: 0 0 0 20px; }
.toc li { margin-bottom: 4px; }

/* ---------- 视频嵌入 ---------- */
.video-embed { margin: 20px 0; text-align: center; }
.video-embed iframe { max-width: 100%; border-radius: var(--radius); }

/* ---------- Hero图片 ---------- */
.hero-img { width: 100%; max-height: 300px; object-fit: cover; border-radius: var(--radius); margin: 16px 0; }

/* ---------- Last Updated（手册第2课） ---------- */
.last-updated { margin-bottom: 24px; }
.last-updated h2 { font-size: 1.4rem; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid var(--theme); }
.updated-list { list-style: none; }
.updated-list li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; }
.updated-list time { color: var(--muted); font-size: .85rem; }
.all-guides { max-height: 400px; overflow-y: auto; }

/* ---------- 语言切换器 ---------- */
.lang-switcher { font-size: .85rem; }
.lang-switcher a { color: rgba(255,255,255,.85); padding: 4px 6px; }
.lang-switcher a.active { font-weight: 700; color: #fff; }
.lang-switcher a:hover { color: #fff; }

/* ---------- 状态 ticker 栏（对标 miniwars.art） ---------- */
.ticker { background: #111827; color: #9ca3af; font-size: .78rem; padding: 6px 0; text-align: center; white-space: nowrap; overflow: hidden; }
.ticker span { margin: 0 12px; }
.ticker b { color: #fff; }

/* ---------- Tip 提示框（对标 vvultimatum） ---------- */
.tip-box { background: #fefce8; border-left: 4px solid #eab308; border-radius: 0 var(--radius) var(--radius) 0; padding: 14px 16px; margin: 20px 0; }

/* ---------- 文章副标题 ---------- */
.article-dek { font-size: 1.05rem; color: var(--muted); margin-bottom: 20px; line-height: 1.6; }

/* ---------- 速览信息框 ---------- */
.quick-facts { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 24px; }
.quick-facts ul { list-style: none; margin: 0; }
.quick-facts li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.quick-facts li:last-child { border-bottom: none; }

/* ---------- "为什么选这个wiki" ---------- */
.why-wiki { background: var(--bg-soft); border-radius: var(--radius); padding: 24px; margin-bottom: 24px; }
.why-wiki h2 { font-size: 1.4rem; margin-bottom: 12px; }

/* ---------- 桌面端 ---------- */
@media (min-width: 900px) {
  .layout { grid-template-columns: 1fr 320px; }
  .sidebar { display: block; }
  .cards { grid-template-columns: 1fr 1fr; }
  .hero h1 { font-size: 2.4rem; }
  article h1 { font-size: 2.1rem; }
}

/* ---------- 移动端导航 ---------- */
@media (max-width: 899px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; position: absolute; top: 56px; left: 0; right: 0; background: var(--theme-dark); }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; padding: 8px; }
  .header-inner { position: relative; }
}

/* ---------- Quick Answer 框（对标 allthings.how） ---------- */
article p strong:first-child {
  color: var(--text);
}
.quick-answer {
  background: var(--bg-soft);
  border-left: 4px solid var(--theme);
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .95rem;
}

/* ---------- 表格优化 ---------- */
article table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 20px;
  font-size: .92rem;
  line-height: 1.5;
}
article th, article td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
}
article th {
  background: var(--bg-soft);
  font-weight: 600;
}
article tr:nth-child(even) td {
  background: #fafbfc;
}

/* ---------- 游戏内原话引用 ---------- */
article p em, article li em {
  color: var(--muted);
}
