:root {
  --bg-a: #061a4f;
  --bg-b: #0d3f85;
  --bg-c: #126fbf;
  --card: rgba(19, 53, 126, 0.6);
  --card-border: rgba(163, 214, 255, 0.22);
  --text-main: #e8f3ff;
  --text-muted: #a7c3ea;
  --accent: #ff7f5f;
  --accent-soft: #ffd1c4;
  --ok: #45e0b6;
  --chip-bg: rgba(127, 180, 244, 0.16);
  --danger: #ff5e84;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Noto Sans SC", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 15% 15%, rgba(76, 213, 255, 0.22), transparent 25%),
    radial-gradient(circle at 90% 5%, rgba(255, 170, 124, 0.2), transparent 28%),
    linear-gradient(160deg, var(--bg-a), var(--bg-b) 45%, var(--bg-c));
  padding: 24px 14px 40px;
  position: relative;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.35;
  z-index: 0;
}

.bg-orb-left {
  width: 180px;
  height: 180px;
  left: -60px;
  top: 120px;
  background: #49b6ff;
}

.bg-orb-right {
  width: 220px;
  height: 220px;
  right: -80px;
  top: -30px;
  background: #ff8c6b;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.card {
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: var(--card);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.is-hidden {
  display: none !important;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
}

.topbar-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.lang-switch {
  display: inline-flex;
  padding: 2px;
  border-radius: 999px;
  background: rgba(169, 216, 255, 0.14);
  border: 1px solid rgba(169, 216, 255, 0.22);
}

.lang-btn {
  border: 0;
  color: #c9e6ff;
  background: transparent;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.lang-btn.active {
  color: #ffffff;
  background: linear-gradient(120deg, rgba(90, 191, 255, 0.95), rgba(47, 121, 212, 0.95));
}

.topbar .btn-primary {
  min-width: 132px;
}

.topbar h1 {
  margin: 2px 0 0;
  font-family: "Rajdhani", sans-serif;
  font-size: 30px;
  letter-spacing: 0.5px;
}

.label {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.panel {
  padding: 14px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0;
  font-size: 17px;
}

.network-badge {
  font-size: 12px;
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 4px 10px;
  border-radius: 99px;
}

.input-wrap input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(2, 9, 43, 0.4);
  color: #fff;
  font-size: 36px;
  text-align: center;
  font-family: "Rajdhani", sans-serif;
  padding: 14px;
  outline: none;
}

.input-wrap input::placeholder {
  color: #8ca7cf;
  font-size: 18px;
}

.input-wrap input.input-invalid {
  border-color: rgba(255, 94, 132, 0.95);
  box-shadow: 0 0 0 2px rgba(255, 94, 132, 0.2);
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: var(--chip-bg);
  color: #e7f2ff;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.chip.active {
  border-color: rgba(255, 127, 95, 0.9);
  color: #fff;
  background: rgba(255, 127, 95, 0.22);
}

.action-row {
  margin-top: 14px;
  display: flex;
  gap: 8px;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: saturate(0.6);
}

.btn-primary {
  background: linear-gradient(120deg, #52bfff, #2f79d4);
  color: #fff;
}

.btn-accent {
  background: linear-gradient(120deg, #ff9860, #ff6e68);
  color: #fff;
  flex: 1;
}

.btn-ghost {
  color: #d3e6ff;
  background: rgba(185, 219, 255, 0.12);
  border: 1px solid rgba(185, 219, 255, 0.28);
}

/* 已连接状态：地址不可误触断开，仅 ✕ 触发断开 */
.wallet-addr {
  cursor: default;
}

.wallet-disconnect {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 0 6px;
  border-radius: 8px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.wallet-disconnect:hover {
  background: rgba(255, 94, 132, 0.85);
  opacity: 1;
}

.status {
  margin: 10px 2px 0;
  font-size: 13px;
  color: var(--text-muted);
}

.progress-track {
  width: 100%;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #45e0b6, #7fd4ff 60%, #ffa171);
  transition: width 0.35s ease;
}

.record-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.record-tab {
  flex: 1;
  border: 1px solid rgba(159, 201, 255, 0.35);
  border-radius: 12px;
  padding: 9px 12px;
  background: rgba(159, 201, 255, 0.1);
  color: #cce3ff;
  font-weight: 700;
  cursor: pointer;
}

.record-tab.active {
  background: linear-gradient(120deg, rgba(255, 147, 104, 0.3), rgba(255, 110, 104, 0.24));
  border-color: rgba(255, 153, 115, 0.85);
  color: #fff;
}

.record-pane {
  display: none;
}

.record-pane.active {
  display: block;
}

.record-preview-note {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px dashed rgba(255, 189, 169, 0.5);
  color: #ffd7ca;
  background: rgba(255, 140, 107, 0.08);
  font-size: 12px;
}

.table-wrap {
  max-height: 220px;
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  position: sticky;
  top: 0;
  background: rgba(8, 26, 79, 0.92);
  color: #b7d4f6;
  text-align: left;
  font-weight: 600;
  padding: 8px 6px;
}

tbody td {
  padding: 8px 6px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
}

.mini-link {
  border: 0;
  background: transparent;
  color: #9ec3f3;
  cursor: pointer;
  font-size: 13px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 10px;
}

.stat-box {
  border-radius: 12px;
  background: rgba(3, 20, 57, 0.45);
  border: 1px solid rgba(146, 196, 252, 0.25);
  padding: 12px;
}

.stat-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.stat-value {
  margin: 6px 0 0;
  font-family: "Rajdhani", sans-serif;
  font-size: 30px;
  font-weight: 700;
  color: var(--accent);
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ====== 钱包选择弹窗 ====== */
.picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(2, 6, 28, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.picker-modal {
  width: min(340px, 90vw);
  padding: 20px;
  text-align: center;
}

.picker-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.picker-wallet-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.picker-wallet-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: var(--accent);
}

.picker-wallet-btn img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}
