/* ─────────────────────────────────────────────
   SOL Watch · 设计系统
   深色为默认主题，data-theme="light" 切换亮色
   ───────────────────────────────────────────── */

:root {
  --accent: #9945ff;
  --accent-2: #14f195;
  --in: #14f195;
  --out: #ff6b6b;
  --swap: #58a6ff;
  --danger: #ff5c72;
  --warn: #ffcc48;
  /* 跨链标记色 */
  --xchain: #00d1ff;
  /* 合约胶囊：金色最能传达「这里可以复制」 */
  --gold: #e9c46a;
  --gold-dim: #b99a45;
  --gold-border: rgba(233, 196, 106, 0.34);
  --gold-bg: rgba(233, 196, 106, 0.1);

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, "Liberation Mono", monospace;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 30px 70px -24px rgba(0, 0, 0, 0.62);
}

html[data-theme="dark"] {
  --bg: #07080c;
  --bg-glow-1: rgba(153, 69, 255, 0.16);
  --bg-glow-2: rgba(20, 241, 149, 0.09);
  --panel: #0e1016;
  --panel-2: #131722;
  --panel-hover: #171c28;
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #e8ecf4;
  --text-dim: #aab3c4;
  --muted: #737d90;
  --input-bg: rgba(255, 255, 255, 0.035);
  --chip-bg: rgba(255, 255, 255, 0.05);
  --chip-active-bg: rgba(153, 69, 255, 0.2);
  --topbar-bg: rgba(7, 8, 12, 0.78);
  --skeleton: rgba(255, 255, 255, 0.05);
}

html[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-glow-1: rgba(153, 69, 255, 0.1);
  --bg-glow-2: rgba(20, 241, 149, 0.12);
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --panel-hover: #f1f4f9;
  --border: #e4e8f0;
  --border-strong: #d2d9e5;
  --text: #0d1119;
  --text-dim: #4a5464;
  --muted: #78828f;
  --input-bg: #f7f9fc;
  --chip-bg: #f1f4f9;
  --chip-active-bg: rgba(153, 69, 255, 0.12);
  --topbar-bg: rgba(244, 246, 251, 0.82);
  --skeleton: rgba(0, 0, 0, 0.05);
  --in: #00a86b;
  --out: #d92d20;
  --swap: #2563eb;
  --xchain: #0891b2;
  --gold: #96690a;
  --gold-dim: #7a5508;
  --gold-border: rgba(150, 105, 10, 0.3);
  --gold-bg: rgba(150, 105, 10, 0.08);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 10px 28px -14px rgba(16, 24, 40, 0.22);
  --shadow-lg: 0 30px 70px -28px rgba(16, 24, 40, 0.28);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(720px 420px at 12% -8%, var(--bg-glow-1), transparent 62%),
    radial-gradient(680px 380px at 92% 4%, var(--bg-glow-2), transparent 60%);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.01em;
}

button,
input,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ───────────── 顶栏 ───────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(14px, 3vw, 30px);
  background: var(--topbar-bg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(145deg, rgba(153, 69, 255, 0.18), rgba(20, 241, 149, 0.14));
  border: 1px solid var(--border-strong);
  flex: none;
}

.brand-mark svg {
  width: 22px;
  height: 22px;
}

.brand-text h1 {
  font-size: 15px;
  line-height: 1.2;
}

.brand-text p {
  margin: 1px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  font-size: 12px;
  white-space: nowrap;
}

.pill-status {
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.pill-status:hover {
  border-color: var(--border-strong);
  background: var(--panel-hover);
}

.pill-sub {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
  position: relative;
}

.dot[data-state="live"] {
  background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(20, 241, 149, 0.55);
  animation: pulse 2.2s ease-out infinite;
}

.dot[data-state="poll"] {
  background: var(--warn);
}

.dot[data-state="error"] {
  background: var(--danger);
  animation: pulse 1.4s ease-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 currentColor;
    opacity: 1;
  }
  70% {
    box-shadow: 0 0 0 7px transparent;
    opacity: 0.85;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
    opacity: 1;
  }
}

.icon-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
}

