/* 指南针四法 · 天青釉色的试验台：四种装法并排，同一阵风同时吹到。
   针锋用朱色；原文竖排，碰到哪一种装法，哪一句就亮起来。 */
:root {
	--bg: #dfe8e3;
	--bg2: #d2ddd7;
	--card: #edf3ef;
	--ink: #1d2a2a;
	--ink2: #3c4e4d;
	--ink3: #556766;
	--line: rgba(29, 42, 42, .14);
	--zhu: #a8382a;
	--glaze: #8fb8a8;
	--silk: #b88a2e;
	--hl: rgba(184, 138, 46, .2);
	--serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "Noto Serif SC", "SimSun", serif;
	--sans: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
	color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
	margin: 0; min-height: 100%; color: var(--ink); font: 14px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden;
	background: radial-gradient(110% 90% at 40% 30%, #e9f0ec 0%, var(--bg) 55%, var(--bg2) 100%) no-repeat, var(--bg);
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--zhu); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- 桌面：上标题，中间四张试验台，右边竖排原文，下边按钮 ---------- */
.app {
	height: 100vh; height: 100svh; min-height: 540px; overflow: hidden;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 176px;
	grid-template-rows: 56px minmax(0, 1fr) auto;
	grid-template-areas: "top top" "lab text" "more more";
	column-gap: 22px; padding: 0 22px 12px;
}
.top { grid-area: top; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.title { margin: 0; font: 700 24px/1.15 var(--serif); letter-spacing: .3em; margin-left: .3em; }
.sub { margin: 3px 0 0; font-size: 12.5px; color: var(--ink3); letter-spacing: .04em; }

.lab { grid-area: lab; min-height: 0; display: flex; flex-direction: column; justify-content: center; }
.bench { min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; align-items: center; }
.card {
	position: relative; min-width: 0; display: grid; grid-template-rows: auto auto auto auto; align-content: center;
	padding: 8px 10px 9px; background: var(--card); border: 1px solid rgba(29, 42, 42, .1); border-radius: 14px;
	box-shadow: 0 1px 0 rgba(255, 255, 255, .7) inset, 0 14px 28px -22px rgba(29, 42, 42, .45);
	transition: box-shadow .2s, border-color .2s;
}
.card.hl { border-color: rgba(184, 138, 46, .55); box-shadow: 0 0 0 3px var(--hl), 0 14px 28px -22px rgba(29, 42, 42, .45); }
.card__h { margin: 0 0 2px; font: 700 18px/1.2 var(--serif); letter-spacing: .2em; text-align: center; }
.card__stage { position: relative; overflow: hidden; contain: layout paint; aspect-ratio: 1 / 1; max-height: 40vh; margin: 0 auto; width: 100%; border-radius: 10px; outline: none; touch-action: none; cursor: grab; -webkit-tap-highlight-color: transparent; }
.card__stage:active { cursor: grabbing; }
.card__stage:focus-visible { outline: 2px solid var(--zhu); outline-offset: 2px; }
.card__stage > .base, .lyr, .fxl { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.card__stage > .base { display: block; overflow: visible; }
.base text { font-family: var(--sans); }
.lyr { will-change: transform; transform-origin: 50% 50%; }
.lyr svg { display: block; width: 100%; height: 100%; overflow: visible; }
.lyr.shadow { opacity: .22; }
.lyr.dev { will-change: auto; }
.lyr.dev.shk { animation: shk .42s linear; }
@keyframes shk { 0% { transform: none; } 15% { transform: translate(1.2%, -.8%); } 30% { transform: translate(-1%, .9%); } 45% { transform: translate(.8%, .6%); } 60% { transform: translate(-.6%, -.5%); } 80% { transform: translate(.3%, .2%); } 100% { transform: none; } }
.thread { position: absolute; left: 33%; top: 15%; width: 50%; height: 1px; transform-origin: 0 50%; pointer-events: none; will-change: transform; background: linear-gradient(90deg, rgba(184, 138, 46, 0), #b88a2e 70%); }
.fxl { overflow: hidden; }
.fxl--water { clip-path: circle(31.5% at 50% 50%); }
.rip { position: absolute; width: 64%; height: 64%; margin: -32% 0 0 -32%; border-radius: 50%; pointer-events: none;
	background: radial-gradient(circle closest-side, transparent 88%, rgba(255, 255, 255, .85) 93%, transparent 99%);
	animation: rip 1.5s ease-out both; will-change: transform, opacity; }
@keyframes rip { from { transform: scale(.06); opacity: .9; } to { transform: scale(1); opacity: 0; } }
.gust { position: absolute; inset: 0; transform: rotate(var(--a)); pointer-events: none; }
.gust b { position: absolute; left: 42%; top: calc(50% + var(--o)); width: 16%; height: 1.5px; border-radius: 1px; background: rgba(29, 42, 42, .4); animation: gust .7s linear both; will-change: transform, opacity; }
@keyframes gust { from { transform: translateX(-380%); opacity: 0; } 25% { opacity: .9; } 75% { opacity: .9; } to { transform: translateX(380%); opacity: 0; } }
.card.down .card__stage { cursor: pointer; }
.trace { display: block; width: 100%; height: 30px; margin-top: 4px; }
.card__st { margin: 3px 0 0; min-height: 2.9em; font-size: 12.5px; line-height: 1.45; color: var(--ink2); text-align: center; font-variant-numeric: tabular-nums; }
.card__st b { color: var(--ink); font-weight: 600; }
.card__st .z { color: var(--zhu); font-weight: 600; }

.acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding-top: 12px; }
.btn {
	min-height: 40px; padding: 0 16px; cursor: pointer; white-space: nowrap; font-size: 14.5px; letter-spacing: .06em;
	color: var(--ink); background: rgba(255, 255, 255, .55); border: 1px solid rgba(29, 42, 42, .22); border-radius: 999px;
	transition: background .15s, border-color .15s; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:hover { background: rgba(255, 255, 255, .85); border-color: rgba(29, 42, 42, .38); }
.btn--main { color: #f4f7f5; background: #2c3f3e; border-color: #2c3f3e; }
.btn--main:hover { background: #1f302f; border-color: #1f302f; }
.btn--sw[aria-checked="true"] { border-color: var(--zhu); color: var(--zhu); }
.btn--sw::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; border: 1.5px solid currentColor; vertical-align: 1px; }
.btn--sw[aria-checked="true"]::before { background: currentColor; }
.btn--text { display: none; }

.text { grid-area: text; position: relative; min-height: 0; padding: 4px 0 130px; display: flex; justify-content: center; }
.text__x { display: none; }
.q { margin: 0; writing-mode: vertical-rl; display: flex; flex-direction: column; gap: 10px; max-height: 100%; }
.q p { margin: 0; font: 18px/1.95 var(--serif); letter-spacing: .1em; color: var(--ink); }
.q p::before { content: "「"; }
.q p::after { content: "」"; }
.q span { border-radius: 3px; transition: background .2s, color .2s; }
.q span.hl { background: var(--hl); color: #000; }
.q cite { font: 12.5px/1.6 var(--sans); font-style: normal; color: var(--ink3); letter-spacing: .06em; }

.more { grid-area: more; display: flex; flex-wrap: wrap; gap: 4px 22px; max-width: calc(100% - 420px); padding-top: 10px; }
.more p { margin: 0; font-size: 12.5px; line-height: 1.65; color: var(--ink2); }
.more b { margin-right: 6px; font-weight: 700; color: var(--ink); }
.more__note { color: var(--ink3) !important; }

/* 矮一些的桌面 */
@media (min-width: 761px) and (max-height: 760px) {
	.card__h { font-size: 16px; }
	.trace { height: 22px; }
	.more p:not(.more__note) { display: none; }
}
/* 中等宽度：两行两列 */
@media (min-width: 761px) and (max-width: 1080px) {
	.app { grid-template-columns: minmax(0, 1fr) 150px; }
	.bench { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.card__stage { max-height: 24vh; }
	.trace { display: none; }
}

/* ---------- 手机 ---------- */
@media (max-width: 760px) {
	.app {
		height: auto; min-height: 100svh; overflow: visible; align-content: start;
		grid-template-columns: minmax(0, 1fr); grid-template-rows: none;
		grid-template-areas: "top" "lab" "more"; padding: 0 10px 22px;
	}
	.top { min-height: 48px; padding: 0 100px 0 112px; }
	.title { font-size: 19px; letter-spacing: .16em; margin-left: .16em; }
	.sub { display: none; }
	.lab { display: block; }
	.bench { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 2px; }
	.card { padding: 5px 6px 6px; border-radius: 12px; }
	.card__h { font-size: 15px; }
	.card__stage { max-height: none; }
	.trace { display: none; }
	.card__st { font-size: 11.5px; min-height: 2.9em; }
	.acts { gap: 6px; padding-top: 10px; }
	.btn { min-height: 38px; padding: 0 12px; font-size: 13.5px; letter-spacing: .02em; }
	.btn--text { display: inline-block; }
	.text {
		position: fixed; inset: auto 10px 10px 10px; z-index: 20; max-height: 74svh; overflow: auto; display: block;
		padding: 18px 16px 16px; background: #f3f7f4; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .45);
		visibility: hidden; opacity: 0; transform: translateY(12px); transition: opacity .2s, transform .2s, visibility .2s;
	}
	.text.open { visibility: visible; opacity: 1; transform: none; }
	.text__x { display: block; position: absolute; right: 8px; top: 4px; width: 36px; height: 36px; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--ink2); }
	.q { writing-mode: horizontal-tb; display: block; }
	.q p { font-size: 16px; line-height: 1.9; letter-spacing: .02em; }
	.q cite { display: block; margin-top: 6px; }
	.more { max-width: none; flex-direction: column; padding-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
	.card, .btn, .q span, .text { transition: none; }
}

/* 暂停时（外层页面发来 pause、标签页隐藏或滚出视口），CSS 动画也一起停 */
.is-paused *, .is-paused *::before, .is-paused *::after { animation-play-state: paused !important; }
