/* 永字八法 · 模式标签、操作条、说明面板、弹窗与宽屏布局 */

/* ---------- 模式 ---------- */
.yz-tabs { display: flex; justify-content: center; gap: 2px; border-bottom: 1px solid var(--line); }
.yz-tabs button {
	position: relative; display: grid; justify-items: center; gap: 1px;
	padding: 6px 10px 8px; background: none; border: 0; color: var(--txt2);
	font: 500 14px/1.3 var(--sans); letter-spacing: .06em; white-space: nowrap;
}
.yz-tabs button i { font-style: normal; font-size: 9.5px; color: var(--txt3); letter-spacing: .1em; }
.yz-tabs button:hover { color: var(--txt); }
.yz-tabs button[aria-selected="true"] { color: var(--txt); }
.yz-tabs button[aria-selected="true"] i { color: var(--gold); }
.yz-tabs button[aria-selected="true"]::after {
	content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--verm);
}

/* ---------- 操作条 ---------- */
.yz-ctl { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; max-width: 100%; }
.yz-sep { width: 1px; height: 20px; background: var(--line2); margin: 0 2px; }
.yz-btn, .yz-ib {
	display: inline-flex; align-items: center; justify-content: center; gap: 2px;
	height: 36px; min-width: 36px; padding: 0 13px;
	background: rgba(242, 235, 222, .04); border: 1px solid var(--line2); border-radius: 2px;
	color: var(--txt); font: 500 14px/1 var(--sans); letter-spacing: .08em; text-decoration: none;
	transition: background .15s, border-color .15s, color .15s;
}
.yz-ib { padding: 0; width: 36px; }
.yz-ib svg { width: 16px; height: 16px; }
.yz-btn:hover, .yz-ib:hover { background: rgba(242, 235, 222, .1); border-color: rgba(242, 235, 222, .4); }
.yz-btn[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-l); background: rgba(217, 179, 108, .1); }
.yz-btn--main { background: var(--verm-d); border-color: var(--verm); color: var(--paper); }
.yz-btn--main:hover { background: var(--verm); border-color: var(--verm); }
.yz-btn:disabled, .yz-ib:disabled { opacity: .35; cursor: default; pointer-events: none; }
#bSound .off { display: none; }
#bSound[aria-pressed="false"] .on { display: none; }
#bSound[aria-pressed="false"] .off { display: block; }
#bSound[aria-pressed="false"] { color: var(--txt3); }

/* ---------- 面板 ---------- */
.yz-panel { padding-bottom: 72px; }
.yz-pane { animation: yzIn .3s ease both; }
@keyframes yzIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.yz-k { margin: 0 0 6px; font: 500 10.5px/1.4 var(--mono); letter-spacing: .22em; color: var(--gold); }
.yz-lead { margin: 0 0 14px; font-size: 14px; line-height: 1.85; color: var(--txt2); }
.yz-h { margin: 18px 0 8px; font: 700 17px/1.4 var(--serif); letter-spacing: .08em; }

.yz-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 0 0 14px; }
.yz-chip {
	position: relative; display: grid; justify-items: center; gap: 2px; padding: 7px 4px 8px;
	background: rgba(242, 235, 222, .03); border: 1px solid var(--line); border-radius: 2px; color: var(--txt);
}
.yz-chip i { position: absolute; left: 5px; top: 4px; font: 500 9px/1 var(--mono); font-style: normal; color: var(--txt3); }
.yz-chip b { font: 700 24px/1.15 var(--serif); }
.yz-chip span { font-size: 11px; line-height: 1.2; color: var(--txt3); white-space: nowrap; }
.yz-chip em { position: absolute; right: 5px; top: 4px; font: 600 9.5px/1 var(--mono); font-style: normal; color: var(--gold); }
.yz-chip:hover { border-color: var(--line2); background: rgba(242, 235, 222, .07); }
.yz-chip.done::after { content: ""; position: absolute; right: 6px; bottom: 6px; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }
.yz-chip[aria-current="true"] { border-color: var(--verm); background: rgba(226, 70, 43, .13); }
.yz-chip[aria-current="true"] span { color: var(--txt2); }

