/* ===== Auth Modal ===== */

/* 遮罩 */
.auth-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9998;
}
.auth-overlay.show { display: block; }

/* 弹窗容器 */
.auth-modal {
  display: none;
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 12px;
  width: 420px;
  max-width: 90vw;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  overflow: hidden;
}
.auth-modal.show { display: block; }

/* 关闭按钮 */
.auth-close {
  position: absolute;
  top: 12px; right: 16px;
  background: none; border: none;
  font-size: 24px; color: #999;
  cursor: pointer; z-index: 1;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}
.auth-close:hover { background: #f0f0f0; color: #333; }

/* Tab 栏 */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid #eee;
  padding: 0 24px;
}
.auth-tab {
  flex: 1;
  padding: 16px 0;
  text-align: center;
  font-size: 16px;
  color: #999;
  cursor: pointer;
  border: none; background: none;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.auth-tab.active {
  color: #333;
  font-weight: bold;
  border-bottom-color: #DC0000;
}

/* Tab 内容 */
.auth-panel { display: none; padding: 24px; }
.auth-panel.active { display: block; }

/* 表单项 */
.auth-field { margin-bottom: 16px; position: relative; }

.auth-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #f9f9f9;
  overflow: hidden;
  transition: border-color 0.2s;
}
.auth-input-wrap:focus-within {
  border-color: #DC0000;
  background: #fff;
}

.auth-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #999;
}
.auth-icon svg { width: 20px; height: 20px; }

.auth-input {
  flex: 1;
  border: none; outline: none; background: none;
  font-size: 14px; color: #333;
  padding: 12px 12px 12px 0;
  height: 44px; box-sizing: border-box;
}
.auth-input::placeholder { color: #bbb; }

/* 密码可见切换 */
.auth-eye {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  color: #bbb;
  background: none; border: none;
}
.auth-eye:hover { color: #666; }
.auth-eye svg { width: 20px; height: 20px; }

/* 验证码行 */
.auth-code-row {
  display: flex; gap: 12px;
}
.auth-code-row .auth-input-wrap { flex: 1; }

.auth-code-btn {
  flex-shrink: 0;
  padding: 0 16px;
  height: 44px;
  border: 1px solid #DC0000;
  border-radius: 8px;
  background: #fff;
  color: #DC0000;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, opacity 0.2s;
}
.auth-code-btn:hover { background: #FFF5F5; }
.auth-code-btn:disabled {
  border-color: #ddd; color: #999;
  cursor: not-allowed; background: #f5f5f5;
}

/* 错误提示 */
.auth-error {
  font-size: 12px; color: #DC0000;
  margin-top: 4px; padding-left: 44px;
  min-height: 16px;
  visibility: hidden;
}
.auth-error.show { visibility: visible; }

/* 提交按钮 */
.auth-submit {
  width: 100%;
  height: 44px;
  border: none; border-radius: 8px;
  background: #DC0000;
  color: #fff;
  font-size: 16px; font-weight: bold;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.auth-submit:hover { opacity: 0.9; }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* loading spinner */
.auth-spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.6s linear infinite;
}
.auth-submit.loading .auth-spinner { display: inline-block; }

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

/* 提示文字 */
.auth-hint {
  text-align: center;
  font-size: 13px; color: #999;
  margin-top: 16px;
}

/* Toast 消息 */
.auth-toast {
  display: none;
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  z-index: 10000;
  max-width: 80vw;
  text-align: center;
}
.auth-toast.show { display: block; }

/* ===== 响应式 ===== */
@media (max-width: 480px) {
  .auth-modal { width: 90vw; border-radius: 12px; }
  .auth-tabs { padding: 0 16px; }
  .auth-panel { padding: 20px 16px; }
  .auth-tab { font-size: 15px; padding: 14px 0; }
}
