/* USDT 地址追踪分析 — Gradient Glass 玻璃拟态 */
:root {
  --bg1: #0f172a;
  --bg2: #1e1b4b;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-strong: rgba(255, 255, 255, 0.1);
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --accent: #6366f1;
  --accent2: #22d3ee;
  --green: #34d399;
  --red: #f87171;
  --yellow: #fbbf24;
  --radius: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: linear-gradient(135deg, var(--bg1) 0%, var(--bg2) 50%, #172554 100%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* 背景光斑 */
body::before, body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}
body::before { width: 520px; height: 520px; background: #6366f1; top: -180px; right: -120px; }
body::after  { width: 460px; height: 460px; background: #06b6d4; bottom: -160px; left: -140px; }

.container { max-width: 1280px; margin: 0 auto; padding: 24px 20px 60px; position: relative; z-index: 1; }

/* ===== 头部 ===== */
.header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
}
.logo h1 { font-size: 21px; font-weight: 700; letter-spacing: 0.5px; }
.logo h1 span { background: linear-gradient(90deg, var(--accent2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo p { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.header-actions { display: flex; gap: 10px; }

/* ===== 玻璃卡片 ===== */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 12px; border: 1px solid var(--glass-border);
  background: var(--glass-strong); color: var(--text);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; user-select: none;
}
.btn:hover { background: rgba(255, 255, 255, 0.16); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border: none; box-shadow: 0 4px 18px rgba(99, 102, 241, 0.45);
}
.btn-primary:hover { box-shadow: 0 6px 24px rgba(99, 102, 241, 0.6); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: 10px; }
.btn-danger { background: rgba(248, 113, 113, 0.15); border-color: rgba(248, 113, 113, 0.3); color: var(--red); }

/* ===== 输入区 ===== */
.input-area label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 8px; font-weight: 600; letter-spacing: 0.3px; }
textarea {
  width: 100%; min-height: 96px; padding: 14px 16px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--glass-border);
  border-radius: 12px; color: var(--text); font-size: 14px;
  font-family: 'Consolas', 'Courier New', monospace;
  resize: vertical; outline: none; line-height: 1.6;
}
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2); }
textarea::placeholder { color: #64748b; }

.controls { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-end; margin-top: 16px; }
.ctrl-group { display: flex; flex-direction: column; gap: 6px; }
.ctrl-group label { font-size: 12px; color: var(--text-dim); margin: 0; }
.ctrl-row { display: flex; align-items: center; gap: 10px; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 140px; height: 6px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.15); outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  cursor: pointer; box-shadow: 0 2px 8px rgba(99, 102, 241, 0.5);
}
.range-val {
  min-width: 28px; text-align: center; font-weight: 700;
  font-size: 15px; color: var(--accent2);
}

select, input[type="text"], input[type="password"], input[type="number"] {
  padding: 9px 12px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--glass-border);
  color: var(--text); font-size: 13px; outline: none;
}
select:focus, input:focus { border-color: var(--accent); }

/* ===== 进度条 ===== */
.progress-wrap { display: none; margin-top: 16px; }
.progress-wrap.active { display: block; }
.progress-bar-bg {
  height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.1);
  overflow: hidden; margin-bottom: 8px;
}
.progress-bar {
  height: 100%; width: 0%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.3s;
}
.progress-text { font-size: 12px; color: var(--text-dim); display: flex; justify-content: space-between; }

/* ===== Tabs ===== */
.tabs {
  display: flex; gap: 6px; margin-bottom: 0;
  background: rgba(0, 0, 0, 0.2); border-radius: 14px 14px 0 0;
  padding: 8px 8px 0; border: 1px solid var(--glass-border); border-bottom: none;
}
.tab {
  padding: 11px 22px; border-radius: 10px 10px 0 0;
  font-size: 14px; font-weight: 600; cursor: pointer;
  color: var(--text-dim); border: none; background: none;
  transition: all 0.2s;
}
.tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.tab.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(34, 211, 238, 0.2));
}
.tab-panel {
  display: none;
  background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 0 0 var(--radius) var(--radius);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--shadow); padding: 22px; min-height: 320px;
}
.tab-panel.active { display: block; }

/* ===== 图表容器 ===== */
#graphChart { width: 100%; height: 560px; }
.chart-half { width: 100%; height: 300px; }
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }

