@import url('https://fonts.googleapis.com/css2?family=Ubuntu:ital,wght@0,300;0,400;0,500;0,700;1,300;1,400;1,500;1,700&display=swap');

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  text-decoration: none;
  list-style-type: none;
  border: none;
  outline: none;
  font-family: 'Ubuntu', Poppins, sans-serif;
  color: var(--text-color, #ffffff);
}

:root {
  --text-color: #ffffff;
  --text-shadow-color: rgba(0, 0, 0, 0.5);
  --icon-color: #ffffff;
  --placeholder-color: rgba(255, 255, 255, 0.8);
  --input-bg: rgba(0, 0, 0, 0.3);
  --input-border: rgba(255, 255, 255, 0.4);
  --link-color: #4fdcff;
  --accent-color: #4fdcff;
}

body.dark-mode {
  --text-color: #ffffff;
  --text-shadow-color: rgba(0, 0, 0, 0.5);
  --icon-color: #ffffff;
  --placeholder-color: rgba(255, 255, 255, 0.8);
  --input-bg: rgba(0, 0, 0, 0.3);
  --input-border: rgba(255, 255, 255, 0.4);
  --link-color: #4fdcff;
  --accent-color: #4fdcff;
}

body.light-mode {
  --text-color: #000000;
  --text-shadow-color: rgba(255, 255, 255, 0.5);
  --icon-color: #000000;
  --placeholder-color: rgba(0, 0, 0, 0.7);
  --input-bg: rgba(255, 255, 255, 0.3);
  --input-border: rgba(0, 0, 0, 0.3);
  --link-color: #0066cc;
  --accent-color: #0066cc;
}
body {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: url("https://bing.img.run/rand.php");
  background-size: cover;
  background-position: center;
}
.content {
  width: 400px;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(13px);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  padding: 30px 35px;
  opacity: 0;
  animation: slideDown 0.8s ease-out forwards;
}
.content.loaded {
  animation-delay: 0s;
}
.content h2 {
  font-size: 38px;
  font-weight: 700;
  text-align: center;
  color: #ffffff;
}
.content .input-box {
  position: relative;
  width: 100%;
  margin: 30px 0;
}

.input-warning {
  font-size: 12px;
  color: #ff6b6b;
  margin-top: 5px;
  min-height: 16px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  display: none;
  animation: fadeIn 0.3s ease;
}

.input-warning.show {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.input-wrapper {
  position: relative;
  width: 100%;
  height: 55px;
}

.input-wrapper input {
  width: 100%;
  height: 100%;
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  padding: 20px 45px 20px 45px;
  font-size: 16px;
  color: var(--text-color);
  text-shadow: 1px 1px 2px var(--text-shadow-color);
  opacity: 0.85;
}

.input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  fill: var(--icon-color);
  pointer-events: none;
  text-shadow: 1px 1px 2px var(--text-shadow-color);
}
input::placeholder {
  color: var(--placeholder-color);
  font-size: 16px;
  text-shadow: 1px 1px 2px var(--text-shadow-color);
  opacity: 0.7;
}
.input-box i {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  font-size: 20px;
  color: var(--icon-color);
  text-shadow: 1px 1px 2px var(--text-shadow-color);
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}
.input-box i:hover {
  font-size: 22px;
  opacity: 0.8;
  transform: translateY(-50%) scale(1.1);
}
.content .remember {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -16px 0 16px;
}
.remember-left{display:flex;align-items:center;gap:10px}
.remember label {
  color: var(--text-color);
  text-shadow: 1px 1px 2px var(--text-shadow-color);
}
.remember label input {
  accent-color: var(--accent-color);
  margin-right: 4px;
}

/* 使“记住我”和“我已同意”在同一视觉尺寸、并在选中时显示相同高亮色 */
.remember-text,
.terms-inline .terms-text {
  font-size: 13px;
  color: var(--text-color);
  line-height: 1;
}

