:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background: #f3f6fa;
  color: #152846;
  --ink: #152846;
  --muted: #536780;
  --blue: #175cd3;
  --line: #e0e8f2;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body { margin: 0; }
button { font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, svg:focus-visible { outline: 3px solid #1763dd; outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .65; }
.wrap { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.top { background: #fff; border-bottom: 1px solid var(--line); }
.brand { min-height: 66px; display: flex; gap: 12px; align-items: center; font-weight: 730; }
.mark { display: grid; place-items: center; background: #1760d2; color: #fff; width: 34px; aspect-ratio: 1; border-radius: 9px; font-size: 20px; }
.intro { margin: 35px 0 21px; }
h1 { margin: 0 0 8px; font-size: clamp(1.8rem, 4vw, 2.4rem); letter-spacing: -.035em; }
p { margin: 0; }
.intro p, footer, #quote-date, #checked, .summary { color: var(--muted); }
.currencies { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.currencies button { display: flex; gap: 11px; align-items: center; text-align: left; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 12px; min-height: 71px; padding: 12px 15px; }
.currencies button:hover, .periods button:hover, #refresh:hover { border-color: #6ca3fb; }
.currencies button[aria-pressed="true"] { border-color: #2772e9; background: #eef5ff; box-shadow: inset 0 0 0 1px #2772e9; }
.coin { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%; font: 700 .82rem system-ui; color: #1452b7; background: #e5efff; }
[data-currency="EUR"] .coin { color: #5e49a7; background: #f0ebff; }
[data-currency="CAD"] .coin { color: #a33740; background: #ffeef0; }
[data-currency="GBP"] .coin { color: #176457; background: #e5f5ef; }
.currencies strong, .currencies small { display: block; }
.currencies small { color: var(--muted); font-size: .8rem; margin-top: 3px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 24px 27px 19px; box-shadow: 0 8px 30px #163e7410; }
h2 { margin: 0; font-size: 1rem; }
#quote-label { color: var(--muted); }
.quote, .toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; }
.quote { align-items: flex-start; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.equation { display: flex; align-items: baseline; flex-wrap: wrap; gap: .27em; margin: 4px 0 6px; font-size: clamp(1.75rem, 6vw, 3rem); font-weight: 720; font-variant-numeric: tabular-nums; letter-spacing: -.045em; }
.equation strong { color: var(--blue); }
.equals { color: #60758f; font-weight: 480; }
.unit { font-size: .53em; letter-spacing: 0; }
#quote-date, #checked, .summary, footer { font-size: .875rem; }
.sync { display: grid; justify-items: end; gap: 7px; }
#refresh, .periods button { border: 1px solid #d8e3f1; border-radius: 7px; color: #244465; background: #fff; padding: 7px 12px; font-size: .875rem; }
.toolbar { padding-block: 16px 8px; }
.periods { display: flex; gap: 6px; flex-wrap: wrap; }
.periods button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.chart { position: relative; min-height: 320px; }
#plot { display: block; width: 100%; height: 320px; overflow: visible; }
#plot text { fill: var(--muted); font-size: 12px; font-family: inherit; font-variant-numeric: tabular-nums; }
.empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: var(--muted); pointer-events: none; }
.notice { background: #fff6e6; color: #704509; border: 1px solid #f4dcaa; border-radius: 8px; padding: 9px 12px; margin: 7px 0 3px; font-size: .875rem; }
.tooltip { position: absolute; pointer-events: none; padding: 8px 10px; white-space: pre-line; border-radius: 7px; font-size: .8rem; background: #172e50; color: white; box-shadow: 0 3px 10px #17375b33; }
.summary { min-height: 43px; border-top: 1px solid var(--line); padding-top: 13px; display: flex; flex-wrap: wrap; gap: 7px 22px; }
.summary strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.summary .up { color: #117155; }
.summary .down { color: #ba3440; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding-block: 16px 26px; }
footer a { color: #235da7; text-underline-offset: 3px; }
@media (max-width: 680px) {
  .wrap { width: calc(100% - 28px); }
  .intro { margin-top: 24px; }
  .currencies { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
  .currencies button { min-height: 60px; padding: 8px 10px; }
  .panel { padding: 17px 13px 13px; }
  .sync { justify-items: start; }
  #plot { height: 258px; }
  .chart { min-height: 258px; }
}
