/* aEmblemLogoUpload.css */
/* =========================================
   全域防爆 + 基礎
   ========================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

.wiki-content,
.content-box,
.tutorial-container,
.step-card,
.step-content {
  min-width: 0;     /* ✅ flex/grid 子項目不硬撐 */
  max-width: 100%;
}

.step-card * {
  max-width: 100%;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* =========================================
   容器設定
   ========================================= */
.tutorial-container {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 10px 0;
}

/* =========================================
   神戒盟徽教學 v2（只作用在 .emblem-v2）
   ========================================= */
.emblem-v2-head {
  margin-bottom: 6px;
}

.emblem-v2-title {
  color: #fff;
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: .5px;
  margin-bottom: 6px;
}

.emblem-v2-sub {
  color: rgba(255, 255, 255, .65);
  font-size: .95rem;
  line-height: 1.7;
}

/* =========================================
   3步總覽
   ========================================= */
.emblem-quickbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 10px 0 4px;
}

.emblem-quickitem {
  background: rgba(0, 0, 0, .22);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  min-width: 0;
}

.emblem-quickicon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .10);
  color: #fbb750;
  flex: 0 0 auto;
}

.emblem-quicktext {
  min-width: 0;
}

.emblem-quicktitle {
  color: rgba(255, 255, 255, .92);
  font-weight: 900;
  font-size: .95rem;
  margin: 0;
  line-height: 1.45;
}

.emblem-quickdesc {
  color: rgba(255, 255, 255, .62);
  font-size: .85rem;
  margin-top: 4px;
  line-height: 1.55;
}

/* =========================================
   步驟卡片 (Step Card)
   ========================================= */
.step-card {
  display: flex;
  gap: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 26px;
  position: relative;
  overflow: hidden; /* ✅ 防止圓角溢出 */
}

.step-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 999px;
  background: rgba(251, 183, 80, 0.55);
  filter: drop-shadow(0 0 10px rgba(251, 183, 80, 0.25));
}

/* 左側數字徽章 */
.step-badge {
  flex: 0 0 auto;
  width: 50px;
  height: 50px;
  color: #000;
  font-size: 1.5rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-family: 'Segoe UI', sans-serif;
  box-shadow: 0 0 15px rgba(251, 183, 80, 0.35);
}

.step-badge.badge-blue {
  background: linear-gradient(135deg, #4da6ff, #2f7bd8);
}

.step-badge.badge-gold {
  background: linear-gradient(135deg, #fbb750, #d4af37);
}

/* 右側內容 */
.step-content {
  flex: 1 1 auto;
  min-width: 0;
}

.step-content h3 {
  margin: 0 0 10px 0;
  color: var(--primary-gold, #fbb750);
  font-size: 1.25rem;
  font-weight: 900;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  display: inline-block;
}

.step-content p {
  color: #ddd;
  line-height: 1.75;
  margin: 0 0 10px 0;
  font-size: 1rem;
}

/* =========================================
   重要字：膠囊
   - 桌機可不換行；手機會在 media query 允許換行
   ========================================= */
.kbd-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .93);
  font-weight: 900;
  letter-spacing: .2px;
  margin: 0 2px;
  white-space: nowrap;
}

/* =========================================
   Step 2 列表：icon + 文字區（防止直排）
   ========================================= */
.emblem-v2-list {
  margin: 10px 0 12px;
  padding: 0;
  list-style: none;
}

.emblem-v2-li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  color: #ddd;
  line-height: 1.75;
  min-width: 0;
}

.emblem-v2-li i {
  width: 22px;
  min-width: 22px;
  text-align: center;
  margin-top: 2px;
  color: #fbb750;
  flex: 0 0 auto;
}

.emblem-v2-li .li-text {
  flex: 1 1 auto;     /* ✅ 文字區撐滿，避免被擠到像直排 */
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* =========================================
   圖片展示區
   ========================================= */
.step-imgs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  min-width: 0;
}

.shadow-img {
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.10);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.shadow-img:hover {
  transform: scale(1.01);
  border-color: rgba(251, 183, 80, 0.55);
}

/* exe 小圖示：固定大小，不要被放大 */
.emblem-icon-img {
  width: 110px !important;
  height: 133px !important;
  max-width: none !important;
  object-fit: contain;
  display: block;
  margin: 8px auto 0;
  border-radius: 12px;
}

