/*
Theme Name: 高丽参百科
Theme URI: https://www.example.com/
Description: 高丽参主题网站：产品展示 + 知识文章。轻量、快速、内置 SEO（结构化数据、面包屑、目录、相关文章）。
Version: 1.0.1
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: gaolishen
*/

:root {
	--bg: #fbf8f2;
	--surface: #ffffff;
	--ink: #2a2420;
	--muted: #7a6f66;
	--line: #ece4d7;
	--brand: #8e2b1e;
	--brand-dark: #6e1f15;
	--brand-soft: #f6e9e3;
	--gold: #a87a2a;
	--radius: 10px;
	--serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
	--sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.8 var(--sans); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.4; }

/* ---------- 页头 ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 28px; min-height: 64px; }
.logo { font: 700 21px/1 var(--serif); color: var(--ink); display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 17px; }
.logo img { max-height: 40px; width: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px 20px; flex-wrap: wrap; }
.main-nav a { color: var(--ink); padding: 6px 0; display: block; }
.main-nav .current-menu-item > a, .main-nav .current-menu-parent > a, .main-nav a:hover { color: var(--brand); text-decoration: none; }
.main-nav li { position: relative; }
.main-nav .sub-menu { display: none; position: absolute; top: 100%; left: -12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; min-width: 150px; flex-direction: column; gap: 0; }
.main-nav li:hover > .sub-menu { display: flex; }
.header-search { margin-left: auto; }
.header-search input { border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; width: 180px; background: var(--bg); font: inherit; font-size: 14px; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font: inherit; }
@media (max-width: 860px) {
	.site-header { position: static; }
	.header-inner { flex-wrap: wrap; gap: 8px; padding: 10px 0; }
	.nav-toggle { display: block; }
	.main-nav, .header-search { display: none; width: 100%; }
	.site-header.open .main-nav, .site-header.open .header-search { display: block; }
	.main-nav ul { flex-direction: column; }
	.main-nav .sub-menu { display: flex; position: static; border: 0; padding: 0 0 0 16px; }
	.header-search input { width: 100%; }
}

/* ---------- 页脚 ---------- */
.site-footer { margin-top: 64px; padding: 36px 0; background: #2a2420; color: #cbbfb2; font-size: 14px; }
.site-footer a { color: #f0e2d0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer-grid h3 { color: #fff; font-size: 16px; margin: 0 0 10px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-bottom { border-top: 1px solid #443a32; margin-top: 24px; padding-top: 16px; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- 通用区块 ---------- */
.section { margin: 48px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 2px solid var(--ink); margin-bottom: 16px; }
.section-head h2 { margin: 0 0 6px; font-size: 24px; }
.page-title { font-size: 30px; margin: 28px 0 8px; }
.page-desc { color: var(--muted); margin: 0 0 24px; }
.breadcrumbs { font-size: 14px; color: var(--muted); margin: 20px 0 0; }
.breadcrumbs a { color: var(--muted); }
.btn { display: inline-block; padding: 10px 22px; border-radius: 99px; background: var(--brand); color: #fff; font-weight: 600; border: 0; cursor: pointer; font-size: 15px; }
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn-ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); }
.badge { display: inline-block; font-size: 12px; padding: 0 9px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); }