/* ===== 统计卡片 ===== */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card {
  background: rgba(0, 0, 0, 0.22); border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 14px 16px;
}
.stat-card .label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 6px; }
.stat-card .value { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-card .value.green { color: var(--green); }
.stat-card .value.red { color: var(--red); }
.stat-card .value.cyan { color: var(--accent2); }
.stat-card .sub { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; margin: 12px 0; border-radius: 12px; border: 1px solid var(--glass-border); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  background: rgba(99, 102, 241, 0.18); color: var(--accent2);
  padding: 10px 12px; text-align: left; font-weight: 600;
  white-space: nowrap; position: sticky; top: 0;
}
td { padding: 9px 12px; border-top: 1px solid rgba(255, 255, 255, 0.06); font-variant-numeric: tabular-nums; }
tr:hover td { background: rgba(255, 255, 255, 0.04); }
.addr-mono { font-family: 'Consolas', 'Courier New', monospace; font-size: 12px; color: var(--accent2); }
.tag-chip {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  background: rgba(251, 191, 36, 0.18); color: var(--yellow);
  font-size: 11px; font-weight: 600; margin-left: 6px;
}
.tag-chip.ex { background: rgba(52, 211, 153, 0.18); color: var(--green); }

/* ===== AI 报告 ===== */
.ai-box { display: flex; flex-direction: column; gap: 14px; }
.ai-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ai-report {
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 20px 24px; line-height: 1.85;
  font-size: 14px; min-height: 120px;
}
.ai-report h1 { font-size: 20px; margin: 14px 0 10px; color: var(--accent2); }
.ai-report h2 { font-size: 17px; margin: 16px 0 8px; color: var(--accent2); border-left: 3px solid var(--accent); padding-left: 10px; }
.ai-report h3 { font-size: 15px; margin: 12px 0 6px; color: var(--text); }
.ai-report p { margin: 8px 0; color: var(--text); }
.ai-report ul { margin: 8px 0 8px 22px; }
.ai-report li { margin: 4px 0; }
.ai-report strong { color: var(--accent2); }
.ai-report code { background: rgba(99, 102, 241, 0.2); padding: 1px 6px; border-radius: 4px; font-size: 13px; }
.md-table { margin: 10px 0; border-collapse: collapse; width: 100%; }
.md-table th, .md-table td { border: 1px solid rgba(255, 255, 255, 0.12); padding: 6px 10px; font-size: 12.5px; }
.ai-cursor { display: inline-block; width: 2px; height: 1em; background: var(--accent2); animation: blink 0.8s infinite; vertical-align: text-bottom; }
@keyframes blink { 50% { opacity: 0; } }

/* ===== 设置抽屉 ===== */
.drawer-mask {
  display: none; position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.5); z-index: 99;
  backdrop-filter: blur(4px);
}
.drawer-mask.open { display: block; }
.drawer {
  position: fixed; top: 0; right: -400px; width: 380px; height: 100vh;
  background: #1e293b; border-left: 1px solid var(--glass-border);
  z-index: 100; transition: right 0.28s ease;
  padding: 26px; overflow-y: auto;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.4);
}
.drawer.open { right: 0; }
.drawer h2 { font-size: 17px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; }
.drawer .field { margin-bottom: 18px; }
.drawer .field label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 7px; font-weight: 600; }
.drawer .field input { width: 100%; }
.drawer .hint { font-size: 11px; color: var(--text-dim); line-height: 1.6; margin-top: 6px; }
.key-status { font-size: 12px; margin-top: 8px; padding: 6px 10px; border-radius: 8px; }
.key-status.ok { background: rgba(52, 211, 153, 0.15); color: var(--green); }
.key-status.err { background: rgba(248, 113, 113, 0.15); color: var(--red); }

/* ===== 空状态 ===== */
.empty {
  text-align: center; padding: 60px 20px; color: var(--text-dim);
}
.empty .icon { font-size: 48px; margin-bottom: 14px; opacity: 0.6; }
.empty p { font-size: 14px; line-height: 1.8; }

/* ===== 通用 ===== */
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb8 { margin-bottom: 8px; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.dim { color: var(--text-dim); font-size: 12px; }
.green { color: var(--green); } .red { color: var(--red); } .cyan { color: var(--accent2); }
.num { font-variant-numeric: tabular-nums; font-weight: 700; }

.section-title {
  font-size: 15px; font-weight: 700; margin: 20px 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: ''; width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent2));
}

.pair-card {
  background: rgba(0, 0, 0, 0.22); border: 1px solid var(--glass-border);
  border-radius: 12px; padding: 16px; margin-bottom: 12px;
}
.pair-card h4 { font-size: 14px; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700;
}
.badge.cyan { background: rgba(34, 211, 238, 0.18); color: var(--accent2); }
.badge.green { background: rgba(52, 211, 153, 0.18); color: var(--green); }
.badge.yellow { background: rgba(251, 191, 36, 0.18); color: var(--yellow); }

/* 响应式 */
@media (max-width: 760px) {
  .charts-row { grid-template-columns: 1fr; }
  .controls { flex-direction: column; align-items: stretch; }
  .drawer { width: 88vw; right: -88vw; }
  #graphChart { height: 420px; }
}
