/* ============================================================
   LAK · DEX 兑换页 / 看板  —  Refined Dark Luxury
   与官网 style.css 同一套设计语言（去噪 / 降饱和 / 柔几何）
   ============================================================ */

:root {
  --bg: #07080c;
  --panel: rgba(255, 255, 255, 0.032);
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f4f6f8;
  --muted: #8d95a4;
  --dim: #5b6273;
  /* 语义色：保留可辨识度但去掉荧光感 */
  --up: #5fc99a;
  --down: #e0788c;
  --accent: #d8b36a;
  --blue: #8fb4e0;
  --purple: #c9a85f;
  --gold: #d4b483;
  --cyan: #d8b36a;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-sm: 7px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.44), 0 18px 48px rgba(0, 0, 0, 0.36);
  --glow: 0 0 22px rgba(216, 179, 106, 0.12);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 背景：柔光 + 极淡网格 + 暗角（去扫描线） */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(1100px 620px at 14% -12%, rgba(216, 179, 106, 0.08), transparent 60%),
    radial-gradient(900px 540px at 86% -2%, rgba(212, 180, 131, 0.05), transparent 58%),
    radial-gradient(1000px 700px at 50% 112%, rgba(155, 142, 196, 0.05), transparent 62%),
    linear-gradient(rgba(255, 255, 255, 0.016) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.016) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 64px 64px, 64px 64px;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(120% 90% at 50% 42%, transparent 40%, rgba(0, 0, 0, 0.42) 100%);
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
::selection { background: rgba(216, 179, 106, 0.26); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #050505; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.11); border-radius: 6px; border: 2px solid #050505; }
::-webkit-scrollbar-thumb:hover { background: rgba(216, 179, 106, 0.34); }

.wrap { position: relative; z-index: 2; max-width: 1560px; margin: 0 auto; padding: 0 26px 64px; }

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(20px);
  -webkit-backdrop-filter: saturate(140%) blur(20px);
  background: rgba(7, 8, 12, 0.72);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1560px;
  margin: 0 auto;
  padding: 16px 26px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 500; }
.brand-mark {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #d8b36a, #e8d9b8 58%, #d4b483);
  display: grid; place-items: center; color: #0b0a07; font-weight: 600; font-size: 14px;
  box-shadow: 0 2px 10px rgba(216, 179, 106, 0.18);
}
.brand-name { font-size: 15px; letter-spacing: 0.28em; font-weight: 500; }
.brand-name span { color: var(--accent); }
.brand-sub { font-size: 10.5px; color: var(--dim); font-weight: 400; letter-spacing: 1.6px; text-transform: uppercase; font-family: var(--mono); }

.nav { display: flex; gap: 4px; margin-left: 8px; flex-wrap: wrap; }
.nav a {
  padding: 8px 15px; border-radius: var(--radius-sm); color: var(--muted); font-size: 13px; font-weight: 500;
  border: 1px solid transparent; transition: all 0.3s var(--ease);
}
.nav a:hover { color: var(--text); background: rgba(255, 255, 255, 0.045); border-color: var(--border); }
.nav a.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--border-strong);
  font-weight: 500;
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.status-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 13px; border-radius: 100px;
  background: rgba(255, 255, 255, 0.032); border: 1px solid var(--border);
  font-size: 11.5px; color: var(--muted); white-space: nowrap; font-family: var(--mono);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.dot.live { background: var(--up); box-shadow: 0 0 0 3px rgba(95, 201, 154, 0.16); animation: pulse 2.4s infinite; }
.dot.polling { background: #d9b877; box-shadow: 0 0 0 3px rgba(217, 184, 119, 0.14); }
.dot.offline { background: var(--down); box-shadow: 0 0 0 3px rgba(224, 120, 140, 0.14); }
.dot.idle { background: var(--dim); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.42; } }