/* ---------- 首页 ---------- */
.hero { background: linear-gradient(135deg, #3a1a14 0%, #8e2b1e 100%); color: #fff; padding: 64px 0; }
.hero h1 { font-size: 40px; margin: 0 0 14px; }
.hero p { font-size: 18px; max-width: 620px; margin: 0 0 24px; color: #f3dcd3; }
.hero .btn { background: #fff; color: var(--brand); }
.hero .btn-ghost { background: transparent; color: #fff; border-color: #fff; margin-left: 10px; }
@media (max-width: 720px) { .hero { padding: 40px 0; } .hero h1 { font-size: 28px; } }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.cat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--ink); }
.cat-card:hover { border-color: var(--brand); text-decoration: none; }
.cat-card strong { font-family: var(--serif); font-size: 18px; display: block; color: var(--brand); }
.cat-card span { font-size: 13px; color: var(--muted); }

/* ---------- 产品卡片 ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.product-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--ink); display: flex; flex-direction: column; transition: box-shadow .2s; }
.product-card:hover { box-shadow: 0 6px 24px rgba(60, 30, 20, .1); text-decoration: none; }
.product-card .thumb { aspect-ratio: 1 / 1; background: var(--brand-soft); display: grid; place-items: center; overflow: hidden; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .thumb .ph { font: 700 56px/1 var(--serif); color: var(--brand); opacity: .35; }
.product-card .body { padding: 14px 16px 16px; }
.product-card h3 { font-size: 17px; margin: 0 0 4px; }
.product-card .spec { font-size: 13px; color: var(--muted); margin: 0; }
.product-card .price { color: var(--brand); font-weight: 700; margin-top: 6px; }

/* ---------- 文章列表 ---------- */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-item { padding: 18px 0; border-bottom: 1px solid var(--line); display: flex; gap: 18px; }
.post-item .pthumb { flex: 0 0 180px; aspect-ratio: 16 / 10; border-radius: 8px; overflow: hidden; }
.post-item .pthumb img { width: 100%; height: 100%; object-fit: cover; }
.post-item h3 { margin: 0 0 4px; font-size: 19px; }
.post-item h3 a { color: var(--ink); }
.post-item h3 a:hover { color: var(--brand); }
.post-item p { margin: 0 0 6px; color: var(--muted); font-size: 15px; }
.meta { font-size: 13px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
@media (max-width: 600px) { .post-item .pthumb { flex-basis: 110px; } .post-item p { display: none; } }
.pagination { margin: 28px 0; display: flex; gap: 6px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- 文章页 ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 48px; }
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; } }
.entry-title { font-size: 32px; margin: 12px 0; }
@media (max-width: 720px) { .entry-title { font-size: 26px; } }
.entry-lead { font-size: 17px; color: var(--muted); border-left: 3px solid var(--gold); padding-left: 14px; margin: 16px 0 24px; }
.entry-content { font-size: 17px; line-height: 1.9; }
.entry-content h2 { font-size: 24px; margin: 40px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); scroll-margin-top: 84px; }
.entry-content h3 { font-size: 19px; margin: 28px 0 8px; scroll-margin-top: 84px; }
.entry-content p { margin: 0 0 16px; }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content li { margin: 4px 0; }
.entry-content blockquote { margin: 20px 0; padding: 12px 18px; background: var(--brand-soft); border-left: 4px solid var(--brand); border-radius: 0 var(--radius) var(--radius) 0; }
.entry-content blockquote p:last-child { margin: 0; }
.entry-content strong { color: var(--brand); font-weight: 600; }
.entry-content table { border-collapse: collapse; margin: 20px 0; font-size: 15px; display: block; overflow-x: auto; max-width: 100%; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.entry-content th { background: var(--brand-soft); white-space: nowrap; }
.entry-content img { border-radius: 8px; margin: 16px 0; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; margin: 32px 0; }
.box > h2 { font-size: 20px; margin: 0 0 12px; }
.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq details:last-child { border-bottom: 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 8px 0 0; }
.notice { font-size: 14px; color: var(--muted); }
.sources ol { font-size: 14px; padding-left: 1.4em; word-break: break-all; margin: 0; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 24px 0; }
.tags a { font-size: 13px; border: 1px solid var(--line); padding: 2px 10px; border-radius: 99px; color: var(--muted); }
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 32px 0; font-size: 15px; }
.prev-next a { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; color: var(--ink); display: block; }
.prev-next span { display: block; font-size: 12px; color: var(--muted); }

/* ---------- 侧栏 ---------- */
.sidebar .sticky { position: sticky; top: 84px; }
.widget { margin-bottom: 28px; }
.widget h2 { font-size: 16px; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--line); font-size: 14px; }
.toc li a { display: block; padding: 3px 0 3px 12px; color: var(--muted); }
.toc li.d3 a { padding-left: 24px; font-size: 13px; }
.toc a:hover { color: var(--brand); }
.mini-products a { display: flex; gap: 10px; align-items: center; color: var(--ink); padding: 8px 0; border-bottom: 1px dashed var(--line); }
.mini-products img, .mini-products .ph { width: 56px; height: 56px; border-radius: 6px; object-fit: cover; background: var(--brand-soft); flex: none; }
.mini-products span { font-size: 14px; line-height: 1.5; }
@media (max-width: 980px) { .sidebar .toc { display: none; } }

/* ---------- 产品详情 ---------- */
.product-top { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 20px; }
@media (max-width: 820px) { .product-top { grid-template-columns: 1fr; } }
.product-gallery .main-img { border-radius: var(--radius); overflow: hidden; background: var(--brand-soft); aspect-ratio: 1 / 1; display: grid; place-items: center; }
.product-gallery .main-img img { width: 100%; height: 100%; object-fit: cover; }
.product-gallery .thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.product-gallery .thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; }
.product-gallery .thumbs img.active { border-color: var(--brand); }
.product-info h1 { font-size: 28px; margin: 0 0 8px; }
.product-info .summary { color: var(--muted); }
.product-info .price { font-size: 24px; color: var(--brand); font-weight: 700; margin: 12px 0; }
.spec-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 15px; }
.spec-table th, .spec-table td { border-bottom: 1px solid var(--line); padding: 10px 4px; text-align: left; }
.spec-table th { color: var(--muted); font-weight: 400; width: 30%; }
.contact-box { background: var(--brand-soft); border-radius: var(--radius); padding: 16px 18px; margin-top: 20px; }
.contact-box p { margin: 4px 0; }
.contact-box img { width: 120px; margin-top: 8px; border-radius: 6px; }

/* ---------- 搜索/404 ---------- */
.search-form { display: flex; gap: 8px; max-width: 520px; }
.search-form input[type=search] { flex: 1; font: inherit; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; }
