/**
 * 首页样式 - 现代卡片风格
 */

/* ========== 步骤指示器 ========== */
.steps {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 15px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border-medium);
  z-index: 0;
}

.step.done:not(:last-child)::after {
  background: var(--success);
}

.step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-muted);
  border: 2px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  z-index: 1;
  transition: all var(--transition);
  color: var(--text-muted);
}

.step.active .step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.step.done .step-num {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.step-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.step.active .step-label {
  color: var(--primary);
}

.step.done .step-label {
  color: var(--success);
}

/* ========== 游戏名称显示 ========== */
.game-name-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--primary-bg), rgba(99, 102, 241, 0.08));
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border: 1px solid rgba(99, 102, 241, 0.15);
}

.game-name-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.game-name-value {
  font-size: 15px;
  color: var(--primary);
  font-weight: 600;
}

/* ========== 二维码区域 ========== */
#qr-section {
  display: none;
}

.qr-tips {
  text-align: center;
  margin-bottom: 20px;
}

.qr-tips-main {
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.qr-tips-main strong {
  color: var(--primary-light);
}

.qr-tips-sub {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.qr-tips-time {
  font-size: 13px;
  color: var(--primary-light);
  margin-bottom: 8px;
}

.qr-tips-warn {
  font-size: 12px;
  color: var(--warning);
  line-height: 1.5;
}

.qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--bg-muted);
  border-radius: var(--radius-lg);
  position: relative;
  cursor: default;
}

.qr-wrap.expired {
  cursor: pointer;
}

.qr-img {
  width: 220px;
  height: 220px;
  border-radius: var(--radius-md);
  background: white;
  padding: 12px;
  box-shadow: var(--shadow-md);
}

.qr-img.expired {
  opacity: 0.4;
  filter: grayscale(50%);
}

.qr-refresh-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(22, 27, 46, 0.95);
  border-radius: var(--radius-lg);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
}

.qr-refresh-overlay.show {
  display: flex;
}

.qr-refresh-overlay svg {
  width: 32px;
  height: 32px;
  color: var(--primary);
}

.progress-wrap {
  width: 100%;
  margin-top: 16px;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: var(--bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
  background: var(--primary);
}

.progress-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
}

.progress-status.pending {
  background: var(--primary-bg);
  color: var(--primary);
}

.progress-status.processing {
  background: var(--primary-bg);
  color: var(--primary-dark);
}

.progress-status.scanned {
  background: var(--success-bg);
  color: var(--success);
}

.progress-status.done {
  background: var(--success-bg);
  color: #059669;
}

.progress-status.failed {
  background: var(--error-bg);
  color: var(--error);
}

/* ========== 帮助气泡 ========== */
.help-bubble {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-bg);
  color: var(--primary);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 16px;
  border: none;
}

.help-bubble:hover {
  background: rgba(99, 102, 241, 0.12);
}

.help-bubble svg {
  width: 16px;
  height: 16px;
}

/* ========== 弹窗通用样式 ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease forwards;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title svg {
  color: var(--primary);
  width: 20px;
  height: 20px;
}

.modal-close {
  background: var(--bg-muted);
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--border-light);
  color: var(--text-secondary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  padding: 16px 24px;
  background: var(--bg-muted);
  border-top: 1px solid var(--border-light);
}

.modal-footer .btn {
  flex: 1;
}

/* ========== 帮助弹窗 ========== */
.help-modal {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.help-modal.open {
  display: flex;
}

.help-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease forwards;
  display: flex;
  flex-direction: column;
}

.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.help-title {
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

.help-title svg {
  color: var(--primary);
}

.help-close {
  background: var(--bg-muted);
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
}

.help-close:hover {
  background: var(--border-light);
  color: var(--text-secondary);
}

.help-steps {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.help-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.help-step-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.help-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.help-step-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.help-step-img {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-muted);
  min-height: 120px;
  object-fit: contain;
}

.help-step-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding-left: 40px;
}

/* ========== 平台选择器 ========== */
.platform-selector {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.platform-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-muted);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
}

.platform-option:hover {
  background: var(--border-light);
}

.platform-option input[type="radio"] {
  display: none;
}

.platform-option input[type="radio"]:checked + .platform-label {
  color: var(--primary);
}

.platform-option:has(input[type="radio"]:checked) {
  background: var(--primary-bg);
  border-color: var(--primary);
}

.platform-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.platform-option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-muted);
}

.platform-option.disabled .platform-label {
  color: var(--text-muted);
}

/* ========== 确认弹窗 ========== */
.confirm-modal {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.confirm-modal[style*="flex"] {
  display: flex;
}

.confirm-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s ease forwards;
  overflow: hidden;
}

.confirm-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.confirm-header svg {
  color: var(--warning);
  flex-shrink: 0;
}

