/* 登录/注册页样式 */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #d9dee3;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-bg {
  width: 100%; min-height: 100vh;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background-image: url('../images/bg.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}
.auth-card {
  width: 380px;
  background: rgba(255, 255, 255, 0.42);
  border-radius: 16px;
  padding: 38px 34px 30px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  box-shadow: 0 18px 50px rgba(0, 60, 120, .25);
  border: 1px solid rgba(255, 255, 255, 0.55);
}
.brand { text-align: center; margin-bottom: 22px; }
.logo {
  width: 60px; height: 60px; line-height: 60px; margin: 0 auto 12px;
  background: var(--brand, #12b7f5); color: #fff; border-radius: 14px;
  font-weight: 800; font-size: 26px; letter-spacing: 1px;
  box-shadow: 0 6px 18px rgba(18,183,245,.45);
}
.brand h1 { margin: 0 0 4px; font-size: 22px; color: #1a1a1a; }
.brand p { margin: 0; font-size: 12px; color: #9aa3ad; }
form { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
form input {
  height: 46px; padding: 0 14px; font-size: 15px;
  border: 1px solid #e1e6eb; border-radius: 10px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
form input:focus { border-color: var(--brand, #12b7f5); box-shadow: 0 0 0 3px rgba(18,183,245,.15); }
form button {
  height: 46px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--brand, #12b7f5); color: #fff; font-size: 16px; font-weight: 600;
  letter-spacing: 4px; transition: filter .2s;
}
form button:hover { filter: brightness(0.92); }
.foot a { color: var(--brand, #12b7f5); }
.pwd-wrap { position: relative; }
.pwd-wrap input { width: 100%; padding-right: 38px; }
.pwd-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  cursor: pointer; color: #9aa3ad; user-select: none; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.pwd-eye svg { display: inline-block; vertical-align: middle; }
.login-options {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; margin-top: -2px;
}
.login-check { display: flex; align-items: center; gap: 6px; color: #5a616b; cursor: pointer; }
.login-check input { width: 14px; height: 14px; margin: 0; cursor: pointer; }
.forgot-link { color: var(--brand, #12b7f5); text-decoration: none; }
.alert {
  background: #fdecec; color: #c0392b; border: 1px solid #f5c2c2;
  padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 14px;
}
.alert.ok { background: #eafaf1; color: #1e8e4e; border-color: #b8eccb; }
.foot { text-align: center; margin-top: 18px; font-size: 13px; color: #9aa3ad; }
.foot a { color: var(--brand, #12b7f5); text-decoration: none; }
.foot span { margin: 0 8px; }

.avatar-upload {
  position: relative;
  width: 100px; height: 100px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.72);
  overflow: visible;
  box-shadow: 0 4px 18px rgba(0,0,0,.1);
  cursor: pointer;
  flex-shrink: 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.5);
}
.avatar-inner {
  position: absolute; inset: 0;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
}
.avatar-preview {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  max-width: 100%; max-height: 100%;
}
.avatar-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: #a0a6ad;
}
.avatar-placeholder svg { display: block; stroke: currentColor; }
.avatar-camera {
  display: none;
}
.avatar-camera svg { display: block; stroke: currentColor; }
.avatar-upload:hover .avatar-preview { opacity: .95; }

/* 头像裁剪弹窗 */
.crop-mask {
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.6);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.crop-mask.active {
  display: flex;
  animation: cropFadeIn .2s ease;
}
@keyframes cropFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.crop-box {
  width: 100%; max-width: 460px;
  background: #fff; border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
  display: flex; flex-direction: column;
  animation: cropBoxIn .25s ease;
}
@keyframes cropBoxIn {
  from { transform: scale(.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.crop-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #f0f1f3;
  background: #fff;
}
.crop-head span { font-size: 17px; font-weight: 600; color: #1a1a1a; }
.crop-head button {
  background: none; border: 0; color: #9aa3ad; font-size: 20px; cursor: pointer; line-height: 1;
  padding: 4px; margin: -4px;
}
.crop-stage {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  background: #111;
  overflow: hidden;
  touch-action: none;
}
.crop-img {
  position: absolute;
  top: 0; left: 0;
  transform-origin: center center;
  user-select: none; -webkit-user-select: none;
  touch-action: none; pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}
.crop-img.loaded { opacity: 1; }
.crop-circle {
  position: absolute; top: 50%; left: 50%;
  width: 70%;
  height: 0;
  padding-bottom: 70%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.5);
  pointer-events: none;
}
.crop-loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; letter-spacing: 1px;
  pointer-events: none;
}
.crop-foot {
  padding: 16px 18px 20px;
  display: flex; flex-direction: column; gap: 14px;
  background: #fff;
}
.crop-zoom {
  display: flex; align-items: center; gap: 12px;
  color: #5a616b; font-size: 14px;
  padding: 0 6px;
}
.crop-zoom input[type=range] {
  flex: 1; height: 4px; border-radius: 2px;
  -webkit-appearance: none; appearance: none;
  background: #e1e6eb; outline: none;
}
.crop-zoom input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--brand, #12b7f5); cursor: pointer;
  box-shadow: 0 2px 6px rgba(18,183,245,.35);
}
.crop-actions {
  display: flex; gap: 12px;
}
.crop-actions button {
  flex: 1; height: 44px; border-radius: 10px; border: 0;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: filter .15s;
}
.crop-actions .crop-cancel { background: #f5f6f7; color: #5a616b; }
.crop-actions .crop-save { background: var(--brand, #12b7f5); color: #fff; }
.crop-actions button:active { filter: brightness(.92); }
.crop-tip {
  text-align: center; font-size: 12px; color: #9aa3ad; margin-top: 2px;
}
.crop-gif-hint {
  display: none; padding: 12px 18px; background: #fff9e6; color: #8a6d0b;
  font-size: 13px; text-align: center; border-bottom: 1px solid #f0e6c0;
}
.crop-gif-hint.active { display: block; }

@media (max-width: 480px) {
  .crop-mask { padding: 16px; align-items: flex-end; }
  .crop-box {
    width: 100%;
    max-width: 360px;
    max-height: calc(100vh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    border-radius: 16px;
  }
  .crop-head { padding: 14px 16px; }
  .crop-foot { padding: 14px 16px 18px; }
}
