<script setup>
import { onLaunch, onShow } from '@dcloudio/uni-app'

onLaunch(() => {
  console.log('App Launch - 电竞服务平台启动')

  // 检查租户ID (从扫码参数获取)
  const tenantId = uni.getStorageSync('tenantId')
  if (!tenantId) {
    // 测试环境默认租户
    uni.setStorageSync('tenantId', 10001)
  }
})

onShow(() => {
  console.log('App Show')
})
</script>

<style lang="scss">
/* 电竞赛博朋克风格 - 全局样式 */
@import './uni.scss';

page {
  background: linear-gradient(180deg, #0a0e27 0%, #0f1229 50%, #1a1d3a 100%);
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', sans-serif;
}

/* 通用容器 */
.page-container {
  min-height: 100vh;
  padding-bottom: 20rpx;
}

/* 赛博朋克卡片基础样式 */
.cyber-card {
  background: linear-gradient(135deg, rgba(20, 25, 50, 0.9) 0%, rgba(10, 14, 39, 0.8) 100%);
  border: 1px solid rgba(0, 255, 255, 0.2);
  border-radius: 16rpx;
  position: relative;
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
      transparent 0%,
      rgba(0, 255, 255, 0.5) 50%,
      transparent 100%
    );
    animation: scan 3s infinite;
  }
}

/* 扫描动画 */
@keyframes scan {
  0%, 100% { opacity: 0; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(100px); }
}

/* 霓虹发光文字 */
.neon-text {
  color: #00ffff;
  text-shadow:
    0 0 5px rgba(0, 255, 255, 0.5),
    0 0 10px rgba(0, 255, 255, 0.3),
    0 0 15px rgba(0, 255, 255, 0.2);
}

/* 主要按钮 - 赛博朋克风格 */
.cyber-button {
  background: linear-gradient(135deg, #00ffff 0%, #0099ff 100%);
  color: #0a0e27;
  border: none;
  border-radius: 8rpx;
  font-weight: bold;
  position: relative;
  overflow: hidden;

  &::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
  }

  &:active::after {
    left: 100%;
  }
}

/* 次要按钮 */
.cyber-button-outline {
  background: transparent;
  color: #00ffff;
  border: 1px solid #00ffff;
  border-radius: 8rpx;

  &:active {
    background: rgba(0, 255, 255, 0.1);
  }
}

/* 标签 */
.cyber-tag {
  display: inline-block;
  padding: 4rpx 12rpx;
  background: rgba(0, 255, 255, 0.1);
  border: 1px solid rgba(0, 255, 255, 0.3);
  border-radius: 4rpx;
  color: #00ffff;
  font-size: 24rpx;
}

/* 分割线 */
.cyber-divider {
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(0, 255, 255, 0.3) 50%,
    transparent 100%
  );
  margin: 20rpx 0;
}

/* 加载动画 */
.loading-dot {
  display: inline-block;
  width: 8rpx;
  height: 8rpx;
  border-radius: 50%;
  background: #00ffff;
  margin: 0 4rpx;
  animation: pulse 1.4s infinite ease-in-out;

  &:nth-child(1) { animation-delay: -0.32s; }
  &:nth-child(2) { animation-delay: -0.16s; }
}

@keyframes pulse {
  0%, 80%, 100% {
    box-shadow: 0 0 0 0 rgba(0, 255, 255, 0.7);
    transform: scale(0.8);
  }
  40% {
    box-shadow: 0 0 10px 5px rgba(0, 255, 255, 0);
    transform: scale(1);
  }
}

/* 渐变文字 */
.gradient-text {
  background: linear-gradient(135deg, #00ffff 0%, #ff00ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
</style>
