/**
 * 首页样式 - 浅色授权工作台
 */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.07), transparent 34%),
    linear-gradient(315deg, rgba(16, 185, 129, 0.07), transparent 30%);
  z-index: -1;
}

.steps {
  display: flex;
  gap: 0;
  margin-bottom: 30px;
  padding: 6px;
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
}

.step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  padding: 8px 6px;
  border-radius: var(--radius-md);
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 22px;
  left: calc(50% + 18px);
  width: calc(100% - 36px);
  height: 2px;
  background: #dbe4f0;
  z-index: 0;
}

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

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

.step.active .step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
}

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

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

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

.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), #f0fdf4);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  border: 1px solid #bfdbfe;
}

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

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

#qr-section {
  display: none;
}

.qr-tips {
  text-align: center;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-muted);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
}

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

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

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

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

.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: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  position: relative;
  cursor: default;
  box-shadow: var(--shadow-md);
}

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

.qr-img {
  width: 220px;
  height: 220px;
  border-radius: var(--radius-lg);
  background: white;
  padding: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  border: 1px solid var(--border-light);
}

.qr-img.expired {
  opacity: 0.38;
  filter: grayscale(55%);
}

.qr-refresh-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-xl);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

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

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

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

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

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
  background: linear-gradient(90deg, var(--primary), #06b6d4);
}

.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: 700;
  border: 1px solid transparent;
}

.progress-status.pending,
.progress-status.processing {
  background: var(--primary-bg);
  color: var(--primary-dark);
  border-color: #bfdbfe;
}

.progress-status.scanned,
.progress-status.done {
  background: var(--success-bg);
  color: #166534;
  border-color: #bbf7d0;
}

.progress-status.failed {
  background: var(--error-bg);
  color: #991b1b;
  border-color: #fecaca;
}

.shop-card,
.tutorial-card {
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.shop-card:hover,
.tutorial-card:hover {
  transform: translateY(-2px);
  border-color: #bfdbfe;
  box-shadow: var(--shadow-md);
}

.shop-card-header,
.tutorial-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.shop-card-title,
.tutorial-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.shop-card-badge,
.tutorial-card-badge {
  flex: 0 0 auto;
  font-size: 12px;
  color: #fff;
  background: var(--primary);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
}

.tutorial-card-badge {
  background: var(--success);
}

.shop-card-desc,
.tutorial-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 12px;
  line-height: 1.7;
}

.shop-card-link,
.tutorial-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.18);
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

.tutorial-card-link {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  box-shadow: 0 10px 20px rgba(22, 163, 74, 0.16);
}

.shop-card-link:hover,
.tutorial-card-link:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 14px 26px rgba(37, 99, 235, 0.22);
}

.tutorial-card-link:hover {
  box-shadow: 0 14px 26px rgba(22, 163, 74, 0.20);
}

.shop-card-link:active,
.tutorial-card-link:active {
  transform: translateY(1px);
}

.shop-qr-placeholder {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.shop-qr-image {
  width: 132px;
  height: 132px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: #fff;
  padding: 8px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
}

.shop-qr-tip {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.guigu-options-hint a {
  color: var(--primary-dark);
  font-weight: 800;
  text-decoration: none;
}

.guigu-options-hint a:hover {
  text-decoration: underline;
}

.help-bubble {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: var(--primary-dark);
  padding: 9px 14px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 16px;
  border: 1px solid #bfdbfe;
  box-shadow: var(--shadow-sm);
}

.help-bubble:hover {
  background: var(--primary-bg);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

.modal-overlay,
.help-modal,
.confirm-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(5px);
  -webkit-backdrop-filter: blur(5px);
}

.confirm-modal {
  z-index: 400;
}

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

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

.modal-content {
  max-width: 440px;
}

.help-content {
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.confirm-content {
  max-width: 420px;
}

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

.confirm-header {
  justify-content: flex-start;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}

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

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

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

.modal-close,
.help-close {
  background: #ffffff;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  cursor: pointer;
  padding: 7px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover,
.help-close:hover {
  background: var(--primary-bg);
  color: var(--primary-dark);
  border-color: #bfdbfe;
}

.modal-body,
.confirm-body {
  padding: 24px;
}

.confirm-body {
  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: 800;
}

.confirm-warning {
  background: var(--warning-bg);
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  color: #92400e;
  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;
}

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

.modal-footer .btn,
.confirm-actions .btn {
  flex: 1;
}

.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: 800;
  flex-shrink: 0;
}

.help-step-title {
  font-size: 14px;
  font-weight: 800;
  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.7;
  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-card);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.platform-option:hover {
  border-color: #bfdbfe;
  background: var(--primary-bg);
}

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

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

.platform-option:has(input[type="radio"]:checked) {
  background: var(--primary-bg);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.10);
}

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

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

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

.guigu-options {
  margin: 18px 0 20px;
  padding: 18px;
  background: linear-gradient(135deg, #ffffff, #f8fbff);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.guigu-options-title {
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
}

.guigu-options-after-auth {
  margin-top: 16px;
}

.guigu-bound-package {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--primary-bg);
  border: 1px solid #bfdbfe;
}

.guigu-bound-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 800;
}

.guigu-bound-value {
  font-size: 14px;
  color: var(--primary-dark);
  font-weight: 800;
  text-align: right;
}

.guigu-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.guigu-options .form-group {
  margin-bottom: 0;
}

.guigu-options select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 44px;
  padding: 0 38px 0 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 19px,
    calc(100% - 13px) 19px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all var(--transition);
}

.guigu-options select:hover {
  border-color: #bfdbfe;
}

.guigu-options select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.guigu-options select:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.guigu-options select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.guigu-options-hint {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-muted);
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.guigu-start-btn {
  margin-top: 14px;
  width: 100%;
}

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

.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: 42px;
  height: 42px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.unique-id-help-btn:hover {
  background: var(--primary-bg);
  color: var(--primary-dark);
  border-color: #bfdbfe;
  transform: translateY(-1px);
}

.unique-id-content {
  max-width: 600px;
}

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

.unique-id-img {
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  border: 1px solid var(--border-light);
}

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

@media (max-width: 640px) {
  .steps {
    margin-bottom: 22px;
  }

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

  .step:not(:last-child)::after {
    top: 20px;
    left: calc(50% + 16px);
    width: calc(100% - 32px);
  }

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

  .game-name-display {
    padding: 10px 14px;
    margin-bottom: 12px;
  }

  .qr-wrap {
    padding: 12px;
  }

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

  .qr-tips {
    margin-bottom: 16px;
    padding: 14px;
  }

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

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

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

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

  .help-bubble {
    padding: 7px 12px;
    font-size: 12px;
    margin-bottom: 12px;
  }

  .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;
  }

  .guigu-options {
    padding: 14px;
    margin: 14px 0 18px;
  }

  .guigu-options-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .guigu-bound-package {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .guigu-bound-value {
    text-align: left;
  }

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

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

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

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

@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;
  }
}
