html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  font-family: "Segoe UI","Lucida Grande","Helvetica","Arial","Microsoft YaHei","FreeSans","Arimo","Droid Sans","Hiragino Sans GB","Hiragino Sans GB W3",sans-serif;
  background-color: #f0f2f5; /* 防止背景圖未加載時留白 */
}

html input,
body input,
select {
  caret-color: auto;
  outline: none;
}

html .register,
body .register {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background-image: url("./theme/default/registerbg.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

/* 容器 */
html .register-container,
body .register-container {
  position: relative;
  width: 1000px;
  max-width: 90%;
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.3);
  padding: 40px 65px;
  box-sizing: border-box;
  color: #666;
}

.register-form {
  width: 100%;
}

/* 分段標題樣式 */
.reg-section-title {
  width: 100%;
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: normal;
  padding-bottom: 8px;
  margin: 25px 0 15px 0;
}

.reg-section-title.title-icon>span {
  line-height: 21px;
  font-size: 14px;
  margin-left: 30px;
}

.reg-section-title.title-icon::before {
  content: '';
  display: inline-block;
  position: absolute;
  background-image: url("./theme/default/icon-sprite-desktop.svg?v=2");
}

.reg-section-title.title-icon.icon-login::before {
  width: 23px;
  height: 20px;
  background-position: -117px -1px;
}

.reg-section-title.title-icon.icon-safe::before {
  width: 22px;
  height: 20px;
  background-position: -139px 0;
}

.reg-section-title.title-icon.icon-option::before {
  width: 21px;
  height: 21px;
  background-position: -60px -41px;
  border-radius: 8px;
}

.reg-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #888;
  margin-left: 15px;
}

/* 表單行佈局 */
.form-row {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
  transform: translateX(-50px);
}

@media (max-width: 428px){
  .form-row{ transform: none; }
}

.form-label {
  width: 90px;
  text-align: right;
  margin-right: 20px;
  font-size: 12px;
  font-weight: bold;
}

.form-label span {
  color: #ff4d4f;
  margin-left: 2px;
}

.form-input-case {
  flex: 1;
  position: relative;
}

.form-input-case input,
.form-input-case select {
  width: 100%;
  height: 42px;
  border: #d9d9d9 1px solid;
  border-radius: 4px;
  padding: 0 12px;
  transition: all 0.3s;
  outline: none;
  box-sizing: border-box;
  font-size: 14px;
  color: #555;
}

.form-input-case input:focus,
.form-input-case select:focus {
  color: #333;
  border-color: #00764a;
  box-shadow: 0 0 8px rgba(0, 118, 74, 0.2);
}

.form-input-case select.has-value,
.form-input-case input:not(:placeholder-shown) {
  color: #555;
}

/* 按鈕樣式 */
.btn-group {
  margin-top: 35px;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 330px;
  margin-left: auto;
  margin-right: auto;
}

