* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  -webkit-tap-highlight-color: transparent;
}

.card {
  background: #fff;
  border-radius: 22px;
  padding: 24px 36px 30px;
  width: 100%;
  max-width: 680px;
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
  text-align: center;
  animation: pop .35s ease;
}

@keyframes pop {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.logo { font-size: 40px; margin-bottom: 4px; }
h1 { font-size: 28px; color: #1f2937; margin-bottom: 4px; }
.sub { font-size: 14px; color: #8b95a5; margin-bottom: 18px; }

.input-row { margin-bottom: 14px; }

input#codeInput {
  width: 100%;
  padding: 16px 18px;
  font-size: 17px;
  letter-spacing: 1px;
  border: 2px solid #e5e8ef;
  border-radius: 12px;
  outline: none;
  transition: .2s;
  text-align: center;
  font-family: inherit;
}
input#codeInput:focus { border-color: #667eea; box-shadow: 0 0 0 4px rgba(102,126,234,.12); }

button.primary {
  width: 100%;
  padding: 16px;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: .2s;
}
button.primary:hover { filter: brightness(1.08); }
button.primary:disabled { opacity: .6; cursor: not-allowed; }

.ghost-btn {
  margin-top: 20px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  color: #4f46e5;
  background: #f4f6fb;
  border: 2px solid #e2e6ee;
  border-radius: 10px;
  cursor: pointer;
  transition: .2s;
  font-family: inherit;
}
.ghost-btn:hover { background: #eef1ff; border-color: #c7d2fe; }

.msg { margin-top: 16px; font-size: 15px; min-height: 22px; color: #e5484d; }

.result { margin-top: 10px; padding-top: 10px; border-top: 2px dashed #e5e8ef; }
.game-name { font-size: 26px; font-weight: 800; color: #1f2937; margin-bottom: 18px; word-break: break-all; }

.btn-row { display: flex; gap: 14px; flex-direction: row; }
.copy-btn {
  flex: 1;
  padding: 18px 10px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: .2s;
  font-family: inherit;
  white-space: nowrap;
  box-shadow: 0 4px 15px rgba(102,126,234,0.4);
}
.copy-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(102,126,234,0.5); }
.copy-btn:active { transform: translateY(0); box-shadow: 0 4px 15px rgba(102,126,234,0.4); }
.copy-btn.ok { background: #12864a; box-shadow: 0 4px 15px rgba(18,134,74,0.4); }

.alert-tip {
  margin-top: 20px;
  padding: 14px 20px;
  background: #fff0f0;
  border-radius: 10px;
  border: 1.5px solid #ffd4d4;
  font-size: 17px;
  font-weight: 700;
  color: #d93b3b;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: .75; }
  100% { opacity: 1; }
}

.hidden { display: none !important; }

/* ================= 教程 ================= */
.tutorial-box {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px dashed #e5e8ef;
  text-align: left;
}

.tutorial-header {
  font-size: 20px;
  font-weight: 800;
  color: #1f2937;
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: 1px;
}

.tutorial-content {
  font-size: 15.5px;
  color: #374151;
  line-height: 1.8;
  word-wrap: break-word;
}

.tut-module-box {
  background: #f5f7fa;
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.tut-module-box:last-child { margin-bottom: 0; }

.tut-module-box img {
  max-width: 100%;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.video-wrapper {
  width: 100%;
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  position: relative;
}
.video-wrapper.horizontal { aspect-ratio: 16 / 9; }
.video-wrapper.vertical {
  aspect-ratio: 9 / 16;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.video-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.video-shield {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}
.video-shield .vs-top,
.video-shield .vs-bottom {
  position: absolute;
  left: 0;
  right: 0;
  height: 25%;
  pointer-events: auto;
  background: transparent;
  cursor: default;
}
.video-shield .vs-top { top: 0; }
.video-shield .vs-bottom { bottom: 0; }

/* ================= 复制引导弹窗 ================= */
.copy-guide-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  user-select: none;
  -webkit-user-select: none;
}

.copy-guide-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.guide-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
  max-width: 440px;
  min-height: 692px;
  justify-content: flex-start;
}

.guide-tip-bar {
  width: 100%;
  background: #ffec3d;
  color: #4a3f00;
  padding: 14px 20px;
  font-size: 23px;
  font-weight: 800;
  text-align: center;
  line-height: 1.5;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  box-sizing: border-box;
}
.guide-tip-bar > div + div { margin-top: 4px; }

.guide-dialog {
  position: relative;
  width: 100%;
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  animation: guidePop 0.3s ease;
  user-select: none;
  -webkit-user-select: none;
}

@keyframes guidePop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.guide-dialog-main {
  width: 100%;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.guide-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 48px 34px 20px;
  text-align: center;
  overflow-y: auto;
}

.guide-lock-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 22px;
  flex-shrink: 0;
}
.guide-lock-icon svg { width: 100%; height: 100%; }

.guide-content h2 {
  font-size: 32px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}

.guide-desc {
  font-size: 17px;
  color: #4b5563;
  margin-bottom: 34px;
  line-height: 1.55;
}

.guide-body {
  font-size: 17px;
  color: #4b5563;
  line-height: 1.7;
  margin-bottom: 22px;
}

.guide-link {
  display: inline-block;
  font-size: 17px;
  color: #007aff;
  cursor: pointer;
  margin-bottom: 6px;
  margin-top: auto;
}

.guide-buttons {
  padding: 0 34px 36px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.guide-btn-primary {
  width: 100%;
  padding: 19px;
  font-size: 19px;
  font-weight: 600;
  color: #fff;
  background: #007aff;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-family: inherit;
  transition: .15s;
}
.guide-btn-primary:active { background: #0066d6; }

.guide-btn-secondary {
  width: 100%;
  padding: 14px;
  font-size: 18px;
  font-weight: 500;
  color: #007aff;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: .15s;
}
.guide-btn-secondary:active { opacity: .6; }

/* 第二步遮罩层 */
.guide-step2-overlay {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.25s ease;
  user-select: none;
  -webkit-user-select: none;
}

.guide-step2-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

/* ✅ PC/iPad 端：黄条上移 11px，弹窗保持原位
   容器高度 692 → 714（多 22px，居中时黄条整体上移 11px）
   gap 200 → 211（弹窗相对黄条下移 11px，回到原位） */
.guide-step2-overlay .guide-inner {
  min-height: 714px;
  gap: 211px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.guide-dialog-alert {
  position: relative;
  width: 100%;
  max-width: 340px;
  border-radius: 16px;
  overflow: hidden;
  background: #f2f2f7;
  animation: alertPop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

@keyframes alertPop {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.guide-dialog-alert .guide-content {
  padding: 28px 24px 24px;
  flex: none;
  overflow: visible;
}
.guide-dialog-alert .guide-content h2 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: 0;
}
.guide-dialog-alert .guide-body {
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 0;
  color: #3a3a3a;
}

.guide-buttons-row {
  display: flex;
  border-top: 1px solid #d1d1d6;
  background: #f2f2f7;
}
.guide-btn-link {
  flex: 1;
  padding: 16px 6px;
  font-size: 17px;
  font-weight: 400;
  color: #007aff;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: .15s;
}
.guide-btn-link:first-child { border-right: 1px solid #d1d1d6; }
.guide-btn-link.blue { font-weight: 600; }
.guide-btn-link:active { background: #e5e5ea; }

.guide-dialog.shake { animation: guideShake 0.4s ease; }
@keyframes guideShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* ================= 响应式 ================= */
@media (max-width: 768px) {
  body {
    padding: 12px;
    align-items: flex-start;
    padding-top: 14vh;
  }
  .card { padding: 18px 20px 22px; border-radius: 18px; }
  .logo { font-size: 34px; }
  h1 { font-size: 24px; }
  .sub { font-size: 13px; margin-bottom: 14px; }
  input#codeInput { padding: 14px; font-size: 16px; }
  button.primary { padding: 14px; font-size: 16px; }
  .game-name { font-size: 22px; }
  .btn-row { gap: 10px; }
  .copy-btn { padding: 15px 6px; font-size: 15px; }
  .alert-tip { font-size: 15px; padding: 12px 16px; }
  .tutorial-box { margin-top: 18px; padding-top: 16px; }
  .tutorial-header { font-size: 17px; }
  .tutorial-content { font-size: 14.5px; }
  .tut-module-box { padding: 12px 14px; margin-bottom: 10px; }
  .video-wrapper.vertical { max-width: 100%; }

  /* ✅ 手机端：两个遮罩都用 flex-start + 相同 padding-top，让黄条位置重叠 */
  .copy-guide-modal,
  .guide-step2-overlay {
    align-items: flex-start;
    padding-top: 18vh;
    padding-left: 14px;
    padding-right: 14px;
    padding-bottom: 14px;
  }

  .guide-inner {
    max-width: 100%;
    min-height: 0;
    height: auto;
    gap: 14px;
  }

  /* ✅ 手机端：黄条位置不变（与第一步重叠），小弹窗下移 120px
     gap 14 → 134，弹窗相对黄条下移 120px */
  .guide-step2-overlay .guide-inner {
    min-height: 0;
    gap: 134px;
  }

  .guide-tip-bar {
    font-size: 22px;
    padding: 12px 16px;
  }

  .guide-dialog-main {
    max-width: 100%;
    min-height: 0;
    height: auto;
    max-height: 96vh;
  }
  .guide-content { padding: 34px 24px 14px; }
  .guide-content h2 { font-size: 26px; margin-bottom: 18px; }
  .guide-desc { font-size: 15.5px; margin-bottom: 26px; }
  .guide-body { font-size: 15.5px; }
  .guide-link { font-size: 15.5px; }
  .guide-lock-icon { width: 64px; height: 64px; margin-bottom: 16px; }
  .guide-buttons { padding: 0 24px 24px; }
  .guide-btn-primary { padding: 17px; font-size: 18px; }
  .guide-btn-secondary { font-size: 17px; }

  .guide-dialog-alert { max-width: 88%; }
  .guide-dialog-alert .guide-content { padding: 30px 24px 24px; }
  .guide-dialog-alert .guide-content h2 { font-size: 20px; margin-bottom: 12px; }
  .guide-dialog-alert .guide-body { font-size: 15.5px; line-height: 1.6; }
  .guide-btn-link { padding: 17px 6px; font-size: 17px; }
}

@media (max-width: 380px) {
  .card { padding: 16px 14px 18px; }
  h1 { font-size: 22px; }
  .alert-tip { font-size: 13px; }
  .btn-row { gap: 6px; }
  .copy-btn { padding: 12px 4px; font-size: 13px; }
  .guide-tip-bar { font-size: 20px; padding: 10px 14px; }
  .guide-content { padding: 26px 18px 12px; }
  .guide-content h2 { font-size: 23px; }
  .guide-buttons { padding: 0 18px 20px; }
}

@media (min-width: 769px) and (max-height: 800px) {
  .guide-inner { min-height: 0; }
  .guide-step2-overlay .guide-inner {
    min-height: 0;
    gap: 211px;
  }
  .guide-dialog-main {
    min-height: 0;
    max-height: 88vh;
  }
  .guide-content { padding: 30px 28px 16px; }
  .guide-content h2 { font-size: 26px; }
  .guide-lock-icon { width: 60px; height: 60px; margin-bottom: 14px; }
  .guide-desc { font-size: 15.5px; margin-bottom: 24px; }
  .guide-body { font-size: 15.5px; }
}

/* ============ 兑换成功后手机端顶部留白收缩 ============ */
@media (max-width: 768px) {
  body.redeemed { padding-top: 12px; }
  body.redeemed .card { margin-top: 0; }
}
/* ============ 黄条里【其它选项】/【不升级】高亮颜色 ============ */
/* 第一步（默认）：【其它选项】红色、【不升级】黑色 */
.guide-tip-bar .hl-other { color: #d93b3b; }
.guide-tip-bar .hl-no    { color: inherit; }

/* 第二步：【其它选项】黑色、【不升级】红色 */
.guide-step2-overlay .guide-tip-bar .hl-other { color: inherit; }
.guide-step2-overlay .guide-tip-bar .hl-no    { color: #d93b3b; }
/* ============ 图片模块多图展示 ============ */
.tut-module-box img {
  max-width: 100%;
  border-radius: 8px;
  display: block;
  margin: 10px auto;
}
.tut-module-box img:first-child { margin-top: 0; }
.tut-module-box img:last-child { margin-bottom: 0; }