.confirm-body {
  padding: 24px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.confirm-body p {
  margin: 8px 0;
}

.confirm-body p:first-child {
  margin-top: 0;
}

.confirm-body p:last-child {
  margin-bottom: 0;
}

.confirm-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

.confirm-warning {
  background: var(--warning-bg);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: #b45309;
  font-size: 13px;
  line-height: 1.6;
  margin: 16px 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.confirm-warning::before {
  content: '⚠️';
  flex-shrink: 0;
}

.confirm-info {
  color: var(--text-muted);
  font-size: 13px;
}

.confirm-actions {
  display: flex;
  gap: 10px;
  padding: 16px 24px;
  background: var(--bg-muted);
  border-top: 1px solid var(--border-light);
}

.confirm-actions .btn {
  flex: 1;
}

/* ========== 响应式 ========== */
@media (max-width: 480px) {
  .step-num {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  .step:not(:last-child)::after {
    top: 13px;
  }

  .step-label {
    font-size: 11px;
  }

  .qr-img {
    width: 200px;
    height: 200px;
  }

  .qr-tips-main {
    font-size: 14px;
  }

  .qr-tips-sub {
    font-size: 13px;
  }

  .help-content,
  .confirm-content {
    max-height: 90vh;
  }

  .help-step-desc {
    padding-left: 0;
    margin-top: 4px;
  }

  .modal-header,
  .help-header,
  .confirm-header {
    padding: 16px 20px;
  }

  .modal-body,
  .help-steps,
  .confirm-body {
    padding: 20px;
  }

  .modal-footer,
  .confirm-actions {
    padding: 12px 20px;
  }
}

/* ========== 移动端增强适配 ========== */
@media (max-width: 640px) {
  /* 游戏名称显示 */
  .game-name-display {
    padding: 10px 14px;
    margin-bottom: 12px;
  }

  .game-name-label {
    font-size: 12px;
  }

  .game-name-value {
    font-size: 14px;
  }

  /* 二维码区域 */
  .qr-wrap {
    padding: 12px;
  }

  .qr-img {
    width: 180px;
    height: 180px;
    padding: 8px;
  }

  /* 提示文字 */
  .qr-tips {
    margin-bottom: 16px;
  }

  .qr-tips-main {
    font-size: 14px;
  }

  .qr-tips-sub {
    font-size: 13px;
  }

  .qr-tips-time {
    font-size: 12px;
  }

  .qr-tips-warn {
    font-size: 11px;
    padding: 0 8px;
  }

  /* 帮助气泡 */
  .help-bubble {
    padding: 6px 12px;
    font-size: 12px;
    margin-bottom: 12px;
  }

  .help-bubble svg {
    width: 14px;
    height: 14px;
  }

  /* 进度条 */
  .progress-wrap {
    margin-top: 12px;
  }

  .progress-status {
    padding: 10px 12px;
    font-size: 13px;
    margin-top: 10px;
  }

  /* 平台选择器 */
  .platform-selector {
    gap: 8px;
  }

  .platform-option {
    padding: 10px 12px;
  }

  .platform-label {
    font-size: 13px;
  }

  /* 确认弹窗 */
  .confirm-modal {
    padding: 12px;
  }

  .confirm-content {
    max-width: 100%;
  }

  .confirm-header {
    padding: 16px 20px;
    font-size: 15px;
  }

  .confirm-body {
    padding: 20px;
    font-size: 13px;
  }

  .confirm-warning {
    padding: 12px 14px;
    font-size: 12px;
  }

  .confirm-actions {
    padding: 12px 16px;
    gap: 8px;
  }

  .confirm-actions .btn {
    padding: 10px 16px;
    font-size: 13px;
  }

  /* 帮助弹窗 */
  .help-modal {
    padding: 12px;
  }

  .help-content {
    max-width: 100%;
    max-height: 85vh;
  }

  .help-header {
    padding: 14px 18px;
  }

  .help-title {
    font-size: 15px;
  }

  .help-steps {
    padding: 18px;
    gap: 18px;
  }

  .help-step-num {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .help-step-title {
    font-size: 13px;
  }

  .help-step-img {
    min-height: 100px;
  }

  .help-step-desc {
    font-size: 12px;
    padding-left: 0;
  }
}

/* ========== 小屏幕手机适配 ========== */
@media (max-width: 375px) {
  .qr-img {
    width: 160px;
    height: 160px;
  }

  .qr-tips-main {
    font-size: 13px;
  }

  .qr-tips-sub {
    font-size: 12px;
  }

  .qr-tips-warn {
    font-size: 10px;
  }

  .progress-status {
    font-size: 12px;
    padding: 8px 10px;
  }

  .platform-option {
    padding: 8px 10px;
  }

  .platform-label {
    font-size: 12px;
  }
}

/* ========== 标签提示 ========== */
.label-hint {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ========== 设备ID输入框 ========== */
.unique-id-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.unique-id-input-wrap input {
  flex: 1;
}

.unique-id-help-btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  background: var(--bg-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
}

.unique-id-help-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-light);
}

/* ========== 设备ID提示弹窗 ========== */
.unique-id-content {
  max-width: 600px;
}

.unique-id-body {
  padding: 16px;
}

.unique-id-img {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 12px;
}

.unique-id-desc {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin: 0;
}
