/* 统一登录 UI — 验证码 / 密码 / 微信（仅界面层） */

.auth-box--unified {
  padding: 32px 32px 28px;
}

.auth-method-tabs {
  display: flex;
  position: relative;
  background: #f1f5f9;
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 24px;
}

.auth-method-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
  position: relative;
  z-index: 1;
}

.auth-method-tab.is-active {
  color: #0ea5e9;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.auth-panel {
  display: none;
}

.auth-panel.is-active {
  display: block;
  animation: authPanelIn 0.25s ease;
}

@keyframes authPanelIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 手机号 + 区号 */
.auth-phone-row {
  display: flex;
  gap: 8px;
}

.auth-country-select {
  flex: 0 0 88px;
  padding: 12px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  color: #334155;
  background: #f8fafc;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

.auth-country-select:focus,
.auth-phone-row input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
  background-color: #fff;
}

.auth-phone-row input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
}

.auth-otp-row input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  letter-spacing: 0.2em;
  font-variant-numeric: tabular-nums;
}

/* 验证码行 */
.auth-otp-row {
  display: flex;
  gap: 8px;
}

.auth-otp-send {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 12px 14px;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  background: #e8f8fd;
  color: #0ea5e9;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.auth-otp-send:hover:not(:disabled) {
  background: #c5ebf8;
}

.auth-otp-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  color: #94a3b8;
  border-color: #e2e8f0;
  background: #f1f5f9;
}

/* 协议勾选 */
.auth-legal {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 16px 0 4px;
  font-size: 12px;
  line-height: 1.5;
  color: #64748b;
}

.auth-legal input {
  margin-top: 3px;
  width: 15px;
  height: 15px;
  accent-color: #667eea;
  flex-shrink: 0;
  cursor: pointer;
}

.auth-legal a {
  color: #667eea;
  text-decoration: none;
}

.auth-legal a:hover {
  text-decoration: underline;
}

/* 分隔线 */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 18px;
  color: #94a3b8;
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

/* 第三方登录 */
.auth-social {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-social-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-social-row > * {
  min-width: 0;
}

.auth-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.auth-social-btn:hover:not(:disabled) {
  border-color: #cbd5e1;
  background: #f8fafc;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.auth-social-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-social-btn svg {
  flex-shrink: 0;
}

.auth-social-btn--wechat {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.auth-social-btn--wechat:hover:not(:disabled) {
  border-color: #86efac;
  background: #dcfce7;
}

.auth-social-btn--aliyun {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}

.auth-social-btn--aliyun:hover:not(:disabled) {
  border-color: #fdba74;
  background: #ffedd5;
}

/* 密码 Tab 辅助链接 */
.auth-extra-links {
  display: flex;
  justify-content: flex-end;
  margin-top: -8px;
  margin-bottom: 4px;
}

.auth-link-muted {
  font-size: 13px;
  color: #667eea;
  text-decoration: none;
}

.auth-link-muted:hover {
  text-decoration: underline;
}

/* 微信扫码弹层 */
.auth-wechat-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}

.auth-wechat-modal.is-open {
  display: flex;
  animation: authModalBg 0.2s ease;
}

@keyframes authModalBg {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.auth-wechat-dialog {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px 24px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
  animation: authModalIn 0.25s ease;
}

@keyframes authModalIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-wechat-dialog h3 {
  margin: 0 0 6px;
  text-align: center;
  font-size: 18px;
  color: #1e293b;
}

.auth-wechat-dialog p {
  margin: 0 0 20px;
  text-align: center;
  font-size: 13px;
  color: #64748b;
}

.auth-wechat-qr {
  width: 200px;
  height: 200px;
  margin: 0 auto 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.auth-wechat-qr iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.auth-wechat-qr-placeholder {
  text-align: center;
  padding: 16px;
}

.auth-wechat-qr-placeholder svg {
  display: block;
  margin: 0 auto 10px;
  opacity: 0.35;
}

.auth-wechat-qr-placeholder span {
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
}

.auth-wechat-status {
  text-align: center;
  font-size: 13px;
  color: #16a34a;
  min-height: 20px;
  margin-bottom: 12px;
}

.auth-wechat-close {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.auth-wechat-close:hover {
  background: #e2e8f0;
}

/* Toast 提示（演示用） */
.auth-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(12px);
  z-index: 1100;
  padding: 12px 20px;
  background: rgba(30, 41, 59, 0.92);
  color: #fff;
  font-size: 13px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: calc(100vw - 48px);
  text-align: center;
}

.auth-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 移动端适配 */
body.auth-page .auth-method-tabs {
  margin-bottom: 20px;
}

body.auth-page .auth-country-select {
  flex: 0 0 82px;
  font-size: 15px;
  border-color: var(--border, #e2e8f0);
}

body.auth-page .auth-phone-row input,
body.auth-page .auth-otp-row input {
  padding: 13px 14px;
  font-size: 16px;
  border-color: var(--border, #e2e8f0);
  background: #f8fafc;
}

body.auth-page .auth-phone-row input:focus,
body.auth-page .auth-otp-row input:focus {
  border-color: rgba(99, 102, 241, 0.45);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
  background: #fff;
}

body.auth-page .auth-otp-send {
  font-size: 13px;
  padding: 13px 12px;
}

body.auth-page .auth-legal {
  font-size: 11px;
}

body.auth-page .auth-wechat-dialog {
  max-width: 320px;
}

@media (max-width: 400px) {
  .auth-box--unified {
    padding: 28px 20px 24px;
  }

  .auth-otp-send {
    padding: 12px 10px;
    font-size: 12px;
  }
}
