/* 汇率模块（/fx/）。复用 tool.css 的面板 / 表单 / 按钮，这里只加本模块特有的部分。 */

.fx-section { margin: 26px 0 0; }
.fx-section > h2 { font-size: 17px; margin: 0 0 10px; }
.fx-section > h2 + .tz-hint { margin-top: -4px; }
.fx-muted { color: var(--muted); }
/* .fx-table th/td 的 text-align:start 优先级更高，这里必须连表一起写才压得住 */
.fx-num, .fx-table .fx-num { text-align: end; font-variant-numeric: tabular-nums; }
.fx-warn  { margin: 10px 0 0; }
.fx-fresh { gap: 6px 8px; }

/* ---------- 换算器 ---------- */
.fx-form__grid {
  display: grid; gap: 12px;
  grid-template-columns: minmax(120px, 1fr) minmax(150px, 1.4fr) auto minmax(150px, 1.4fr);
  align-items: end;
}
.fx-form__swap { padding-bottom: 6px; }
.fx-form__swap .btn-mini {
  width: 34px; height: 34px; padding: 0;
  font-size: 15px; line-height: 1;
  border: 1px solid var(--line-2); border-radius: var(--r-2);
  background: var(--surface); color: var(--ink-2);
}
.fx-form__swap .btn-mini:hover { border-color: var(--line-strong); color: var(--accent); }
.fx-form__foot {
  display: flex; flex-wrap: wrap; gap: 10px 16px;
  align-items: center; justify-content: space-between;
  margin: 14px 0 0;
}
.fx-result {
  margin: 0; min-width: 0;
  font-size: 1.15rem; font-variant-numeric: tabular-nums;
}
.fx-result:empty { display: none; }
.fx-result strong { font-weight: 700; }