/* 当记住我被勾选时，文字变为主题高亮色（使用通用兄弟选择符以避免受空白文本影响） */
.remember input:checked ~ .remember-text,
.remember input:checked + .remember-text {
  color: var(--link-color);
  font-weight:600;
}

/* 当条款复选框被勾选时，使文本与内部链接继承高亮色 */
.terms-inline input:checked ~ .terms-text,
.terms-inline input:checked + .terms-text {
  color: var(--link-color);
  font-weight:600;
}
.terms-inline .terms-text a{color:inherit;text-decoration:underline}

/* 将登录页的 .terms 样式与注册页保持一致 */
.terms {
  margin: 18px 0;
  padding: 12px 0;
}
.terms label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-color);
  text-shadow: 1px 1px 2px var(--text-shadow-color);
  line-height: 1.5;
}
.terms input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  cursor: pointer;
  accent-color: var(--accent-color);
  flex-shrink: 0;
}
.terms span {
  flex: 1;
}
.terms a {
  color: var(--link-color);
  text-decoration: none;
  transition: all 0.2s ease;
}
.terms a:hover { text-decoration: underline; }
.remember a {
  color: var(--link-color);
  text-decoration: none;
  text-shadow: 1px 1px 2px var(--text-shadow-color);
}
.remember a:hover {
  text-decoration: underline;
}

/* 横向排列登录页条款 */
.terms-inline{
  display:flex;
  align-items:center;
  gap:8px;
  margin-left:8px;
  white-space:nowrap;
}
.terms-inline .terms-text{font-size:13px;color:var(--text-color);}
.terms-inline .terms-text a{color:var(--link-color);margin-left:6px;text-decoration:underline}

