/**
 * 文件: css/auth.css (用户认证)
 * 说明: 登录/注册弹窗、导航入口、用户下拉菜单样式，沿用宣纸底色与朱砂主色
 */

.x6r-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(51, 48, 46, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 16px;
}

.x6r-auth-overlay[hidden] {
  display: none;
}

.x6r-auth-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: var(--bg-color, #f9f5ea);
  border: 1px solid rgba(135, 45, 45, 0.25);
  border-radius: 12px;
  padding: 28px 24px 24px;
  box-shadow: 0 12px 40px rgba(51, 48, 46, 0.25);
}

.x6r-auth-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-color, #33302e);
  opacity: 0.6;
  cursor: pointer;
}

.x6r-auth-title {
  margin: 0 0 16px;
  font-size: 20px;
  color: var(--primary-color, #872d2d);
  text-align: center;
  letter-spacing: 4px;
}

.x6r-auth-msg {
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
}

.x6r-auth-msg.is-error {
  background: rgba(180, 66, 48, 0.1);
  color: #b44230;
  border: 1px solid rgba(180, 66, 48, 0.3);
}

.x6r-auth-msg.is-ok {
  background: rgba(104, 142, 38, 0.1);
  color: #688e26;
  border: 1px solid rgba(104, 142, 38, 0.3);
}

.x6r-auth-view input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(51, 48, 46, 0.25);
  border-radius: 8px;
  background: #fff;
  color: var(--text-color, #33302e);
  font-size: 14px;
}

.x6r-auth-view input:focus {
  outline: none;
  border-color: var(--primary-color, #872d2d);
  box-shadow: 0 0 0 2px rgba(135, 45, 45, 0.12);
}

.x6r-auth-code-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.x6r-auth-code-row input {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
}

.x6r-auth-code-btn {
  flex: 0 0 auto;
  width: auto;
  padding: 0 12px;
  border: 1px solid var(--primary-color, #872d2d);
  border-radius: 8px;
  background: transparent;
  color: var(--primary-color, #872d2d);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.x6r-auth-code-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.x6r-auth-submit {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 8px;
  background: var(--button-bg, #872d2d);
  color: #fff;
  font-size: 15px;
  letter-spacing: 2px;
  cursor: pointer;
}

.x6r-auth-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.x6r-auth-links {
  display: flex;
  justify-content: space-between;
  margin: 14px 0 0;
  font-size: 13px;
}

.x6r-auth-links a {
  color: var(--primary-color, #872d2d);
  cursor: pointer;
  text-decoration: none;
}

.x6r-auth-links a:hover {
  text-decoration: underline;
}

/* 导航入口 */
.x6r-auth-nav {
  position: relative;
  display: flex;
  align-items: center;
  list-style: none;
}

.x6r-auth-nav-btn {
  padding: 8px 16px;
  border: 1px solid var(--primary-color, #872d2d);
  border-radius: 20px;
  background: transparent;
  color: var(--primary-color, #872d2d);
  font-size: 14px;
  cursor: pointer;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.x6r-auth-nav-btn:hover {
  background: var(--primary-color, #872d2d);
  color: #fff;
}

.x6r-auth-dropdown {
  /* 用 fixed 摆脱 .menu-bar 的 overflow:hidden 裁剪，位置由 JS 按按钮坐标计算 */
  position: fixed;
  min-width: 140px;
  background: var(--bg-color, #f9f5ea);
  border: 1px solid rgba(135, 45, 45, 0.25);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(51, 48, 46, 0.18);
  overflow: hidden;
  z-index: 10001;
}

.x6r-auth-dropdown button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: none;
  color: var(--text-color, #33302e);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.x6r-auth-dropdown button:hover {
  background: var(--secondary-color, #f3ecd8);
  color: var(--primary-color, #872d2d);
}

.x6r-auth-nav-mobile .x6r-auth-logout {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  opacity: 0.75;
}

/* 抵消站点全局 button 样式（margin/ripple/hover位移）对认证组件的干扰 */
.x6r-auth-card button,
.x6r-auth-nav button,
.x6r-auth-dropdown button {
  margin: 0;
}

.x6r-auth-card button:hover,
.x6r-auth-nav-btn:hover,
.x6r-auth-dropdown button:hover {
  transform: none;
  box-shadow: none;
}

.x6r-auth-card button::after,
.x6r-auth-nav-btn::after,
.x6r-auth-dropdown button::after {
  display: none;
}

.x6r-auth-submit:hover {
  background-color: var(--button-bg, #872d2d);
  opacity: 0.92;
}

.x6r-auth-code-btn:hover {
  background-color: rgba(135, 45, 45, 0.08);
}

.x6r-auth-close:hover {
  background: none;
  opacity: 1;
}

/* 注册密码实时提示 */
.x6r-pwd-hint {
  margin: -6px 0 10px;
  font-size: 12px;
  line-height: 1.5;
  padding: 0 4px;
}

.x6r-pwd-hint.is-ok {
  color: #688e26;
}

.x6r-pwd-hint.is-bad {
  color: #b44230;
}

/* 图形验证码 */
.x6r-captcha-img {
  flex: 0 0 110px;
  height: 42px;
  object-fit: contain;
  border: 1px solid rgba(51, 48, 46, 0.25);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

/* VIP 角标与会员中心 */
.x6r-vip-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 8px;
  background: linear-gradient(135deg, #b8894d, #d4af6a);
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  vertical-align: middle;
}

.x6r-vip-status {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--secondary-color, #f3ecd8);
  color: var(--text-color, #33302e);
  font-size: 14px;
  text-align: center;
}

.x6r-vip-status.is-vip {
  background: linear-gradient(135deg, rgba(184, 137, 77, 0.15), rgba(212, 175, 106, 0.2));
  border: 1px solid rgba(184, 137, 77, 0.5);
  color: #8a6d2f;
  font-weight: bold;
}

.x6r-vip-quota {
  margin: -6px 0 14px;
  text-align: center;
  font-size: 13px;
  color: var(--primary-color, #872d2d);
}

.x6r-vip-perks {
  margin: 0 0 14px;
  padding-left: 20px;
  color: var(--text-color, #33302e);
  font-size: 14px;
  line-height: 2;
}

.x6r-vip-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
  opacity: 0.85;
}

.x6r-vip-note a {
  color: var(--primary-color, #872d2d);
}

/* 轻提示 */
.x6r-auth-toast {
  position: fixed;
  left: 50%;
  bottom: 60px;
  transform: translateX(-50%) translateY(10px);
  padding: 10px 24px;
  background: var(--text-color, #33302e);
  color: var(--bg-color, #f9f5ea);
  border-radius: 20px;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 10002;
  pointer-events: none;
}

.x6r-auth-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 768px) {
  .x6r-auth-overlay {
    padding: 10px;
    /* 键盘弹出时弹窗靠上，避免输入框被遮住 */
    align-items: flex-start;
    padding-top: 8vh;
  }

  .x6r-auth-card {
    max-width: 100%;
    padding: 22px 16px 18px;
    border-radius: 10px;
  }

  .x6r-auth-title {
    font-size: 18px;
    margin-bottom: 14px;
  }

  /* 16px 防止 iOS Safari 聚焦时自动放大页面 */
  .x6r-auth-view input {
    font-size: 16px;
    padding: 12px;
    margin-bottom: 10px;
  }

  .x6r-auth-code-row {
    gap: 6px;
    margin-bottom: 10px;
  }

  /* 验证码输入框保证可读：最小宽度 + 字距 */
  .x6r-auth-code-row input[name="code"] {
    min-width: 0;
    letter-spacing: 3px;
    text-align: center;
  }

  .x6r-auth-code-btn {
    padding: 0 10px;
    font-size: 12px;
  }

  .x6r-auth-submit {
    padding: 12px;
    font-size: 16px;
  }

  .x6r-auth-links {
    font-size: 12px;
  }
}

/* 超窄屏（≤360px）：验证码行改为上下排列，输入框不再被挤压 */
@media (max-width: 360px) {
  .x6r-auth-code-row {
    flex-direction: column;
  }

  .x6r-auth-code-btn {
    width: 100%;
    padding: 10px;
  }
}
