/* ============================================================
   購買 USDT 頁（buy.html）
   ------------------------------------------------------------
   設計重點：
     1. 開頭就把「限已註冊會員」講清楚，避免非會員白填
     2. 匯款帳號預設不顯示，只有審核通過才出現
     3. 金額自動換算，減少客戶算錯
     4. 手機優先，單欄式輸入
   ============================================================ */

.buy-wrap {
  padding-bottom: 40px;
}

/* ---------- LINE 客服入口 ---------- */

.buy-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  text-decoration: none;
  background: #06c755;
  box-shadow: 0 6px 18px rgba(6, 199, 85, 0.28);
  transition: transform 0.18s, box-shadow 0.18s;
}

.buy-line:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(6, 199, 85, 0.4);
}

/* 等待頁用：稍微縮小，避免搶走「審核中」的焦點 */
.buy-line-compact {
  padding: 12px 14px;
  background: rgba(6, 199, 85, 0.14);
  box-shadow: inset 0 0 0 1.5px rgba(6, 199, 85, 0.5);
}

.buy-line-compact .buy-line-main {
  color: #0a6b31;
}

.buy-line-compact .buy-line-sub {
  color: #3f7a56;
}

.buy-line-compact .buy-line-arrow {
  color: #0a6b31;
}

/* 匯款頁用：加深強調，因為回報是最重要的一步 */
.buy-line-strong {
  background: #06c755;
  box-shadow: 0 8px 22px rgba(6, 199, 85, 0.36);
}

.buy-line-ico {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 17px;
  background: rgba(255, 255, 255, 0.22);
}

.buy-line-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-align: left;
  line-height: 1.4;
}

.buy-line-main {
  font-size: 14.5px;
  font-weight: 800;
  color: #fff;
}

.buy-line-sub {
  margin-top: 2px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.82);
}

.buy-line-arrow {
  flex-shrink: 0;
  font-size: 20px;
  color: rgba(255, 255, 255, 0.75);
}

/* ---------- 頁尾：回到首頁 ---------- */

.buy-foot-home {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

.buy-home {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  text-decoration: none;
  background: rgba(212, 175, 55, 0.09);
  border: 1px dashed var(--border-strong);
  transition: all 0.2s;
}

.buy-home:hover {
  background: rgba(212, 175, 55, 0.16);
  border-color: var(--gold-500);
  border-style: solid;
}

.buy-home-ico {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 18px;
  background: rgba(212, 175, 55, 0.24);
}

.buy-home-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-align: left;
  line-height: 1.4;
}

.buy-home-main {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-primary);
}

.buy-home-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}

.buy-home-arrow {
  flex-shrink: 0;
  font-size: 21px;
  color: var(--gold-200);
}

/* ---------- 引導圖片（入金頁看審核結果） ---------- */

/*
 * 改成「上下堆疊」的大卡片：
 *   原本圖片固定 132px、文字只有 11-12px，手機上幾乎看不清楚。
 *   現在圖片放到接近全寬，說明文字也放大一階，
 *   讓「去哪看審核結果」這件事一眼就能看懂。
 */
.buy-guide-figure {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
  padding: 20px 18px 22px;
  border-radius: 14px;
  background: rgba(212, 175, 55, 0.09);
  border: 1px solid var(--border-strong);
}

.buy-guide-img {
  width: 100%;
  max-width: 320px;
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(168, 134, 28, 0.16);
}

.buy-guide-caption {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

.buy-guide-caption-main {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--text-primary);
}

.buy-guide-caption-sub {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-secondary);
}

/* 說明裡的重點字（入金） */
.buy-guide-caption-sub strong {
  color: var(--gold-200);
  font-weight: 800;
}

@media (max-width: 420px) {
  .buy-guide-figure {
    padding: 16px 14px 18px;
  }

  .buy-guide-img {
    max-width: 100%;
  }

  .buy-guide-caption-main {
    font-size: 15px;
  }

  .buy-guide-caption-sub {
    font-size: 13px;
  }
}

/* ---------- 每日額度提醒 ---------- */

.buy-quota {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  border-left: 3px solid #e8a33d;
  background: rgba(232, 163, 61, 0.11);
}

.buy-quota-ico {
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1.55;
}

.buy-quota-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.buy-quota-main {
  font-size: 12px;
  font-weight: 700;
  color: #8a5a10;
}

.buy-quota-sub {
  font-size: 11px;
  line-height: 1.55;
  color: #9c7434;
}

/* ---------- 帳戶封面上傳 ---------- */

