* { box-sizing: border-box; }
html { background: #f7f8fa; color-scheme: light; }
body { margin: 0; color: #262d34; font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .35; cursor: default; }
button:focus-visible, a:focus-visible { outline: 2px solid #567088; outline-offset: 4px; }
a { color: inherit; text-underline-offset: 3px; }
[hidden] { display: none !important; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; display: block; }
.desk { width: min(1040px, 100%); margin: 0 auto; padding: 56px 40px 36px; }
header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #c8d3df; padding-bottom: 23px; }
.heading { display: flex; align-items: center; gap: 14px; }
.heading-icon { width: 40px; height: 40px; display: grid; place-items: center; background: #2d536f; color: #fff; border-radius: 5px; }
.heading-icon .icon { width: 23px; height: 23px; }
h1 { font-size: 28px; line-height: 1.4; font-weight: 500; letter-spacing: .5px; margin: 0; }
h1 > span { color: #89939c; font-weight: 300; margin: 0 8px; }
.icon-button { border: 0; background: transparent; color: #65727e; padding: 9px; display: grid; place-items: center; border-radius: 3px; }
.icon-button:hover { color: #253b4d; background: #eaedf0; }
header > .icon-button { border: 1px solid #c5d2dd; background: #fff; color: #3d6280; }
.rate-bar { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; margin-top: 23px; }
.rate { display: flex; align-items: center; gap: 10px; font-size: 18px; color: #535e68; margin: 0; }
.rate > .icon { width: 19px; height: 19px; color: #527895; flex-shrink: 0; }
.rate strong { font-size: 21px; font-weight: 500; color: #2d5878; font-variant-numeric: tabular-nums; margin: 0 5px; }
.rate-date { display: flex; align-items: center; gap: 7px; margin: 0; font-size: 14px; color: #68737e; white-space: nowrap; }
.rate-date > .icon { width: 17px; height: 17px; color: #6e8294; }
.dot { margin: 0 1px; }
.conversion { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr); align-items: center; gap: 0; margin-top: 36px; }
.conversion::before { content: ""; position: absolute; left: calc(50% - 38px); top: calc(50% + 17px); width: 76px; height: 1px; background: #bdccd8; }
.currency-field { --accent: #3e759f; --soft: #edf4f9; --line: #bcd0e0; --ink: #284f6d; min-width: 0; border: 1px solid var(--line); border-top: 3px solid var(--accent); background: var(--soft); border-radius: 5px; padding: 20px 22px 16px; transition: border-color .15s; }
.currency-field[data-currency="CNY"] { --accent: #b47550; --soft: #fbf2ec; --line: #e5ccbb; --ink: #8d5537; }
.currency-field:focus-within { border-color: var(--accent); }
.currency-field label, .output-label { display: flex; align-items: center; gap: 10px; color: #55616d; height: 36px; font-size: 16px; }
.currency-badge { display: inline-grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 50%; background: #ffffffc9; color: var(--ink); font-size: 22px; font-weight: 500; line-height: 1; }
.currency-name { display: inline-flex; align-items: center; gap: 9px; }
#from-currency, #to-currency { color: var(--ink); font-weight: 600; letter-spacing: .7px; font-size: 16px; }
.output-label { justify-content: space-between; }
.output-label > span { display: flex; gap: 10px; align-items: center; }
.output-label .icon-button { padding: 6px; }
.output-label .icon { width: 18px; height: 18px; }
input#amount, output#result { display: block; width: 100%; min-width: 0; border: 0; background: transparent; color: var(--ink); padding: 12px 0 0; margin: 0; font-size: 64px; font-weight: 400; letter-spacing: -2px; line-height: 1.28; text-align: left; font-family: inherit; font-variant-numeric: tabular-nums; border-radius: 0; outline: none; height: 96px; }
output#result { overflow-wrap: anywhere; height: auto; min-height: 96px; user-select: text; }
.output-field { align-self: stretch; }
output#result.long-number { font-size: 40px; padding-top: 27px; letter-spacing: -1px; }
.swap-button { position: relative; z-index: 1; justify-self: center; align-self: center; margin-top: 34px; width: 42px; height: 42px; border: 1px solid #bccbd7; background: #fff; color: #3e6685; display: grid; place-items: center; border-radius: 50%; }
.swap-button:hover { background: #eaedf0; color: #2d4c63; }
.swap-button .icon { width: 25px; height: 25px; }
.conversion-tools { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 17px; gap: 12px 20px; }
.quick-amounts { display: flex; gap: 0; border: 1px solid #cbd6e0; background: #fff; border-radius: 4px; overflow: hidden; }
.quick-amounts button { border: 0; border-right: 1px solid #d9e1e8; background: none; color: #68737e; font-size: 14px; padding: 6px 12px; font-variant-numeric: tabular-nums; }
.quick-amounts button:last-child { border-right: 0; }
.quick-amounts button:hover, .quick-amounts button.selected { color: #263f52; }
.quick-amounts button.selected { font-weight: 600; background: #e3edf6; }
.text-button { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 5px 0; font-size: 14px; color: #596a78; white-space: nowrap; }
.text-button > .icon { width: 17px; height: 17px; flex-shrink: 0; }
.text-button:hover { color: #243f54; }
.text-button[aria-expanded=true] { color: #354f64; }
.conversion-tools > .text-button { margin-left: auto; }
.custom-rate-row { display: flex; justify-content: flex-end; align-items: center; gap: 9px; margin-top: 15px; font-size: 15px; color: #526577; }
.custom-rate-row input { border: 1px solid #aebcc7; background: #fff; width: 140px; padding: 7px 10px; color: #344f64; border-radius: 3px; outline: none; font-variant-numeric: tabular-nums; }
.custom-rate-row input:focus { border-color: #56728a; }
.field-error { font-size: 14px; color: #985032; margin: 10px 0 0; }
.notice { color: #8b5d37; font-size: 14px; margin: 18px 0 -22px; line-height: 1.8; }
.history { margin-top: 42px; border-top: 1px solid #cbd5df; padding-top: 22px; }
.chart-heading { display: flex; justify-content: space-between; align-items: center; }
h2 { font-size: 16px; font-weight: 400; margin: 0; color: #4e606f; }
.chart-heading h2 { display: flex; align-items: center; gap: 9px; }
.chart-heading h2 > .icon { width: 21px; height: 21px; color: #3f739a; }
#range-change { font-variant-numeric: tabular-nums; font-size: 14px; }
.up { color: #526c39; }
.down { color: #9b6347; }
.range-switch { display: flex; gap: 10px; }
.range-switch button { border: 0; border-radius: 3px 3px 0 0; background: none; color: #68737e; padding: 5px 8px 7px; font-size: 14px; border-bottom: 1px solid transparent; }
.range-switch button[aria-pressed=true] { color: #2d5878; border-bottom-color: #466f90; background: #e6eef5; }
.range-switch button:hover { color: #2f4e66; }
.chart-container { height: 190px; position: relative; margin-top: 18px; touch-action: pan-y; }
#chart { width: 100%; height: 100%; display: block; overflow: visible; }
.chart-empty { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 14px; color: #68737e; }
.chart-tooltip { pointer-events: none; position: absolute; top: 5px; padding: 9px 12px; background: #fff; border: 1px solid #ccd5dc; color: #576d7e; font-size: 13px; min-width: 125px; z-index: 2; white-space: nowrap; }
.chart-tooltip strong { display: block; font-size: 18px; font-weight: 500; margin-top: 3px; color: #314d62; font-variant-numeric: tabular-nums; }
footer { margin-top: 30px; padding-top: 18px; border-top: 1px solid #d5dce1; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; font-size: 13px; color: #68737e; letter-spacing: .2px; }
footer .text-button { font-size: 13px; color: #596c7c; }
.icp-record { flex-basis: 100%; margin-top: 16px; text-align: center; color: #68737e; text-decoration: none; }
.icp-record:hover { color: #2d5878; text-decoration: underline; }
.source-credit { display: inline-flex; align-items: center; gap: 8px; }
.source-credit .icon { width: 16px; height: 16px; color: #65829a; }
dialog { color: #3f5363; background: #fafbfc; border: 1px solid #d0d9e0; width: min(460px, calc(100% - 36px)); padding: 26px; border-radius: 6px; max-height: calc(100svh - 50px); overflow: auto; box-shadow: 0 12px 45px #19273412; }
dialog::backdrop { background: #1d2c3626; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.dialog-head h2 { font-size: 19px; color: #304a5e; }
dialog p { font-size: 15px; line-height: 1.9; color: #536675; margin: 0 0 17px; }
dialog .checked-at { font-size: 13px; margin-bottom: 0; color: #68737e; }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); padding: 10px 16px; background: #edf1f3; border: 1px solid #c7d3dd; color: #415f75; border-radius: 4px; max-width: calc(100vw - 30px); text-align: center; font-size: 14px; }
.busy .icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 1400px) { .desk { padding-top: 72px; } }
@media (max-width: 700px) {
  .desk { padding: 42px 26px 26px; }
  h1 { font-size: 26px; }
  .rate-bar { flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 19px; }
  .rate { font-size: 17px; }
  .rate strong { font-size: 20px; }
  .rate-date { font-size: 14px; }
  .conversion { margin-top: 36px; grid-template-columns: minmax(0, 1fr) 50px minmax(0, 1fr); }
  input#amount, output#result { font-size: 40px; height: 72px; min-height: 72px; letter-spacing: -1.3px; padding-top: 12px; }
  output#result.long-number { font-size: 29px; letter-spacing: -.7px; padding-top: 20px; }
  .currency-field label, .output-label { font-size: 15px; gap: 8px; }
  #from-currency, #to-currency { font-size: 15px; }
  .output-label > span { gap: 8px; }
  .swap-button { width: 36px; height: 36px; margin-top: 30px; }
  .swap-button .icon { width: 23px; height: 23px; }
  .currency-field { padding: 17px 18px 12px; }
  .quick-amounts { gap: 0; }
  .quick-amounts button { padding: 6px 9px; }
  .history { margin-top: 34px; }
  .chart-container { height: 175px; }
  .range-switch { gap: 6px; }
  footer { margin-top: 25px; }
  .notice { margin-bottom: -15px; }
}
@media (max-width: 600px) {
  .desk { padding: 28px 20px 25px; }
  .heading { gap: 11px; }
  .heading-icon { width: 34px; height: 34px; }
  .heading-icon .icon { width: 21px; height: 21px; }
  header { padding-bottom: 19px; }
  h1 { font-size: 24px; }
  .conversion { grid-template-columns: 1fr; margin-top: 30px; }
  .conversion::before { display: none; }
  .currency-field { padding: 16px 18px 12px; }
  .swap-button { justify-self: center; margin: 7px 0; transform: rotate(90deg); }
  input#amount, output#result { font-size: 54px; height: 84px; min-height: 84px; letter-spacing: -1.6px; padding-top: 10px; }
  output#result.long-number { font-size: 34px; letter-spacing: -.8px; padding-top: 22px; }
  .currency-field label, .output-label { height: 34px; font-size: 16px; }
  #from-currency, #to-currency { font-size: 16px; }
  .conversion-tools { margin-top: 16px; }
  .quick-amounts { gap: 0; }
  .quick-amounts button, .text-button { font-size: 14px; }
  .history { margin-top: 31px; padding-top: 18px; }
  .chart-heading { flex-wrap: wrap; gap: 12px; }
  .range-switch { flex-basis: 100%; justify-content: space-between; }
  .chart-container { height: 160px; }
  .rate-bar { gap: 9px; }
  .rate { gap: 8px; }
  .notice { margin-bottom: -10px; }
}
@media (max-width: 350px) {
  .desk { padding-right: 18px; padding-left: 18px; }
  .quick-amounts { gap: 0; }
  .quick-amounts button { padding: 6px 7px; }
  input#amount, output#result { font-size: 48px; }
  .range-switch { gap: 4px; }
  .range-switch button { padding-right: 6px; padding-left: 6px; }
  .chart-heading h2 { gap: 6px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
