:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f7f6;
  color: #182521;
  --accent: #086650;
  --muted: #52645d;
  --line: #dbe5e0;
  --tint: #e9f4ef;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.shell { max-width: 66rem; margin: auto; padding: 2rem 1rem; }
header { margin-bottom: 1.4rem; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 5vw, 2.7rem); letter-spacing: -.04em; }
h2 { font-size: 1.1rem; }
#data-time { color: var(--muted); margin-top: .35rem; font-size: .875rem; }
.layout, .market { display: grid; gap: 1rem; align-items: start; min-width: 0; }
.card {
  min-width: 0;
  background: white;
  border-radius: 16px;
  padding: clamp(1rem, 3vw, 1.65rem);
  box-shadow: 0 5px 22px #152f2510;
}
.segmented {
  display: flex;
  gap: .25rem;
  padding: .25rem;
  border-radius: 12px;
  background: #eef3f0;
}
button {
  border: 0;
  background: var(--tint);
  color: var(--accent);
  border-radius: 9px;
  font-weight: 650;
  min-height: 2.25rem;
  padding: .35rem .75rem;
}
button:hover { box-shadow: inset 0 0 0 1px currentColor; }
.segmented button { flex: 1; background: transparent; white-space: nowrap; }
.segmented button[aria-pressed=true] { background: var(--accent); color: white; }
.compact { font-size: .875rem; }
.date-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem 1rem;
  margin-top: 1rem;
  color: var(--muted);
  font-size: .875rem;
}
.date-row input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .4rem;
  background: white;
  min-height: 2.5rem;
}
.field-label { display: block; font-size: .875rem; color: var(--muted); margin: 1.1rem 0 .4rem; }
.money-field {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 4.1rem;
  padding: .6rem .75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.money-field input, .money-field output {
  flex: 1;
  min-width: 0;
  font-size: clamp(1.35rem, 6vw, 2rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.money-field input { width: 100%; border: 0; padding: 0; background: transparent; }
.money-field output { overflow-wrap: anywhere; }
.money-field select {
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: var(--tint);
  padding: .55rem 1.7rem .55rem .55rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: right .8rem center, right .55rem center;
  background-size: .25rem .25rem;
  background-repeat: no-repeat;
  font-weight: 700;
}
.result-field { background: #f6faf8; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .65rem; font-size: .875rem; }
.chips button { border-radius: 100px; }
.swap-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .7rem; margin-top: 1rem; }
.swap-row::before, .swap-row::after { content: ""; height: 1px; background: var(--line); }
#swap { border-radius: 50%; width: 2.75rem; height: 2.75rem; padding: 0; font-size: 1.4rem; }
.swap-row + .field-label { margin-top: .55rem; }
.rate, .notice, .feedback, .note { margin-top: .7rem; font-size: .875rem; }
.rate:empty, .feedback:has(span:empty) { display: none; }
.rate { color: var(--accent); font-weight: 650; }
.notice { background: var(--tint); border-radius: 8px; padding: .55rem .7rem; }
.feedback { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; color: var(--muted); }
.muted { color: var(--muted); }
.quote {
  display: grid;
  grid-template-columns: 1fr auto minmax(5.6rem, auto);
  align-items: center;
  gap: .4rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.quote:first-child { margin-top: .35rem; }
.quote-change { text-align: right; font-size: .875rem; }
.up { color: #e5484d; }
.down { color: #16a34a; }
.card-heading, .chart-heading, .chart-dates { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.card-heading { flex-wrap: wrap; }
.chart { margin: .85rem 0 0; }
.chart-heading { font-size: .875rem; font-weight: 650; }
.chart-heading strong { font-variant-numeric: tabular-nums; }
.chart-plot { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .5rem; margin-top: .3rem; }
.chart-range { display: flex; flex-direction: column; justify-content: space-between; }
.chart-dates, .chart-range { color: var(--muted); font-size: .75rem; }
.chart-dates { grid-column: 2; }
.chart svg { width: 100%; height: 3.25rem; background: #f6faf8; border-radius: 5px; }
.chart polyline { stroke: var(--accent); stroke-width: 2; fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
footer { margin-top: 1.25rem; color: var(--muted); font-size: .875rem; line-height: 1.65; }
footer summary { font-weight: 650; }
footer ul { padding-inline-start: 1.3rem; }
@media (min-width: 48rem) {
  .shell { padding: 3.5rem 1.5rem; }
  .layout { grid-template-columns: 1.14fr 1fr; }
}