.buy-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 22px 16px;
  border: 2px dashed var(--border-strong);
  border-radius: 11px;
  background: rgba(212, 175, 55, 0.05);
  cursor: pointer;
  transition: all 0.2s;
}

.buy-upload:hover {
  border-color: var(--gold-500);
  background: rgba(212, 175, 55, 0.1);
}

/* 隱藏原生 input，用 label 當按鈕 */
.buy-upload-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.buy-upload-ico {
  font-size: 26px;
  line-height: 1;
}

.buy-upload-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: center;
}

.buy-upload-main {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.buy-upload-sub {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* 已選擇：顯示縮圖 */
.buy-upload-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--navy-800);
  border: 1px solid var(--border-strong);
}

.buy-upload-thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: #fff;
}

.buy-upload-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.buy-upload-name {
  font-size: 11.5px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buy-upload-remove {
  align-self: flex-start;
  padding: 4px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  background: transparent;
  font-family: inherit;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s;
}

.buy-upload-remove:hover {
  color: #c41c1c;
  border-color: rgba(224, 46, 46, 0.5);
}

/* ---------- 限時匯款提醒 ---------- */

.buy-deadline {
  margin-bottom: 16px;
  padding: 13px 15px;
  border-radius: 11px;
  border: 1px solid rgba(224, 46, 46, 0.35);
  background: rgba(224, 46, 46, 0.07);
  text-align: left;
}

/* 通過頁用：更強烈的紅色框，因為這是最需要注意的事 */
.buy-deadline-strong {
  border-width: 1.5px;
  border-color: rgba(224, 46, 46, 0.55);
  background: rgba(224, 46, 46, 0.11);
  box-shadow: 0 3px 14px rgba(224, 46, 46, 0.12);
}

.buy-deadline-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}

.buy-deadline-ico {
  font-size: 15px;
  line-height: 1;
}

.buy-deadline-title {
  font-size: 13px;
  font-weight: 800;
  color: #c41c1c;
}

.buy-deadline-desc {
  font-size: 11.5px;
  line-height: 1.7;
  color: #8c3a3a;
}

/* ---------- 步驟進度條 ---------- */

.buy-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 20px;
  padding: 14px 10px;
  border-radius: 12px;
  background: var(--navy-700);
  border: 1px solid var(--border-subtle);
}

.buy-steps-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  opacity: 0.45;
  transition: opacity 0.25s;
}

.buy-steps-item.active,
.buy-steps-item.done {
  opacity: 1;
}

.buy-steps-dot {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
  background: rgba(168, 134, 28, 0.16);
  border: 1.5px solid var(--border-subtle);
  transition: all 0.25s;
}

.buy-steps-item.active .buy-steps-dot {
  color: #1a1200;
  background: linear-gradient(135deg, #f0d98a, #d4af37);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.buy-steps-item.done .buy-steps-dot {
  color: #fff;
  background: #2e7d32;
  border-color: transparent;
}

.buy-steps-text {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.buy-steps-item.active .buy-steps-text {
  color: var(--gold-300);
}

.buy-steps-item.done .buy-steps-text {
  color: #2e7d32;
}

.buy-steps-line {
  flex: 1;
  height: 2px;
  min-width: 18px;
  margin: 0 6px 16px;
  border-radius: 99px;
  background: rgba(168, 134, 28, 0.2);
}

/* ---------- 欄位編號 ---------- */

.buy-field-num {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-right: 4px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  color: #1a1200;
  background: rgba(212, 175, 55, 0.35);
  vertical-align: 1px;
}

/* 欄位填寫正確的勾選提示 */
.buy-check-tip {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: #2e7d32;
  text-align: left;
}

/* 送出按鈕下方的說明 */
.buy-submit-hint {
  margin-top: -4px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- 前置門檻（限會員） ---------- */

.buy-gate {
  margin-bottom: 16px;
  padding: 22px 18px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: rgba(212, 175, 55, 0.1);
  text-align: center;
}

.buy-gate-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 24px;
  background: linear-gradient(135deg, #f0d98a, #d4af37);
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.36);
}

.buy-gate-title {
  margin-bottom: 7px;
  font-size: 15.5px;
  font-weight: 800;
  color: var(--text-primary);
}

.buy-gate-desc {
  margin-bottom: 15px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-secondary);
}

.buy-gate-btn {
  display: inline-block;
  padding: 11px 28px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  color: #1a1200;
  background: linear-gradient(135deg, #f0d98a, #d4af37);
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.3);
}

/* ---------- 審核說明列 ---------- */

.buy-notice {
  margin-bottom: 18px;
  padding: 14px 15px;
  border-radius: 11px;
  background: var(--navy-700);
  border: 1px solid var(--border-subtle);
}

.buy-notice-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 5px 0;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-secondary);
  text-align: left;
}

