/**
 * 预测功能样式
 */

/* 彩种标签横向滚动 */
.lottery-tabs {
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  position: relative;
  margin-top: 60px;
  z-index: 99;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.lottery-tabs::-webkit-scrollbar {
  display: none;
}

/* ====== Lottery Tabs 动态特效增强版（追加到你原CSS后面） ====== */

/* 可选：整体“彩光背景”与闪点 */
/* 横排一行 + 超出横向滚动 */
.lottery-tabs-wrapper{
  display: flex;
  flex-direction: row;
  font-size: 1.5rem;
  flex-wrap: nowrap;        /* 关键：不换行 */
  align-items: center;
  gap: 8px;                 /* 可选：间距 */
  overflow-x: auto;         /* 关键：超出可滑动 */
  overflow-y: hidden;
  white-space: nowrap;      /* 兼容某些非 flex 场景 */
  -webkit-overflow-scrolling: touch;
  justify-content: space-evenly;
}

.lottery-tab-item{
  flex: 0 0 auto;           /* 关键：不被压缩成多行/不撑满 */
  display: inline-flex;     /* 让内部文字居中更稳 */
  align-items: center;
  justify-content: center;
  width: auto;              /* 防止被父级影响成 100% */
}
.lottery-tabs-wrapper::-webkit-scrollbar{ display:none; }

/* 背景闪点/微粒（纯CSS） */
.lottery-tabs-wrapper::before{
  content:"";
  position:absolute;
  inset: 0;
  pointer-events:none;
  opacity:.9;
  /* 多层 radial-gradient 做闪点 */
  background:
    radial-gradient(6px 6px at 12% 35%, rgba(102,126,234,.22), transparent 60%),
    radial-gradient(5px 5px at 28% 70%, rgba(118,75,162,.18), transparent 60%),
    radial-gradient(4px 4px at 46% 30%, rgba(102,126,234,.18), transparent 60%),
    radial-gradient(6px 6px at 62% 60%, rgba(118,75,162,.20), transparent 60%),
    radial-gradient(4px 4px at 78% 40%, rgba(102,126,234,.16), transparent 60%),
    radial-gradient(5px 5px at 90% 75%, rgba(118,75,162,.18), transparent 60%),
    linear-gradient(90deg, rgba(102,126,234,.06), rgba(118,75,162,.06));
  filter: blur(.2px);
  animation: tabSparkMove 5.5s linear infinite;
}
@keyframes tabSparkMove{
  0%{ transform: translateX(-10px); opacity:.75; }
  50%{ transform: translateX(10px); opacity:1; }
  100%{ transform: translateX(-10px); opacity:.75; }
}

/* tab item：增强“玻璃感 + hover/press 动效” */
.lottery-tab-item{
  position: relative;
  border-radius: 12px;
  margin: 6px 6px 8px 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;

  /* 轻微玻璃感 */
  background: rgba(255,255,255,.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  /* 更顺滑 */
  transition: transform .22s ease, color .22s ease, background .22s ease, box-shadow .22s ease, border-color .22s ease;
}

/* hover（PC） */
.lottery-tab-item:hover{
  color:#4a5bdc;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(102,126,234,.12);
}

/* active：发光 + 呼吸 + 流动下划线 */
.lottery-tab-item.active{
  color:#667eea;
  font-weight: 700;
  border-bottom-color: transparent; /* 用伪元素做更高级下划线 */
  background: linear-gradient(135deg, rgba(102,126,234,.16), rgba(118,75,162,.12));
  box-shadow:
    0 10px 26px rgba(102,126,234,.18),
    0 0 0 1px rgba(102,126,234,.14) inset;
  animation: tabPulse 1.8s ease-in-out infinite;
}

/* 呼吸高亮 */
@keyframes tabPulse{
  0%,100%{ filter: brightness(1); transform: translateY(0); }
  50%{ filter: brightness(1.08); transform: translateY(-1px); }
}

/* 流动下划线（active） */
.lottery-tab-item.active::after{
  content:"";
  position:absolute;
  left: 10px;
  right: 10px;
  bottom: -2px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg,
    rgba(102,126,234,0),
    rgba(102,126,234,.95),
    rgba(118,75,162,.95),
    rgba(102,126,234,0)
  );
  background-size: 220% 100%;
  box-shadow: 0 0 14px rgba(102,126,234,.35);
  animation: tabLineFlow 1.25s linear infinite;
}
@keyframes tabLineFlow{
  0%{ background-position: 0% 50%; opacity:.85; }
  100%{ background-position: 220% 50%; opacity:1; }
}

/* 轻微“扫光”效果（active） */
.lottery-tab-item.active::before{
  content:"";
  position:absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events:none;
  background: linear-gradient(120deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,.38) 45%,
    rgba(255,255,255,0) 80%
  );
  transform: translateX(-120%);
  animation: tabShine 2.2s ease-in-out infinite;
  opacity:.75;
}
@keyframes tabShine{
  0%{ transform: translateX(-120%); opacity:.0; }
  25%{ opacity:.75; }
  55%{ transform: translateX(120%); opacity:.0; }
  100%{ transform: translateX(120%); opacity:.0; }
}