/* ───────────── 按钮 ───────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-weight: 550;
  font-size: 13px;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease, opacity 0.16s ease;
  white-space: nowrap;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.btn:active {
  transform: scale(0.975);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #6d3cf0 55%, var(--accent-2) 160%);
  color: #fff;
  box-shadow: 0 6px 20px -8px rgba(153, 69, 255, 0.7);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.09);
}

.btn-ghost {
  color: var(--text-dim);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--chip-bg);
  color: var(--text);
}

.btn-outline {
  border-color: var(--border-strong);
  background: var(--panel-2);
  color: var(--text-dim);
}

.btn-outline:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--accent);
}

.btn-danger-ghost {
  color: var(--danger);
  border-color: transparent;
}

.btn-danger-ghost:hover:not(:disabled) {
  background: rgba(255, 92, 114, 0.12);
}

.btn-block {
  width: 100%;
  padding: 11px;
  border-radius: var(--radius);
}

.btn-mini {
  padding: 5px 10px;
  font-size: 12px;
  border-color: var(--border);
  background: var(--panel-2);
  color: var(--text-dim);
}

.btn-mini:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-icon {
  padding: 7px;
  border-radius: 9px;
  color: var(--muted);
}

.btn-icon:hover {
  background: var(--chip-bg);
  color: var(--text);
}

.btn-icon svg {
  width: 17px;
  height: 17px;
}

.btn.is-on {
  color: var(--accent-2);
  background: rgba(20, 241, 149, 0.1);
}

html[data-theme="light"] .btn.is-on {
  color: var(--in);
  background: rgba(0, 168, 107, 0.1);
}

.btn.is-off {
  color: var(--muted);
}

/* ───────────── 布局 ───────────── */

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px clamp(14px, 3vw, 30px) 60px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(200px, 1.35fr);
  gap: 12px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.stat-value {
  font-size: 24px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.stat-value-sm {
  font-size: 16px;
  padding-top: 5px;
}

.stat-sub {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spark {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 34px;
  margin: 3px 0 1px;
}

.spark i {
  flex: 1;
  min-width: 2px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--accent), rgba(153, 69, 255, 0.28));
  transition: height 0.35s cubic-bezier(0.3, 1.4, 0.5, 1);
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.col {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-grow {
  display: flex;
  flex-direction: column;
  min-height: 320px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
}

.card-head h2 {
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.hint {
  font-size: 11.5px;
  color: var(--muted);
}

.hint.ok {
  color: var(--in);
}

.hint.bad {
  color: var(--danger);
}

/* ───────────── 表单 ───────────── */

.form {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > span {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 550;
}

.field input,
.field select,
.search {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--input-bg);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  font-size: 13px;
}

.field input::placeholder,
.search::placeholder {
  color: var(--muted);
}

.field input:focus,
.field select:focus,
.search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(153, 69, 255, 0.16);
  background: var(--panel-2);
}

.field input.is-valid {
  border-color: var(--in);
}

.field input.is-invalid {
  border-color: var(--danger);
}

.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
  cursor: pointer;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 10px;
}

.field-narrow {
  min-width: 0;
}

.switch-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
  cursor: pointer;
  transition: border-color 0.16s ease;
}

.switch-row:hover {
  border-color: var(--border-strong);
}

.switch-row input {
  display: none;
}

.switch {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: var(--border-strong);
  flex: none;
  margin-top: 1px;
  transition: background 0.2s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s cubic-bezier(0.3, 1.4, 0.5, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.switch-row input:checked + .switch {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.switch-row input:checked + .switch::after {
  transform: translateX(14px);
}

.switch-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.switch-label strong {
  font-size: 12.5px;
  font-weight: 600;
}

.switch-label small {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

/* ───────────── 地址列表 ───────────── */

.addr-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  max-height: 460px;
}

.addr-item {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  padding: 11px 12px 11px 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: border-color 0.16s ease, background 0.16s ease;
  overflow: hidden;
}

.addr-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--tint, var(--accent));
}

.addr-item:hover {
  border-color: var(--border-strong);
}

.addr-item.is-disabled {
  opacity: 0.55;
}

.addr-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 9px;
}

