/*
Theme Name: 夜航 Yehang
Theme URI: https://xfylab.cn/
Description: 夜间休闲行前核实的独立经典主题：行前四步导航、带核实范围的编辑精选、六栏任务索引、发布/核实日期分列的列表与文章事实框。浅底深海蓝，无父主题、无第三方字体与统计。
Version: 1.0.0
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: xfylab-yehang
*/

:root {
	--yh-bg: #f5f6f7;
	--yh-card: #ffffff;
	--yh-ink: #26323d;
	--yh-main: #17324d;
	--yh-main-dark: #0f2338;
	--yh-amber: #a86a1d;
	--yh-muted: #4c5967;
	--yh-line: #d8dde3;
	--yh-soft: #e8edf2;
	--yh-focus: #a86a1d;
	--yh-max: 1160px;
	--yh-r: 4px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--yh-bg); color: var(--yh-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(--yh-main); text-underline-offset: 3px; }
a:hover { color: var(--yh-amber); }
:focus-visible { outline: 3px solid var(--yh-focus); outline-offset: 2px; }
.screen-reader-text, .yh-skip:not(:focus) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.yh-skip:focus { position: fixed; top: 8px; left: 8px; z-index: 99; background: #fff; padding: 8px 12px; }
.yh-shell { max-width: var(--yh-max); margin: 0 auto; padding: 0 16px; }
.yh-muted { color: var(--yh-muted); font-size: 14px; margin: 0; }

/* 页头：浅底＋主色顶线 */
.yh-header { background: var(--yh-main); }
.yh-header__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 62px; }
.yh-brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.yh-brand__mark { width: 32px; height: 32px; border-radius: 4px; background: var(--yh-amber); color: #fff; display: inline-grid; place-items: center; font-size: 16px; }
.yh-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 6px; }
.yh-nav a { color: #e6edf4; text-decoration: none; font-size: 15px; padding: 6px 10px; border-radius: 999px; display: inline-block; }
.yh-nav a:hover, .yh-nav .current-cat > a, .yh-nav .current-menu-item > a { background: #24476a; color: #fff; }
.yh-menu-toggle { display: none; }
.yh-search { background: var(--yh-main-dark); }
.yh-search form { display: flex; gap: 8px; padding: 10px 0; }
.yh-search label { font-size: 14px; color: #c9d5e1; align-self: center; white-space: nowrap; }
.yh-search input[type="search"] { flex: 1; min-width: 0; border: 1px solid #b9c7c2; border-radius: 999px; padding: 6px 14px; font-size: 15px; background: #fff; color: var(--yh-ink); }
.yh-search button { border: 0; border-radius: 999px; background: var(--yh-amber); color: #fff; padding: 6px 18px; font-size: 15px; cursor: pointer; }

/* 首页 */
.yh-hero { padding: 34px 0 18px; }
.yh-hero h1 { margin: 0 0 8px; font-size: 29px; line-height: 1.35; color: var(--yh-main-dark); }
.yh-hero p { margin: 0; max-width: 760px; color: var(--yh-muted); }
.yh-steps { margin: 6px 0 30px; }
.yh-steps h2 { font-size: 17px; margin: 0 0 10px; }
.yh-steps ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: yhstep; border: 1px solid var(--yh-line); background: var(--yh-card); }
.yh-steps li { counter-increment: yhstep; border-left: 1px solid var(--yh-line); }
.yh-steps li:first-child { border-left: 0; }
.yh-steps a { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px 14px 12px 52px; position: relative; text-decoration: none; color: var(--yh-ink); }
.yh-steps a::before { content: counter(yhstep); position: absolute; left: 14px; top: 12px; width: 28px; height: 28px; border-radius: 50%; background: var(--yh-main); color: #fff; display: grid; place-items: center; font-weight: 700; }
.yh-steps a:hover { background: var(--yh-soft); }
.yh-steps strong { font-size: 17px; color: var(--yh-main); }
.yh-steps span { font-size: 14px; color: var(--yh-muted); line-height: 1.6; }
.yh-steps em { font-style: normal; font-size: 13px; color: var(--yh-amber); }
.yh-check { margin: 4px 0 0; font-size: 13px; color: var(--yh-muted); display: flex; flex-wrap: wrap; gap: 2px 10px; }
.yh-check b { color: #fff; background: var(--yh-main); padding: 0 8px; border-radius: 3px; font-weight: 400; }
.yh-factbox { border: 1px solid var(--yh-line); border-left: 4px solid var(--yh-main); background: #f9fafb; padding: 10px 16px; margin: 0 0 18px; font-size: 15px; }
.yh-factbox__title { font-size: 16px; margin: 0 0 6px; color: var(--yh-main); }
.yh-factbox dl { margin: 0; display: grid; grid-template-columns: 5.5em minmax(0, 1fr); gap: 4px 10px; }
.yh-factbox dt { color: var(--yh-muted); }
.yh-factbox dd { margin: 0; }
.yh-factbox ul { margin: 0; padding-left: 18px; }

.yh-section { margin: 0 0 32px; }
.yh-section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.yh-section__head h2 { margin: 0; font-size: 21px; padding-left: 12px; border-left: 4px solid var(--yh-main); line-height: 1.3; }

.yh-feature { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; }
.yh-feature__side { display: grid; gap: 18px; }
.yh-card { background: var(--yh-card); border: 1px solid var(--yh-line); border-radius: var(--yh-r); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.yh-card__thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--yh-soft); }
.yh-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.yh-card--side { flex-direction: row; }
.yh-card--side .yh-card__thumb { flex: 0 0 46%; }
.yh-card__body { padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.yh-card h3 { margin: 0; font-size: 18px; line-height: 1.5; }
.yh-card--main h3 { font-size: 21px; }
.yh-card h3 a { color: var(--yh-ink); text-decoration: none; }
.yh-card h3 a:hover { color: var(--yh-amber); }
.yh-card p { margin: 0; font-size: 15px; color: var(--yh-muted); }
.yh-card time { font-size: 13px; color: var(--yh-muted); }
.yh-tag { align-self: flex-start; font-size: 13px; color: var(--yh-amber); text-decoration: none; border: 1px solid #e3c7bb; border-radius: 999px; padding: 0 10px; }

.yh-index { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.yh-index__col { background: var(--yh-card); border: 1px solid var(--yh-line); border-radius: var(--yh-r); padding: 12px 14px; }
.yh-index__col h3 { margin: 0 0 6px; font-size: 17px; }
.yh-index__col h3 a { text-decoration: none; color: var(--yh-main-dark); }
.yh-index__col small { color: var(--yh-muted); font-weight: 400; font-size: 13px; }
.yh-index__col ul { margin: 0; padding-left: 18px; }
.yh-index__col li { font-size: 15px; padding: 3px 0; line-height: 1.6; }
.yh-index__col li a { color: var(--yh-ink); text-decoration: none; }
.yh-index__col li a:hover { color: var(--yh-amber); }

.yh-principles__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.yh-principles__grid > div { background: var(--yh-card); border: 1px dashed var(--yh-main); border-radius: var(--yh-r); padding: 14px 18px; }
.yh-principles h3 { margin: 0 0 6px; font-size: 17px; color: var(--yh-main-dark); }
.yh-principles ol { margin: 0; padding-left: 22px; }
.yh-principles p { margin: 0 0 8px; color: var(--yh-muted); font-size: 15px; }
.yh-more { font-size: 15px; margin-right: 12px; }

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

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

/* 归档、侧栏 */
.yh-crumbs { font-size: 13px; color: var(--yh-muted); padding-top: 16px; }
.yh-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.yh-crumbs li + li::before { content: "/"; margin-right: 4px; color: #9aa7a4; }
.yh-crumbs a { color: var(--yh-muted); }
.yh-archive-head { padding: 22px 0 12px; }
.yh-archive-head h1 { margin: 0 0 6px; font-size: 26px; color: var(--yh-main-dark); }
.yh-archive-head .yh-desc { margin: 0; max-width: 780px; color: var(--yh-muted); }
.yh-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 26px; padding-bottom: 40px; }
.yh-layout > * { min-width: 0; }
.yh-side .yh-box { background: var(--yh-card); border: 1px solid var(--yh-line); border-radius: var(--yh-r); padding: 14px 16px; margin-bottom: 18px; }
.yh-side h2 { font-size: 16px; margin: 0 0 8px; }
.yh-side ul { list-style: none; margin: 0; padding: 0; }
.yh-side li { padding: 6px 0; border-top: 1px solid var(--yh-soft); font-size: 15px; }
.yh-side li:first-child { border-top: 0; }
.yh-side a { text-decoration: none; }
.yh-pagination { margin: 24px 0; }
.yh-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.yh-pagination .page-numbers { display: inline-block; min-width: 38px; text-align: center; padding: 4px 12px; border: 1px solid var(--yh-line); border-radius: 999px; background: var(--yh-card); text-decoration: none; }
.yh-pagination .current { background: var(--yh-main); border-color: var(--yh-main); color: #fff; }

/* 文章 */
.yh-article { background: var(--yh-card); border: 1px solid var(--yh-line); border-radius: var(--yh-r); padding: 24px 28px; }
.yh-article h1 { margin: 0 0 8px; font-size: 27px; line-height: 1.45; color: var(--yh-main-dark); }
.yh-summary { background: var(--yh-soft); border-radius: 8px; padding: 10px 14px; margin: 16px 0; font-size: 15px; }
.yh-toc { border: 1px solid var(--yh-line); border-radius: 8px; padding: 10px 16px; margin: 0 0 18px; font-size: 15px; }
.yh-toc summary { cursor: pointer; font-weight: 700; color: var(--yh-main-dark); }
.yh-toc ol { margin: 8px 0 0; padding-left: 22px; }
.yh-content { font-size: 17px; line-height: 1.9; overflow-wrap: anywhere; }
.yh-content h2 { font-size: 21px; margin: 30px 0 10px; padding-left: 10px; border-left: 4px solid var(--yh-amber); line-height: 1.4; scroll-margin-top: 16px; }
.yh-content h3 { font-size: 18px; margin: 22px 0 8px; }
.yh-content p { margin: 0 0 14px; }
.yh-content ul, .yh-content ol { padding-left: 24px; margin: 0 0 14px; }
.yh-content blockquote { margin: 0 0 16px; padding: 10px 16px; background: #faf5f1; border-left: 4px solid var(--yh-amber); border-radius: 0 8px 8px 0; font-size: 16px; }
.yh-content blockquote p:last-child { margin: 0; }
.yh-content figure { margin: 18px 0; }
.yh-content figure img { margin: 0 auto; max-height: 720px; width: auto; border-radius: 8px; }
.yh-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 16px; border: 1px solid var(--yh-line); border-radius: 8px; }
.yh-content table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 15px; background: #fff; }
.yh-content th, .yh-content td { border: 1px solid var(--yh-line); padding: 8px 10px; text-align: left; vertical-align: top; }
.yh-content th { background: var(--yh-soft); }
.yh-source { margin-top: 24px; font-size: 14px; color: var(--yh-muted); border-top: 1px solid var(--yh-line); padding-top: 12px; }
.yh-related { margin-top: 24px; }
.yh-related h2 { font-size: 19px; margin: 0 0 8px; border: 0; padding: 0; }
.yh-related ul { margin: 0; padding-left: 20px; }
.yh-postnav { display: flex; justify-content: space-between; gap: 16px; margin-top: 20px; font-size: 15px; flex-wrap: wrap; }

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

@media (max-width: 980px) {
	.yh-layout { grid-template-columns: minmax(0, 1fr); }
	.yh-steps ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.yh-steps li:nth-child(3) { border-left: 0; }
	.yh-steps li:nth-child(n+3) { border-top: 1px solid var(--yh-line); }
	.yh-feature { grid-template-columns: minmax(0, 1fr); }
	.yh-footer__cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
	.yh-header__bar { flex-wrap: wrap; padding: 8px 0; }
	.yh-nav--desktop { display: none; }
	.yh-menu-toggle { display: block; }
	.yh-menu-toggle summary { list-style: none; cursor: pointer; color: #fff; border: 1px solid #5d7d9c; border-radius: 999px; padding: 2px 14px; font-size: 15px; }
	.yh-menu-toggle summary::-webkit-details-marker { display: none; }
	.yh-menu-toggle[open] { flex-basis: 100%; }
	.yh-menu-toggle[open] .yh-nav ul { flex-direction: column; padding: 6px 0; }
	.yh-row { grid-template-columns: minmax(0, 1fr); }
	.yh-row__thumb { width: 100%; }
	.yh-card--side { flex-direction: column; }
	.yh-principles__grid { grid-template-columns: 1fr; }
	.yh-hero h1 { font-size: 24px; }
	.yh-article { padding: 18px 16px; }
	.yh-article h1 { font-size: 23px; }
}
@media (max-width: 480px) {
	.yh-steps ol { grid-template-columns: minmax(0, 1fr); }
	.yh-steps li { border-left: 0; border-top: 1px solid var(--yh-line); }
	.yh-steps li:first-child { border-top: 0; }
	.yh-footer__cols { grid-template-columns: 1fr; }
	.yh-search label { display: none; }
	.yh-content { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
