/**
 * Theme Name: XuanJi (玄机)
 * Theme URI: https://ceshi.aiya123.com
 * Author: XuanJi Metaphysics
 * Description: Bilingual (zh/en) content theme for a feng shui / metaphysics (周易·风水·命理) platform targeting South-East-Asian Chinese readers. Traditional×modern palette, mobile-first, SEO-friendly, with ad slots, Polylang support and compliance disclaimer areas. Pairs with the BaZi & XuanJi Core plugins.
 * Version: 1.0.0
 * License: Proprietary
 * Text Domain: xuanji
 * Tags: custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, two-columns, right-sidebar, blog, entertainment
 */

:root {
	--red: #9e2b25;
	--red-soft: #b53a30;
	--gold: #b8893b;
	--gold-light: #d9b877;
	--ink: #2b2b2b;
	--ink-soft: #555;
	--bg: #fbf7f0;
	--bg-card: #ffffff;
	--line: #e8e0d2;
	--muted: #8a7f6f;
	--maxw: 1180px;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
	color: var(--ink);
	background: var(--bg);
	line-height: 1.65;
	font-size: 16px;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
	font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
	color: var(--ink);
	line-height: 1.3;
	margin: 0 0 .5em;
	font-weight: 700;
}
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-soft); }
img { max-width: 100%; height: auto; }
.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px);
}

/* ---------- layout ---------- */
.site { display: flex; flex-direction: column; min-height: 100vh; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 18px; width: 100%; }
.site-content { flex: 1; padding: 26px 0; }
.content-area { width: 100%; }
.site-main.has-sidebar { display: grid; grid-template-columns: 1fr 300px; gap: 32px; }
.widget-area { font-size: 14px; }