.buy-notice-ico {
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1.55;
}

/* ---------- 表單 ---------- */

.buy-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.buy-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.buy-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: left;
}

.buy-required {
  color: #e02e2e;
  margin-left: 2px;
}

.buy-input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--navy-900);
  font-family: inherit;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.buy-input::placeholder {
  color: var(--text-muted);
  font-size: 13px;
}

.buy-input:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

.buy-input.invalid {
  border-color: #e02e2e;
  box-shadow: 0 0 0 3px rgba(224, 46, 46, 0.12);
}

.buy-help {
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: left;
}

/* ---------- 客服聯絡提示（取代原本的聯絡方式欄位） ---------- */

.buy-contact-tip {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 12px 14px;
  border-radius: 10px;
  border-left: 3px solid #06c755;
  background: rgba(6, 199, 85, 0.1);
  font-size: 12px;
  line-height: 1.7;
  color: #14663a;
  text-align: left;
}

.buy-contact-ico {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1.55;
}

/* ---------- 金額換算 ---------- */

.buy-calc {
  padding: 14px 15px;
  border-radius: 11px;
  background: rgba(212, 175, 55, 0.11);
  border: 1px solid var(--border-strong);
}

.buy-calc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.buy-calc-total {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 13.5px;
  color: var(--text-primary);
}

.buy-calc-total strong {
  font-size: 19px;
  font-weight: 800;
  color: #c41c1c;
}

/* ---------- 同意勾選 ---------- */

.buy-agree {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
}

.buy-agree input {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: #d4af37;
}

/* ---------- 錯誤訊息 ---------- */

.buy-error {
  padding: 11px 14px;
  border-radius: 9px;
  border-left: 3px solid #e02e2e;
  background: rgba(224, 46, 46, 0.1);
  font-size: 12.5px;
  line-height: 1.6;
  color: #8c1d1d;
  text-align: left;
}

/* ---------- 狀態圖示 ---------- */

.buy-state-icon {
  width: 76px;
  height: 76px;
  margin: 6px auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 34px;
}

.buy-state-pending {
  background: linear-gradient(135deg, #ffe9a8, #f0d98a);
  box-shadow: 0 8px 22px rgba(212, 175, 55, 0.34);
}

.buy-state-ok {
  background: linear-gradient(135deg, #a5e8a8, #6dc870);
  box-shadow: 0 8px 22px rgba(46, 125, 50, 0.3);
}

/* ---------- 申請摘要 ---------- */

.buy-summary {
  margin-bottom: 16px;
  padding: 14px 15px;
  border-radius: 11px;
  background: var(--navy-700);
  border: 1px solid var(--border-strong);
}

.buy-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: left;
}

.buy-summary-row + .buy-summary-row {
  border-top: 1px solid var(--border-subtle);
}

.buy-summary-row strong {
  font-size: 13.5px;
  color: var(--text-primary);
}

.buy-summary-row code {
  max-width: 62%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 11.5px;
  color: var(--text-primary);
}

/* 狀態標籤 */
.buy-tag {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.buy-tag-pending {
  color: #8a6a00;
  background: rgba(212, 175, 55, 0.26);
}

/* ---------- 匯款資訊區 ---------- */

.buy-bank {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 13px;
  background: var(--navy-700);
  border: 1px solid var(--border-strong);
  box-shadow: 0 4px 16px rgba(168, 134, 28, 0.1);
}

.buy-bank-title {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
  font-weight: 800;
  color: var(--gold-300);
  text-align: left;
}

.buy-bank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: left;
}

.buy-bank-row strong {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
}

.buy-acct {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.buy-bank-amount {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.buy-bank-amount strong {
  font-size: 20px;
  font-weight: 800;
  color: #c41c1c;
}

/* ---------- 手機微調 ---------- */

@media (max-width: 480px) {
  .buy-gate {
    padding: 18px 14px;
  }

  .buy-gate-title {
    font-size: 14.5px;
  }

  .buy-input {
    font-size: 15px; /* iOS 小於 16px 會自動放大，這裡刻意放大避免 */
  }

  .buy-bank-row strong {
    font-size: 12.5px;
  }

  .buy-acct {
    font-size: 13px;
  }
}
