:root {
  color-scheme: light;
  --ink: #132033;
  --muted: #607086;
  --line: #d8e4ef;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-soft: #f5faff;
  --blue: #2563eb;
  --cyan: #06b6d4;
  --teal: #0f9f9a;
  --coral: #ff6b4a;
  --amber: #f5b23c;
  --shadow: 0 22px 60px rgba(15, 23, 42, 0.13);
  --soft-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(37, 99, 235, 0.17), transparent 31rem),
    radial-gradient(circle at 92% 8%, rgba(6, 182, 212, 0.18), transparent 29rem),
    linear-gradient(135deg, #f8fbff 0%, #edf6ff 50%, #eaf1fb 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, var(--blue), var(--cyan), #22c55e);
  box-shadow: 0 0 26px rgba(6, 182, 212, 0.32);
  z-index: 20;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.052) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.052) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.58), transparent 74%);
}

.app {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 38px 20px 42px;
}

.fx-nav {
  position: absolute;
  top: 48px;
  right: 20px;
  z-index: 20;
}

.fx-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 14px;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.2);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.query-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(520px, 1.15fr);
  gap: 28px;
  align-items: end;
  min-height: 260px;
  padding: 26px;
  overflow: visible;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 26px;
  background:
    radial-gradient(circle at 18% 20%, rgba(56, 189, 248, 0.16), transparent 18rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 251, 255, 0.82)),
    var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

h1 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.law-highlight {
  display: inline-flex;
  align-items: center;
  margin: 0 4px;
  padding: 2px 9px;
  border: 1px solid #ffd0c5;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff1ed, #fff7dc);
  color: #b8321d;
  font-weight: 900;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 0.7fr 1.4fr 0.7fr;
  gap: 12px;
  align-items: end;
}

label {
  display: grid;
  gap: 6px;
  color: #4a5a6f;
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #cbd8dc;
  border-radius: 14px;
  outline: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font: inherit;
}

input:focus {
  border-color: rgba(14, 165, 233, 0.72);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.14);
}

.combo {
  position: relative;
  z-index: 30;
}

.combo input {
  padding-right: 38px;
}

.clear-currency {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: #7a8795;
  font-size: 18px;
  line-height: 1;
}

.clear-currency.visible {
  display: grid;
  place-items: center;
}

.clear-currency:hover {
  background: #fff1ed;
  border-color: #ffd0c5;
  color: var(--coral);
}

.suggestions {
  display: none;
  position: absolute;
  z-index: 120;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 360px;
  overflow: auto;
  border: 1px solid #cbd8dc;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 34px rgba(24, 33, 47, 0.18);
}

.suggestions.open {
  display: block;
}

.suggestion {
  display: grid;
  grid-template-columns: 28px minmax(74px, 1fr) 52px;
  gap: 9px;
  align-items: center;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  box-shadow: none;
}

.suggestion:hover {
  background: var(--panel-soft);
  transform: none;
}

.suggestion span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion strong {
  text-align: right;
}

.flag-img {
  width: 24px;
  height: 18px;
  border: 1px solid #d7dde6;
  border-radius: 6px;
  object-fit: cover;
  background: #fff;
}

.currency-cell {
  display: inline-grid;
  grid-template-columns: 24px auto auto;
  gap: 8px;
  align-items: center;
}

button {
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.2);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.25);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.controls button[type="submit"] {
  min-width: 94px;
  white-space: nowrap;
}

#fillAll,
#resetDefault,
.pager-actions button,
.close-trend,
.trend-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid #cbd8dc;
  box-shadow: var(--soft-shadow);
}

.status-row,
.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 18px 2px;
  color: var(--muted);
}

.status-actions,
.pager-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.trend-panel,
.table-wrap,
.copyright-note {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(16px);
}

.trend-panel {
  margin: 0 0 18px;
  padding: 18px;
}

.trend-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 12px;
}

.trend-head h2 {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin: 0 0 6px;
  padding: 5px 14px;
  border: 1px solid rgba(15, 159, 154, 0.28);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(15, 159, 154, 0.16), rgba(255, 255, 255, 0.94));
  color: #0a6f6b;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
}

.trend-head p {
  font-size: 13px;
}

.trend-button {
  width: 58px;
  height: 30px;
  padding: 0;
  color: #0b7f7b;
}

#trendCanvas {
  display: block;
  width: 100%;
  height: 320px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 1020px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf2f3;
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #f8fafc;
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  font-weight: 800;
  text-align: center;
}

tbody tr:nth-child(even) {
  background: rgba(248, 252, 255, 0.78);
}

tbody tr:hover {
  background: rgba(224, 242, 254, 0.72);
}

tr:last-child td {
  border-bottom: 0;
}

.empty {
  color: #7b8794;
  text-align: center;
}

.copyright-note {
  margin-top: 18px;
  padding: 20px 22px;
  color: #405062;
  line-height: 1.75;
}

.copyright-kicker {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 12px;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff7ed 0%, #eff6ff 100%);
  color: #9a3412;
  font-size: 12px;
  font-weight: 900;
}

.copyright-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 7px;
  background: var(--amber);
  box-shadow: 10px 0 0 var(--teal);
}

.copyright-title {
  margin-top: 10px;
  color: #162235;
  font-size: 18px;
  font-weight: 900;
}

.copyright-body {
  margin-top: 8px;
  font-size: 13px;
}

.copyright-body p {
  margin: 0;
}

.copyright-body p + p {
  margin-top: 4px;
}

.copyright-slogan {
  margin-top: 12px;
  padding: 9px 11px;
  border-left: 4px solid var(--amber);
  border-radius: 12px;
  background: #fffbeb;
  color: #8a4b10;
  font-size: 13px;
  font-weight: 900;
}

@media (max-width: 820px) {
  .query-panel,
  .controls,
  .status-row,
  .pager {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .query-panel {
    padding: 20px;
  }

  .status-actions,
  .pager-actions {
    justify-content: space-between;
  }
}
