/*
Theme Name: 茶序 Chaxu Index
Theme URI: https://09xn.cn/
Description: 以“条件比较与到店准备”为阅读流程的独立经典主题：横向条件条、分组信息行、文章目录与字段对照表。无父主题、无第三方字体与统计。
Version: 1.0.1
Requires at least: 6.4
Requires PHP: 8.0
Author: 上海品茶网
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: chaxu-index
*/

:root {
	--cx-bg: #f6f4ed;
	--cx-card: #ffffff;
	--cx-green: #254c3b;
	--cx-green-2: #1b3a2d;
	--cx-ink: #22332b;
	--cx-muted: #4f5f57;
	--cx-copper: #9a603a;
	--cx-line: #dcd6c6;
	--cx-soft: #ebe7da;
	--cx-focus: #b5651d;
	--cx-max: 1180px;
	--cx-radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--cx-bg);
	color: var(--cx-ink);
	font: 16px/1.8 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
	overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cx-green); text-underline-offset: 3px; }
a:hover { color: var(--cx-copper); }
:focus-visible { outline: 3px solid var(--cx-focus); outline-offset: 2px; }
.screen-reader-text, .cx-skip:not(:focus) {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.cx-skip:focus { position: fixed; top: 8px; left: 8px; z-index: 99; background: #fff; padding: 8px 12px; }
.cx-shell { max-width: var(--cx-max); margin: 0 auto; padding: 0 16px; }

/* 头部 */
.cx-header { background: var(--cx-green); color: #fff; }
.cx-header__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.cx-brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 20px; letter-spacing: 1px; display: flex; align-items: center; gap: 10px; }
.cx-brand__mark { width: 30px; height: 30px; border: 2px solid #e8d5c4; border-radius: 50%; display: inline-grid; place-items: center; font-size: 15px; color: #e8d5c4; }
.cx-brand:hover { color: #f3e6d9; }
.cx-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 18px; }
.cx-nav a { color: #f2efe6; text-decoration: none; font-size: 15px; padding: 6px 0; display: inline-block; }
.cx-nav a:hover, .cx-nav .current-menu-item > a, .cx-nav .current-cat > a { color: #fff; border-bottom: 2px solid #e8d5c4; }
.cx-menu-toggle { display: none; }
.cx-search { background: var(--cx-green-2); }
.cx-search form { display: flex; gap: 8px; padding: 10px 0; }
.cx-search label { color: #e9e4d6; font-size: 14px; align-self: center; white-space: nowrap; }
.cx-search input[type="search"] { flex: 1; min-width: 0; border: 1px solid #6c8a7b; background: #fff; color: var(--cx-ink); border-radius: var(--cx-radius); padding: 6px 10px; font-size: 15px; }
.cx-search button { background: var(--cx-copper); color: #fff; border: 0; border-radius: var(--cx-radius); padding: 6px 16px; font-size: 15px; cursor: pointer; }

/* 首页 */
.cx-hero { padding: 36px 0 20px; }
.cx-hero h1 { margin: 0 0 10px; font-size: 30px; line-height: 1.35; color: var(--cx-green); }
.cx-hero p { margin: 0; color: var(--cx-muted); max-width: 760px; }
.cx-coverage { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--cx-muted); }
.cx-coverage strong { color: var(--cx-ink); }
.cx-condbar { background: var(--cx-card); border: 1px solid var(--cx-line); border-radius: var(--cx-radius); padding: 14px 16px; margin: 8px 0 28px; }
.cx-condbar h2 { font-size: 16px; margin: 0 0 8px; color: var(--cx-green); }
.cx-condbar ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cx-condbar a { display: inline-block; border: 1px solid var(--cx-line); border-radius: 999px; padding: 4px 14px; text-decoration: none; background: var(--cx-bg); font-size: 15px; }
.cx-condbar a:hover { border-color: var(--cx-copper); }
.cx-condbar a span { color: var(--cx-muted); font-size: 13px; margin-left: 4px; }

.cx-section { margin: 0 0 32px; }
.cx-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border-bottom: 2px solid var(--cx-green); margin-bottom: 14px; }
.cx-section__head h2 { margin: 0 0 6px; font-size: 21px; color: var(--cx-green); }
.cx-section__head a { font-size: 14px; white-space: nowrap; }
.cx-section__lead { margin: -4px 0 14px; color: var(--cx-muted); font-size: 15px; }

.cx-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; list-style: none; margin: 0; padding: 0; counter-reset: cxstep; }
.cx-steps li { background: var(--cx-card); border: 1px solid var(--cx-line); border-radius: var(--cx-radius); padding: 14px 16px 14px 56px; position: relative; counter-increment: cxstep; }
.cx-steps li::before { content: counter(cxstep); position: absolute; left: 16px; top: 14px; width: 28px; height: 28px; border-radius: 50%; background: var(--cx-copper); color: #fff; display: grid; place-items: center; font-weight: 700; }
.cx-steps strong { display: block; color: var(--cx-green); }

.cx-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.cx-group { background: var(--cx-card); border: 1px solid var(--cx-line); border-radius: var(--cx-radius); padding: 14px 16px; }
.cx-group h3 { margin: 0 0 4px; font-size: 18px; }
.cx-group h3 a { text-decoration: none; }
.cx-group p { margin: 0 0 8px; font-size: 14px; color: var(--cx-muted); }
.cx-group ul { margin: 0; padding: 0; list-style: none; }
.cx-group li { border-top: 1px dashed var(--cx-line); padding: 7px 0; display: flex; gap: 10px; justify-content: space-between; font-size: 15px; }
.cx-group li a { text-decoration: none; color: var(--cx-ink); }
.cx-group li a:hover { color: var(--cx-copper); }
.cx-group time { color: var(--cx-muted); font-size: 13px; white-space: nowrap; }

.cx-empty { background: var(--cx-card); border: 1px dashed var(--cx-copper); border-radius: var(--cx-radius); padding: 16px; color: var(--cx-muted); }

/* 列表行（4:3 缩略图 368×276） */
.cx-rows { display: grid; gap: 16px; }
.cx-row { display: grid; grid-template-columns: 368px minmax(0, 1fr); gap: 20px; background: var(--cx-card); border: 1px solid var(--cx-line); border-radius: var(--cx-radius); padding: 14px; }
.cx-row__thumb { display: block; width: 368px; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; background: var(--cx-soft); }
.cx-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.cx-row h2, .cx-row h3 { margin: 2px 0 6px; font-size: 19px; line-height: 1.5; }
.cx-row h2 a, .cx-row h3 a { text-decoration: none; color: var(--cx-ink); }
.cx-row h2 a:hover, .cx-row h3 a:hover { color: var(--cx-copper); }
.cx-meta { font-size: 13px; color: var(--cx-muted); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.cx-meta a { color: var(--cx-copper); text-decoration: none; }
.cx-row p { margin: 8px 0 0; font-size: 15px; color: #33443b; }

/* 归档 */
.cx-archive-head { padding: 26px 0 10px; }
.cx-archive-head h1 { margin: 0 0 6px; font-size: 26px; color: var(--cx-green); }
.cx-archive-head .cx-desc { color: var(--cx-muted); margin: 0; max-width: 780px; }
.cx-crumbs { font-size: 13px; color: var(--cx-muted); padding-top: 16px; }
.cx-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.cx-crumbs li + li::before { content: "›"; margin-right: 4px; }
.cx-crumbs a { color: var(--cx-muted); }

.cx-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; padding-bottom: 40px; }
.cx-layout > *, .cx-row > * { min-width: 0; }
.cx-side .cx-box { background: var(--cx-card); border: 1px solid var(--cx-line); border-radius: var(--cx-radius); padding: 14px 16px; margin-bottom: 18px; }
.cx-side h2 { font-size: 16px; margin: 0 0 8px; color: var(--cx-green); }
.cx-side ul { margin: 0; padding: 0; list-style: none; }
.cx-side li { padding: 6px 0; border-top: 1px dashed var(--cx-line); font-size: 15px; }
.cx-side li:first-child { border-top: 0; }
.cx-side a { text-decoration: none; }

.cx-pagination { margin: 24px 0; }
.cx-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.cx-pagination .page-numbers { display: inline-block; min-width: 38px; text-align: center; padding: 4px 10px; border: 1px solid var(--cx-line); border-radius: var(--cx-radius); background: var(--cx-card); text-decoration: none; }
.cx-pagination .current { background: var(--cx-green); color: #fff; border-color: var(--cx-green); }

/* 文章 */
.cx-article { background: var(--cx-card); border: 1px solid var(--cx-line); border-radius: var(--cx-radius); padding: 24px 28px; }
.cx-article h1 { margin: 0 0 8px; font-size: 27px; line-height: 1.45; color: var(--cx-green); }
.cx-summary { background: var(--cx-bg); border-left: 4px solid var(--cx-copper); padding: 10px 14px; margin: 16px 0; font-size: 15px; color: #33443b; }
.cx-toc { border: 1px solid var(--cx-line); border-radius: var(--cx-radius); padding: 10px 16px; margin: 0 0 18px; font-size: 15px; }
.cx-toc summary { cursor: pointer; font-weight: 700; color: var(--cx-green); }
.cx-toc ol { margin: 8px 0 0; padding-left: 22px; }
.cx-content { font-size: 17px; line-height: 1.9; overflow-wrap: anywhere; }
.cx-content h2 { font-size: 21px; color: var(--cx-green); margin: 30px 0 10px; padding-bottom: 4px; border-bottom: 1px solid var(--cx-line); scroll-margin-top: 16px; }
.cx-content h3 { font-size: 18px; margin: 22px 0 8px; }
.cx-content p { margin: 0 0 14px; }
.cx-content ul, .cx-content ol { padding-left: 24px; margin: 0 0 14px; }
.cx-content figure { margin: 18px 0; }
.cx-content figure img { margin: 0 auto; max-height: 720px; width: auto; border-radius: 4px; }
.cx-content figcaption { text-align: center; font-size: 13px; color: var(--cx-muted); margin-top: 6px; }
.cx-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 16px; border: 1px solid var(--cx-line); border-radius: 4px; }
.cx-content table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 15px; background: #fff; }
.cx-content th, .cx-content td { border: 1px solid var(--cx-line); padding: 8px 10px; text-align: left; vertical-align: top; }
.cx-content th { background: var(--cx-soft); color: var(--cx-green-2); }
.cx-note { background: #fbf6ef; border: 1px solid #e6d3c1; border-radius: 4px; padding: 10px 14px; font-size: 15px; }
.cx-source { margin-top: 24px; font-size: 14px; color: var(--cx-muted); border-top: 1px solid var(--cx-line); padding-top: 12px; }
.cx-related { margin-top: 24px; }
.cx-related h2 { font-size: 19px; color: var(--cx-green); margin: 0 0 8px; }
.cx-related ul { margin: 0; padding-left: 20px; }
.cx-related li { padding: 3px 0; }
.cx-postnav { display: flex; justify-content: space-between; gap: 16px; margin-top: 20px; font-size: 15px; }

/* 页脚 */
.cx-footer { background: var(--cx-green-2); color: #d9d4c6; padding: 28px 0 22px; font-size: 14px; }
.cx-footer a { color: #f1ead9; }
.cx-footer__cols { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 20px; }
.cx-footer h2 { font-size: 15px; color: #fff; margin: 0 0 8px; }
.cx-footer ul { list-style: none; margin: 0; padding: 0; }
.cx-footer li { padding: 3px 0; }
.cx-footer__copy { border-top: 1px solid #3a5b4b; margin-top: 18px; padding-top: 12px; }

.cx-404 { padding: 48px 0; }

@media (max-width: 980px) {
	.cx-layout { grid-template-columns: minmax(0, 1fr); }
	.cx-groups { grid-template-columns: 1fr; }
	.cx-footer__cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
	.cx-header__bar { flex-wrap: wrap; padding: 8px 0; }
	.cx-menu-toggle { display: block; }
	.cx-menu-toggle summary { list-style: none; cursor: pointer; color: #fff; border: 1px solid #8fae9f; border-radius: var(--cx-radius); padding: 2px 12px; font-size: 15px; }
	.cx-menu-toggle summary::-webkit-details-marker { display: none; }
	.cx-nav--desktop { display: none; }
	.cx-menu-toggle[open] .cx-nav ul { flex-direction: column; gap: 0; padding: 8px 0; }
	.cx-row { grid-template-columns: 1fr; }
	.cx-row__thumb { width: 100%; max-width: none; }
	.cx-steps { grid-template-columns: 1fr; }
	.cx-hero h1 { font-size: 24px; }
	.cx-article { padding: 18px 16px; }
	.cx-article h1 { font-size: 23px; }
}
@media (max-width: 480px) {
	.cx-footer__cols { grid-template-columns: 1fr; }
	.cx-search label { display: none; }
	.cx-content { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
