/* ============================================
   172号卡订单管理系统注册页面样式 - 防闪烁优化版
   ============================================ */

/* Reset通用元素样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body, div, img, input, button, a, span, p, h1, h2, h3, ul, li {
  font-family: "Arial", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

/* 关键修复：防止页面加载时内容闪烁 */
html {
  background: linear-gradient(135deg, #ffd8cb 0%, #a2cfff 100%);
  min-height: 100%;
}

body {
  /* 背景与html保持一致，避免加载时背景突变 */
  background: linear-gradient(135deg, #ffd8cb 0%, #a2cfff 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 20px 0 40px;
  color: #333;
  position: relative;
  /* 关键修复：从一开始就可见，无透明度过渡 */
  opacity: 1 !important;
  transition: none !important;
}

/* 背景特效容器 - 确保不影响渲染层级，无闪烁 */
.background-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  /* 确保背景特效不会造成重绘闪烁 */
  will-change: auto;
}

/* 气泡样式和动画 - 优化性能减少闪动 */
.bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(2px);
  animation: float linear infinite;
  will-change: transform;
  pointer-events: none;
}

@keyframes float {
  0% {
    transform: translateY(100vh) translateX(0) scale(1);
    opacity: 0;
  }
  10% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.7;
  }
  90% {
    opacity: 0.4;
  }
  100% {
    transform: translateY(-100px) translateX(var(--drift, 0px)) scale(0.3);
    opacity: 0;
  }
}

/* 主体容器 - 预渲染，无闪烁 */
.xz_cen {
  max-width: 640px;
  width: 95%;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 35px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  z-index: 2;
  position: relative;
  transition: box-shadow 0.3s ease;
  /* 关键修复：防止容器加载时大小突变 */
  transform: translateZ(0);
  backface-visibility: hidden;
}

.xz_cen:hover {
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.2);
}

/* 顶部图片 - 预定义尺寸，避免布局偏移 */
.xz_cen_img {
  width: 100%;
  background: #f0f4fa;
  line-height: 0;
}

.xz_cen_img img {
  display: block;
  width: 100%;
  height: auto;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  /* 防止图片加载慢时出现空白闪烁 */
  background-color: #e9edf2;
}

/* 内容区域 */
.xz_cen_ul {
  padding: 20px 5%;
}

/* 注册列表 */
.reg_lb {
  width: 100%;
  text-align: left;
  margin: 10px auto 20px;
}

/* 注册卡片 - 预定义渲染 */
.reg_lb_li {
  width: 100%;
  overflow: hidden;
  margin-bottom: 30px;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease, transform 0.2s ease;
  background: transparent;
  /* 硬件加速，减少重绘 */
  transform: translateZ(0);
}

.reg_lb_li:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

/* 卡片标题 */
.reg_lb_li_tit {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #1a1a1a;
  padding-left: 12px;
  position: relative;
}

.reg_lb_li_tit::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: linear-gradient(135deg, #3a8ee6, #6b9fff);
  border-radius: 2px;
}

/* 卡片链接区域 - 默认状态稳定 */
.reg_lb_li_cen {
  display: flex;
  align-items: center;
  padding: 25px 20px;
  background-color: #fafafa;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  position: relative;
  transition: background-color 0.3s ease;
  /* 防止布局偏移 */
  min-height: 180px;
}

.reg_lb_li_cen:hover {
  background-color: #eef4ff;
}

