/* Chakra Petch (SIL Open Font License 1.1), latin subset, self-hosted */
@font-face { font-family: "Chakra Petch"; font-weight: 500; font-display: swap; src: url("/static/fonts/chakra-500.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 600; font-display: swap; src: url("/static/fonts/chakra-600.woff2") format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 700; font-display: swap; src: url("/static/fonts/chakra-700.woff2") format("woff2"); }

:root {
    --bg: #05080d;
    --panel: rgba(7, 11, 18, 0.9);
    --panel-solid: #070b12;
    --line: rgba(95, 214, 234, 0.16);
    --line-soft: rgba(95, 214, 234, 0.12);
    --line-strong: rgba(95, 214, 234, 0.45);
    --cyan: #5fd6ea;
    --cyan-hi: #9be8f4;
    --cyan-ink: #03161b;
    --btn: #54adf7;
    --btn-hi: #86c6fa;
    --btn-ink: #041525;
    --amber: #f0b35a;
    --red: #ff7a6b;
    --green: #4fd69c;
    --text: #d6e2ec;
    --text-hi: #f2f7fb;
    --text-2: #9fb2c1;
    --text-3: #8fa3b3;
    --muted: #6d8191;
    --track: #16222c;
    --num: "Chakra Petch", "Bahnschrift", "DIN Alternate", ui-monospace, monospace;
    --sans: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
    color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
    margin: 0;
    min-height: 100vh;
    background-color: var(--bg);
    background-image:
        linear-gradient(rgba(95, 214, 234, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(95, 214, 234, 0.045) 1px, transparent 1px);
    background-size: 48px 48px;
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: var(--cyan); text-decoration: none; }
a:hover { color: var(--cyan-hi); }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; color: var(--text-hi); }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 64px; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* top bar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: rgba(5, 8, 13, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.topbar .wrap { height: 72px; display: flex; align-items: center; gap: 40px; }
.brand { display: flex; align-items: center; gap: 12px; color: #eef5fa; }
.brand:hover { color: #fff; }
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.brand span { font-weight: 700; font-size: 17px; letter-spacing: 0.04em; }
.brand small { font-family: var(--num); font-size: 12px; letter-spacing: 0.16em; color: var(--amber); border: 1px solid rgba(240, 179, 90, 0.4); padding: 1px 8px; }
.menu { display: flex; gap: 32px; margin-left: auto; font-size: 15px; letter-spacing: 0.06em; }
.menu a { color: var(--text-3); }
.menu a:hover { color: var(--text-hi); }

/* cut-corner buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 56px;
    padding: 0 28px;
    border: 0;
    font-weight: 700;
    font-size: 17px;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, box-shadow .2s ease;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary {
    background: var(--btn);
    color: var(--btn-ink);
    clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
}
.btn-primary:hover { background: var(--btn-hi); color: var(--btn-ink); }
.btn-ghost { background: transparent; border: 1px solid var(--line-strong); color: var(--text); font-weight: 500; font-size: 16px; padding: 0 24px; }
.btn-ghost:hover { background: rgba(95, 214, 234, 0.08); color: var(--text-hi); }
.btn-sm { height: 40px; padding: 0 18px; font-size: 14px; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }

/* section heads */
.kicker { display: flex; align-items: center; gap: 12px; font-family: var(--num); font-size: 14px; letter-spacing: 0.08em; color: var(--cyan); }
.kicker .dot { width: 8px; height: 8px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.sec-head { display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap; }
.sec-head h2 { font-size: 36px; font-weight: 700; text-wrap: balance; }

/* segmented tabs */
.seg { display: inline-flex; border: 1px solid rgba(95, 214, 234, 0.3); font-size: 14px; letter-spacing: 0.06em; }
.seg button { height: 44px; padding: 0 20px; background: transparent; border: 0; color: var(--text-3); cursor: pointer; }
.seg button:hover { color: var(--text-hi); }
.seg button[aria-selected="true"] { background: var(--btn); color: var(--btn-ink); font-weight: 700; }

/* panels */
.panel { border: 1px solid var(--line); background: var(--panel); padding: 28px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; font-weight: 500; color: #b8c7d3; }
.panel-head span:last-child { font-weight: 400; font-size: 13px; color: var(--muted); }
.empty { padding: 26px 12px; text-align: center; color: var(--muted); font-size: 14px; border: 1px dashed rgba(95, 214, 234, 0.2); }

/* horizontal bars */
.bars { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.bar-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 96px; gap: 16px; align-items: center; }
.bar-row .b-name { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .b-track { height: 10px; background: rgba(95, 214, 234, 0.06); position: relative; }
.bar-row .b-fill { position: absolute; inset: 0 auto 0 0; background: var(--cyan); transform-origin: left; animation: grow .7s cubic-bezier(.2, .7, .2, 1) both; }
.bar-row .b-val { font-family: var(--num); font-size: 16px; text-align: right; color: var(--text-hi); }
.bar-row.hl .b-name, .bar-row.hl .b-val { color: var(--amber); }
.bar-row.hl .b-fill { background: var(--amber); }
@keyframes grow { from { transform: scaleX(0); } }

/* stacked outcome meter */
.meter { height: 6px; background: var(--track); display: flex; overflow: hidden; animation: reveal .7s ease both; }
.meter span { height: 100%; }
.meter .ok { background: var(--cyan); }
.meter .bad { background: var(--red); }
.meter .cancel { background: #3a4a56; }
@keyframes reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 3px; background: var(--c); }

/* charts */
.chart { position: relative; height: 280px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid { stroke: rgba(95, 214, 234, 0.08); }
.chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--num); }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: 0.1; }
.chart .cursor { stroke: rgba(155, 232, 244, 0.45); stroke-dasharray: 3 3; }
.tip {
    position: absolute;
    top: 0;
    pointer-events: none;
    min-width: 170px;
    padding: 10px 12px;
    background: rgba(5, 8, 13, 0.95);
    border: 1px solid var(--line-strong);
    font-size: 12px;
    opacity: 0;
    transition: opacity .12s ease;
    z-index: 3;
}
.tip .t-date { font-family: var(--num); color: var(--muted); margin-bottom: 4px; letter-spacing: 0.08em; }
.tip .t-row { display: flex; justify-content: space-between; gap: 12px; }
.tip .t-row span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.tip .t-row i { width: 10px; height: 3px; background: var(--c); }
.tip b { font-family: var(--num); font-weight: 600; color: var(--text-hi); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 12px;
    background: transparent;
    border: 1px solid rgba(95, 214, 234, 0.2);
    color: var(--text-3);
    font-size: 13px;
    cursor: pointer;
}
.chip i { width: 10px; height: 3px; background: var(--c); }
.chip[aria-pressed="true"] { color: var(--text-hi); border-color: var(--c); background: rgba(95, 214, 234, 0.05); }
.chip[aria-pressed="false"] i { background: transparent; box-shadow: inset 0 0 0 1px var(--c); }

.footer { margin-top: 110px; border-top: 1px solid var(--line-soft); }
.footer .wrap { padding-top: 36px; padding-bottom: 36px; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }

@media (max-width: 1100px) {
    .wrap { padding: 0 32px; }
}
@media (max-width: 720px) {
    .wrap { padding: 0 16px; }
    .topbar .wrap { height: 60px; gap: 16px; }
    .menu { display: none; }
    .topbar .btn-sm { margin-left: auto; }
    .sec-head { flex-direction: column; gap: 10px; }
    .sec-head h2 { font-size: 26px; }
    .seg { width: 100%; }
    .seg button { flex: 1; padding: 0 8px; }
    .panel { padding: 20px 16px; }
    .bar-row { grid-template-columns: 104px minmax(0, 1fr) 76px; gap: 10px; }
    .bar-row .b-name { font-size: 14px; }
    .bar-row .b-val { font-size: 14px; }
    .chart { height: 220px; }
    .btn { height: 50px; padding: 0 20px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    html { scroll-behavior: auto; }
}
