/* 陶埏七十二 · 版式：瓷白底、钴蓝墨、窑火橙。桌面三栏（原文｜工位｜过手），手机上下叠。 */
:root {
	--bg: #edf0f2; --bg2: #e3e8ed; --card: rgba(248, 249, 250, .86);
	--ink: #141a2a; --ink2: #475166; --ink3: #7b8497;
	--co: #1e3ba0; --co6: #2f4fc0; --co4: #6f88d6; --co3: #a9baea; --co2: #d2dbf3; --co1: #e7ecf8;
	--fire: #ff5a1f; --gold: #ffc23d;
	--serif: 'Noto Serif SC', 'Songti SC', 'STSong', 'SimSun', serif;
	--sans: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Source Han Sans SC', system-ui, sans-serif;
	--num: 'Space Grotesk', 'JetBrains Mono', ui-sans-serif, sans-serif;
	--mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
	--wk-pill-bg: rgba(20, 26, 42, .82); --wk-pill-fg: #f3f5fa; --wk-pill-accent: #1e3ba0;
	--ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
	background: radial-gradient(120% 90% at 62% 30%, #f6f8f9 0%, var(--bg) 48%, #e2e7ec 100%) fixed;
	color: var(--ink); font: 15px/1.7 var(--sans); overflow: hidden;
	-webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--fire); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ts {
	position: fixed; inset: 0; display: grid;
	grid-template-columns: clamp(318px, 28vw, 408px) minmax(0, 1fr) 192px;
	grid-template-rows: auto 1fr auto;
	grid-template-areas: "head stage hx" "text stage hands" "nav nav nav";
}
.ts-glyph {
	position: absolute; right: 13%; top: 50%; transform: translateY(-54%);
	font: 900 min(64vh, 46vw)/1 var(--serif); color: var(--co); opacity: .055;
	pointer-events: none; user-select: none; transition: opacity .5s var(--ease), transform .7s var(--ease);
}
.ts-glyph.out { opacity: 0; transform: translateY(-50%) scale(.96); }
.ts-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; z-index: 1; outline: none; }
.ts-grain {
	position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: .5; mix-blend-mode: multiply;
	background-size: 220px 220px;
}
.ts-stage { grid-area: stage; pointer-events: none; }

/* 题头 */
.ts-head { grid-area: head; z-index: 3; padding: 26px 18px 0 34px; pointer-events: none; }
.ts-title { margin: 0; font: 900 34px/1.05 var(--serif); letter-spacing: .02em; color: var(--ink); display: flex; align-items: baseline; gap: 10px; }
.ts-title em { font-style: normal; color: var(--co); }
.ts-kick { margin: 8px 0 0; font: 12.5px/1.5 var(--sans); color: var(--ink3); letter-spacing: .04em; }
.ts-kick b { font: 600 10.5px/1 var(--mono); letter-spacing: .12em; color: var(--co); margin-right: 8px; }

