/* ===== 登入 / 訂閱閘門樣式（獨立於編輯器樣式，避免互相污染） ===== */
#auth-gate {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: linear-gradient(135deg, #1a3a6b, #2a5298);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Microsoft JhengHei", "蘋方-繁", Arial, sans-serif;
}
#auth-gate.auth-hidden { display: none; }

#auth-box {
  background: #fff;
  border-radius: 12px;
  padding: 32px 28px;
  width: 340px;
  max-width: 90vw;
  box-shadow: 0 10px 40px rgba(0,0,0,.3);
  text-align: center;
}
#auth-box h1 {
  font-size: 18px;
  margin-bottom: 8px;
  color: #1a3a6b;
}
/* v249：讓還沒註冊的訪客也能先看到方案與價格頁 */
.auth-pricing-link {
  display: inline-block;
  font-size: 12.5px;
  color: #3a7bd5;
  text-decoration: underline;
  margin-bottom: 18px;
}
.auth-pricing-link:hover { color: #1a3a6b; }
#ui-lang-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eee;
}
.ui-lang-label {
  font-size: 11px;
  color: #888;
  margin-right: 2px;
}
.ui-lang-btn {
  font-size: 12px;
  padding: 5px 12px;
  border: 1.5px solid #ccc;
  background: #f9fafc;
  color: #555;
  border-radius: 14px;
  cursor: pointer;
  transition: all .15s;
}
.ui-lang-btn:hover { border-color: #3a7bd5; color: #3a7bd5; }
.ui-lang-btn.active {
  background: #1a3a6b;
  border-color: #1a3a6b;
  color: #fff;
  font-weight: 700;
}
.auth-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.auth-tab {
  flex: 1;
  padding: 8px 6px;
  border: 1px solid #ccc;
  background: #f5f5f5;
  border-radius: 6px;
  font-size: 12.5px;
  color: #666;
  cursor: pointer;
  font-weight: 700;
}
.auth-tab.active {
  background: #1a3a6b;
  border-color: #1a3a6b;
  color: #fff;
}
.auth-help {
  font-size: 12px;
  color: #555;
  text-align: left;
  line-height: 1.6;
  margin: 0 0 12px;
  background: #f0f4fa;
  border-radius: 6px;
  padding: 8px 10px;
}
#auth-box input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}
.auth-btn {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border: none;
  border-radius: 6px;
  background: #eee;
  color: #333;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.auth-btn:hover { background: #ddd; }
.auth-btn-primary {
  background: #1a3a6b;
  color: #fff;
}
.auth-btn-primary:hover { background: #234a86; }
.auth-msg {
  min-height: 18px;
  font-size: 12.5px;
  color: #c0392b;
  margin-bottom: 8px;
}
/* v237：忘記密碼連結——文字連結樣式，跟主要按鈕區分開，避免搶走「登入」的視覺重點 */
.auth-link-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #3a7bd5;
  font-size: 12.5px;
  text-decoration: underline;
  cursor: pointer;
  margin-top: 10px;
  padding: 2px;
}
.auth-link-btn:hover { color: #1a3a6b; }
#auth-loading-panel { color: #888; font-size: 13px; }

/* ===== 會員中心（v224） ===== */
#member-center {
  position: fixed;
  top: 8px;
  right: 12px;
  z-index: 4000;
  font-family: "Microsoft JhengHei", "蘋方-繁", Arial, sans-serif;
}

#member-avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.7);
  background: #f0a500;
  color: #1a3a6b;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
#member-avatar-btn:hover { background: #ffb81c; }

#member-panel {
  display: none;
  position: absolute;
  top: 44px;
  right: 0;
  width: 300px;
  max-width: 88vw;
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
  padding: 18px;
  color: #222;
}
#member-panel.open { display: block; }

.mc-view { display: block; }

.mc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eee;
  margin-bottom: 14px;
}
.mc-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #eef0ff;
  color: #1a3a6b;
  font-weight: 800;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mc-header-info { min-width: 0; }