.btn {
  width: 100%;
  max-width: 100%;
  height: 45px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 12px;
  transition: 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-join {
  background: linear-gradient(to bottom, #00764a 0, #005636 100%) top repeat-x;
  color: #fff;
}

.btn-login{
  background: linear-gradient(to bottom, #00764a 0, #005636 100%) top repeat-x;
  color: #fff;
}

.btn-secondary {
  background-color: #f5f5f5;
  color: #666;
  border: 1px solid #d9d9d9;
}

.btn-verification {
  background-color: #f5f5f5;
  color: #666;
  border: 1px solid #888;
}

.phone-group .phonenumber {
  width: 180px;
}

@media (max-width: 767px) and (min-width: 429px) {
  .sms-group {
    flex-direction: column;
  }
  
  .sms-group input {
    padding: 12px 8px;
  }
  
  .sms-group .btn-verification {
    width: 100% !important; /* 按鈕滿寬 */
    padding: 6px;
  }
  .phone-group{
    flex-direction: column;
  }
  .phone-group .areacode{
    width: 100%;
    padding: 6px;
  }
  .phone-group .phonenumber{
    width: 100% ;
    padding: 6px;
  }
}

.btn:hover { opacity: 0.85; }

.btn-join:hover {
  color: #fee819;
  background: linear-gradient(to bottom, #008a57 0, #006640 100%);
  box-shadow: 0 2px 8px rgba(0, 118, 74, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: #ededed;
  border-color: #bcbcbc;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-verification:hover {
  background-color: #ededed;
  border-color: #bcbcbc;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-join:active, .btn-secondary:active {
  transform: translateY(1px);
}

/* 同意條款 */
.agreement-row {
  font-size: 13px;
  text-align: center;
  margin: 20px 0;
}
.agreement-row a {
  color: #06855f;
  text-decoration: none;
}

/* 彈出視窗 Modal 樣式 */
.modal-overlay {
  display: none; /* 預設隱藏 */
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: #fff;
  width: 100%;
  height: 600px;
  max-width: 650px;
  max-height: 80vh;
  border-radius: 3px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 15px;
  background: #06815d;
  border-bottom: 1px solid #eee;
  text-align: center;
  color: #fff;
}

.modal-body {
  padding: 20px;
  max-height: 65vh;
  overflow-y: auto;
  overflow-x: hidden;
  /* 強制換行設定 */
  word-break: break-all;
  word-wrap: break-word;
  white-space: normal;
  line-height: 1.6;
  text-align: justify;
}

/* 確保 API 回傳的所有子元素都不會超出寬度 */
.modal-body * {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.modal-footer {
  padding: 10px;
  background: #f8f8f8;
  border-top: 1px solid #dfdfdf;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.btn-agree {
  background: linear-gradient(to bottom, #00d2b4 0%, #00b396 100%);
  font-size: 18px;
  color: #fff; border: none;
  padding: 10px 30px;
  flex: 0 0 30%;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 10px;
}

.btn-agree:hover {
  opacity: 0.9;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.btn-disagree {
  position: absolute;
  right: 30px;
  background: #0000;
  font-size: 14px;
  color: #333;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.1);
}

/* 註冊頁驗證碼 */
.captcha-inline .captchaInput {
  width: 100%;
  height: 44px;
  border: 1px solid #e6e8eb;
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
  padding-right: 100px; /* 驗證碼圖片放置的位置 */
  font-size: 14px;
  color: #555;
  box-shadow: none;
  box-sizing: border-box;
}
.captcha-inline .captchaInput:focus {
  border: #009dff 1px solid;
  box-shadow: 0 0 4px -1px #3da2e0;
}

.captcha-inline #defaultCaptcha{
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  height: 32px;
  cursor: pointer;
}

@media (max-width: 428px){
  .captcha-inline {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  
  .captcha-inline .captchaInput {
    border-radius: unset;
    background-color: rgba(255,255,255,0.9);
  }
}


/* 手機版響應式 */
@media (max-width: 428px) {
  html .login, body .login {
    background: #fff;
    align-items: flex-start;
    padding-top: 0;
  }
  
  html .register-container, body .register-container {
    width: 100%;
    max-width: 100%;
    box-shadow: none;
    padding: 20px;
    border-radius: 0;
    color: #666;
  }
  
  .form-row {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .form-label {
    text-align: left;
    width: 100%;
    margin-bottom: 5px;
    font-weight: bold;
  }
  
  .form-input-case {
    width: 100%;
  }
}

/* 錯誤提示字樣式 */
.error-msg {
  color: #ff4d4f;
  font-size: 12px;
  margin-top: 4px;
  display: none; /* 預設隱藏 */
}

/* 輸入框報錯時的邊框顏色 */
.input-error {
  border-color: #ff4d4f !important;
}

/* 登入區 */

html .login,
body .login {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;     /* 429+ 置中 */
  padding: 24px 0;
  background: url("./theme/default/registerbg.jpg") center/cover fixed no-repeat;
}

@media (max-width: 428px) {
  html .login, body .login {
    background: #fff;
    align-items: flex-start;
    padding-top: 0;
  }
  
  html .login-container, body .login-container {
    width: 100%;
    max-width: 100%;
    box-shadow: none;
    padding: 20px;
    border-radius: 0;
    color: #666;
  }
  
  .form-row-login {
    align-items: flex-start;
  }
  
  .form-label {
    text-align: left;
    width: 100%;
    margin-bottom: 5px;
    font-weight: bold;
  }
  
  .form-input-case {
    width: 100%;
  }
}

.form-row-login {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* 預設隱藏 */
.captcha-row { display: none; }

/* 需要顯示時 */
.captcha-row.is-open { display: flex; }

@media (max-width: 767px) and (min-width: 429px) {
  .captcha-row.is-open{ display: flex; }
}


html .login-container.login-panel,
body .login-container.login-panel{
  width: min(500px, 90%);
  border-radius: 8px;
  background-color: rgba(255, 255, 255, 0.3);
  padding: 40px 65px;
  box-sizing: border-box;
  color: #666;
}

html .login-container .input-block .input-case,
body .login-container .input-block .input-case {
  width: 82%;
  border-bottom: 1px rgba(255, 255, 255, 0.4) solid;
  height: 6vh;
}

html .login-container .input-block .password,
body .login-container .input-block .password {
  position: relative;
}
.login-login {
  font-size: 25px;
  text-align: center;
  margin-bottom: 15px;
}

.login-form {
  width: 100%;
}
/* ===== Login input layout ===== */

/* 針對login的兩列input做樣式 */
.login .login-style .form-row-login[data-name="username"],
.login .login-style .form-row-login[data-name="password"]{
  max-width: 330px;            /* 控制整列最大寬度 */
  width: 100%;
  margin: 0px auto 14px;         /* 置中 + 間距 */
  display: flex;
  align-items: center;
  gap: 10px;                   /* icon跟input的距離 */
  transform: none !important;
}

/* 左邊icon的尺寸與顏色 */
.login .login-style .form-row-login > i{
  width: 34px;                 /* 固定icon欄寬 */
  min-width: 34px;
  text-align: center;
  font-size: 18px;
  color: #9aa0a6;
}

/* input外層撐滿 */
.login .login-style .form-input-case{
  flex: 1;
  position: relative;
}

/* 輸入框外觀：白底、圓角、細邊框 */
.login .login-style .form-input-case input{
  width: 100%;
  height: 44px;
  border: 1px solid #e6e8eb;
  border-radius: 6px;
  background: #fff;
  padding: 0 14px;
  font-size: 14px;
  color: #555;
  box-shadow: none;
}

.login .login-style .form-input-case input:focus{
  border-color: #3aa978;
  box-shadow: 0 0 0 3px rgba(58,169,120,.15);
}

/* 密碼眼睛icon會擋到文字 */
.login .login-style .form-input-case.password input.passwordInput{
  padding-right: 46px;
}

/* 眼睛icon的位置 */
.login .login-style .form-input-case.password label{
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa0a6;
}

.login .login-style .error-msg{
  margin-top: 6px;
}

@media (max-width: 428px){
  .login .login-style .form-row-login[data-name="username"],
  .login .login-style .form-row-login[data-name="password"]{
    gap: 10px;
  }
}

/* 驗證碼列：預設隱藏*/
.login #captcha.form-row-login.captcha-row{
  position: relative;
  display: none;
  align-items: center;
  gap: 10px;
  
  width: 100%;
  max-width: 330px;
  margin: 0 auto 14px;
  
  height: auto; /* 由内部input控制高度 */
  border-bottom: 0;
}

.login #captcha.form-row-login.captcha-row.is-open{
  display: flex;
}

.login #captcha.form-row-login.captcha-row[style*="display: block"]{
  display: flex !important;
}

.login #captcha.form-row-login.captcha-row > i{
  width: 34px;
  min-width: 34px;
  text-align: center;
  font-size: 18px;
  color: #9aa0a6;
}

.login #captcha.form-row-login.captcha-row .form-input-case{
  position: relative;
  flex: 1;
}

.login #captcha.form-row-login.captcha-row .form-input-case input.captchaInput{
  width: 100%;
  height: 44px;
  border: 1px solid #e6e8eb;
  border-radius: 6px;
  background: #fff;
  padding: 0 40px;
  padding-right: 110px; /* 驗證碼圖片放置的位置 */
  font-size: 14px;
  color: #555;
  box-shadow: none;
  box-sizing: border-box;
}

.login #captcha.form-row-login.captcha-row .form-input-case input.captchaInput:focus{
  border: #009dff 1px solid;
  box-shadow: 0 0 4px -1px #3da2e0;
}

/* 驗證碼圖片放右邊 */
.login #captcha.form-row-login.captcha-row .form-input-case #defaultCaptcha{
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  height: 32px;
  cursor: pointer;
}

@media (max-width: 428px){
  .login #captcha.form-row-login.captcha-row{
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  .login #captcha.form-row-login.captcha-row .form-input-case input.captchaInput{
    border-radius: unset;
    background-color: rgba(255,255,255,0.9);
  }
}

/* 讓每一列可定位 */
.login .login-style .form-row-login{
  position: relative;
}

/* 把FontAwesome轉出來的svg定位到input內 */
.login .login-style .form-row-login > svg.svg-inline--fa,
.login .login-style .form-row-login > i{
  position: absolute;
  left: 14px ;
  top: 50% ;
  transform: translateY(-50%) ;
  z-index: 2 ;
  color: #9aa0a6 ;
  pointer-events: none ;
  
  width: 16px ;
  height: 16px ;
  min-width: 0 ;
  margin: 0 ;
}

/* input左側挪出空間給icon */
.login .login-style .form-row-login .form-input-case input{
  padding-left: 42px ;
}

.login .login-style .form-row-login[data-name="password"] .form-input-case input.passwordInput{
  padding-right: 46px;
}

/* 驗證碼右側圖片 */
.login .login-style #captcha.form-row-login .form-input-case input.captchaInput{
  padding-right: 110px;
}
.login .login-style .form-row-login{
  gap: 0;
}