/* 原文栏 */
.ts-text { grid-area: text; z-index: 3; display: flex; flex-direction: column; min-height: 0; padding: 18px 22px 16px 34px; }
.ts-sh { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.ts-no { font: 700 58px/.82 var(--num); color: var(--co); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ts-of { font: 500 13px/1 var(--num); color: var(--ink3); margin: 0 4px 4px -6px; }
.ts-name { margin: 0; font: 900 46px/1 var(--serif); letter-spacing: .04em; }
.ts-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: 8px; scrollbar-width: thin; scrollbar-color: var(--co3) transparent; }
.ts-q { margin: 0 0 6px; padding: 2px 0 2px 16px; border-left: 3px solid var(--co); font: 500 16.5px/1.95 var(--serif); color: #18203a; }
.ts-q p { margin: 0 0 8px; }
.ts-q p:last-child { margin-bottom: 0; }
.gl { cursor: help; border-bottom: 1.5px dotted var(--co4); color: inherit; border-radius: 1px; }
.gl:hover, .gl[aria-expanded="true"] { background: var(--co1); border-bottom-color: var(--co); }
.gl:focus-visible { outline: 2px solid var(--fire); outline-offset: 1px; }
.ts-src { margin: 4px 0 14px 19px; font-size: 12px; color: var(--ink3); }
.ts-plain { margin: 0 0 10px; font-size: 14px; line-height: 1.8; color: var(--ink2); }
.ts-sy { margin: 0 0 6px; font-size: 13px; line-height: 1.7; color: var(--ink3); }
.tag { display: inline-block; font: 600 11px/1 var(--sans); padding: 3px 6px 2px; margin-right: 6px; border: 1px solid var(--co4); color: var(--co); border-radius: 3px; vertical-align: 1px; letter-spacing: .06em; background: rgba(255, 255, 255, .5); }

/* 动手卡 */
.ts-do {
	flex: 0 0 auto; margin-top: 14px; padding: 14px 16px 14px; background: var(--card);
	border: 1px solid var(--co2); border-top: 3px solid var(--co); border-radius: 4px;
	box-shadow: 0 18px 40px -26px rgba(20, 30, 70, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.ts-subs { display: flex; gap: 6px; margin-bottom: 8px; align-items: center; }
.ts-subs i { width: 18px; height: 4px; border-radius: 2px; background: var(--co2); transition: background .3s; }
.ts-subs i.on { background: var(--fire); }
.ts-subs i.ok { background: var(--co); }
.ts-subs span { margin-left: auto; font: 600 10.5px/1 var(--mono); color: var(--ink3); letter-spacing: .1em; }
.ts-prompt { margin: 0 0 12px; font-size: 14.5px; line-height: 1.65; color: var(--ink); min-height: 2.4em; }
.ts-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
	position: relative; overflow: hidden; border: 1.5px solid var(--co); background: #fff; color: var(--co);
	padding: 8px 14px 8px; border-radius: 3px; font: 600 14px/1.2 var(--sans); cursor: pointer; letter-spacing: .04em;
	transition: background .2s, color .2s, transform .12s; user-select: none; -webkit-user-select: none; touch-action: none;
	min-height: 40px;
}
.btn:hover { background: var(--co1); }
.btn:active, .btn.down { transform: translateY(1px); background: var(--co2); }
.btn.pri { background: var(--co); color: #fff; }
.btn.pri:hover { background: var(--co6); }
.btn.pri.down { background: #172f86; }
.btn kbd { font: 500 10.5px/1 var(--mono); opacity: .62; margin-left: 8px; border: 1px solid currentColor; border-radius: 2px; padding: 1px 4px; }
.btn .fill { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--fire); }
.btn.go .fill { animation: fill 2.4s linear forwards; }
@keyframes fill { to { width: 100%; } }
.btn[disabled] { opacity: .4; cursor: default; }

/* 过手 */
.ts-hands { grid-area: hands; z-index: 3; padding: 20px 30px 16px 6px; display: flex; flex-direction: column; align-items: flex-start; }
.ts-hk { font: 600 10.5px/1 var(--mono); letter-spacing: .14em; color: var(--ink3); display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.ts-hk b { font: 900 15px/1 var(--serif); color: var(--ink); letter-spacing: .1em; }
.ts-hn { margin: 6px 0 12px; font: 700 54px/.9 var(--num); color: var(--ink); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ts-hn i { font-style: normal; font-size: 18px; color: var(--ink3); font-weight: 500; margin-left: 2px; }
.ts-hg { display: block; width: 156px; height: 312px; }
.ts-hlast { margin: 10px 0 0; min-height: 1.7em; font: 600 13px/1.4 var(--sans); color: var(--co); opacity: 0; transform: translateY(4px); transition: opacity .3s, transform .3s; }
.ts-hlast.on { opacity: 1; transform: none; }
.ts-legend { list-style: none; margin: auto 0 0; padding: 12px 0 0; font-size: 11.5px; line-height: 1.9; color: var(--ink3); }
.ts-legend i { display: inline-block; width: 9px; height: 11px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; }
.ts-legend .me { background: var(--co); }
.ts-legend .ot { background: var(--co3); }
.ts-legend .un { border: 1px dashed var(--co4); }

/* 工序条 */
.ts-nav { grid-area: nav; z-index: 3; display: flex; align-items: stretch; gap: 0; padding: 0 22px 0 26px; border-top: 1px solid var(--co2); background: linear-gradient(to bottom, rgba(237, 240, 242, .75), rgba(237, 240, 242, .95)); }
.ts-steps { display: flex; flex: 1 1 auto; min-width: 0; }
.ts-st {
	flex: 1 1 0; min-width: 0; border: 0; background: none; cursor: pointer; padding: 12px 6px 13px; text-align: left; position: relative;
	display: flex; flex-direction: column; gap: 2px; color: var(--ink3); transition: color .2s;
}
.ts-st::before { content: ''; position: absolute; left: 6px; right: 6px; top: -1px; height: 3px; background: transparent; transition: background .3s; }
.ts-st:hover { color: var(--ink); }
.ts-st b { font: 600 11px/1 var(--num); letter-spacing: .06em; }
.ts-st span { font: 700 15px/1.2 var(--serif); letter-spacing: .08em; white-space: nowrap; }
.ts-st.done { color: var(--ink2); }
.ts-st.done::before { background: var(--co3); }
.ts-st.done b::after { content: ' ●'; color: var(--co); font-size: 8px; vertical-align: 2px; }
.ts-st[aria-current="step"] { color: var(--co); }
.ts-st[aria-current="step"]::before { background: var(--fire); }
.ts-tools { display: flex; align-items: center; gap: 6px; padding-left: 14px; margin-left: 8px; border-left: 1px solid var(--co2); }
.ib { border: 1px solid var(--co2); background: rgba(255, 255, 255, .6); color: var(--ink2); height: 38px; min-width: 38px; padding: 0 10px; border-radius: 3px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; }
.ib:hover { border-color: var(--co); color: var(--co); }
.ib svg { width: 17px; height: 17px; }
.ib .off { display: none; }
.ib[aria-pressed="true"] .on { display: none; }
.ib[aria-pressed="true"] .off { display: inline; }

/* 浮层 */
.ts-toast {
	position: absolute; z-index: 6; left: 50%; top: 18px; transform: translate(-50%, -10px); opacity: 0; pointer-events: none;
	background: var(--ink); color: #fff; font-size: 13.5px; padding: 7px 14px; border-radius: 3px; transition: opacity .25s, transform .25s; max-width: min(90vw, 460px); text-align: center;
}
.ts-toast.on { opacity: 1; transform: translate(-50%, 0); }
.ts-pop {
	position: absolute; z-index: 8; max-width: 290px; background: #fff; color: var(--ink); border: 1px solid var(--co3); border-top: 3px solid var(--co);
	padding: 10px 12px; font-size: 13px; line-height: 1.7; border-radius: 3px; box-shadow: 0 14px 34px -16px rgba(20, 30, 70, .5);
}
.ts-pop b { font: 700 14px/1.4 var(--serif); display: block; margin-bottom: 3px; }
.ts-ov { position: fixed; inset: 0; z-index: 9; background: rgba(20, 26, 42, .42); display: flex; align-items: center; justify-content: center; padding: 22px; }
.ts-ov[hidden] { display: none; }
.ts-card { position: relative; background: #f7f8f9; max-width: 760px; width: 100%; max-height: 100%; overflow: auto; border-top: 4px solid var(--co); padding: 26px 30px 26px; border-radius: 4px; box-shadow: 0 30px 80px -30px rgba(10, 16, 40, .6); }
.ts-card h2 { margin: 0 0 4px; font: 900 26px/1.3 var(--serif); }
.ts-card .sub { margin: 0 0 16px; color: var(--ink3); font-size: 12.5px; }
.ts-card .full p { font: 400 16px/2 var(--serif); margin: 0 0 12px; text-indent: 2em; }
.ts-card .full mark { background: none; color: var(--co); font-weight: 700; }
.ts-card .x { position: absolute; right: 12px; top: 10px; }
.ts-card .note { font-size: 12.5px; color: var(--ink3); line-height: 1.7; margin-top: 14px; }

/* 中等宽度 */
@media (max-width: 1180px) {
	.ts { grid-template-columns: clamp(300px, 34vw, 360px) minmax(0, 1fr) 150px; }
	.ts-hands { padding-right: 18px; }
	.ts-hg { width: 120px; height: 240px; }
	.ts-hn { font-size: 44px; }
	.ts-st span { font-size: 14px; }
}

/* 手机 */
@media (max-width: 760px) {
	body { font-size: 14px; }
	.ts {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: auto minmax(180px, 1fr) auto auto auto;
		grid-template-areas: "head" "stage" "hands" "text" "nav";
	}
	.ts-glyph { right: 50%; transform: translate(50%, -56%); top: 34%; font-size: min(78vw, 46vh); }
	.ts-glyph.out { transform: translate(50%, -52%) scale(.96); }
	.ts-head { padding: 12px 16px 6px; display: flex; align-items: baseline; gap: 10px; min-height: 52px; }
	.ts-title { font-size: 20px; gap: 6px; }
	.ts-kick { display: none; }
	.ts-hands { flex-direction: row; align-items: center; padding: 4px 16px 2px; gap: 10px; }
	.ts-hk { font-size: 0; gap: 0; }
	.ts-hk b { font-size: 13px; }
	.ts-hn { margin: 0; font-size: 18px; }
	.ts-hn i { font-size: 12px; }
	.ts-hg { width: auto; flex: 1 1 auto; height: 22px; min-width: 0; }
	.ts-hlast, .ts-legend { display: none; }
	.ts-text { padding: 6px 16px 8px; }
	.ts-sh { gap: 8px; margin: 0 0 6px; align-items: baseline; }
	.ts-no { font-size: 24px; }
	.ts-of { margin: 0 2px 0 -4px; font-size: 11px; }
	.ts-name { font-size: 22px; }
	.ts-sh .ts-more { margin-left: auto; }
	.ts-scroll { display: none; }
	.ts-do { margin-top: 0; padding: 10px 12px 10px; border-top-width: 2px; }
	.ts-prompt { font-size: 13.5px; margin-bottom: 8px; min-height: 0; }
	.ts-subs { margin-bottom: 6px; }
	.btn { padding: 7px 12px; font-size: 13.5px; min-height: 40px; }
	.btn kbd { display: none; }
	.ts-nav { padding: 0 6px 0 4px; padding-bottom: env(safe-area-inset-bottom); }
	.ts-steps { overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
	.ts-steps::-webkit-scrollbar { display: none; }
	.ts-st { flex: 0 0 auto; min-width: 66px; padding: 8px 8px 9px; scroll-snap-align: center; }
	.ts-st span { font-size: 14px; }
	.ts-tools { padding-left: 6px; margin-left: 4px; gap: 4px; }
	.ts-tools .ib { padding: 0 8px; }
	.ts-tools .ib .lab { display: none; }
	.ts-card { padding: 20px 18px; }
	.ts-toast { top: 58px; font-size: 13px; max-width: calc(100vw - 32px); }
	.ts-card .full p { font-size: 15px; }
}
/* 手机嵌在展馆里（约七成屏高）：动手卡再紧一点，把高度让给工位 */
@media (max-width: 760px) and (max-height: 720px) {
	.ts-head { padding: 8px 14px 2px; min-height: 40px; }
	.ts-title { font-size: 17px; }
	.ts-hands { padding: 2px 14px 0; }
	.ts-hg { height: 16px; }
	.ts-text { padding: 4px 14px 6px; }
	.ts-sh { margin-bottom: 4px; }
	.ts-no { font-size: 19px; }
	.ts-name { font-size: 18px; }
	.ts-more { height: 26px; font-size: 12px; }
	.ts-do { padding: 7px 10px 8px; }
	.ts-subs { margin-bottom: 4px; }
	.ts-prompt { font-size: 13px; line-height: 1.5; margin-bottom: 6px; }
	.btn { min-height: 36px; padding: 5px 11px; font-size: 13px; }
	.ts-st { padding: 6px 8px 7px; min-width: 60px; }
	.ts-st span { font-size: 13px; }
	.ts-tools .ib { height: 34px; min-width: 34px; }
}
@media (min-width: 761px) { .ts-more { display: none; } }
.ts-more { border: 1px solid var(--co3); background: rgba(255, 255, 255, .7); color: var(--co); font-size: 12.5px; height: 30px; padding: 0 10px; border-radius: 3px; cursor: pointer; }

/* 矮屏桌面：收紧 */
@media (min-width: 761px) and (max-height: 720px) {
	.ts-head { padding-top: 18px; }
	.ts-title { font-size: 28px; }
	.ts-no { font-size: 44px; }
	.ts-name { font-size: 36px; }
	.ts-q { font-size: 15.5px; line-height: 1.85; }
	.ts-hn { font-size: 40px; }
	.ts-hg { width: 120px; height: 240px; }
	.ts-st { padding: 9px 6px 10px; }
}

/* 注释词不在行尾断开 */
.gl { white-space: nowrap; }

/* 横着拿的手机、放大到 200% 左右的窗口（宽不过 760、高不过 500）：工位在左，工序名和提示在右，工序条在底 */
@media (max-width: 760px) and (max-height: 500px) and (orientation: landscape) {
	.ts {
		grid-template-columns: minmax(0, 1fr) minmax(250px, 44%);
		grid-template-rows: auto auto minmax(0, 1fr) auto;
		grid-template-areas: "head text" "hands text" "stage text" "nav nav";
	}
	.ts-glyph { right: auto; left: 28%; top: 54%; transform: translate(-50%, -50%); font-size: min(46vw, 62vh); }
	.ts-glyph.out { transform: translate(-50%, -46%) scale(.96); }
	.ts-text { min-height: 0; overflow-y: auto; padding: 10px 14px 8px 6px; }
	.ts-solo .ts-text { padding-top: 58px; }
	.ts-hands { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
@media print { .ts-cv, .ts-grain { display: none; } }