/* 点击涟漪（纯CSS） */
.lottery-tab-item{
  overflow: hidden; /* 让涟漪不溢出 */
}
.lottery-tab-item:active{
  opacity: 1; /* 覆盖你原来的 .7，避免变灰太多 */
  transform: translateY(0) scale(.98);
}

/* 涟漪层 */
.lottery-tab-item .ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: ripple .6s ease-out;
  background: rgba(102,126,234,.25);
  pointer-events: none;
}

/* 涟漪动画 */
@keyframes ripple {
  to {
    transform: scale(5);
    opacity: 0;
  }
}

/* ====== 无JS版本的“按压闪光”补偿（不需要 .ripple 元素也能有点动效） ====== */
.lottery-tab-item:active::after{
  /* active 的下划线已占用 after，这里只给非 active 的按压闪光 */
}
.lottery-tab-item:not(.active):active::before{
  content:"";
  position:absolute;
  inset: -20%;
  border-radius: 18px;
  background: radial-gradient(circle at 30% 30%, rgba(102,126,234,.28), transparent 55%);
  transform: scale(.9);
  animation: pressFlash .35s ease-out;
}
@keyframes pressFlash{
  0%{ opacity:.0; transform: scale(.8); }
  30%{ opacity:1; transform: scale(1); }
  100%{ opacity:0; transform: scale(1.15); }
}

/* ====== 动效降级：用户系统设置“减少动态效果”时自动关闭 ====== */
@media (prefers-reduced-motion: reduce){
  .lottery-tabs-wrapper::before,
  .lottery-tab-item.active,
  .lottery-tab-item.active::after,
  .lottery-tab-item.active::before{
    animation: none !important;
  }
  .lottery-tab-item{ transition: none !important; }
}


/* 预测容器 */
.prediction-container {
  padding: 10px;
  background: #f5f5f5;
  min-height: calc(100vh - 200px);
}

/* 预测列表项 - 并排显示 */
/* ===== 预测列表：动态特效增强（追加覆盖） ===== */
.prediction-item{
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(0,0,0,.06);

  /* 轻微玻璃感（在白底也舒服） */
  background: rgba(255,255,255,.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  /* 更顺滑的动效 */
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease, border-color .22s ease;
  will-change: transform;
}

/* 左侧动态渐变能量条 */
.prediction-item::before{
  content:"";
  position:absolute;
  left:0;
  top:10px;
  bottom:10px;
  width:3px;
  border-radius: 999px;

  background: linear-gradient(180deg,
    rgba(102,126,234,.0),
    rgba(102,126,234,.85),
    rgba(118,75,162,.75),
    rgba(102,126,234,.0)
  );
  box-shadow: 0 0 12px rgba(102,126,234,.25);
  opacity:.55;
  transform: translateX(-2px);
  transition: opacity .22s ease, transform .22s ease;
  animation: energyPulse 1.9s ease-in-out infinite;
}

@keyframes energyPulse{
  0%,100%{ filter: brightness(1); opacity:.45; }
  50%{ filter: brightness(1.15); opacity:.75; }
}

/* 细闪点层（纯CSS） */
.prediction-item::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.65;
  background:
    radial-gradient(6px 6px at 18% 30%, rgba(102,126,234,.14), transparent 60%),
    radial-gradient(5px 5px at 72% 40%, rgba(118,75,162,.12), transparent 60%),
    radial-gradient(4px 4px at 40% 75%, rgba(102,126,234,.10), transparent 60%);
  animation: sparkFloat 6s linear infinite;
}
@keyframes sparkFloat{
  0%{ transform: translateX(-10px); opacity:.45; }
  50%{ transform: translateX(10px); opacity:.75; }
  100%{ transform: translateX(-10px); opacity:.45; }
}

