/* ===== 登入 / 訂閱閘門樣式（獨立於編輯器樣式，避免互相污染） ===== */
#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: 20px;
  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;
}
#auth-loading-panel { color: #888; font-size: 13px; }

#auth-signout-floating {
  position: fixed;
  top: 8px;
  right: 12px;
  z-index: 4000;
  background: rgba(0,0,0,.55);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
}

/* ===== 使用前小問卷 ===== */
#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; }