.addr-id {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.addr-label {
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.addr-addr {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
}

.addr-addr:hover {
  color: var(--text-dim);
}

.addr-addr svg {
  width: 11px;
  height: 11px;
  opacity: 0.65;
}

.addr-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: none;
}

.addr-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.metric {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--chip-bg);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.metric strong {
  font-weight: 650;
  font-size: 12.5px;
}

.metric span {
  color: var(--muted);
  font-size: 10.5px;
}

.metric.ghost {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--muted);
}

.token-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.token-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  padding: 2px 3px 2px 7px;
  border-radius: 999px;
  background: var(--chip-active-bg);
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  max-width: 175px;
  overflow: hidden;
  white-space: nowrap;
}

.token-chip .copy-mini {
  width: 16px;
  height: 16px;
}

.token-chip .copy-mini svg {
  width: 10px;
  height: 10px;
}

.addr-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}

.rule-tag {
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
}

.rule-tag.warn {
  color: var(--warn);
  border-color: rgba(255, 204, 72, 0.3);
}

/* ───────────── 动态流 ───────────── */

.card-head-feed {
  flex-wrap: wrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  transition: background 0.2s ease;
}

.live-dot[data-live="1"] {
  background: var(--accent-2);
  animation: pulse 2.2s ease-out infinite;
}

.feed-tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

.search {
  width: 190px;
  padding: 6px 10px;
  font-size: 12px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--border);
}

.chip {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--chip-bg);
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.chip:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.chip.is-active {
  background: var(--chip-active-bg);
  border-color: var(--accent);
  color: var(--text);
  font-weight: 600;
}

.feed {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
  max-height: calc(100vh - 300px);
}

/* ── 事件卡片 ─────────────────────────────────────────────
   信息层级（自上而下）：
     身份行 → 金额行 → 链 / 跨链路线 → 合约胶囊 → 统计行
   跨链路线与合约复制是两条最重要的信息，分别占据独立一行。
   ──────────────────────────────────────────────────────── */

.ev {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel-2);
  transition: border-color 0.16s ease, background 0.16s ease;
  animation: slideIn 0.32s cubic-bezier(0.2, 1, 0.4, 1);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-7px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.ev:hover {
  border-color: var(--border-strong);
  background: var(--panel-hover);
}

.ev.is-failed {
  border-color: color-mix(in srgb, var(--danger) 26%, var(--border));
}

.ev.is-new::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  border: 1px solid var(--accent-2);
  opacity: 0;
  animation: flash 2.4s ease-out;
  pointer-events: none;
}

@keyframes flash {
  0% {
    opacity: 0.95;
  }
  100% {
    opacity: 0;
  }
}

/* ── 身份行 ── */

.ev-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.ev-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(
    140deg,
    hsl(var(--av-h, 260) 68% 54%),
    hsl(calc(var(--av-h, 260) + 42) 68% 38%)
  );
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  user-select: none;
}

