/*
 * 公共页面样式 (login.html & register.html)
 * 商户交易撮合系统
 */

/* ===== 公共布局样式 ===== */

/* 防止页面滚动 - 针对登录和注册页面 */
body {
  overflow: hidden !important; /* 防止body滚动 */
}

/* 重置主容器样式 */
.app-main {
  min-height: 100vh !important;
  padding-bottom: 0 !important; /* 登录注册页面不需要底部导航间距 */
  max-width: none !important; /* 移除宽度限制 */
  margin: 0 !important; /* 移除居中边距 */
  background: transparent !important; /* 背景透明 */
}

/* 页面内容区域 */
#login, #register {
  min-height: 100vh; /* 确保内容区域填满视口 */
}

/* ===== 个性化标题样式 ===== */

.system-title {
  font-size: 18px; 
  font-weight: 500; /* 更粗的字体 */
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
  letter-spacing: 0.3px; /* 字母间距 */
    line-height: 1.2;
    margin-bottom: 0.2rem;
}

/* 副标题样式优化 */
.system-subtitle {
  font-size: 14px; /* 16px */
  color: #64748b; /* slate-600 */
  font-weight: 400;
  opacity: 0.8;
}

/* ===== 密码显示/隐藏功能样式 ===== */

/* 密码输入框容器 */
.relative {
  position: relative !important;
  contain: layout style !important;
  isolation: isolate !important;
  transform: translateZ(0) !important;
  -webkit-transform: translateZ(0) !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
}

/* 密码切换按钮 */
.password-toggle {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  width: 3rem !important;
  height: 100% !important;
  min-height: 48px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #94a3b8 !important; /* slate-400 灰色 */
  background: transparent !important;
  border: none !important;
  cursor: pointer;
  transition: color 0.2s ease !important;
  outline: none !important;
  z-index: 15 !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  transform: none !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  -webkit-transform: none !important;
  -moz-transform: none !important;
  -ms-transform: none !important;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
}

.password-toggle:hover {
  color: #64748b !important;
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  width: 3rem !important;
  height: 100% !important;
  transform: none !important;
  -webkit-transform: none !important;
}

.password-toggle:focus {
  color: #64748b !important;
  outline: none !important;
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  width: 3rem !important;
  height: 100% !important;
  transform: none !important;
  -webkit-transform: none !important;
}

.password-toggle:active {
  color: #64748b !important;
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  width: 3rem !important;
  height: 100% !important;
  transform: none !important;
  -webkit-transform: none !important;
}

/* 密码输入框右侧内边距已在.form-input中统一设置 */

/* 眼睛图标样式 */
.password-toggle i {
  font-size: 1.0rem !important;
  color: inherit !important;
  pointer-events: none !important;
  position: static !important;
  transform: none !important;
  -webkit-transform: none !important;
  -moz-transform: none !important;
  -ms-transform: none !important;
  margin: 0 !important;
  padding: 0 !important;
  vertical-align: baseline !important;
  line-height: 1 !important;
  display: inline-block !important;
}

/* 避免按钮在表单提交时被触发 */
.password-toggle[tabindex="-1"]:focus {
  outline: none;
}

/* ===== 移动端特定修复 ===== */

/* 移动端密码切换按钮修复 */
@media (max-width: 768px) {
  .password-toggle,
  .password-toggle:hover,
  .password-toggle:focus,
  .password-toggle:active,
  .password-toggle:visited {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 3rem !important;
    height: 100% !important;
    min-height: 48px !important;
    max-height: none !important;
    transform: none !important;
    -webkit-transform: none !important;
    -moz-transform: none !important;
    -ms-transform: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 20 !important;
    touch-action: manipulation !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
  }
  
  /* 移动端输入框样式已在.form-input中统一设置 */
  
  /* 移动端图标大小调整 */
  .password-toggle i,
  .password-toggle:hover i,
  .password-toggle:focus i,
  .password-toggle:active i {
    font-size: 1.2rem !important;
    position: static !important;
    transform: none !important;
    -webkit-transform: none !important;
    -moz-transform: none !important;
    -ms-transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: baseline !important;
    line-height: 1 !important;
    display: inline-block !important;
  }
}

/* 针对iOS Safari的特殊处理 */
@supports (-webkit-touch-callout: none) {
  .password-toggle,
  .password-toggle:hover,
  .password-toggle:focus,
  .password-toggle:active {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 3rem !important;
    height: 100% !important;
    transform: none !important;
    -webkit-transform: none !important;
    transition: color 0.2s ease !important;
  }
}

/* ===== 全局强制样式 - 防止任何位移 ===== */

/* 强制所有浏览器遵循固定位置 */
.password-toggle,
.password-toggle:hover,
.password-toggle:focus, 
.password-toggle:active,
.password-toggle:visited,
.password-toggle:link {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  left: auto !important;
  bottom: 0 !important;
  width: 3rem !important;
  height: 100% !important;
  min-height: 48px !important;
  max-height: none !important;
  transform: none !important;
  -webkit-transform: none !important;
  -moz-transform: none !important;
  -ms-transform: none !important;
  -o-transform: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: transparent !important;
  will-change: auto !important;
  transition: none !important;
  animation: none !important;
  -webkit-animation: none !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  perspective: none !important;
  -webkit-perspective: none !important;
  contain: layout style !important;
}

/* 强制图标固定 */
.password-toggle i,
.password-toggle:hover i,
.password-toggle:focus i,
.password-toggle:active i {
  transform: none !important;
  -webkit-transform: none !important;
  -moz-transform: none !important;
  -ms-transform: none !important;
  -o-transform: none !important;
  position: static !important;
  margin: 0 !important;
  padding: 0 !important;
  will-change: auto !important;
}

/* ===== QQ浏览器和移动端浏览器特殊处理 ===== */

/* QQ浏览器特殊处理 */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  .password-toggle,
  .password-toggle:hover,
  .password-toggle:focus,
  .password-toggle:active {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: 3rem !important;
    height: 100% !important;
    min-height: 48px !important;
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    will-change: auto !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    -webkit-font-smoothing: antialiased !important;
    contain: layout style !important;
    isolation: isolate !important;
  }
}

/* 移动端WebKit浏览器强化处理 */
@media screen and (max-width: 768px) and (-webkit-min-device-pixel-ratio: 1) {
  .password-toggle,
  .password-toggle:hover,
  .password-toggle:focus,
  .password-toggle:active,
  .password-toggle:visited {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: auto !important;
    width: 3rem !important;
    height: 100% !important;
    min-height: 48px !important;
    max-height: 48px !important;
    transform: translate3d(0, 0, 0) !important;
    -webkit-transform: translate3d(0, 0, 0) !important;
    will-change: auto !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    -webkit-font-smoothing: antialiased !important;
    contain: layout style !important;
    isolation: isolate !important;
    z-index: 999 !important;
  }
  
  .password-toggle i,
  .password-toggle:hover i,
  .password-toggle:focus i,
  .password-toggle:active i {
    transform: translate3d(0, 0, 0) !important;
    -webkit-transform: translate3d(0, 0, 0) !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    -webkit-font-smoothing: antialiased !important;
    contain: layout style !important;
  }
}

/* ===== 兼容性处理 ===== */

/* Safari 兼容性 */
@supports (-webkit-background-clip: text) {
  .system-title {
    -webkit-background-clip: text;
    background-clip: text; /* 标准属性 */
    -webkit-text-fill-color: transparent;
  }
}

/* 降级处理：不支持渐变文字的浏览器 */
@supports not (-webkit-background-clip: text) {
  .system-title {
    color: #667eea; /* 降级为单一颜色 */
  }
}