/* ---------- 报价头 ---------- */
.fx-hero { display: grid; gap: 4px; margin: 0 0 16px; }
.fx-hero__line {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline;
  margin: 0 0 6px;
}
.fx-hero__amount { font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.fx-hero__amount--out { color: var(--accent); }
.fx-hero__eq { color: var(--muted); }
.fx-hero__rate { margin: 0; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.fx-hero__rate--rev { color: var(--muted); font-size: 13.5px; }

/* ---------- 小节 ---------- */
.fx-section--lead { margin-top: 18px; }
.fx-section__head {
  display: flex; flex-wrap: wrap; gap: 2px 12px;
  align-items: baseline; justify-content: space-between; margin: 0 0 10px;
}
.fx-section__head h2 { margin: 0; }
.fx-section__note { color: var(--muted-2); font-size: 11.5px; }

/* ---------- 常用货币卡片 ---------- */
.fx-cards {
  display: grid; gap: 10px; list-style: none; margin: 0; padding: 0;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.fx-card {
  border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--r-2); padding: 10px 12px;
  display: grid; gap: 2px; min-width: 0;
}
.fx-card__name { display: flex; align-items: center; min-width: 0; text-decoration: none; color: var(--ink); font-weight: 600; }
.fx-card__name > span { min-width: 0; overflow-wrap: anywhere; }
.fx-card__name:hover { color: var(--accent); text-decoration: underline; }
.fx-card__rate { font-size: 1.28rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.fx-card__meta { display: flex; gap: 8px; align-items: baseline; color: var(--muted); font-size: 12px; }

/* ---------- 大洲分组 ---------- */
.fx-jump {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline;
  margin: 0 0 14px; font-size: 13px;
}
.fx-jump__label { color: var(--muted); font-size: 11.5px; }
.fx-jump a {
  display: inline-block; padding: 2px 10px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-2); text-decoration: none; white-space: nowrap;
}
.fx-jump a:hover { border-color: var(--line-strong); color: var(--accent); }
.fx-jump__n { color: var(--muted-2); font-size: 11px; margin-inline-start: 3px; }

.fx-continent { margin: 0 0 22px; scroll-margin-top: calc(var(--nav-h) + 12px); }
.fx-continent__title {
  display: flex; gap: 8px; align-items: baseline;
  font-size: 13px; color: var(--muted); font-weight: 600;
  margin: 0 0 6px; padding-bottom: 5px; border-bottom: 1px solid var(--line-2);
}
.fx-continent__n { color: var(--muted-2); font-size: 11.5px; font-weight: 400; }

/* ---------- 最近查询 ---------- */
.fx-recent__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.fx-recent__head h2 { margin: 0; }
.fx-recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fx-recent li {
  display: flex; gap: 10px; align-items: baseline;
  border: 1px solid var(--line); border-radius: var(--r-2);
  background: var(--surface); padding: 7px 10px; font-size: 13.5px;
}
.fx-recent li > a { flex: 1 1 auto; min-width: 0; color: var(--ink); text-decoration: none; font-weight: 600; overflow-wrap: anywhere; }
.fx-recent li > a:hover { color: var(--accent); text-decoration: underline; }
.fx-recent__meta { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.fx-recent__drop {
  flex: 0 0 auto; color: var(--muted); font-size: 15px; line-height: 1;
  background: transparent; border: 0; padding: 2px 6px; border-radius: var(--r-1); cursor: pointer;
}
.fx-recent__drop:hover { color: var(--danger-ink); background: var(--danger-bg); }

/* ---------- 文字块 ---------- */
.fx-hint  { color: var(--muted); font-size: 13.5px; margin: 0 0 10px; }
.fx-note  { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
.fx-empty { color: var(--muted); font-size: 14px; margin: 10px 0; }
.fx-warn  {
  border: 1px solid rgba(143,28,28,.28); background: var(--danger-bg); color: var(--danger-ink);
  border-radius: var(--r-2); padding: 10px 12px; font-size: 13.5px; margin: 10px 0 0;
}

/* ---------- 链接列表 ---------- */
.fx-links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13.5px; }
.fx-links li { min-width: 0; }
.fx-links__n { color: var(--muted-2); font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* ---------- 表格 ---------- */
/* 数值列收到内容宽度，剩余空间留给货币名：名字靠左、数字成组靠右 */
/* 上限别取消：不封顶的话宽屏上货币名和数字会被拉开将近一屏，行内左右两端对不起来 */
.fx-table { width: 100%; max-width: 780px; border-collapse: collapse; font-size: 14px; }
.fx-table th, .fx-table td {
  text-align: start; padding: 7px 10px;
  border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap;
}
.fx-table tr:last-child th, .fx-table tr:last-child td { border-bottom: 0; }
.fx-table thead th { color: var(--muted); font-weight: 500; }
.fx-table th[scope=row] { font-weight: 600; white-space: normal; }
.fx-table td.mono, .fx-table th.mono { font-family: var(--font-mono); }
.fx-table td.fx-num, .fx-table th.fx-num,
.fx-table td.mono:not(.fx-num) { width: 1%; padding-inline-start: 22px; }

.fx-table a { text-decoration: none; color: var(--ink); font-weight: 600; }
.fx-table a:hover { color: var(--accent); text-decoration: underline; }

.fx-delta--up   { color: var(--danger-ink); }   /* 中文财经惯例：红涨绿跌 */
.fx-delta--down { color: var(--success-ink); }
.fx-delta--flat { color: var(--muted); }

/* ---------- 换算梯度 ---------- */
.fx-ladder { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.fx-ladder__col { min-width: 0; }
.fx-ladder__col h3 { font-size: 13px; color: var(--muted); margin: 0 0 6px; font-weight: 600; }

/* ---------- 金额导航 ---------- */
.fx-amounts { gap: 6px 12px; }
.fx-amounts a, .fx-amounts__on {
  display: inline-block; padding: 3px 10px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; text-decoration: none; white-space: nowrap;
}
.fx-amounts a { color: var(--ink-2); background: var(--surface); }
.fx-amounts a:hover { border-color: var(--line-strong); color: var(--accent); }
.fx-amounts__on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ---------- 走势 ---------- */
.fx-ranges { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; margin: 0 0 10px; }
.fx-ranges__on { font-weight: 600; color: var(--accent); }
.fx-trend__summary { margin: 0 0 12px; font-size: 15px; }
.fx-chart__wrap { position: relative; margin: 0 0 10px; }
.fx-chart__tipnote { margin: 0 0 12px; }

.fx-chart { display: block; width: 100%; height: auto; overflow: visible; }
.fx-chart__grid   { stroke: var(--line); stroke-width: 1; }
.fx-chart__ylabel,
.fx-chart__xlabel { fill: var(--muted-2); font-size: 11px; font-family: var(--font-mono); }
.fx-chart__area   { fill: var(--accent); opacity: .07; }
.fx-chart__line   { fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.fx-chart__dot            { fill: var(--surface); stroke: var(--accent); stroke-width: 1.6; }
.fx-chart__dot--last      { fill: var(--accent); stroke: var(--surface); stroke-width: 1.4; }
.fx-chart__dot--high      { stroke: var(--danger-ink); }
.fx-chart__dot--low       { stroke: var(--success-ink); }
.fx-chart__cursor         { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 3; }

.fx-chart__tip {
  position: absolute; z-index: 2; pointer-events: none;
  transform: translate(-50%, -100%);
  background: var(--ink); color: #fff;
  border-radius: var(--r-2); padding: 5px 9px;
  font-size: 12px; line-height: 1.45; white-space: nowrap;
  box-shadow: var(--shadow-2);
}
.fx-chart__tip b { font-variant-numeric: tabular-nums; font-weight: 600; }
.fx-chart__tip span { display: block; color: rgba(255,255,255,.7); font-size: 11px; }

.fx-stats {
  display: grid; gap: 10px 20px; margin: 0;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.fx-stats > div { min-width: 0; }
.fx-stats dt { color: var(--muted); font-size: 11.5px; margin: 0 0 2px; }
.fx-stats dd { margin: 0; font-size: 14px; overflow-wrap: anywhere; }

/* ---------- 旗帜 ---------- */
.fx-flag--lg { width: 1.1em; margin-inline-end: 8px; }

@media (max-width: 720px) {
  /* 两列会让「兑换成」单独占半行，和上面的字段对不齐；窄屏直接一列到底 */
  .fx-form__grid { grid-template-columns: 1fr; }
  .fx-form__swap { padding-bottom: 0; }
  .fx-form__swap .btn-mini { width: 100%; }
  .fx-ladder { grid-template-columns: 1fr; }
  .fx-hero__amount { font-size: 1.3rem; }
  .fx-stats { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }
  .fx-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .fx-card__rate { font-size: 1.15rem; }
  .fx-chart__ylabel, .fx-chart__xlabel { font-size: 12.5px; }
}
