/* 七十二候 · 华文道 */
:root {
	--ink: #0b0a08; --ink2: #14110d; --ink3: #1e1a14;
	--paper: #f2ebde; --paper2: rgba(242, 235, 222, .78); --paper3: rgba(242, 235, 222, .52);
	--verm: #e2462b; --gold: #d9b36c; --gold2: rgba(217, 179, 108, .62); --gold3: rgba(217, 179, 108, .3);
	--hair: rgba(242, 235, 222, .14);
	--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;
	--mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
	color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--paper); overflow: hidden; }
body { font: 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { position: fixed; inset: 0; overflow: hidden; background: var(--ink); touch-action: pan-y; }
.sky, .dial { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.dial { pointer-events: none; overflow: visible; }
.scene { position: absolute; left: 0; top: 0; border-radius: 50%; background: var(--ink2); }

/* 题签 */
.plate { position: absolute; left: 0; top: 0; width: 320px; margin: 0; opacity: 1; transition: opacity .5s ease; }
.plate.swap { opacity: 0; transition-duration: .28s; }
.plate p { margin: 0; }
.kicker { display: flex; align-items: baseline; gap: .7em; font-family: var(--serif); font-size: clamp(16px, 1.05vw, 22px); color: var(--gold); letter-spacing: .12em; }
.k-hou { color: var(--paper2); }
.k-no { margin-left: auto; font: 11px/1 var(--mono); letter-spacing: .08em; color: var(--gold2); }
.kicker::before { content: ""; align-self: center; width: 22px; height: 1px; background: var(--verm); margin-right: .1em; }
.name { margin: .28em 0 .1em; font-family: var(--serif); font-weight: 600; color: var(--paper); line-height: 1.12;
	font-size: var(--fs, 64px); letter-spacing: .1em; text-wrap: balance; text-shadow: 0 0 28px rgba(217, 179, 108, .16); }
.yin { min-height: 1.2em; font: 12px/1.4 var(--mono); color: var(--gold2); letter-spacing: .06em; }
.dates { display: flex; flex-wrap: wrap; gap: .3em 1.1em; align-items: baseline; margin-top: .9em !important;
	padding-top: .8em; border-top: 1px solid var(--hair); font: clamp(12.5px, .8vw, 16px)/1.5 var(--mono); color: var(--paper2); letter-spacing: .02em; }
.lon { color: var(--gold2); font-size: 11px; }
.expl { margin-top: .75em !important; font-size: clamp(15px, 1.08vw, 22px); line-height: 1.75; color: var(--paper2); max-width: 30em; }
.vari { margin-top: .6em !important; font-size: clamp(12.5px, .78vw, 16px); color: var(--gold2); font-family: var(--serif); letter-spacing: .04em; }
.vari:empty, .yin:empty, .note:empty { display: none; }
.expl.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.note { margin-top: .9em !important; font: clamp(11.5px, .72vw, 15px)/1.5 var(--mono); color: var(--paper3); letter-spacing: .03em; }
.note b { color: var(--verm); font-weight: 400; }

/* 控制 */
.ctrl { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; gap: 8px; transition: opacity .4s ease; }
.ctrl .row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ctrl button, .ctrl .date { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; min-width: 36px;
	padding: 0 12px; border: 1px solid rgba(242, 235, 222, .2); border-radius: 2px; background: rgba(20, 17, 13, .62);
	color: var(--paper2); font-size: 13px; letter-spacing: .06em; cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
	transition: border-color .2s, color .2s, background .2s; }
.ctrl .ib { padding: 0; width: 36px; }
.ctrl button:hover, .ctrl .date:hover { border-color: var(--gold2); color: var(--paper); }
.ctrl button:focus-visible, .ctrl .date:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.ctrl svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
#play svg path { fill: currentColor; stroke: none; }
#play .i-pause path { fill: none; stroke: currentColor; stroke-width: 2; }
#play .i-pause, #play[aria-pressed="true"] .i-play { display: none; }
#play[aria-pressed="true"] .i-pause { display: block; }
#snd .i-on, #snd[aria-pressed="true"] .i-off { display: none; }
#snd[aria-pressed="true"] .i-on { display: block; }
#snd[aria-pressed="true"], #play[aria-pressed="true"] { color: var(--gold); border-color: var(--gold3); }
.seg { display: inline-flex; border: 1px solid rgba(242, 235, 222, .2); border-radius: 2px; background: rgba(20, 17, 13, .62); }
.ctrl .seg button { border: 0; background: none; height: 34px; padding: 0 14px; font-family: var(--serif); font-size: 14px; letter-spacing: .2em; }
.ctrl .seg button[aria-checked="true"] { color: var(--ink); background: var(--gold); }
.ctrl .date { position: relative; overflow: hidden; }
.ctrl .date input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }
.ctrl .date input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.ctrl [hidden], .app[data-mode="today"] #speed, .app[data-mode="today"] #play { display: none !important; }
.app[data-mode="year"] #back, .app[data-mode="year"] .date { display: none; }

/* 角落的读数 */
.hud { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 1.1em !important; font: 10.5px/1.4 var(--mono); letter-spacing: .06em; color: rgba(217, 179, 108, .55); }
.hud span:empty { display: none; }
.app.compact .hud { display: none; }

.toast { position: absolute; left: 50%; top: 18px; transform: translate(-50%, -8px); margin: 0; padding: 8px 14px; font-size: 13px; letter-spacing: .06em;
	background: rgba(20, 17, 13, .86); border: 1px solid var(--gold3); color: var(--paper); opacity: 0; pointer-events: none; transition: opacity .35s, transform .35s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* 展厅模式 */
.app.hall .ctrl { opacity: 0; pointer-events: none; }
.app.hall.peek .ctrl { opacity: 1; pointer-events: auto; }
.app.hall.idle { cursor: none; }
.app.hall .note { display: none; }

/* 窄屏、矮屏 */
.app.tall .plate { text-align: left; }
.app.tall .kicker { font-size: 15px; }
.app.tall .expl { font-size: 14.5px; line-height: 1.65; }
.app.tall .dates { margin-top: .5em !important; padding-top: .5em; font-size: 12px; }
.app.tall .ctrl { gap: 6px; }
.app.compact .yin { display: none; }
.app.compact .vari, .app.compact .note { display: none; }
.app.compact .expl { margin-top: .4em !important; font-size: 13.5px; line-height: 1.55; }
.app.compact .ctrl button, .app.compact .ctrl .date { height: 32px; min-width: 32px; padding: 0 9px; font-size: 12px; }
.app.compact .ctrl .ib { width: 32px; padding: 0; }
.app.compact .ctrl .seg button { height: 30px; padding: 0 10px; }

@media (prefers-reduced-motion: reduce) {
	.plate, .plate.swap, .ctrl, .toast { transition: none; }
}
@media print { .ctrl, .toast { display: none; } }