.btn {
  padding: 9px 16px; border-radius: var(--radius-sm); cursor: pointer;
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--border-strong);
  color: var(--text); font-size: 12.5px; font-weight: 500;
  transition: all 0.3s var(--ease); white-space: nowrap;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(212, 180, 131, 0.42);
}
.btn.primary {
  background: linear-gradient(120deg, #a8dcea, #cbd8e6);
  color: #0b0a07; font-weight: 600; border-color: transparent;
  box-shadow: 0 2px 10px rgba(216, 179, 106, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn.primary:hover { box-shadow: 0 6px 22px rgba(216, 179, 106, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.btn.icon { padding: 9px 12px; }

/* ---------------- 布局 ---------------- */

.section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.kpi-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.main-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 1080px) { .main-grid { grid-template-columns: 1fr; } }

/* ---------------- 卡片 ---------------- */

.card {
  position: relative;
  background: linear-gradient(168deg, rgba(255, 255, 255, 0.034), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.card:hover { border-color: var(--border-strong); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-title { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; color: #fff; letter-spacing: -0.01em; }
.card-title small { color: var(--dim); font-weight: 400; font-size: 11.5px; }

.kpi { padding: 18px 20px; }
.kpi-label { font-size: 12px; color: var(--muted); }
.kpi-value {
  font-size: 26px; font-weight: 400; margin-top: 8px;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
  font-family: var(--mono);
}
.kpi-foot { margin-top: 6px; font-size: 12px; color: var(--dim); display: flex; align-items: center; gap: 8px; }

/* ---------------- 语义色 ---------------- */

.up { color: var(--up); }
.down { color: var(--down); }
.flat { color: var(--muted); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 100px; font-size: 12px; font-weight: 500;
  font-variant-numeric: tabular-nums; font-family: var(--mono);
}
.pill.up { background: rgba(95, 201, 154, 0.12); color: var(--up); }
.pill.down { background: rgba(224, 120, 140, 0.12); color: var(--down); }
.pill.flat { background: rgba(255, 255, 255, 0.05); color: var(--muted); }
.tag { padding: 2px 9px; border-radius: 100px; background: rgba(255, 255, 255, 0.045); color: var(--muted); font-size: 11px; font-family: var(--mono); }

@keyframes flashUp { from { background: rgba(95, 201, 154, 0.16); } to { background: transparent; } }
@keyframes flashDown { from { background: rgba(224, 120, 140, 0.14); } to { background: transparent; } }
.flash-up { animation: flashUp 0.8s ease-out; }
.flash-down { animation: flashDown 0.8s ease-out; }

/* ---------------- 主图 ---------------- */

.hero { display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 6px; }
.hero-coin { display: flex; align-items: center; gap: 10px; }
.hero-coin img { width: 34px; height: 34px; border-radius: 50%; background: #0d1018; border: 1px solid var(--border); }
.hero-name { font-size: 15px; font-weight: 500; }
.hero-symbol { font-size: 12px; color: var(--dim); font-family: var(--mono); }
.hero-value {
  font-size: 36px; font-weight: 300; font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em; line-height: 1.12; font-family: var(--mono);
}
.hero-change { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.hero-stats { display: flex; gap: 28px; margin-left: auto; flex-wrap: wrap; }
.hero-stat .k { font-size: 11.5px; color: var(--dim); }
.hero-stat .v { font-size: 14px; font-weight: 400; font-variant-numeric: tabular-nums; margin-top: 2px; font-family: var(--mono); }

.seg { display: inline-flex; padding: 3px; gap: 2px; background: rgba(255, 255, 255, 0.032); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.seg button {
  padding: 6px 13px; border-radius: 5px; border: none; background: transparent; cursor: pointer;
  color: var(--muted); font-size: 12.5px; transition: all 0.3s var(--ease);
}
.seg button:hover { color: var(--text); }
.seg button.active {
  background: rgba(255, 255, 255, 0.08); color: var(--text); font-weight: 500;
}

.chart-box { position: relative; width: 100%; }
.chart-box canvas { display: block; width: 100%; height: 100%; }
.chart-tip {
  position: absolute; display: none; pointer-events: none; z-index: 20;
  background: rgba(12, 14, 19, 0.97); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12px; line-height: 1.7; color: var(--text);
  box-shadow: var(--shadow-md); white-space: nowrap;
  font-variant-numeric: tabular-nums; font-family: var(--mono);
  backdrop-filter: blur(10px);
}
.chart-tip b { font-weight: 500; color: #fff; }
.chart-tip .row { display: flex; justify-content: space-between; gap: 14px; }
.chart-tip .k { color: var(--muted); }

/* ---------------- 表格 ---------------- */

.table-wrap { overflow-x: auto; margin: 0 -20px -20px; padding: 0 20px 20px; }
table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.data th {
  text-align: right; font-size: 11px; font-weight: 500; color: var(--dim);
  padding: 10px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; cursor: pointer; user-select: none;
  font-family: var(--mono); letter-spacing: 0.1em; text-transform: uppercase;
  transition: color 0.3s var(--ease);
}
table.data th:hover { color: var(--text); }
table.data th.sorted { color: var(--accent); }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data th:nth-child(2), table.data td:nth-child(2) { text-align: left; }
table.data td { padding: 11px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.045); text-align: right; white-space: nowrap; font-size: 13px; font-family: var(--mono); }
table.data tbody tr { transition: background 0.3s var(--ease); cursor: pointer; }
table.data tbody tr:hover { background: rgba(255, 255, 255, 0.028); }
.coin-cell { display: flex; align-items: center; gap: 10px; }
.coin-cell img { width: 26px; height: 26px; border-radius: 50%; background: #0d1018; border: 1px solid var(--border); flex: none; }
.coin-name { font-weight: 500; font-size: 13px; }
.coin-sym { font-size: 11px; color: var(--dim); }
.rank { color: var(--dim); font-size: 12px; min-width: 22px; display: inline-block; font-family: var(--mono); }
.spark { width: 96px; height: 30px; }
.dom-bar { height: 4px; border-radius: 100px; background: rgba(255, 255, 255, 0.06); overflow: hidden; min-width: 70px; }
.dom-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); }

/* ---------------- 榜单 ---------------- */

.rank-list { display: flex; flex-direction: column; gap: 3px; }
.rank-item {
  display: grid; grid-template-columns: 20px 1fr auto auto; align-items: center; gap: 10px;
  padding: 10px; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.3s var(--ease); border: 1px solid transparent;
}
.rank-item:hover { background: rgba(255, 255, 255, 0.035); border-color: var(--border); }
.rank-item .r-name { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 400; overflow: hidden; }
.rank-item .r-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-item .r-name .dim { font-weight: 400; }
.rank-item img { width: 20px; height: 20px; border-radius: 50%; }

/* ---------------- 指标 / 表单 ---------------- */

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 12px; }
.stat {
  background: rgba(255, 255, 255, 0.028); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 15px;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.stat:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.stat .k { font-size: 11.5px; color: var(--dim); font-family: var(--mono); letter-spacing: 0.06em; }
.stat .v { font-size: 19px; font-weight: 400; margin-top: 5px; font-variant-numeric: tabular-nums; font-family: var(--mono); }
.stat .sub { font-size: 11px; color: var(--dim); margin-top: 3px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; color: var(--dim); font-family: var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
select, input[type='text'], input[type='search'], input[type='number'] {
  background: rgba(255, 255, 255, 0.028); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px; outline: none; transition: all 0.3s var(--ease); width: 100%;
  color: var(--text); font-family: var(--mono);
}
select:focus, input:focus {
  border-color: rgba(216, 179, 106, 0.42);
  background: rgba(216, 179, 106, 0.04);
  box-shadow: 0 0 0 3px rgba(216, 179, 106, 0.08);
}
option { background: #0d1018; color: var(--text); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .grow { flex: 1; min-width: 160px; }

/* ---------------- 状态 ---------------- */

.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.035) 25%, rgba(255, 255, 255, 0.075) 37%, rgba(255, 255, 255, 0.035) 63%);
  background-size: 400% 100%; animation: shimmer 1.6s ease infinite; border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.sk-line { height: 13px; margin: 9px 0; }
.sk-title { height: 20px; width: 45%; }

.empty { padding: 44px 18px; text-align: center; color: var(--dim); }
.empty .big { font-size: 15px; color: var(--muted); margin-bottom: 6px; }

.toast-host { position: fixed; right: 22px; bottom: 22px; z-index: 100; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: rgba(12, 14, 19, 0.97); border: 1px solid var(--border-strong); color: var(--text);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm); padding: 14px 18px; font-size: 13px; max-width: 340px;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.35s var(--ease);
  backdrop-filter: blur(10px);
}
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.banner {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm);
  background: rgba(217, 184, 119, 0.07); border: 1px solid rgba(217, 184, 119, 0.26);
  color: #e0c489; font-size: 12.5px; margin-top: 16px;
}
.banner.warn { display: block; line-height: 1.75; }
.banner b { color: #f0dcae; }

/* 内联提示块 */
.notice-inline {
  margin-top: 14px; padding: 14px 16px; border-radius: var(--radius-sm);
  background: rgba(224, 120, 140, 0.05); border: 1px solid rgba(224, 120, 140, 0.2);
}
.notice-inline-title {
  font-size: 12.5px; font-weight: 500; color: var(--down); margin-bottom: 6px;
  font-family: var(--mono); letter-spacing: 0.04em;
}
.notice-inline .hint { color: var(--muted); font-size: 12px; line-height: 1.7; }

/* 键值表（池子信息） */
table.data.kv td:first-child { color: var(--muted); width: 38%; white-space: nowrap; }
table.data.kv tr:last-child td { border-bottom: 0; }

.footer {
  margin-top: 52px; padding-top: 24px; border-top: 1px solid var(--border);
  color: var(--dim); font-size: 12px; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between;
  font-family: var(--mono);
}

.hint { font-size: 11.5px; color: var(--dim); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); font-family: var(--mono); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; }
.matrix-box { width: 100%; }
.progress { height: 4px; border-radius: 100px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--gold)); transition: width 0.4s var(--ease); }

@media (max-width: 640px) {
  .wrap { padding: 0 16px 48px; }
  .topbar-inner { padding: 12px 16px; }
  .hero-value { font-size: 29px; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px -16px; padding: 0 16px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .dot.live, .skeleton { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
