/*!
 * 360行职业基因盲盒测试 - 统一样式
 * 盲盒开箱科技感潮流风
 */

/* ===== 全局变量 ===== */
:root {
  --bg-primary: #0d0b1a;
  --bg-secondary: #1a1830;
  --bg-card: rgba(255, 255, 255, 0.05);
  --text-primary: #ffffff;
  --text-secondary: #8b7faa;
  --accent-gradient: linear-gradient(135deg, #a855f7, #f97316);
  --border-radius: 16px;
  --transition: all 0.3s ease;
}

/* ===== 重置样式 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== 通用容器 ===== */
.container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* ===== 粒子背景 ===== */
.particle-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.particle-bg canvas {
  width: 100%;
  height: 100%;
}

/* ===== 按钮样式 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(168, 85, 247, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-large {
  width: 100%;
  padding: 18px 32px;
  font-size: 18px;
}

/* ===== 卡片样式 ===== */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  padding: 24px;
  backdrop-filter: blur(10px);
}

/* ===== 标题样式 ===== */
.title {
  font-size: 28px;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 12px;
}

.subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== 6大类别配色 ===== */
.theme-make { --theme-color: #00D4FF; --theme-bg: #0A192F; }
.theme-money { --theme-color: #FFD700; --theme-bg: #1A1A2E; }
.theme-manage { --theme-color: #F5A623; --theme-bg: #0F3460; }
.theme-create { --theme-color: #FF00FF; --theme-bg: #2D1B4E; }
.theme-craft { --theme-color: #FF8C00; --theme-bg: #3D1F00; }
.theme-help { --theme-color: #00CC88; --theme-bg: #0D3328; }

/* ===== 标签样式 ===== */
.tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.tag-theme {
  background: rgba(168, 85, 247, 0.2);
  color: #a855f7;
}

/* ===== 加载动画 ===== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #a855f7;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ===== 模态框 ===== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 32px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  transform: scale(0.9);
  transition: var(--transition);
}

.modal.active .modal-content {
  transform: scale(1);
}

/* ===== 动画 ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-5deg); }
  75% { transform: rotate(5deg); }
}

.animate-fadeIn {
  animation: fadeIn 0.6s ease forwards;
}

.animate-pulse {
  animation: pulse 2s ease infinite;
}

/* ===== 模糊遮罩 ===== */
.blur-overlay {
  position: relative;
}

.blur-overlay::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, var(--bg-primary));
  pointer-events: none;
}

/* ===== 锁图标 ===== */
.lock-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  font-size: 12px;
}

/* ===== 输入框 ===== */
.input {
  width: 100%;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 16px;
  outline: none;
  transition: var(--transition);
}

.input:focus {
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.input::placeholder {
  color: var(--text-secondary);
}

/* ===== 二维码容器 ===== */
.qrcode-container {
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  display: inline-block;
}

.qrcode-container img,
.qrcode-container canvas {
  display: block;
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
  html {
    font-size: 15px;
  }
  
  .container {
    padding: 0 16px;
  }
  
  .card {
    padding: 20px;
  }
  
  .title {
    font-size: 24px;
  }
}

/* ===== 安全区域适配 ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  body {
    padding-bottom: env(safe-area-inset-bottom);
  }
}
