/* ===================================================================
   components.css — 通用组件
   按钮 / 卡片 / 徽章 / Tabs / 进度条 / Ticker / 输入框 / 列表项
   设计原则：中性配色、克制强调、无霓虹光效、排版周正
   =================================================================== */

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--tap-min); padding: 0 18px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg4); color: var(--text);
  font-size: 14px; font-weight: 500; cursor: pointer;
  transition: background 0.18s, border-color 0.18s; white-space: nowrap;
}
.btn:active { background: var(--bg3); }
.btn-block { width: 100%; }
.btn-lg { height: 50px; font-size: 15px; border-radius: var(--radius); }
.btn-primary { background: var(--accent); color: #08130d; border-color: transparent; font-weight: 600; }
.btn-primary:active { background: var(--accent2); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:active { background: var(--bg3); }
.btn-cancel { flex: 1; background: transparent; border: 1px solid var(--border); color: var(--text2); height: var(--tap-min); border-radius: var(--radius-sm); font-weight: 500; cursor: pointer; }
.btn-confirm { flex: 1; background: var(--accent); color: #08130d; border: none; height: var(--tap-min); border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; }
.btn-confirm:active { background: var(--accent2); }

/* ===== 卡片 ===== */
.card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.card-glow { background: var(--bg3); }
.card-row { display: flex; align-items: center; gap: 12px; }

/* 通用栅格 */
.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row-gap { padding: 0 16px; }

/* ===== 徽章 ===== */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 6px;
  font-size: 11px; font-weight: 500;
  background: var(--bg4); color: var(--text2);
  border: 1px solid var(--border);
}
.badge-gray { background: var(--bg4); color: var(--text2); border-color: var(--border); }
.badge-gold { background: rgba(224,179,65,0.10); color: var(--gold); border-color: rgba(224,179,65,0.22); }

/* 资质徽章网格 */
.badge-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 0 16px; }
.badge-card {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 4px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
}
.badge-card i { font-size: 18px; color: var(--text2); }
.badge-card span { font-size: 10px; color: var(--text2); }

/* ===== 统计卡 ===== */
.stats-row { display: flex; gap: 8px; padding: 0 16px; }
.stat-card {
  flex: 1; min-width: 0;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 8px; text-align: center;
}
.stat-num { font-size: 18px; font-weight: 600; color: var(--text); }
.stat-label { font-size: 10px; color: var(--text2); margin-top: 4px; }

/* ===== Tabs ===== */
.tabs {
  display: flex; gap: 8px; padding: 0 16px; margin: 10px 0 4px;
}
.tab {
  flex: 1; height: 38px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text2);
  font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.tab.active { background: var(--bg4); color: var(--text); border-color: var(--border-hover); }

/* 下划线式 tabs */
.tabs-line { display: flex; border-bottom: 1px solid var(--border); padding: 0 16px; }
.tab-line {
  background: none; border: none; color: var(--text2);
  padding: 10px 14px; font-size: 14px; font-weight: 500; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all 0.18s;
}
.tab-line.active { color: var(--text); border-color: var(--accent); }

/* ===== 进度条 ===== */
.progress {
  height: 6px; background: var(--bg4);
  border-radius: 20px; overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%; background: var(--accent);
  border-radius: 20px;
  transition: width 0.4s ease;
}

/* ===== 输入框 ===== */
.input-group { margin-bottom: 14px; }
.input-group label { display: block; font-size: 12px; color: var(--text2); margin-bottom: 6px; }
.input {
  width: 100%; font-size: 16px; padding: 0 14px; height: var(--tap-min);
  background: var(--bg4); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  -webkit-appearance: none; appearance: none; transition: border-color 0.18s;
}
.input:focus { outline: none; border-color: var(--border-hover); }
.input-hint { font-size: 11px; color: var(--text2); margin-top: 4px; line-height: 1.6; }

/* ===== 列表项（键值对行）===== */
.kv-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0; border-bottom: 1px solid var(--border);
}
.kv-row:last-child { border-bottom: none; }
.kv-row .k { font-size: 13px; color: var(--text2); }
.kv-row .v { font-size: 14px; font-weight: 500; color: var(--text); }

/* ===== 菜单项 ===== */
.menu-list { padding: 8px 16px 16px; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px;
  margin-bottom: 8px; cursor: pointer; transition: background 0.15s;
}
.menu-item:active { background: var(--bg4); }
.menu-icon {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg4); color: var(--text2);
  border: 1px solid var(--border); font-size: 15px; flex-shrink: 0;
}
.menu-icon.gold   { color: var(--gold); }
.menu-icon.blue   { color: var(--blue); }
.menu-icon.purple { color: var(--purple); }
.menu-icon.orange { color: var(--orange); }
.menu-icon.red    { color: var(--red); }
.menu-label { flex: 1; font-size: 14px; font-weight: 400; color: var(--text); }
.menu-item > i:last-child { color: var(--text3); font-size: 13px; }

/* ===== TICKER 行情条 ===== */
.ticker-strip {
  background: var(--bg2);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  overflow: hidden; padding: 8px 0; white-space: nowrap;
  user-select: none; -webkit-user-select: none;
  will-change: transform; transform: translateZ(0);
}
.ticker-inner {
  display: inline-flex; gap: 28px; padding-left: 16px;
  animation: tickerScroll 38s linear infinite; line-height: 1;
}
@keyframes tickerScroll {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}
.ticker-item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; flex-shrink: 0; }
.ticker-item .t-coin  { font-weight: 500; color: var(--text2); }
.ticker-item .t-price { color: var(--text); font-variant-numeric: tabular-nums; }

/* ===== 空状态 ===== */
.empty {
  text-align: center; color: var(--text3);
  font-size: 13px; padding: 28px 16px; line-height: 1.7;
}
.empty i { font-size: 26px; display: block; margin-bottom: 8px; opacity: 0.5; }

/* ===== 钱包选择列表（连接弹窗）===== */
.wallet-list { display: flex; flex-direction: column; gap: 10px; }
.wallet-opt {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg4); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  cursor: pointer; transition: background 0.18s, border-color 0.18s; width: 100%; text-align: left;
}
.wallet-opt:active:not(:disabled) { border-color: var(--border-hover); background: var(--bg3); }
.wallet-opt:disabled { opacity: 0.4; cursor: not-allowed; }
.wallet-opt .w-icon { font-size: 22px; line-height: 1; }
.wallet-opt .w-name { flex: 1; font-size: 15px; font-weight: 500; color: var(--text); }
.wallet-opt .w-status { font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: 6px; }
.w-detected { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(41,192,126,0.22); }
.w-undetected { background: var(--bg3); color: var(--text2); border: 1px solid var(--border); }
