﻿/*
* { box-sizing: border-box; margin: 0; padding: 0; }
*/
/* ---- 容器:放宽到 1400px,6 列不挤 ---- */
.panel { max-width: 100%; margin: 0 auto; }

/* ---- 头部 ---- */
.forex_header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.forex_title { font-size: 20px; font-weight: 600; color: #1e293b; text-align:left;}
.forex_title small {
  display: block; font-size: 12px; color: #64748b;
  font-weight: 400; margin-top: 4px;
}

/* ---- 按钮 ---- */
.forex_btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border: none; border-radius: 8px;
  background: var(--gold-light);
  color: #fff; font-size: 14px; font-weight: 500; cursor: pointer;
  box-shadow: 0 4px 12px rgba(79,172,254,.28);
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.forex_btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(79,172,254,.38);
}
.forex_btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-spinner {
  display: none; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  border-radius: 50%;
}
.forex_btn.loading .btn-spinner { display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 网格:一行 6 个 ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));   /* 关键 */
  gap: 14px;
}

/* ---- 卡片 ---- */
.card {    
  position: relative;
  overflow: hidden;
  padding: 14px 14px;                                 /* 收紧,配合窄卡片 */
  border-radius: 12px;
  background: #ffffff;
  border: 1px solid #e5e9f0;
  box-shadow: 0 1px 3px rgba(15,23,42,.05);
  isolation: isolate;
  transition: border-color .3s, box-shadow .3s, transform .15s;
}
.card:hover {
  box-shadow: 0 6px 18px rgba(79,172,254,.15);
  transform: translateY(-1px);
}

/* 填充层 */
.card::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(79,172,254,.16), rgba(0,242,254,.04));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .75s cubic-bezier(.4,0,.2,1);
  z-index: -1;
}
.card.filling::before { transform: scaleX(1); }

/* 边框高亮 */
.card.updated { animation: flashBorder 1s ease-out; }
@keyframes flashBorder {
  0%   { border-color: #4facfe; box-shadow: 0 0 0 3px rgba(79,172,254,.18); }
  100% { border-color: #e5e9f0; box-shadow: 0 1px 3px rgba(15,23,42,.05); }
}

.card > * { position: relative; z-index: 1; }

/* 卡片内文字 */
.card .label {
  text-align:left;
  font-size: 12px;
  color: #64748b;
  letter-spacing: .5px;
  margin-bottom: 8px;
  font-weight: 500;
  white-space: nowrap;
}

.card .value {
  text-align:left;
  font-size: 20px;                                    /* 6 列下 20px 刚好 */
  font-weight: 600;
  color: #1e293b;
  font-variant-numeric: tabular-nums;
  transition: color .35s;
  white-space: nowrap;                                /* 数字不换行 */
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .value.up   { color: #ef4444; }
.card .value.down { color: #16a34a; }
.card .value.flat { color: #475569; }

.card .meta {
  margin-top: 8px; font-size: 12px; color: #64748b;
  display: flex; align-items: center; gap: 6px; min-height: 18px;
}
.card .arrow { font-size: 11px; transition: color .35s; }
.card .arrow.up   { color: #ef4444; }
.card .arrow.down { color: #16a34a; }

.card .change { font-variant-numeric: tabular-nums; white-space: nowrap; }
.card .source { margin-left: auto; font-size: 10px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40%; }
.card .time   { font-size: 11px; color: #94a3b8; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---- 骨架屏 ---- */
.skeleton {
  position: relative; overflow: hidden;
  background: #e8ecf1;
  border-radius: 12px;
  border: 1px solid #e5e9f0;
  height: 106px;                                      /* 比原来矮一点 */
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.85), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }

/* ---- 响应式:窄屏降列数 ---- */
@media (max-width: 1200px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card .value { font-size: 22px; }
}
@media (max-width: 720px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card .value { font-size: 20px; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr; }
}

/* ---- 无障碍 ---- */
@media (prefers-reduced-motion: reduce) {
  .forex_btn.loading .btn-spinner, .skeleton::after { animation: none; }
  .card::before { transition: none; }
  .card.updated { animation: none; }
}