@font-face { font-family: "PAH Kai"; src: url("/assets/kai.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "PAH Hei"; src: url("/assets/hei.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "PAH Mono"; src: url("/assets/mono.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }

:root {
  --shiqing: #1B3A54;
  --shiqing-up: #234862;
  --shiqing-line: #38607A;
  --yuebai: #E8F0F1;
  --wu: #A9C0CA;
  --huo: #F5A83C;
  --zhu: #F0705A;
  --kai: "PAH Kai", "Kaiti SC", "STKaiti", "KaiTi", serif;
  --hei: "PAH Hei", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "PAH Mono", "PAH Hei", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: 9.5rem;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--shiqing);
  color: var(--yuebai);
  font: 400 15px/1.6 var(--hei);
}
h1, h2, h3, p { margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--huo); outline-offset: 3px; border-radius: 4px; }

.page { max-width: 1320px; margin: 0 auto; padding: 44px 40px 40px; }

.top { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; column-gap: 28px; }
.top h1 { font: 500 clamp(52px, 7vw, 84px)/1 var(--kai); letter-spacing: .04em; }
.verdict { font: 500 clamp(20px, 2.2vw, 26px)/1.3 var(--kai); color: var(--huo); }
.verdict.is-bad { color: var(--zhu); }
.clock { font: 400 15px/1 var(--mono); color: var(--wu); font-variant-numeric: tabular-nums; white-space: nowrap; }
.clock-zone { margin-left: .6em; font-size: 12px; }

.alert { margin-top: 20px; padding: 10px 14px; border-radius: 8px; background: #5A2E33; color: #FFD9D2; }

.sky { margin-top: 40px; }
.sky-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.sky-head h2 { font: 500 15px/1.4 var(--hei); color: var(--wu); }

.seg { display: inline-flex; margin: 0; padding: 3px; border: 0; border-radius: 9px; background: var(--shiqing-up); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg span { display: block; padding: 4px 14px; border-radius: 6px; color: var(--wu); font-size: 13px; line-height: 1.5; transition: background .15s, color .15s; }
.seg input:checked + span { background: var(--yuebai); color: var(--shiqing); font-weight: 500; }
.seg input:focus-visible + span { outline: 2px solid var(--huo); outline-offset: 2px; }

.ribbons { position: relative; display: grid; row-gap: 6px; touch-action: pan-y; }
.ribbon { display: grid; grid-template-columns: var(--gutter) 1fr; align-items: center; }
.ribbon-label { min-width: 0; padding-right: 14px; }
.ribbon-name { display: block; font: 500 22px/1.2 var(--kai); }
.ribbon-now { display: block; margin-top: 3px; font: 400 13px/1.3 var(--mono); color: var(--wu); font-variant-numeric: tabular-nums; }
.ribbon canvas { display: block; width: 100%; height: 104px; border-radius: 6px; }
.ribbons.is-loading canvas { clip-path: inset(0 100% 0 0); }
.ribbons canvas { clip-path: inset(0 0 0 0); transition: clip-path 1.1s cubic-bezier(.3, .6, .2, 1); }

.hair { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--yuebai); pointer-events: none; z-index: 2; }
.tip {
  position: absolute; top: 8px; z-index: 3; min-width: 170px; padding: 9px 12px; border-radius: 8px;
  background: #0F2438; box-shadow: 0 6px 20px rgb(6 16 28 / .45); pointer-events: none;
  font-size: 13px; line-height: 1.7;
}
.tip-time { color: var(--wu); font-family: var(--mono); font-size: 12px; }
.tip-row { display: flex; justify-content: space-between; gap: 18px; }
.tip-row b { font: 400 13px/1.7 var(--mono); font-variant-numeric: tabular-nums; }

.axis { position: relative; height: 22px; margin: 6px 0 0 var(--gutter); font: 400 12px/22px var(--mono); color: var(--wu); }
.axis span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.axis span:last-child { transform: translateX(-100%); }

.key { margin: 12px 0 0 var(--gutter); color: var(--wu); font-size: 13px; }
.flame-key { display: inline-block; width: 8px; height: 8px; margin: 0 5px 0 3px; background: var(--huo); border-radius: 50% 50% 50% 0; transform: rotate(-45deg) translate(1px, -1px); }

.posts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 44px; }
.post { padding: 20px 22px 18px; border-radius: 12px; background: var(--shiqing-up); }
.post.is-lost { box-shadow: inset 0 0 0 1px var(--zhu); }
.post-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.post-name { font: 500 28px/1.2 var(--kai); }
.post-state { font-size: 14px; font-weight: 500; color: var(--huo); white-space: nowrap; }
.post-state.is-late, .post-state.is-lost { color: var(--zhu); }
.post-state.is-waiting { color: var(--wu); }
.post-sub { margin-top: 4px; color: var(--wu); font-size: 13px; }
.post-sub b { font: 400 13px/1 var(--mono); }

.meters { display: grid; row-gap: 11px; margin-top: 18px; }
.meter-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--wu); }
.meter-top b { font: 400 13px/1.6 var(--mono); color: var(--yuebai); font-variant-numeric: tabular-nums; }
.meter-track { height: 5px; margin-top: 3px; border-radius: 3px; background: var(--shiqing-line); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 3px; background: var(--yuebai); transition: width .5s ease; }
.meter-fill.is-high { background: var(--huo); }
.meter-fill.is-full { background: var(--zhu); }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 16px; margin: 16px 0 0; font-size: 13px; }
.facts dt { color: var(--wu); }
.facts dd { margin: 0; text-align: right; font: 400 13px/1.6 var(--mono); font-variant-numeric: tabular-nums; }

.nights { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--shiqing-line); }
.nights-head { display: flex; justify-content: space-between; gap: 12px; color: var(--wu); font-size: 13px; }
.nights-head b { font: 400 13px/1.6 var(--mono); color: var(--yuebai); }
.fires { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); margin-top: 10px; }
.fire { justify-self: center; width: 7px; height: 7px; margin: 3px 0; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: inset 0 0 0 1px var(--shiqing-line); }
.fire.is-lit { background: var(--huo); box-shadow: none; }
.fire.is-dim { background: #A5763D; box-shadow: none; }
.fire.is-out { background: none; box-shadow: inset 0 0 0 1.5px var(--zhu); }

.foot { margin: 40px 0 0 var(--gutter); color: var(--wu); }
.foot p:first-child { font: 500 17px/1.6 var(--kai); color: var(--yuebai); }
.fonts { margin-top: 6px; font-size: 12px; }

@media (max-width: 1040px) {
  .posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .page { padding: 28px 16px 32px; }
  .top { grid-template-columns: 1fr auto; row-gap: 8px; }
  .verdict { grid-column: 1 / -1; grid-row: 2; }
  .clock { align-self: start; padding-top: 6px; }
  :root { --gutter: 0rem; }
  .ribbon { grid-template-columns: 1fr; row-gap: 5px; }
  .ribbon-label { display: flex; align-items: baseline; justify-content: space-between; padding: 0; }
  .ribbon-now { margin: 0; }
  .ribbon canvas { height: 76px; }
  .ribbons { row-gap: 14px; }
  .posts { grid-template-columns: 1fr; margin-top: 32px; }
  .post { padding: 18px 16px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .ribbons canvas, .meter-fill, .seg span { transition: none; }
}