.ev-ident {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ev-name {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.ev-title {
  font-size: 14.5px;
  font-weight: 680;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* 动作徽章：绿=买入/转入，红=卖出/转出，青=跨链；虚线表示「推断」 */

.ev-act {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  border: 1px solid var(--border-strong);
  background: var(--chip-bg);
  color: var(--text-dim);
}

.ev-act.in {
  color: var(--in);
  border-color: color-mix(in srgb, var(--in) 38%, transparent);
  background: color-mix(in srgb, var(--in) 11%, transparent);
}

.ev-act.out {
  color: var(--out);
  border-color: color-mix(in srgb, var(--out) 38%, transparent);
  background: color-mix(in srgb, var(--out) 11%, transparent);
}

.ev-act.xchain {
  color: var(--xchain);
  border-color: color-mix(in srgb, var(--xchain) 40%, transparent);
  background: color-mix(in srgb, var(--xchain) 12%, transparent);
}

.ev-act.inferred {
  border-style: dashed;
  font-weight: 580;
  cursor: help;
}

/* 平台徽章 */

.ev-plat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 620;
  color: var(--pc, var(--text-dim));
  border: 1px solid color-mix(in srgb, var(--pc, #8b98a8) 40%, transparent);
  background: color-mix(in srgb, var(--pc, #8b98a8) 12%, transparent);
  white-space: nowrap;
}

.ev-plat .pdot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pc, #8b98a8);
  flex: none;
}

/* 被监控地址（点击复制） */

.ev-addr {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  max-width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  transition: color 0.15s ease;
}

.ev-addr:hover {
  color: var(--accent-2);
}

.ev-addr svg {
  width: 11px;
  height: 11px;
  opacity: 0.7;
}

.ev-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex: none;
}

.ev-time {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ev-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.15s ease;
}

.ev-link:hover {
  color: var(--accent);
}

.ev-link svg {
  width: 10px;
  height: 10px;
}

/* ── 金额行 ── */

.ev-value {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.ev-amt {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.ev-amt em {
  font-style: normal;
  font-size: 13.5px;
  font-weight: 600;
  opacity: 0.78;
}

.ev-amt.in {
  color: var(--in);
}

.ev-amt.out {
  color: var(--out);
}

.ev-usd {
  font-size: 17px;
  font-weight: 750;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.ev-flag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.ev-flag.bad {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}

.ev-flag.test {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

/* ── 链 / 跨链路线行 ── */

.ev-route {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-dim);
}

.ev-route .rt-chain {
  font-weight: 660;
  color: var(--text);
  letter-spacing: -0.01em;
}

.ev-route .rt-dot {
  color: var(--muted);
  opacity: 0.7;
}

.ev-route .rt-tag {
  padding: 1px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 620;
  color: var(--text-dim);
  background: var(--chip-bg);
}

.ev-route .rt-note {
  color: var(--muted);
  font-size: 12.5px;
}

.ev-route .rt-exchange-path {
  color: var(--accent-2);
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ev-route .rt-arrow {
  display: inline-flex;
  color: var(--muted);
}

.ev-route .rt-arrow svg {
  width: 15px;
  height: 15px;
}

/* 跨链时整行高亮，并给出「从哪来 → 到哪去」 */

.ev-route.is-xchain {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--xchain) 32%, transparent);
  background: linear-gradient(90deg, color-mix(in srgb, var(--xchain) 13%, transparent), transparent 78%);
}

.ev-route.is-xchain .rt-arrow {
  color: var(--xchain);
}

.ev-route.is-xchain .rt-tag {
  color: var(--xchain);
  background: color-mix(in srgb, var(--xchain) 15%, transparent);
}

.ev-route.is-pending {
  border-style: dashed;
  background: transparent;
}

/* 跨链行右侧：费用 + 官方详情链接，一起靠右 */

.ev-route .rt-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.ev-route .rt-fee {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ev-route .rt-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--xchain);
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.85;
}

.ev-route .rt-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.ev-route .rt-link svg {
  width: 10px;
  height: 10px;
}

.rt-status {
  padding: 1px 8px;
  border-radius: 5px;
  font-size: 11px;
  border: 1px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
}

.rt-status.ok {
  color: var(--in);
  border-color: color-mix(in srgb, var(--in) 40%, transparent);
  background: color-mix(in srgb, var(--in) 10%, transparent);
}

.rt-status.pending {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 38%, transparent);
}

.rt-status.bad {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}

.rt-status.refund {
  color: var(--swap);
  border-color: color-mix(in srgb, var(--swap) 40%, transparent);
}

/* 跨链两条腿的金额明细 */

.ev-route-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: -4px;
  padding-left: 2px;
  font-size: 11.5px;
  color: var(--muted);
}

.rt-leg {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}

.rt-leg em {
  font-style: normal;
  color: var(--muted);
  opacity: 0.85;
}

.rt-arrow-sm {
  display: inline-flex;
  color: var(--xchain);
  opacity: 0.8;
}

.rt-arrow-sm svg {
  width: 12px;
  height: 12px;
}

/* ── 合约胶囊行 ── */

.ev-contracts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.c-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--gold-border);
  background: var(--gold-bg);
  color: var(--gold);
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 620;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.c-pill:hover {
  background: color-mix(in srgb, var(--gold) 18%, transparent);
  border-color: color-mix(in srgb, var(--gold) 55%, transparent);
}

.c-pill:active {
  transform: scale(0.97);
}

.c-pill svg {
  width: 12px;
  height: 12px;
  opacity: 0.8;
}

.c-pill b {
  font-weight: 700;
}

.c-pill code {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--gold-dim);
}

.c-pill .c-sep {
  opacity: 0.45;
}

/* 代币图标（来自 Jupiter） */

.c-icon {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: var(--chip-bg);
}

/* 发射平台徽章：Jupiter 的 launchpad 字段 */

.c-launchpad {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.c-verified {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--in) 16%, transparent);
  color: var(--in);
  font-size: 10px;
  font-weight: 700;
  flex: none;
}