.mc-name {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mc-email {
  font-size: 12.5px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mc-plan-card {
  background: #f7f8fb;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
}
.mc-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.mc-plan-label { font-size: 13px; color: #555; }
.mc-plan-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fdf1d6;
  color: #a66a00;
}
.mc-plan-badge.mc-badge-active { background: #dcf5e3; color: #1a7a3c; }
.mc-plan-badge.mc-badge-expired { background: #fbe1e1; color: #a3231f; }

.mc-quota-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: #555;
  margin-bottom: 5px;
}
.mc-quota-num { font-weight: 700; color: #333; }
.mc-quota-bar {
  height: 7px;
  border-radius: 999px;
  background: #e3e6f0;
  overflow: hidden;
  margin-bottom: 12px;
}
.mc-quota-fill {
  height: 100%;
  background: #2f6fed;
  border-radius: 999px;
  transition: width .3s ease;
}
.mc-quota-fill.mc-quota-warn { background: #e0a500; }
.mc-quota-fill.mc-quota-full { background: #d9534f; }

.mc-upgrade-btn, .mc-primary-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #2f6fed;
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.mc-upgrade-btn:hover, .mc-primary-btn:hover { background: #1f5adf; }

/* v248：加購 AI 次數按鈕——放在「升級」按鈕下面，樣式弱化一點（外框、非實心），
   避免跟主要的升級 CTA 搶視覺，只有訂閱中（有 plan）才會顯示。 */
.mc-topup-btn {
  width: 100%;
  margin-top: 8px;
  padding: 9px;
  border: 1px solid #2f6fed;
  border-radius: 8px;
  background: #fff;
  color: #2f6fed;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.mc-topup-btn:hover { background: #eef3ff; }

.mc-menu {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #eee;
  padding-top: 4px;
}
.mc-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 4px;
  background: none;
  border: none;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  text-decoration: none;
  border-radius: 6px;
}
.mc-menu-item:hover { background: #f4f5f9; }
.mc-menu-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }

.mc-signout-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 4px;
  margin-top: 6px;
  border-top: 1px solid #eee;
  background: none;
  border-left: none;
  border-right: none;
  border-bottom: none;
  font-size: 14px;
  font-weight: 700;
  color: #c0392b;
  cursor: pointer;
}
.mc-signout-btn:hover { background: #fdf2f1; }

.mc-subheader {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 14px;
}
.mc-back-btn {
  background: #f0f1f5;
  border: none;
  border-radius: 6px;
  width: 26px;
  height: 26px;
  font-size: 14px;
  cursor: pointer;
  color: #333;
}
.mc-back-btn:hover { background: #e3e5ee; }

.mc-field-label {
  display: block;
  font-size: 12.5px;
  color: #555;
  margin-bottom: 6px;
  font-weight: 700;
}
.mc-field-row { display: flex; gap: 6px; }
.mc-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
}
.mc-small-btn {
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: #1a3a6b;
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.mc-small-btn:hover { background: #234a86; }
.mc-msg { font-size: 12px; margin-top: 6px; min-height: 16px; color: #1a7a3c; }
.mc-msg.mc-msg-error { color: #c0392b; }

.mc-divider { border: none; border-top: 1px solid #eee; margin: 16px 0; }

.mc-hint { font-size: 12.5px; color: #666; margin-bottom: 8px; line-height: 1.5; }
.mc-textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 10px;
}

.mc-exams-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.mc-empty { font-size: 13px; color: #999; text-align: center; padding: 14px 0; }
.mc-exam-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid #eee;
  border-radius: 8px;
}
.mc-exam-title {
  font-size: 13px;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.mc-exam-date { font-size: 11px; color: #999; margin-top: 2px; }
.mc-exam-actions { display: flex; gap: 4px; flex-shrink: 0; }
.mc-exam-btn {
  border: none;
  background: #f0f1f5;
  border-radius: 5px;
  padding: 5px 8px;
  font-size: 12px;
  cursor: pointer;
  color: #333;
}
.mc-exam-btn:hover { background: #e3e5ee; }
.mc-exam-btn.mc-exam-del:hover { background: #fbe1e1; color: #a3231f; }

.mc-billing-row { font-size: 13px; color: #333; margin-bottom: 8px; line-height: 1.6; }
.mc-billing-note { font-size: 12px; color: #888; margin-top: 12px; line-height: 1.5; }

/* ===== 使用前小問卷 ===== */
#survey-modal {
  position: fixed;
  inset: 0;
  z-index: 4500;
  background: rgba(20,30,50,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Microsoft JhengHei", "蘋方-繁", Arial, sans-serif;
  padding: 16px;
}
#survey-box {
  background: #fff;
  border-radius: 12px;
  padding: 26px 24px;
  width: 420px;
  max-width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
#survey-box h2 {
  font-size: 17px;
  color: #1a3a6b;
  margin: 0 0 4px;
  text-align: center;
}
.survey-sub {
  font-size: 12px;
  color: #888;
  text-align: center;
  margin: 0 0 18px;
}
.survey-q { margin-bottom: 16px; }
.survey-q-title {
  font-size: 13.5px;
  color: #333;
  margin: 0 0 8px;
  font-weight: 700;
}
.survey-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.survey-opt {
  flex: 1 1 auto;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f7f7f7;
  color: #333;
  font-size: 12.5px;
  cursor: pointer;
  transition: all .15s;
}
.survey-opt:hover { background: #eef3fb; border-color: #9db8e0; }
.survey-opt.selected {
  background: #1a3a6b;
  border-color: #1a3a6b;
  color: #fff;
  font-weight: 700;
}
#survey-submit-btn {
  margin-top: 6px;
}
#survey-submit-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}
.survey-skip {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: #999;
  font-size: 12px;
  text-align: center;
  margin-top: 10px;
  cursor: pointer;
  text-decoration: underline;
}
.survey-skip:hover { color: #666; }

/* ===== v250：試用中的升級提示氣泡 ===== */
#mc-upgrade-hint {
  position: absolute;
  top: 44px;
  right: 0;
  white-space: nowrap;
  background: #e0a82e;
  color: #1a3a6b;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 8px 7px 12px;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
  display: flex;
  align-items: center;
  gap: 8px;
}
#mc-upgrade-hint .mc-hint-arrow {
  position: absolute;
  top: -11px;
  right: 11px;
  font-size: 14px;
  line-height: 1;
  color: #e0a82e;
  animation: mc-hint-bob 1.4s ease-in-out infinite;
}
#mc-upgrade-hint a { color: #1a3a6b; text-decoration: none; }
#mc-upgrade-hint a:hover { text-decoration: underline; }
#mc-upgrade-hint button {
  background: rgba(26,58,107,.15);
  border: none;
  color: #1a3a6b;
  width: 20px; height: 20px;
  border-radius: 50%;
  font-size: 14px; line-height: 1;
  cursor: pointer;
}
#mc-upgrade-hint button:hover { background: rgba(26,58,107,.3); }
@keyframes mc-hint-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media print { #mc-upgrade-hint { display: none !important; } }