/* 条款模态样式（浅/深主题兼容） */
.clause-modal{position:fixed;inset:0;display:none;align-items:center;justify-content:center;z-index:1200}
.clause-modal.open{display:flex}
.clause-modal__backdrop{position:absolute;inset:0;background:rgba(2,6,23,0.6);backdrop-filter:blur(4px)}
.clause-modal__dialog{position:relative;max-width:900px;width:92%;max-height:82vh;background:var(--modal-bg, rgba(255,255,255,1));color:var(--modal-text, #111827);border-radius:12px;overflow:hidden;box-shadow:0 12px 40px rgba(2,6,23,0.6);display:flex;flex-direction:column;font-size:14px}
.clause-modal__close{position:absolute;right:10px;top:10px;background:transparent;border:none;font-size:16px;cursor:pointer;color:inherit}
.clause-modal__body{padding:14px;overflow:auto;flex:1;max-height:70vh}
.clause-modal__content{min-height:120px}
.clause-modal__footer{padding:10px 14px;border-top:1px solid rgba(0,0,0,0.06);display:flex;gap:12px;justify-content:flex-end}

/* 更紧凑的阅读体验：限制段落宽度，细化行间距 */
.clause-modal__content p{line-height:1.6;color:var(--muted);margin-bottom:12px}
.clause-modal__content h2{margin-top:8px;margin-bottom:8px;color:var(--text)}

/* 自定义滚动条（现代浏览器） */
.clause-modal__body::-webkit-scrollbar{width:10px}
.clause-modal__body::-webkit-scrollbar-thumb{background:rgba(0,0,0,0.12);border-radius:6px}
.clause-modal__body::-webkit-scrollbar-track{background:transparent}
.clause-modal__agree.btn{background:linear-gradient(90deg,var(--accent-color, #4fdcff),var(--accent, #1fb6ff));color:#022229}
.clause-modal__cancel{background:transparent}

/* modal 在暗色模式的变量覆盖 */
body.dark-mode .clause-modal__dialog{--modal-bg: #06111a;--modal-text: #e6eef6}

/* 确保小屏幕可读 */
@media (max-width:600px){.clause-modal__dialog{width:96%;padding:0}.clause-modal__body{padding:14px}.clause-modal__footer{padding:10px}}
.btn {
  display: inline-block;
  background: var(--accent-color);
  color: var(--text-color);
  width: 100%;
  border-radius: 30px;
  font-size: 16px;
  height: 45px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  margin-bottom: 20px;
  margin-top: 16px;
  transition: all 0.3s ease;
  border: none;
  font-family: 'Ubuntu', Poppins, sans-serif;
}

.btn:hover {
  transform: scale(1.02);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.btn:active {
  transform: scale(0.98);
}

/* 社交登录 */
.social-login {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.social-title {
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 1px 1px 2px var(--text-shadow-color);
  margin-bottom: 12px;
  margin-top: 0;
}

body.light-mode .social-title {
  color: rgba(0, 0, 0, 0.6);
}

.social-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 15px;
  border-radius: 25px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-color);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  text-shadow: 1px 1px 2px var(--text-shadow-color);
  transition: all 0.3s ease;
  cursor: pointer;
  font-family: 'Ubuntu', Poppins, sans-serif;
}

.social-btn i {
  font-size: 18px;
}

.social-btn:hover {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.social-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Google登录按钮 */
.google-btn {
  border-color: rgba(220, 53, 69, 0.4);
  background: rgba(220, 53, 69, 0.05);
}

.google-btn:hover {
  background: rgba(220, 53, 69, 0.12);
  border-color: rgba(220, 53, 69, 0.6);
}

/* Outlook登录按钮 */
.outlook-btn {
  border-color: rgba(0, 120, 215, 0.4);
  background: rgba(0, 120, 215, 0.05);
}

.outlook-btn:hover {
  background: rgba(0, 120, 215, 0.12);
  border-color: rgba(0, 120, 215, 0.6);
}

body.light-mode .google-btn {
  border-color: rgba(220, 53, 69, 0.3);
  background: rgba(220, 53, 69, 0.08);
}

body.light-mode .google-btn:hover {
  background: rgba(220, 53, 69, 0.15);
  border-color: rgba(220, 53, 69, 0.5);
}

body.light-mode .outlook-btn {
  border-color: rgba(0, 120, 215, 0.3);
  background: rgba(0, 120, 215, 0.08);
}

body.light-mode .outlook-btn:hover {
  background: rgba(0, 120, 215, 0.15);
  border-color: rgba(0, 120, 215, 0.5);
}

/* 注册链接区域 */
.register-section {
  text-align: center;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.register-section p {
  margin: 0;
  font-size: 14px;
  color: var(--text-color);
  text-shadow: 1px 1px 2px var(--text-shadow-color);
}

.register-link {
  color: var(--accent-color);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  margin-left: 5px;
}

.register-link:hover {
  text-decoration: underline;
  opacity: 0.85;
  transform: translateX(2px);
}

/* 旧版本兼容 */
input[type="checkbox"] {
  display: inline-block;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

input::-ms-reveal,
input::-ms-clear {
  display: none;
}

input::-webkit-credentials-auto-fill-button,
input::-webkit-clear-button,
input::-webkit-inner-spin-button,
input::-webkit-contacts-auto-fill-button {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none;
  height: 0;
  width: 0;
  margin: 0;
  padding: 0;
}

/* 响应式 */
@media (max-width: 600px) {
  .content {
    width: 90%;
    padding: 25px 20px;
  }
  
  .content h2 {
    font-size: 28px;
  }
  
  .input-wrapper input {
    font-size: 14px;
    padding: 15px 40px 15px 40px;
  }
  
  .input-wrapper i {
    font-size: 16px;
  }
  
  .btn {
    font-size: 14px;
    height: 40px;
    margin-bottom: 15px;
  }
  
  .social-title {
    font-size: 12px;
    margin-bottom: 10px;
  }
  
  .social-buttons {
    gap: 8px;
  }
  
  .social-btn {
    font-size: 13px;
    padding: 10px 12px;
  }
  
  .social-btn i {
    font-size: 16px;
  }
  
  .register-section p {
    font-size: 13px;
  }
}