/* 市值 / 单价：跟在金额后面 */

.mb {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.mb i {
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-2);
  margin-right: 2px;
  letter-spacing: 0.02em;
}

/* 统计行里的市场指标用稍微亮一点的颜色，和交易信息区分开 */

.ev-stats .st-group {
  display: inline-flex;
  align-items: center;
  gap: 6px 14px;
  flex-wrap: wrap;
}

.ev-stats .st-market-group {
  color: var(--text-dim);
  padding-right: 14px;
  border-right: 1px solid var(--border);
}

.c-pill.is-native {
  cursor: default;
  border-style: dashed;
}

.c-pill.is-native:hover {
  background: var(--gold-bg);
}

.c-pill.is-extra {
  padding: 5px 10px;
  font-size: 11.5px;
}

.c-trade {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--gold-border);
  background: transparent;
  color: var(--gold);
  font-size: 12.5px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.c-trade:hover {
  background: color-mix(in srgb, var(--gold) 16%, transparent);
  border-color: color-mix(in srgb, var(--gold) 55%, transparent);
}

.c-copy {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.c-copy svg {
  width: 13px;
  height: 13px;
}

.c-copy:hover {
  color: var(--gold);
  border-color: var(--gold-border);
  background: var(--gold-bg);
}

.c-copy:active {
  transform: scale(0.92);
}

/* ── 统计行 ── */

.ev-stats {
  display: flex;
  align-items: center;
  gap: 6px 14px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ── 一键复制（详情面板内仍在用）── */

.copy-mini {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex: none;
  text-decoration: none;
  font-size: 11px;
  line-height: 1;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.copy-mini svg {
  width: 11px;
  height: 11px;
}

.copy-mini:hover {
  color: var(--gold);
  background: var(--gold-bg);
  border-color: var(--gold-border);
}

.copy-mini:active {
  transform: scale(0.9);
}

/* ── 详情里的合约明细 ── */

.mint-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
}

.mint-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.mint-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
}

.mint-head strong {
  font-weight: 620;
}

.mint-head .pos {
  color: var(--in);
  font-variant-numeric: tabular-nums;
}

.mint-head .neg {
  color: var(--out);
  font-variant-numeric: tabular-nums;
}

.mint-plat {
  font-style: normal;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--chip-active-bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.mint-plat.none {
  color: var(--muted);
  background: transparent;
  border-style: dashed;
}

.mint-addr {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.mint-addr code {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
  cursor: text;
  user-select: all;
  overflow-wrap: anywhere;
}

.tag.accent {
  color: var(--accent);
  border-color: rgba(153, 69, 255, 0.3);
}

.tag.token {
  color: var(--text-dim);
  background: var(--chip-bg);
}

.tag.fail {
  color: var(--danger);
  border-color: rgba(255, 92, 114, 0.3);
}

.tag.hist {
  color: var(--muted);
  border-style: dashed;
}

.ev-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
  flex: none;
}

.ev-time {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ev-link {
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.16s ease, color 0.16s ease;
}

.ev:hover .ev-link {
  opacity: 1;
}

.ev-link:hover {
  color: var(--accent);
}

.ev-detail {
  border-top: 1px dashed var(--border);
  margin-top: 2px;
  padding-top: 11px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px 14px;
  font-size: 11.5px;
}

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.detail-row > span:first-child {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.detail-row code {
  font-family: var(--mono);
  font-size: 10.5px;
  word-break: break-all;
  color: var(--text-dim);
  cursor: text;
  user-select: text;
}

.ev.is-hidden {
  display: none;
}

/* ───────────── 空态 ───────────── */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}

.empty svg {
  width: 34px;
  height: 34px;
  opacity: 0.4;
}

.empty p {
  margin: 0;
  font-size: 12.5px;
  max-width: 320px;
  line-height: 1.6;
}

.skeleton {
  height: 62px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--skeleton) 25%, transparent 37%, var(--skeleton) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* ───────────── 弹窗 ───────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 8, 0.66);
  backdrop-filter: blur(6px);
  animation: fade 0.2s ease;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

.modal-card {
  position: relative;
  width: min(660px, 100%);
  max-height: min(86vh, 900px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: pop 0.24s cubic-bezier(0.2, 1.2, 0.4, 1);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  font-size: 15px;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.modal-section {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.modal-section h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 650;
}

.modal-note {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.65;
}

.modal-note strong {
  color: var(--text-dim);
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.probe-row {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
}

.probe-result {
  font-size: 11.5px;
  color: var(--muted);
}

.probe-result.ok {
  color: var(--in);
}

.probe-result.bad {
  color: var(--danger);
}

/* 网络诊断结果 */

.diagnose-detail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel-2);
}

.diag-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  line-height: 1.55;
}

.diag-name {
  font-weight: 620;
  flex: none;
  min-width: 96px;
}

.diag-row.ok .diag-name {
  color: var(--in);
}

.diag-row.bad .diag-name {
  color: var(--danger);
}

.diag-row code {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
}

.diag-ip {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.diag-verdict {
  color: var(--muted);
  flex: 1 1 100%;
  padding-left: 104px;
}

@media (max-width: 760px) {
  .diag-verdict {
    padding-left: 0;
  }
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-top: 1px solid var(--border);
  background: var(--panel-2);
}

.modal-foot-actions {
  display: flex;
  gap: 8px;
}

/* ───────────── 提示条 ───────────── */

.toasts {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 36px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  animation: toastIn 0.26s cubic-bezier(0.2, 1.2, 0.4, 1);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
}

.toast.out {
  animation: toastOut 0.24s ease forwards;
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(16px);
  }
}

.toast-bar {
  width: 3px;
  align-self: stretch;
  border-radius: 2px;
  background: var(--accent);
  flex: none;
}

.toast.ok .toast-bar {
  background: var(--in);
}

.toast.bad .toast-bar {
  background: var(--danger);
}

.toast-body {
  min-width: 0;
}

.toast-body strong {
  display: block;
  font-weight: 620;
  margin-bottom: 1px;
}

.toast-body p {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
  word-break: break-word;
}

/* ───────────── 令牌闸门 ───────────── */

.gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg);
}