/* 推荐标签 */
.reg_tuijian {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

.reg_tuijian img {
  border-radius: 12px 0 0 0;
  display: block;
}

/* 左侧图标区域 - 固定宽高防止挤压和闪烁 */
.reg_dt {
  width: 175px;
  text-align: center;
  margin-right: 20px;
  flex-shrink: 0;
}

.reg_dt img {
  width: 80px;
  height: 80px;
  max-width: 80px;
  max-height: 80px;
  display: block;
  margin: 0 auto;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.reg_lb_li_cen:hover .reg_dt img {
  transform: scale(1.05);
}

.reg_dt span {
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-top: 15px;
  color: #0a3d91;
}

/* 右侧详情区域 */
.reg_dd {
  flex: 1;
}

.reg_dd ul li {
  display: flex;
  align-items: center;
  line-height: 1.5;
}

.reg_dd ul li:nth-child(2) {
  margin: 12px 0;
}

.reg_dd ul li img {
  width: 22px;
  height: 22px;
  margin-right: 12px;
  flex-shrink: 0;
  object-fit: contain;
}

.reg_span1 {
  font-weight: 600;
  margin-right: 12px;
  width: 85px;
  flex-shrink: 0;
  color: #555;
}

.reg_span2 {
  flex: 1;
  color: #666;
}

/* 友情提示框 */
.notice-box {
  width: 100%;
  margin: 0 auto 25px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #fff9ef, #fff4e5);
  border-left: 4px solid #ffaa33;
  border-radius: 12px;
  color: #b85c00;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  box-shadow: 0 2px 8px rgba(255, 170, 51, 0.2);
}

.notice-box span {
  font-weight: 700;
  color: #d97000;
}

/* 版权信息 */
.copyright {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.6);
  text-align: center;
  margin-top: 20px;
  padding: 15px 0;
  width: 100%;
  z-index: 2;
  position: relative;
}

.copyright p {
  line-height: 1.6;
}

.copyright a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
}

.copyright a:hover {
  color: #3a8ee6;
  text-decoration: underline;
}

/* 移除页面加载淡入动画相关样式，防止闪烁 */
body.fade-load {
  opacity: 1 !important;
}

/* ========== 移动端适配 ========== */
@media screen and (max-width: 640px) {
  body {
    padding: 12px 0 30px;
  }

  .xz_cen {
    width: 92%;
    border-radius: 16px;
  }

  .xz_cen_img img {
    width: 100%;
    height: auto;
  }

  .xz_cen_ul {
    padding: 16px 4%;
  }

  .reg_lb_li {
    margin-bottom: 20px;
  }

  .reg_lb_li_cen {
    display: block;
    padding: 20px 16px;
    min-height: auto;
  }

  /* 移动端左侧图标 */
  .reg_dt {
    width: auto;
    margin-bottom: 20px;
    margin-right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
  }

  .reg_dt img {
    width: 55px;
    height: 55px;
    max-width: 55px;
    max-height: 55px;
  }

  .reg_dt span {
    margin-top: 0;
    font-size: 15px;
  }

  .reg_dd {
    width: 100%;
  }

  .reg_dd ul li {
    flex-wrap: wrap;
  }

  .reg_span1 {
    width: 75px;
    font-size: 13px;
  }

  .reg_span2 {
    font-size: 13px;
    width: calc(100% - 87px);
  }

  .reg_lb_li_tit {
    font-size: 17px;
    padding-left: 12px;
  }

  .notice-box {
    padding: 12px 14px;
    font-size: 13px;
    margin-bottom: 20px;
  }

  .copyright {
    font-size: 11px;
    margin-top: 15px;
  }
}

/* 小屏手机深度优化 */
@media screen and (max-width: 400px) {
  .reg_dt img {
    width: 48px;
    height: 48px;
  }

  .reg_dt span {
    font-size: 13px;
  }

  .reg_span1 {
    width: 70px;
    font-size: 12px;
  }

  .reg_span2 {
    font-size: 12px;
    width: calc(100% - 82px);
  }

  .reg_lb_li_cen {
    padding: 16px 12px;
  }

  .notice-box {
    padding: 10px 12px;
    font-size: 12px;
  }
}

/* ========== PC端优化 ========== */
@media (min-width: 641px) {
  html, body {
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body {
    padding: 30px 0 50px;
  }

  .xz_cen_ul {
    padding: 24px 6%;
  }

  .reg_lb_li {
    margin-bottom: 28px;
  }

  .copyright {
    margin-top: 30px;
  }
}

/* 大屏幕优化 */
@media (min-width: 1200px) {
  .xz_cen {
    max-width: 700px;
  }
}

/* 辅助样式 - 减少动画（用户偏好） */
@media (prefers-reduced-motion: reduce) {
  .bubble,
  .reg_lb_li,
  .reg_lb_li_cen .reg_dt img,
  .xz_cen {
    transition: none !important;
    animation: none !important;
  }
  
  .bubble {
    display: none !important;
  }
  
  body {
    transition: none !important;
  }
}

/* 打印样式 */
@media print {
  .background-effects,
  .notice-box {
    display: none !important;
  }
  
  body {
    background: white !important;
    padding: 0 !important;
    opacity: 1 !important;
  }
  
  .xz_cen {
    box-shadow: none;
    max-width: 100%;
  }
}