/* VPN 公网 IP 登记 - mobile-first 样式 */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 16px;
  background: #f5f6f8;
  color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
}

.card {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

h1 {
  margin: 0 0 16px;
  font-size: 20px;
  text-align: center;
}

.field {
  margin-bottom: 16px;
}

.label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  color: #6b7280;
}

.value {
  min-height: 24px;
  font-size: 16px;
}

.mono {
  font-family: Consolas, Menlo, monospace;
}

.break {
  word-break: break-all;
  overflow-wrap: anywhere;
}

.input {
  width: 100%;
  height: 46px;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
}

.input:focus {
  outline: 2px solid #2563eb;
  outline-offset: 1px;
  border-color: #2563eb;
}

button {
  width: 100%;
  height: 48px;
  margin-top: 4px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: #ffffff;
  font-size: 17px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: #1d4ed8;
}

button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.status {
  min-height: 24px;
  margin: 12px 0 0;
  font-size: 15px;
  word-break: break-all;
}

.status.ok {
  color: #16a34a;
}

.status.info {
  color: #2563eb;
}

.status.warn {
  color: #ea580c;
}

.status.err {
  color: #dc2626;
}

/* ===== 动画（组合方案：入场开屏 + 成功对勾）=====
   所有动画仅在系统未开启「减少动态效果」时生效 */
@media (prefers-reduced-motion: no-preference) {
  @keyframes rise-in {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  /* 入场开屏：标题 → 字段依次错落 → 表单内容 → 状态区 */
  .card > *:not(form),
  #register-form > * {
    animation: rise-in 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }

  .card > *:nth-child(1) {
    animation-delay: 0.05s; /* 标题 */
  }

  .card > *:nth-child(2) {
    animation-delay: 0.13s; /* 设备标识 */
  }

  .card > *:nth-child(3) {
    animation-delay: 0.21s; /* 当前访问 IP */
  }

  #register-form > *:nth-child(1) {
    animation-delay: 0.29s; /* VPN 账号 */
  }

  #register-form > *:nth-child(2) {
    animation-delay: 0.37s; /* 登记时间 */
  }

  #register-form > *:nth-child(3) {
    animation-delay: 0.45s; /* 按钮 */
  }

  .card > *:nth-child(5) {
    animation-delay: 0.53s; /* 状态区 */
  }

  /* 状态文字滑入（冲突/账号不一致等，克制不摇晃） */
  @keyframes slide-in {
    from {
      opacity: 0;
      transform: translateX(-8px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  .status.pop {
    animation: slide-in 0.3s ease-out;
  }

  /* 登记成功：卡片轻轻上浮回弹 */
  @keyframes card-lift {
    0% {
      transform: none;
    }
    40% {
      transform: translateY(-5px);
    }
    100% {
      transform: none;
    }
  }

  .card.lift {
    animation: card-lift 0.5s ease;
  }

  /* 成功徽章：圆环 + 对勾依次描边画出 */
  @keyframes stroke-draw {
    to {
      stroke-dashoffset: 0;
    }
  }

  .result-badge.show .rb-circle {
    stroke-dasharray: 152;
    stroke-dashoffset: 152;
    animation: stroke-draw 0.45s ease-out forwards;
  }

  .result-badge.show .rb-check {
    stroke-dasharray: 34;
    stroke-dashoffset: 34;
    animation: stroke-draw 0.3s ease-out 0.3s forwards;
  }
}

/* 成功徽章基础样式（减少动态模式下静态显示） */
.result-badge {
  display: flex;
  justify-content: center;
  margin: 12px 0 0;
}

.result-badge svg {
  width: 56px;
  height: 56px;
}

.rb-circle,
.rb-check {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.result-badge.ok .rb-circle,
.result-badge.ok .rb-check {
  stroke: #16a34a;
}

.result-badge.info .rb-circle,
.result-badge.info .rb-check {
  stroke: #2563eb;
}
