/* ============================================================
   点点工具 - 共用登录组件样式 login.css
   渐变玻璃风 v=3：胶囊Tab + 头像 + 蓝色主题 + 注册/忘记密码
   类名与login.js生成的HTML一致（.login-modal-*）
   ============================================================ */

/* ---------- 遮罩层 ---------- */
.login-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}
.login-modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* ---------- 弹窗主体 ---------- */
.login-modal {
  width: 380px;
  max-width: 92vw;
  max-height: 88vh;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
  border: 1px solid rgba(255,255,255,0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(16px);
  transition: transform 0.2s ease;
  position: relative;
}
.login-modal-overlay.show .login-modal {
  transform: translateY(0);
}

/* ---------- 关闭按钮 ---------- */
.login-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  font-size: 20px;
  color: #86909c;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
  z-index: 2;
}
.login-modal-close:hover {
  background: #f5f5f5;
  color: #1d2129;
}

/* ---------- 头部 - 头像+标题 ---------- */
.login-modal-head {
  padding: 24px 24px 0;
  text-align: center;
  flex-shrink: 0;
}
.login-modal-avatar {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  background: #1677ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 15px rgba(22,119,255,0.3);
}
.login-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #1d2129;
}

/* ---------- Tab切换 - 胶囊样式 ---------- */
.login-modal-tabs {
  display: flex;
  margin: 18px 24px 0;
  background: #f0f1f5;
  border-radius: 10px;
  padding: 3px;
  flex-shrink: 0;
}
.login-modal-tab {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #86909c;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}
.login-modal-tab.active {
  background: #fff;
  color: #1677ff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ---------- 内容区 ---------- */
.login-modal-body {
  padding: 18px 24px 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 240px;
}
.login-modal-pane {
  display: none;
}
.login-modal-pane.active {
  display: block;
  animation: loginFadeIn 0.2s ease;
}
@keyframes loginFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 表单字段 ---------- */
.login-modal-field {
  margin-bottom: 14px;
}
.login-modal-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #4e5969;
  margin-bottom: 6px;
}
.login-modal-input,
.login-modal-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #e5e6eb;
  border-radius: 10px;
  font-size: 14px;
  color: #1d2129;
  background: rgba(255,255,255,0.8);
  box-sizing: border-box;
  outline: none;
  transition: all 0.2s;
  font-family: inherit;
}
.login-modal-input:focus,
.login-modal-textarea:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 3px rgba(22,119,255,0.15);
}
.login-modal-textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.6;
}
.login-modal-input::placeholder,
.login-modal-textarea::placeholder {
  color: #c9cdd4;
  white-space: pre-line;
}

/* ---------- 验证码行 ---------- */
.login-modal-captcha-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.login-modal-captcha-row .login-modal-input {
  flex: 1;
  min-width: 0;
}
/* 【2026-10-09】手写体验证码原图 210x76（手写体 + 连笔粘连）。
   这里只写高度、宽度 auto：写死宽高会把原图拉伸/压扁（之前"看不清"有一半是显示造成的）。 */
.login-modal-captcha-img {
  height: 64px;
  width: auto;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid #e5e6eb;
  cursor: pointer;
  object-fit: contain;
  flex-shrink: 0;
  background: #fff;
}

/* ---------- 记住我 ---------- */
.login-modal-remember {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #86909c;
  cursor: pointer;
  user-select: none;
}
.login-modal-remember input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: #1677ff;
  cursor: pointer;
}
.login-modal-remember label {
  cursor: pointer;
}

/* ---------- 按钮 ---------- */
.login-modal-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.login-modal-btn:active {
  opacity: 0.8;
}
.login-modal-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.login-modal-btn-primary {
  background: #1677ff;
  color: #fff;
}
.login-modal-btn-primary:hover:not(:disabled) {
  opacity: 0.9;
}

/* ---------- 提示 ---------- */
.login-modal-hint {
  margin-top: 12px;
  font-size: 12px;
  color: #86909c;
  text-align: center;
  line-height: 1.5;
}

/* ---------- 注册/忘记密码链接 ---------- */
.login-modal-links {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 13px;
}
.login-modal-link {
  color: #1677ff;
  text-decoration: none;
  cursor: pointer;
}
.login-modal-link:hover {
  text-decoration: underline;
}

/* ============================================================
   夜间模式
   ============================================================ */
body.dark .login-modal {
  background: rgba(30,41,59,0.95);
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}
body.dark .login-modal-overlay {
  background: rgba(0, 0, 0, 0.55);
}
body.dark .login-modal-close {
  color: #64748b;
}
body.dark .login-modal-close:hover {
  background: #2a3a4f;
  color: #f1f5f9;
}
body.dark .login-modal-title {
  color: #f1f5f9;
}
body.dark .login-modal-tabs {
  background: #1a2332;
}
body.dark .login-modal-tab {
  color: #94a3b8;
}
body.dark .login-modal-tab.active {
  background: #1e293b;
  color: #60a5fa;
}
body.dark .login-modal-input,
body.dark .login-modal-textarea {
  background: rgba(26,35,50,0.8);
  border-color: #475569;
  color: #f1f5f9;
}
body.dark .login-modal-input:focus,
body.dark .login-modal-textarea:focus {
  border-color: #60a5fa;
}
body.dark .login-modal-input::placeholder,
body.dark .login-modal-textarea::placeholder {
  color: #64748b;
}
body.dark .login-modal-label {
  color: #cbd5e1;
}
body.dark .login-modal-remember {
  color: #94a3b8;
}
body.dark .login-modal-hint {
  color: #64748b;
}
body.dark .login-modal-captcha-img {
  border-color: #475569;
}
body.dark .login-modal-link {
  color: #60a5fa;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 480px) {
  .login-modal {
    width: 94vw;
    border-radius: 16px;
  }
  .login-modal-head {
    padding: 20px 18px 0;
  }
  .login-modal-tabs {
    margin: 14px 18px 0;
  }
  .login-modal-body {
    padding: 14px 18px 20px;
    min-height: 220px;
  }
}