/* ---------- header ---------- */
.site-header {
	background: #fff;
	border-bottom: 3px solid var(--red);
	box-shadow: 0 1px 0 rgba(0,0,0,.03);
	position: sticky; top: 0; z-index: 50;
}
.header-top { border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted); padding: 6px 0; }
.header-top .container { display: flex; justify-content: space-between; align-items: center; }
.header-main { padding: 14px 0; }
.header-main .container { display: flex; align-items: center; gap: 22px; }
.site-branding { display: flex; align-items: center; gap: 12px; }
.custom-logo { max-height: 52px; width: auto; }
.site-title { margin: 0; font-size: 22px; }
.site-title a { color: var(--red); }
.site-title a:hover { color: var(--red-soft); }
.site-description { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; }
.main-nav a { color: var(--ink); font-size: 15px; font-weight: 500; padding: 6px 2px; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav .current-menu-item > a { color: var(--red); border-bottom-color: var(--red); }

.lang-switcher { list-style: none; display: flex; gap: 8px; margin: 0; padding: 0; font-size: 12px; }
.lang-switcher a { color: var(--muted); padding: 2px 6px; border: 1px solid var(--line); border-radius: 3px; }
.lang-switcher .current-lang a { background: var(--red); color: #fff; border-color: var(--red); }

.ad-slot-wrap.ad-header { background: #fff; text-align: center; padding: 8px 0; font-size: 12px; color: var(--muted); border-bottom: 1px dashed var(--line); }

/* ---------- hero ---------- */
.hero {
	background: linear-gradient(135deg, var(--red) 0%, #7a201c 60%, var(--ink) 100%);
	color: #fff; padding: 46px 0; text-align: center; position: relative; overflow: hidden;
}
.hero::after {
	content: "☯ 坤 震 离 坎 巽 乾"; position: absolute; inset: 0;
	display: flex; align-items: center; justify-content: center;
	font-size: 120px; color: rgba(255,255,255,.05); font-family: serif; letter-spacing: .2em; pointer-events: none;
}
.hero h1 { color: #fff; font-size: 30px; margin-bottom: 10px; position: relative; }
.hero p { margin: 0 auto; max-width: 560px; opacity: .92; position: relative; }
.hero .hero-cta { margin-top: 20px; position: relative; }
.btn {
	display: inline-block; background: var(--gold); color: #fff;
	padding: 11px 26px; border-radius: 6px; font-weight: 600; font-size: 15px;
	margin: 0 6px; transition: background .15s, transform .15s;
}
.btn:hover { background: var(--gold-light); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: transparent; border: 1px solid rgba(255,255,255,.6); }

/* ---------- section heading ---------- */
.section { margin: 34px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 16px; border-bottom: 2px solid var(--red); padding-bottom: 8px; }
.section-head h2 { margin: 0; font-size: 21px; }
.section-head h2::before { content: "❖ "; color: var(--gold); }
.section-head .more { font-size: 13px; color: var(--muted); }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }

/* ---------- cards ---------- */
.card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: 0 6px 18px rgba(158,43,37,.10); transform: translateY(-2px); }
.card a { color: var(--ink); display: block; }
.card-thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #f3ecdf; }
.card-body { padding: 14px 16px; }
.card-body h3 { font-size: 16px; margin: 0 0 6px; }
.card-body .meta { font-size: 12px; color: var(--muted); }
.card-body p { font-size: 13px; color: var(--ink-soft); margin: 6px 0 0; }

/* zodiac chips */
.zodiac-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.zodiac-chip { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 6px 14px; font-size: 13px; color: var(--ink); }
.zodiac-chip:hover { background: var(--red); color: #fff; border-color: var(--red); }

/* ---------- single article ---------- */
.entry-header { margin-bottom: 18px; }
.entry-title { font-size: 28px; margin-bottom: 8px; }
.entry-meta { font-size: 13px; color: var(--muted); }
.entry-content { font-size: 16px; }
.entry-content h2 { font-size: 22px; margin-top: 1.4em; }
.entry-content p { margin: 0 0 1.1em; }
.entry-content blockquote { border-left: 4px solid var(--gold); margin: 1.2em 0; padding: 6px 18px; color: var(--ink-soft); background: #fffdf7; }
.entry-footer { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 14px; font-size: 13px; color: var(--muted); }
.tags a, .cats a { color: var(--red); }

.ad-slot-wrap.ad-content { margin: 22px 0; text-align: center; }

/* ---------- archive ---------- */
.archive-header { margin-bottom: 22px; }
.archive-header h1 { font-size: 26px; }
.archive-header .archive-desc { color: var(--muted); font-size: 14px; }
.posts-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }

/* ---------- widgets ---------- */
.widget { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; margin-bottom: 18px; }
.widget-title { font-size: 16px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.widget li:last-child { border-bottom: none; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #cfc6b6; padding: 30px 0 14px; margin-top: 30px; }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.footer-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 16px; margin: 0; padding: 0; font-size: 13px; }
.footer-nav a { color: #cfc6b6; }
.footer-nav a:hover { color: #fff; }
.site-info { width: 100%; text-align: center; border-top: 1px solid #444; margin-top: 18px; padding-top: 14px; font-size: 12px; color: #9a8f7f; }

/* ---------- responsive ---------- */
.menu-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; cursor: pointer; }
@media (max-width: 860px) {
	.site-main.has-sidebar { grid-template-columns: 1fr; }
	.widget-area { order: 2; }
}
@media (max-width: 720px) {
	.menu-toggle { display: inline-block; margin-left: auto; }
	.main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 3px solid var(--red); padding: 10px 18px; }
	.main-nav.open { display: block; }
	.main-nav ul { flex-direction: column; gap: 0; }
	.main-nav li { border-bottom: 1px solid var(--line); }
	.main-nav a { display: block; padding: 12px 0; }
	.header-main .container { flex-wrap: wrap; }
	.hero h1 { font-size: 23px; }
	.entry-title { font-size: 22px; }
}

/* ---- 代开光首页横幅 ---- */
.xx-home-kg { margin: 0 0 10px; }
.xx-kg-banner {
	display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
	background: linear-gradient(135deg, var(--red), #7a201c);
	color: #fff; padding: 24px 28px; border-radius: 10px;
}
.xx-kg-banner h2 { color: #fff; margin: 0 0 6px; font-size: 22px; }
.xx-kg-banner p { margin: 0 0 12px; opacity: .92; max-width: 520px; }
.xx-kg-banner .btn { background: var(--gold); }
.xx-kg-banner .btn:hover { background: var(--gold-light); }

/* ---- 开光流程步骤 ---- */
.xx-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.xx-step {
	background: var(--bg-card); border: 1px solid var(--line); border-radius: 8px; padding: 18px 16px;
}
.xx-step-no {
	display: inline-flex; align-items: center; justify-content: center;
	width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: #fff;
	font-weight: 700; margin-bottom: 10px;
}
.xx-step h4 { margin: 0 0 6px; font-size: 15px; }
.xx-step p { margin: 0; font-size: 13px; color: var(--ink-soft); }

/* ---- FAQ ---- */
.xx-faq details { background: var(--bg-card); border: 1px solid var(--line); border-radius: 6px; margin-bottom: 8px; padding: 12px 16px; }
.xx-faq summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.xx-faq summary::before { content: "Q "; color: var(--red); }
.xx-faq details p { margin: 10px 0 0; font-size: 14px; color: var(--ink-soft); line-height: 1.7; }

/* ---- 案例详情：证书 ---- */
.xx-case-cert { margin: 22px 0; padding: 16px; background: #fffdf7; border: 1px solid var(--line); border-radius: 8px; }
.xx-case-cert h3 { margin: 0 0 12px; font-size: 17px; }
.xx-case-cert img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; }
.xx-cert-no { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.xx-case-product { font-size: 14px; color: var(--ink-soft); }

@media (max-width: 720px) { .xx-steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .xx-steps { grid-template-columns: 1fr; } }

/* ---- 顶部账号区 ---- */
.header-top-right { display: flex; align-items: center; gap: 14px; }
.header-auth { font-size: 12px; }
.header-auth a { color: var(--muted); }

/* ---- 代开光 CTA ---- */
.xx-cta-chat { text-align: center; padding: 24px; background: #fffdf7; border: 1px solid var(--line); border-radius: 8px; }
.xx-cta-chat p { margin: 0 0 6px; font-size: 15px; color: var(--ink-soft); }
.xx-cta-chat .xx-cta-note { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.xx-cta-chat .btn { display: inline-block; }