/* hover 抬起（PC） */
.prediction-item:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(0,0,0,.08);
  border-bottom-color: rgba(102,126,234,.18);
}
.prediction-item:hover::before{
  opacity:.9;
  transform: translateX(0);
}

/* 扫光效果：hover 时掠过一条光带 */
.prediction-item:hover .prediction-row::before{
  content:"";
  position:absolute;
  inset:-40% -60%;
  pointer-events:none;
  background: linear-gradient(120deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,.55) 45%,
    rgba(255,255,255,0) 80%
  );
  transform: translateX(-40%);
  animation: rowShine .85s ease-out;
  border-radius: 18px;
}
.prediction-row{
  position: relative; /* 为扫光伪元素提供定位 */
}

/* 扫光动画 */
@keyframes rowShine{
  0%{ transform: translateX(-45%); opacity:0; }
  25%{ opacity:.9; }
  100%{ transform: translateX(45%); opacity:0; }
}

/* 按下反馈：更“弹”一点 */
.prediction-item:active{
  background: rgba(245,245,245,.92); /* 兼容你原来的 */
  transform: translateY(0) scale(.992);
  box-shadow: 0 6px 14px rgba(0,0,0,.06);
}

/* 点击涟漪（无JS版：按下瞬间闪光） */
.prediction-item:active .prediction-row::after{
  content:"";
  position:absolute;
  inset:-20%;
  border-radius: 20px;
  background: radial-gradient(circle at 30% 35%, rgba(102,126,234,.18), transparent 55%);
  animation: pressFlash .35s ease-out;
  pointer-events:none;
}
@keyframes pressFlash{
  0%{ opacity:0; transform: scale(.85); }
  30%{ opacity:1; transform: scale(1); }
  100%{ opacity:0; transform: scale(1.12); }
}

/* 保持你并排显示的核心不受影响 */
.prediction-row{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
}

/* 低动效模式自动降级 */
@media (prefers-reduced-motion: reduce){
  .prediction-item,
  .prediction-item::before,
  .prediction-item::after{
    animation:none !important;
    transition:none !important;
  }
}

/* 用户排行榜卡片 */
.user-rank-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.3s;
}

.user-rank-item:active {
  background: #f5f5f5;
  transform: scale(0.98);
}

.rank-left {
  display: flex;
  align-items: center;
  flex: 1;
}

.rank-number {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  color: #999;
  margin-right: 10px;
}

.rank-number.rank-gold {
  font-size: 24px;
}

.rank-number.rank-silver {
  font-size: 22px;
}

.rank-number.rank-bronze {
  font-size: 20px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  margin-right: 12px;
}