.captcha-inline{
  display:flex;
  gap:8px;
  align-items:center;
  position: relative;
}

.captcha-img-box{
  width:100px;
  height:40px;
  background:#eee;
  border-radius:4px;
  overflow:hidden;
  flex: 0 0 100px;
}

.captcha-img-box img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  cursor:pointer;
}

/* Toast */

html #dialog,
body #dialog {
  padding: 20px 50px 20px 50px;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  font-size: 14px;
}

html .ui-widget.ui-widget-content,
body .ui-widget.ui-widget-content {
  border: none;
}

html .ui-widget-header,
body .ui-widget-header {
  background-color: #fff;
}

@media (max-width: 428px) {
  html .ui-widget-header,
  body .ui-widget-header {
    color: white;
    border: 1px 0, 0, 0, 0.377 solid;
    background-color: rgba(0, 0, 0, 0);
  }
}

html .ui-dialog,
body .ui-dialog {
  -webkit-box-shadow: 1px 1px 10px 0px #00000062;
  box-shadow: 1px 1px 10px 0px #00000062;
}

@media (max-width: 428px) {
  html .ui-dialog,
  body .ui-dialog {
    border: none;
    background-color: rgba(0, 0, 0, 0.377);
  }
}

html .ui-dialog .ui-dialog-titlebar,
body .ui-dialog .ui-dialog-titlebar {
  position: relative;
  padding: 10px 50px 10px;
  border: unset;
  font-size: 14px;
  font-weight: 600;
}

html .ui-dialog .ui-dialog-titlebar svg,
body .ui-dialog .ui-dialog-titlebar svg {
  color: #faad14;
  top: 13px;
  left: 20px;
  position: absolute;
}

html .ui-widget-content,
body .ui-widget-content {
  display: none ;
}

html .ui-dialog-titlebar-close,
body .ui-dialog-titlebar-close {
  display: none;
}

html .ui-dialog-content,
body .ui-dialog-content {
  display: none !important;
}

html .ui-dialog-buttonpane,
body .ui-dialog-buttonpane {
  display: none;
  margin-top: 0 !important;
}