/* walxn.cn /ip — IP 查询页 */

:root {
  --bg: #070a13;
  --ink: #e7ecf5;
  --muted: #8b94a7;
  --faint: #5b6478;
  --line: rgba(148, 163, 184, 0.14);
  --card: rgba(15, 20, 35, 0.55);
  --ok: #34d399;
  --radius: 22px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(103, 232, 249, 0.28); }

:focus-visible {
  outline: 2px solid rgba(103, 232, 249, 0.75);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ---------- 背景：极光 + 网格 ---------- */

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.aurora {
  position: absolute;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.32;
  mix-blend-mode: screen;
  will-change: transform;
}

.a1 {
  background: radial-gradient(circle at 32% 32%, #4338ca, transparent 64%);
  top: -12vmax;
  left: -10vmax;
  animation: drift1 26s ease-in-out infinite alternate;
}

.a2 {
  background: radial-gradient(circle at 60% 40%, #0e7490, transparent 64%);
  bottom: -16vmax;
  right: -8vmax;
  animation: drift2 32s ease-in-out infinite alternate;
}

.a3 {
  background: radial-gradient(circle at 50% 50%, #a21caf, transparent 60%);
  top: 28%;
  left: 56%;
  opacity: 0.2;
  animation: drift3 38s ease-in-out infinite alternate;
}

@keyframes drift1 { to { transform: translate3d(8vmax, 6vmax, 0) scale(1.15); } }
@keyframes drift2 { to { transform: translate3d(-7vmax, -5vmax, 0) scale(1.08); } }
@keyframes drift3 { to { transform: translate3d(-9vmax, 7vmax, 0) scale(0.92); } }

.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 38%, #000 30%, transparent 74%);
  mask-image: radial-gradient(ellipse 90% 70% at 50% 38%, #000 30%, transparent 74%);
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 120% 90% at 50% 115%, transparent 30%, rgba(7, 10, 19, 0.85) 100%);
}

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

.stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 32px 20px;
}

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

.card {
  width: min(560px, 100%);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015)),
    var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px 20px;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow:
    0 30px 80px -24px rgba(2, 6, 18, 0.9),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  animation: rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark { width: 19px; height: 19px; color: #67e8f9; flex: none; }

.brand-tld { color: var(--muted); font-weight: 500; }

.pill {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  padding: 4px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.pill.v4 {
  color: #67e8f9;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.35);
}

.pill.v6 {
  color: #e879f9;
  background: rgba(232, 121, 249, 0.1);
  border: 1px solid rgba(232, 121, 249, 0.35);
}

/* ---------- IP 展示 ---------- */

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

.ip-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
}

.ip {
  font-family: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, Menlo, monospace;
  font-size: clamp(28px, 7.2vw, 44px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: 0.01em;
  word-break: break-all;
  background: linear-gradient(120deg, #c7d2fe 8%, #67e8f9 52%, #f0abfc 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ip.is-loading {
  min-width: min(58vw, 300px);
  border-radius: 10px;
  background: linear-gradient(100deg,
    rgba(148, 163, 184, 0.13) 38%,
    rgba(148, 163, 184, 0.3) 50%,
    rgba(148, 163, 184, 0.13) 62%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

.ip.is-error {
  background: linear-gradient(120deg, #fda4af, #f0abfc);
  -webkit-background-clip: text;
  background-clip: text;
}

.meta {
  margin: 14px 0 0;
  min-height: 1.3em;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- 复制按钮 ---------- */

.copy-btn {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s, transform 0.15s;
}

.copy-btn:hover:not(:disabled) {
  border-color: rgba(103, 232, 249, 0.45);
  color: #a5f3fc;
  background: rgba(34, 211, 238, 0.08);
  transform: translateY(-1px);
}

.copy-btn:active:not(:disabled) { transform: translateY(0); }

.copy-btn:disabled { opacity: 0.45; cursor: default; }

.copy-btn .ic { width: 19px; height: 19px; }

.copy-btn .ic-check { display: none; }

.copy-btn.is-ok {
  border-color: rgba(52, 211, 153, 0.55);
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.1);
}

.copy-btn.is-ok .ic-copy { display: none; }
.copy-btn.is-ok .ic-check { display: block; }

.copy-tip {
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  transform: translate(-50%, -4px);
  font-size: 12px;
  color: #6ee7b7;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

.copy-btn.is-ok .copy-tip {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- 底部操作区 ---------- */

.card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 550;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.ghost-btn:hover {
  border-color: rgba(199, 210, 254, 0.4);
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.07);
}

.ghost-btn .ic { width: 15px; height: 15px; }

.ghost-btn:active .ic { animation: spin 0.6s ease; }

@keyframes spin { to { transform: rotate(360deg); } }

.ghost-link {
  margin-left: auto;
  font-size: 13px;
  font-weight: 550;
  color: var(--faint);
  text-decoration: none;
  transition: color 0.2s;
}

.ghost-link:hover { color: #a5b4fc; }

/* ---------- 页脚 ---------- */

.foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 24px;
  font-size: 12.5px;
  letter-spacing: 0.03em;
  color: var(--faint);
}

.dot { opacity: 0.5; }

/* ---------- 响应式 & 动效偏好 ---------- */

@media (max-width: 480px) {
  .card { padding: 20px 20px 16px; }
  .ip-block { gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora { animation: none; }
  .ip.is-loading { animation: none; }
  .card { animation: none; }
  .ghost-btn:active .ic { animation: none; }
}