/* =========================================
   提示框
   ========================================= */
.tip-box {
  margin-top: 10px;
  background: rgba(13, 202, 240, 0.08);
  border: 1px solid rgba(13, 202, 240, 0.15);
  border-left: 4px solid #0dcaf0;
  padding: 10px 12px;
  color: rgba(255, 255, 255, .82);
  font-size: .92rem;
  border-radius: 10px;
  line-height: 1.7;
}

.tip-box i {
  margin-right: 8px;
}

.tip-note {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.10);
  border-left-color: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, .75);
}

.tip-warn {
  background: rgba(255, 193, 7, 0.08);
  border-color: rgba(255, 193, 7, 0.18);
  border-left-color: #fbb750;
}

.tip-label {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  margin: 0 6px 0 0;
  font-weight: 900;
  font-size: .85rem;
  letter-spacing: .3px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: rgba(255, 255, 255, .92);
}

.tip-label.danger {
  border-color: rgba(255, 82, 82, 0.22);
  background: rgba(255, 82, 82, 0.10);
  color: #ffb3b3;
}

/* =========================================
   手機版最佳化（關鍵：避免超出 + 避免直排）
   ========================================= */
@media (max-width: 768px) {

  /* ✅ 如果 wiki-layout 是左右兩欄，手機要變單欄 */
  .wiki-layout {
    display: block !important;
  }

  .wiki-layout > main.wiki-content {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* 卡片改直向、縮 padding */
  .step-card {
    flex-direction: column;
    gap: 12px;
    padding: 18px;
  }

  .step-card::before {
    top: 10px;
    bottom: 10px;
  }

  .step-badge {
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }

  .step-content h3 {
    font-size: 1.15rem;
  }

  .step-content p {
    font-size: .98rem;
  }

  /* 3步總覽：三欄 → 單欄 */
  .emblem-quickbar {
    grid-template-columns: 1fr;
  }

  /* ✅ 手機：kbd-tag 允許換行（避免撐爆造成直排/溢出） */
  .kbd-tag {
    white-space: normal;
    line-height: 1.6;
  }

  /* ✅ 列表更穩：icon + 文字不擠 */
  .emblem-v2-li {
    padding: 10px 0;
  }

  .emblem-v2-li .li-text {
    font-size: .98rem;
  }

  /* ✅ 手機觸控：hover 放大容易抖，關掉 */
  .shadow-img:hover {
    transform: none;
  }

  /* exe 小圖仍固定尺寸，但不會超出 */
  .emblem-icon-img {
    max-width: 100% !important;
  }
}

/* 登入器「工具 → 盟徽上傳」直式截圖：維持原尺寸置中，不放大 */
.emblem-launcher-img {
  display: block;
  width: auto;
  max-width: min(320px, 100%);
  height: auto;
  margin: 8px auto 0;
}

/* ===== 合併後：頁內導覽 + 段落標題（上傳 / 破圖修復） ===== */
.emblem-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 6px;
}

.emblem-jump a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  color: #ffe0a8;
  text-decoration: none;
  font-weight: 700;
  font-size: .92rem;
  border: 1px solid rgba(251, 183, 80, .35);
  background: rgba(251, 183, 80, .08);
  transition: background .15s, border-color .15s;
}

.emblem-jump a:hover {
  border-color: rgba(251, 183, 80, .7);
  background: rgba(251, 183, 80, .16);
}

.emblem-section-head {
  margin: 26px 0 14px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #fff;
  font-weight: 900;
  font-size: 1.15rem;
  border-left: 4px solid #fbb750;
  background: rgba(251, 183, 80, .08);
  scroll-margin-top: 80px;
}

.emblem-section-head.fix {
  border-left-color: #ff6b6b;
  background: rgba(255, 107, 107, .08);
}

.emblem-section-head small {
  font-weight: 600;
  font-size: .85rem;
  color: rgba(255, 255, 255, .6);
  margin-left: 4px;
}

.step-badge.badge-red {
  background: linear-gradient(135deg, #ff8a80, #d7423c);
  box-shadow: 0 0 15px rgba(215, 66, 60, .35);
}
