/* ================= a12.css（僅限 a12 模組作用） ================= */

/* 只在 a12 的區塊內做 reset，不影響全站 */
.a12-connection-modal,
.a12-container {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
  line-height: 1.5;
}

/* 作用域化的盒模型與微型 reset（僅限 a12 內部） */
.a12-connection-modal *,
.a12-container * {
  box-sizing: border-box;
  margin: 0;
}

/* ========== a12 連接/斷開：遮罩層 ========== */
.a12-connection-modal-mask {
  display: none;                  /* 預設隱藏 */
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  /* 左右保留距離（含 iOS 安全區域） */
  padding-left:  calc(env(safe-area-inset-left) + 12px);
  padding-right: calc(env(safe-area-inset-right) + 12px);
}
.a12-connection-modal-mask.active {
  display: flex;                  /* 加上 active 時顯示 */
}

/* ========== a12 彈窗內容 ========== */
.a12-connection-modal {
  background: #fff;
  border-radius: 12px;
  padding: 24px 32px;
  /* 重要：響應式寬度 + 置中，確保左右至少 12px 留白 */
  width: min(280px, calc(100vw - 24px));
  max-width: 100%;
  margin: 0 auto;

  text-align: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  animation: a12-modalShow 0.4s ease forwards;
}
.a12-connection-modal.hide {
  animation: a12-modalHide 0.3s ease forwards;
}

/* 標題 */
.a12-connection-modal-title {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 16px;
  color: #222;
}

/* ========== a12 按鈕（僅限 a12 內） ========== */
.a12-connection-modal button,
.a12-container button {
  appearance: none;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}
.a12-connection-modal button:hover,
.a12-container button:hover {
  transform: translateY(-1px) scale(1.02);
}
.a12-connection-modal button:active,
.a12-container button:active {
  transform: translateY(0) scale(1);
}
.a12-connection-modal button:disabled,
.a12-container button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* ========== a12 進度條 ========== */
.a12-connection-progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0 0;
}
.a12-connection-progress-bar-inner {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #34d399, #60a5fa);
  transition: width 3s ease;
}

/* ========== a12 動畫 ========== */
@keyframes a12-modalShow {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
@keyframes a12-modalHide {
  from { transform: scale(1);   opacity: 1; }
  to   { transform: scale(0.8); opacity: 0; }
}

/* ========== a12 範例容器（可按頁面調整/刪除） ========== */
.a12-container {
  max-width: 400px;
  margin: 40px auto;
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  text-align: center;
}

#a12-splash-buttons button {
  margin: 8px 0;
  width: 100%;
  background: #4CAF50;
  color: #fff;
}
#a12-splash-buttons button.disconnect {
  background: #e53e3e;
}
