/* ==========================================================================
   注册页
   --------------------------------------------------------------------------
   布局：大搜索框 → 左边 NFT 实时预览 / 右边状态与操作

   交互参考 ENS 官网：输入即反馈，不用先点「检查」按钮。
   差异点：左边会**实时渲染这张 NFT**（颜色由域名决定），
          比单纯的状态文字更直观。

   注意：预览用的 SVG 来自合约（svgImage），不是前端重画的 ——
        保证「预览」和「实际拿到」完全一致。
   ========================================================================== */

/* ---------- 主视觉 ---------- */

.reg-hero {
  text-align: center;
  padding: 20px 0 28px;
}

.reg-hero h1 {
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin-bottom: 12px;
}

.reg-hero .grad {
  background: linear-gradient(135deg, var(--neon-light) 0%, var(--neon-2-light) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.reg-hero p {
  color: var(--text-dim);
  font-size: 15.5px;
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ---------- 大搜索框 ---------- */

.search-wrap {
  position: relative;
  margin-bottom: 22px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  /* 渐变描边：padding-box 填底色，border-box 放渐变 */
  background: linear-gradient(var(--bg-input), var(--bg-input)) padding-box,
              linear-gradient(135deg, rgba(124,58,237,.55), rgba(6,182,212,.4)) border-box;
  border: 2px solid transparent;
  border-radius: 16px;
  transition: box-shadow .22s, transform .22s;
}

.search-box:focus-within {
  box-shadow: 0 0 0 4px rgba(124, 58, 237, .14),
              0 12px 40px -12px rgba(124, 58, 237, .55);
  transform: translateY(-1px);
}

.search-box .s-ico {
  color: var(--text-mute);
  flex-shrink: 0;
  transition: color .2s;
}
.search-box:focus-within .s-ico { color: var(--neon-light); }

.search-box input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: clamp(18px, 3.4vw, 24px);
  padding: 20px 0;
  letter-spacing: -0.01em;
}
.search-box input::placeholder { color: var(--text-mute); }

/* ---------- 主体：左预览 右状态 ---------- */

.reg-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

@media (max-width: 720px) {
  .reg-main { grid-template-columns: 1fr; }
}

/* ---------- 左：NFT 预览 ---------- */

.preview-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  overflow: hidden;
}

/* 卡片后面的柔光，颜色跟着 NFT 走（由 JS 设 --glow） */
.preview-card::before {
  content: '';
  position: absolute;
  inset: -40% -20% auto -20%;
  height: 70%;
  background: radial-gradient(ellipse at center,
              var(--glow, rgba(124, 58, 237, .5)), transparent 70%);
  filter: blur(46px);
  opacity: .5;
  pointer-events: none;
  transition: background .4s;
}

.preview-stage {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 13px;
  overflow: hidden;
}

.preview-stage svg {
  width: 100%;
  height: auto;
  display: block;
}

/* 未输入 / 校验不通过时的占位 */
.preview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-mute);
  font-size: 13px;
  line-height: 1.7;
  padding: 24px;
}

.preview-note {
  position: relative;
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-mute);
  text-align: center;
  line-height: 1.6;
}

/* ---------- 右：状态与操作 ---------- */

.status-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 17px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 13px;
  transition: border-color .22s, background .22s;
}

.row-status .ico {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  background: rgba(255, 255, 255, .06);
  color: var(--text-mute);
  transition: background .22s, color .22s;
}

.row-status .txt { flex: 1; min-width: 0; }

.row-status .dom {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--text);
  word-break: break-all;
  line-height: 1.4;
}
.row-status .dom em {
  font-style: normal;
  color: var(--text-mute);
}

.row-status .msg {
  font-size: 12.5px;
  color: var(--text-mute);
  margin-top: 2px;
}

.row-status .tag {
  flex-shrink: 0;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  background: rgba(255, 255, 255, .05);
  color: var(--text-mute);
}

/* 可用 */
.row-status.ok {
  border-color: rgba(34, 197, 94, .32);
  background: linear-gradient(180deg, rgba(34, 197, 94, .06), transparent);
}
.row-status.ok .ico { background: rgba(34, 197, 94, .16); color: #4ade80; }
.row-status.ok .tag { background: rgba(34, 197, 94, .14); color: #4ade80; }

/* 占用 */
.row-status.bad {
  border-color: rgba(239, 68, 68, .3);
  background: linear-gradient(180deg, rgba(239, 68, 68, .05), transparent);
}
.row-status.bad .ico { background: rgba(239, 68, 68, .15); color: #f87171; }
.row-status.bad .tag { background: rgba(239, 68, 68, .13); color: #f87171; }
.row-status.bad .dom {
  color: var(--text-dim);
  text-decoration: line-through;
  text-decoration-color: rgba(239, 68, 68, .5);
}

/* 检查中 */
.row-status.pending .ico { background: transparent; }

.row-status .spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, .2);
  border-top-color: var(--neon-light);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* ---------- 操作区 ---------- */

.action-box {
  padding: 17px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 13px;
}

.action-box .cost {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
  font-size: 12.5px;
  color: var(--text-mute);
}
.action-box .cost b {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
}

.btn-register {
  width: 100%;
  padding: 15px 24px;
  border: none;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--neon) 0%, var(--neon-2) 100%);
  color: #fff;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 8px 28px -10px rgba(124, 58, 237, .75);
  transition: transform .18s, box-shadow .18s, opacity .18s;
}
.btn-register:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 38px -10px rgba(124, 58, 237, .85),
              0 0 50px -18px rgba(6, 182, 212, .7);
}
.btn-register:disabled {
  opacity: .34;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* 注册成功后的结果卡片 */
.reg-result {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid rgba(34, 197, 94, .3);
  border-radius: 14px;
}

/* ---------- 底部特性卡 ---------- */

.reg-feats {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 11px;
}

.rf {
  padding: 15px 16px;
  background: rgba(255, 255, 255, .022);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color .2s, transform .2s, background .2s;
}
.rf:hover {
  border-color: var(--border-bright);
  background: rgba(255, 255, 255, .035);
  transform: translateY(-2px);
}

.rf-ico { font-size: 17px; margin-bottom: 9px; line-height: 1; }
.rf h3 { font-size: 13.8px; font-weight: 620; margin-bottom: 4px; }
.rf p { font-size: 12.5px; color: var(--text-dim); line-height: 1.65; }

/* ---------- 窄屏 ---------- */

@media (max-width: 620px) {
  .reg-hero { padding: 8px 0 20px; }
  .search-box { padding: 0 16px; }
  .search-box input { padding: 16px 0; }
  .reg-feats { grid-template-columns: 1fr; }
}

/* ---------- 无障碍 ---------- */

@media (prefers-reduced-motion: reduce) {
  .search-box:focus-within { transform: none; }
  .btn-register:hover:not(:disabled) { transform: none; }
  .rf:hover { transform: none; }
  .row-status .spinner { animation-duration: 1.6s; }
}