.yz-card { border-top: 1px solid var(--line2); padding-top: 14px; }
.yz-card__h { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 10px; }
.yz-card__ch { font: 700 60px/0.95 var(--serif); color: var(--txt); }
.yz-card__meta { display: grid; gap: 4px; padding-bottom: 4px; }
.yz-card__meta .mono { font-size: 11px; color: var(--gold); letter-spacing: .12em; }
.yz-now { font-size: 13px; color: var(--txt2); }
.yz-now b { font: 700 16px/1 var(--serif); color: var(--txt); margin: 0 4px; }
.yz-part { font-size: 12.5px; color: var(--txt3); }
.yz-dl { margin: 0; display: grid; grid-template-columns: 2.6em minmax(0, 1fr); gap: 9px 10px; }
.yz-dl dt { font: 500 10.5px/2.2 var(--mono); letter-spacing: .14em; color: var(--gold); }
.yz-dl dd { margin: 0; font-size: 14px; line-height: 1.8; color: var(--txt2); }
.yz-q { font: 400 15.5px/1.85 var(--serif); color: var(--txt); }
.yz-q .ask { color: var(--txt2); }
.yz-src { display: block; margin-top: 1px; font-size: 11.5px; line-height: 1.5; color: var(--txt3); }
.yz-note { margin: 14px 0 0; font-size: 12.5px; line-height: 1.75; color: var(--txt3); }

.yz-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.yz-list li { padding-left: 12px; border-left: 2px solid rgba(226, 70, 43, .55); }
.yz-list b { display: block; font: 700 15px/1.5 var(--serif); letter-spacing: .06em; }
.yz-list p { margin: 2px 0 0; font-size: 13.5px; line-height: 1.8; color: var(--txt2); }

.yz-res { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 4px; min-height: 34px; }
.yz-res b { font: 700 30px/1 var(--mono); color: var(--gold-l); }
.yz-res span { font: 700 17px/1.2 var(--serif); letter-spacing: .1em; }
.yz-res small { font-size: 12px; color: var(--txt3); }
.yz-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 10px 0; }
.yz-sum div { border: 1px solid var(--line); padding: 6px 4px; text-align: center; }
.yz-sum b { display: block; font: 700 18px/1.2 var(--serif); }
.yz-sum span { font: 600 12px/1.2 var(--mono); color: var(--gold); }
.yz-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* ---------- 存图弹窗 ---------- */
.yz-modal {
	position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
	background: rgba(6, 5, 4, .78); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.yz-modal__box { width: min(420px, 100%); background: var(--ink2); border: 1px solid var(--line2); padding: 16px; text-align: center; }
.yz-modal__t { margin: 0 0 10px; font: 700 16px/1.4 var(--serif); letter-spacing: .1em; }
.yz-modal__box img { display: block; width: 100%; height: auto; max-height: 56vh; object-fit: contain; background: var(--paper); }
.yz-modal__d { margin: 10px 0; font-size: 12.5px; color: var(--txt3); }
.yz-modal__btns { display: flex; justify-content: center; gap: 8px; }

.yz-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 窄屏 ---------- */
@media (max-width: 879px) {
	html.in-frame { --padT: 12px; }
	html.in-frame .yz-head { padding: 2px 84px 0; min-height: 40px; }
	html.in-frame .yz-sub { display: none; }
	.yz-sheet { margin: 26px 0 28px; }
	.yz-tabs { overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
	.yz-tabs::-webkit-scrollbar { display: none; }
	.yz-tabs button { flex: 1 0 auto; padding: 5px 8px 7px; font-size: 13.5px; }
}
@media (max-width: 879px) and (min-width: 480px) { .yz-tabs { justify-content: center; } .yz-tabs button { flex: 0 0 auto; } }
@media (max-width: 479px) { .yz-btn { padding: 0 10px; letter-spacing: .04em; } .yz-ctl { gap: 6px; } .yz-ctl .yz-sep { display: none; } kbd { display: none; } }

/* ---------- 宽屏：左纸右文 ---------- */
@media (min-width: 880px) {
	.yz {
		height: 100vh; height: 100dvh; min-height: 420px; overflow: hidden;
		grid-template-columns: minmax(0, 1fr) clamp(320px, 31vw, 440px);
		grid-template-rows: auto auto minmax(0, 1fr);
		grid-template-areas: "stage head" "stage tabs" "stage panel";
		column-gap: clamp(24px, 3.4vw, 56px);
		row-gap: 10px;
		padding-left: calc(clamp(20px, 3vw, 48px) + var(--sal));
		padding-right: calc(clamp(16px, 2.6vw, 40px) + var(--sar));
	}
	.yz-head { text-align: left; }
	.yz-tabs { justify-content: flex-start; }
	.yz-stage { justify-content: center; min-height: 0; }
	.yz-sheet { margin-top: 24px; margin-bottom: 26px; }
	.yz-panel { min-height: 0; overflow-y: auto; padding-right: 6px; scrollbar-width: thin; scrollbar-color: var(--line2) transparent; }
}

/* 米字格四角的装饰框比格子大一圈：窄屏上格子贴边时别把页面撑宽（否则手机上能左右滑） */
.yz { overflow-x: clip; }
@supports not (overflow: clip) { .yz { overflow-x: hidden; } }