.avatar-img {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-icon {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
}

/* 并排显示元素 */
.user-nickname {
  min-width: 50px;
  max-width: 70px;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
}

.lottery-name {
  min-width: 45px;
  font-size: 12px;
  color: #666;
  white-space: nowrap;
  flex-shrink: 0;
}

.play-name {
  min-width: 40px;
  font-size: 11px;
  color: #999;
  white-space: nowrap;
  flex-shrink: 0;
}

.lottery-expect {
  min-width: 55px;
  font-size: 12px;
  color: #999;
  white-space: nowrap;
  flex-shrink: 0;
}

.result-status {
  margin-left: auto;
  flex-shrink: 0;
}

.result-status .stat-item {
  font-size: 12px;
  white-space: nowrap;
}

.user-info {
  flex: 1;
}

.user-name {
  font-size: 15px;
  color: #333;
  font-weight: 500;
}

.rank-right {
  text-align: right;
}

.stats-main {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 5px;
}

.stat-total {
  color: #333;
}

.stat-separator {
  color: #999;
  margin: 0 5px;
}

.stat-win {
  color: #ff4757;
}

.stats-sub {
  font-size: 11px;
  color: #999;
  white-space: nowrap;
}

/* 用户排行榜项 */
.user-item {
  display: flex;
  align-items: center;
  background: #fff;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-item .rank {
  width: 40px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  color: #666;
  margin-right: 15px;
}

.user-item .rank.top1 {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #fff;
  border-radius: 50%;
}

.user-item .rank.top2 {
  background: linear-gradient(135deg, #C0C0C0 0%, #A9A9A9 100%);
  color: #fff;
  border-radius: 50%;
}

.user-item .rank.top3 {
  background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
  color: #fff;
  border-radius: 50%;
}

.user-item .user-info {
  flex: 1;
}

.user-item .user-name {
  font-size: 16px;
  font-weight: bold;
  color: #333;
  margin-bottom: 5px;
}

.user-item .user-stats {
  font-size: 12px;
  color: #999;
}

.user-item .user-stats span {
  margin-right: 10px;
}

.user-item .view-btn {
  padding: 6px 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
}

.user-item .view-btn:active {
  opacity: 0.8;
}

/* 空状态 */
.empty-tip {
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 14px;
}

/* 加载状态 */
.bload {
  text-align: center;
  padding: 15px;
  color: #999;
  font-size: 14px;
}

.bload a {
  color: #667eea;
  text-decoration: none;
}

.bload a:active {
  opacity: 0.7;
}

/* 标签页激活状态 */
.ntab .swiper-slide.active a {
  color: #667eea;
  border-bottom: 2px solid #667eea;
}

/* 预测列表项 */
.prediction-item {
  background: #fff;
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.prediction-item .header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}

.prediction-item .lottery-name {
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

.prediction-item .status {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.prediction-item .status.pending {
  background: #fff7e6;
  color: #faad14;
}

.prediction-item .status.win {
  background: #f6ffed;
  color: #52c41a;
}

.prediction-item .status.lose {
  background: #fff1f0;
  color: #f5222d;
}

.prediction-item .content {
  font-size: 14px;
  color: #666;
  line-height: 1.8;
}

.prediction-item .numbers {
  font-size: 18px;
  font-weight: bold;
  color: #667eea;
  margin: 10px 0;
}

.prediction-item .footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
  font-size: 12px;
  color: #999;
}

.prediction-item .fee {
  color: #f5222d;
  font-weight: bold;
}

.prediction-item .free {
  color: #52c41a;
}

/* 发布预测按钮 */
.publish-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  text-decoration: none;
  z-index: 999;
}

.publish-btn:active {
  opacity: 0.8;
}

/* 响应式 */
@media (max-width: 480px) {
  .user-item {
    padding: 12px;
  }

  .user-item .rank {
    width: 35px;
    height: 35px;
    line-height: 35px;
    font-size: 16px;
    margin-right: 10px;
  }

  .user-item .user-name {
    font-size: 15px;
  }

  .user-item .user-stats {
    font-size: 11px;
  }

  .user-item .view-btn {
    padding: 5px 12px;
    font-size: 12px;
  }
}

/* 预测列表响应式 */
@media (max-width: 375px) {
  .prediction-row {
    gap: 4px;
  }
  
  .prediction-item {
    padding: 10px 8px;
  }
  
  .avatar-img,
  .avatar-icon {
    width: 32px;
    height: 32px;
  }
  
  .avatar-icon {
    font-size: 14px;
  }
  
  .user-nickname {
    min-width: 45px;
    max-width: 60px;
    font-size: 12px;
  }
  
  .lottery-name {
    min-width: 40px;
    font-size: 11px;
  }
  
  .play-name {
    min-width: 35px;
    font-size: 10px;
  }
  
  .lottery-expect {
    min-width: 50px;
    font-size: 11px;
  }
  
  .result-status .stat-item {
    font-size: 11px;
  }
}

/* 超小屏幕优化 */
@media (max-width: 320px) {
  .prediction-row {
    gap: 3px;
  }
  
  .prediction-item {
    padding: 8px 6px;
  }
  
  .avatar-img,
  .avatar-icon {
    width: 30px;
    height: 30px;
  }
  
  .avatar-icon {
    font-size: 12px;
  }
  
  .user-nickname {
    min-width: 40px;
    max-width: 50px;
    font-size: 11px;
  }
  
  .lottery-name {
    min-width: 35px;
    font-size: 10px;
  }
  
  .play-name {
    min-width: 30px;
    font-size: 9px;
  }
  
  .lottery-expect {
    min-width: 45px;
    font-size: 10px;
  }
  
  .result-status .stat-item {
    font-size: 10px;
  }
  
  /* 极小屏幕时隐藏玩法名称 */
  .play-name {
    display: none;
  }
}