/* ==========================================================================
   Box Subnames — 深色霓虹主题
   ========================================================================== */

:root {
  /* 底色 */
  --bg: #08080c;
  --bg-card: #101018;
  --bg-input: #0c0c14;
  --bg-hover: #16161f;
  --border: #23232f;
  --border-bright: #32323f;

  /* 文字 */
  --text: #e8e8f0;
  --text-dim: #8a8a9a;
  --text-mute: #55555f;

  /* 霓虹 */
  --neon: #7c3aed;
  --neon-light: #a78bfa;
  --neon-2: #06b6d4;
  --neon-2-light: #22d3ee;
  --neon-glow: rgba(124, 58, 237, 0.35);
  --neon-2-glow: rgba(6, 182, 212, 0.3);

  /* 语义 */
  --ok: #22c55e;
  --ok-glow: rgba(34, 197, 94, 0.25);
  --warn: #f59e0b;
  --err: #ef4444;
  --err-glow: rgba(239, 68, 68, 0.25);

  --radius: 12px;
  --radius-sm: 8px;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'Roboto Mono', Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Noto Sans SC', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 背景光晕 */
body::before,
body::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: 520px; height: 520px;
  top: -180px; left: -120px;
  background: radial-gradient(circle, var(--neon-glow), transparent 70%);
}
body::after {
  width: 460px; height: 460px;
  bottom: -160px; right: -100px;
  background: radial-gradient(circle, var(--neon-2-glow), transparent 70%);
}

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

.wrap {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* ---------- 导航 ---------- */

.nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  margin-bottom: 8px;
}

.nav-brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-brand .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 12px var(--neon);
}

.nav-links { display: flex; gap: 4px; }

.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: all 0.15s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-hover); }
.nav-links a.active {
  color: var(--neon-light);
  background: rgba(124, 58, 237, 0.12);
}

/* ---------- 钱包按钮 ---------- */

.wallet-btn {
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-bright);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.wallet-btn:hover {
  border-color: var(--neon);
  box-shadow: 0 0 16px var(--neon-glow);
}
.wallet-btn.connected {
  border-color: rgba(34, 197, 94, 0.4);
  color: var(--ok);
}

/* ---------- 标题 ---------- */

.hero { padding: 40px 0 32px; text-align: center; }

.hero h1 {
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 0%, var(--neon-light) 45%, var(--neon-2-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p { color: var(--text-dim); font-size: 15px; max-width: 480px; margin: 0 auto; }

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--border-bright); }

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}
.card-sub {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 18px;
}

/* ---------- 表单 ---------- */

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 500;
}

.input,
input[type='text'],
input[type='email'],
input[type='url'] {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  padding: 11px 14px;
  transition: all 0.15s;
  outline: none;
}
.input:focus,
input:focus {
  border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}
.input::placeholder { color: var(--text-mute); }

/* 带后缀的输入框 */
.input-group {
  display: flex;
  align-items: stretch;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: all 0.15s;
}
.input-group:focus-within {
  border-color: var(--neon);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}
.input-group input {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 0;
  font-size: 16px;
  padding: 14px 16px;
}
.input-group input:focus { box-shadow: none; }
.input-group .suffix {
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: rgba(124, 58, 237, 0.1);
  color: var(--neon-light);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  border-left: 1px solid var(--border);
  white-space: nowrap;
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon) 0%, var(--neon-2) 100%);
  color: #fff;
  box-shadow: 0 0 24px var(--neon-glow);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 36px var(--neon-glow), 0 0 60px var(--neon-2-glow);
  transform: translateY(-1px);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-bright);
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) {
  border-color: var(--neon);
  background: rgba(124, 58, 237, 0.08);
}
.btn-ghost:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-sm { width: auto; padding: 8px 16px; font-size: 13px; }

/* ---------- 状态提示 ---------- */

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  background: var(--bg-input);
}
.status .icon { flex-shrink: 0; font-size: 15px; line-height: 1; }
.status .body { flex: 1; min-width: 0; }
.status .name {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
}

.status.ok { border-color: rgba(34, 197, 94, 0.35); background: rgba(34, 197, 94, 0.06); }
.status.ok .icon { color: var(--ok); }
.status.err { border-color: rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.06); }
.status.err .icon { color: var(--err); }
.status.warn { border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.06); }
.status.warn .icon { color: var(--warn); }

/* ---------- 域名展示 ---------- */

.domain-list { display: flex; flex-direction: column; gap: 8px; }

.domain-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.domain-row .name {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  word-break: break-all;
}
.domain-row .tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(124, 58, 237, 0.15);
  color: var(--neon-light);
  white-space: nowrap;
  font-weight: 600;
}
.domain-row .tag.dns {
  background: rgba(6, 182, 212, 0.15);
  color: var(--neon-2-light);
}

/* ---------- NFT 卡片（我的名字页）---------- */

.nft-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  transition: border-color 0.2s;
}
.nft-card:hover { border-color: var(--border-bright); }

.nft-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.nft-label {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff, var(--neon-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.nft-domains {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 6px;
}
.nft-domains span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}

/* ---------- toast ---------- */

#toasts {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 13.5px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  animation: toastIn 0.22s ease-out;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.toast.ok { border-color: rgba(34, 197, 94, 0.5); }
.toast.err { border-color: rgba(239, 68, 68, 0.5); }
.toast .body { flex: 1; min-width: 0; word-break: break-word; }
.toast a { color: var(--neon-light); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ---------- 载入 ---------- */

.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-mute);
  font-size: 14px;
}

/* ---------- 杂项 ---------- */

.mono { font-family: var(--mono); }
.dim { color: var(--text-dim); }
.mute { color: var(--text-mute); }
.small { font-size: 13px; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.row { display: flex; gap: 10px; align-items: center; }

a { color: var(--neon-light); }

.hint {
  font-size: 12.5px;
  color: var(--text-mute);
  margin-top: 6px;
  line-height: 1.5;
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.feature-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13.5px;
  color: var(--text-dim);
}
.feature-list .mark {
  color: var(--neon-2-light);
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .nav { flex-wrap: wrap; }
  .nav-links { order: 3; width: 100%; }
  .nav-links a { flex: 1; text-align: center; }
  .card { padding: 18px; }
  .nft-card { padding: 18px; }
  #toasts { left: 16px; right: 16px; max-width: none; }
  .domain-row { flex-direction: column; align-items: flex-start; gap: 6px; }
}