.gate[hidden] {
  display: none;
}

.gate-card {
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--panel);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.gate-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto;
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(153, 69, 255, 0.2), rgba(20, 241, 149, 0.14));
  color: var(--accent);
}

.gate-icon svg {
  width: 23px;
  height: 23px;
}

.gate-card h2 {
  font-size: 16px;
}

.gate-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

.gate-card input {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--input-bg);
  outline: none;
  text-align: center;
}

.gate-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(153, 69, 255, 0.16);
}

.gate-error {
  color: var(--danger);
  min-height: 16px;
  font-size: 11.5px;
}

/* ───────────── 响应式 ───────────── */

@media (max-width: 1180px) {
  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .stat-wide {
    grid-column: 1 / -1;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .feed {
    max-height: 560px;
  }
}

@media (max-width: 760px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .btn-text {
    display: none;
  }
  .brand-text p {
    display: none;
  }
  .search {
    width: 120px;
  }
  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }
  /* 窄屏下卡片改为两行：身份行占满，金额行降一档字号 */
  .ev {
    padding: 12px 13px;
    gap: 9px;
  }
  .ev-avatar {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }
  .ev-title {
    font-size: 13.5px;
  }
  .ev-amt {
    font-size: 17px;
  }
  .ev-side {
    gap: 2px;
  }
  .ev-route {
    font-size: 12.5px;
  }
  .ev-route .rt-fee {
    margin-left: 0;
  }
  .c-pill {
    padding: 5px 10px;
    font-size: 12px;
  }
  .c-trade {
    padding: 5px 11px;
  }
  .ev-stats {
    gap: 4px 11px;
  }
  .pill-sub {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
