/* ============================================================
 * 普问 · 账号登录 UI · 2026-07-11
 * 参考 tianfu.ai 交互：国内站/国际站 Tab + 手机/微信 双入口
 * ============================================================ */

/* ===== 遮罩 ===== */
.pw-auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 15, 25, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: pwAuthFadeIn 0.24s ease;
}
.pw-auth-overlay.is-open { display: flex; }
@keyframes pwAuthFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== 弹窗主体 ===== */
.pw-auth-modal {
  width: 100%;
  max-width: 440px;
  background: #FDFAF3;
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28), 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 32px 32px 28px;
  position: relative;
  animation: pwAuthSlideUp 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}
@keyframes pwAuthSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 背景装饰云纹（低调） */
.pw-auth-modal::before {
  content: '';
  position: absolute;
  top: -60px; right: -80px;
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(200, 155, 64, 0.10) 0%, transparent 65%);
  pointer-events: none;
}

/* ===== 关闭按钮 ===== */
.pw-auth-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 2;
}
.pw-auth-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #333;
}

/* ===== 顶部站点切换（国内 / 国际）===== */
.pw-auth-site-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #EDE8DC;
  border-radius: 999px;
  padding: 4px;
  margin: 0 auto 24px;
  position: relative;
  width: fit-content;
  z-index: 2;
}
.pw-auth-site-btn {
  background: transparent;
  border: none;
  color: #7A6A48;
  font-family: 'Noto Serif SC', serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 6px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.22s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.pw-auth-site-btn.is-active {
  background: #fff;
  color: #1A1A2E;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.pw-auth-site-btn:not(.is-active):hover { color: #1A1A2E; }
.pw-auth-site-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #78BE6E;
}
.pw-auth-site-btn.is-active .pw-auth-site-dot { background: #78BE6E; }
.pw-auth-site-btn:not(.is-active) .pw-auth-site-dot { display: none; }

/* 装饰居中 */
.pw-auth-site-wrap {
  text-align: center;
  position: relative;
  z-index: 2;
}

/* ===== 品牌标题 ===== */
.pw-auth-brand {
  text-align: center;
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}
.pw-auth-brand-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 6px;
  color: #1A1A2E;
  margin-bottom: 6px;
}
.pw-auth-brand-sub {
  font-size: 12.5px;
  letter-spacing: 2px;
  color: #8A8278;
}

/* ===== 登录方式 Tab（手机 / 微信 / 邮箱）===== */
.pw-auth-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
  position: relative;
  z-index: 2;
}
.pw-auth-tab {
  background: transparent;
  border: none;
  padding: 10px 0 12px;
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  font-weight: 600;
  color: #8A8278;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.pw-auth-tab.is-active {
  color: #1A1A2E;
}
.pw-auth-tab.is-active::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: #C89B40;
  border-radius: 2px;
}
.pw-auth-tab:not(.is-active):hover { color: #1A1A2E; }
.pw-auth-tab svg { flex-shrink: 0; }

/* ===== 表单区（内容切换）===== */
.pw-auth-form { display: none; position: relative; z-index: 2; }
.pw-auth-form.is-active { display: block; }

.pw-auth-field {
  margin-bottom: 16px;
}
.pw-auth-field label {
  display: block;
  font-size: 12.5px;
  color: #4B5563;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  font-weight: 500;
}
.pw-auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pw-auth-input {
  flex: 1;
  width: 100%;
  border: 1px solid #E8E1D2;
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  color: #1A1A2E;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.pw-auth-input::placeholder { color: #B8AFA0; }
.pw-auth-input:focus {
  border-color: #C89B40;
  box-shadow: 0 0 0 3px rgba(200, 155, 64, 0.12);
}

/* 手机号国家码前缀 */
.pw-auth-phone-code {
  flex-shrink: 0;
  width: 80px;
  padding: 12px 12px;
  border: 1px solid #E8E1D2;
  background: #FAF7EE;
  border-radius: 10px;
  font-size: 14px;
  color: #1A1A2E;
  outline: none;
  cursor: pointer;
  font-family: inherit;
}

/* 验证码 · 附加按钮 */
.pw-auth-vcode-btn {
  flex-shrink: 0;
  padding: 12px 16px;
  border: 1px solid #C89B40;
  background: #fff;
  color: #C89B40;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: inherit;
}
.pw-auth-vcode-btn:hover:not(:disabled) {
  background: #C89B40;
  color: #fff;
}
.pw-auth-vcode-btn:disabled {
  border-color: #E8E1D2;
  color: #B8AFA0;
  cursor: not-allowed;
  background: #F5F2EA;
}

/* 邀请码 · 折叠可选 */
.pw-auth-optional-toggle {
  font-size: 12.5px;
  color: #8A8278;
  cursor: pointer;
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}
.pw-auth-optional-toggle:hover { color: #C89B40; }
.pw-auth-optional-toggle svg {
  transition: transform 0.2s;
}
.pw-auth-optional-toggle.is-open svg { transform: rotate(180deg); }

.pw-auth-optional {
  display: none;
  margin-bottom: 12px;
}
.pw-auth-optional.is-open { display: block; }

/* ===== 主 CTA 按钮 ===== */
.pw-auth-submit {
  width: 100%;
  background: linear-gradient(135deg, #1A1A2E 0%, #2A2A4E 100%);
  color: #EDE8DC;
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-family: 'Noto Serif SC', serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 3px;
  cursor: pointer;
  transition: all 0.22s;
  margin-top: 4px;
}
.pw-auth-submit:hover {
  background: linear-gradient(135deg, #C89B40 0%, #D4A94E 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(200, 155, 64, 0.30);
}
.pw-auth-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ===== 微信扫码区 ===== */
.pw-auth-wechat-panel {
  text-align: center;
  padding: 12px 0 8px;
}
.pw-auth-wechat-qr {
  width: 200px;
  height: 200px;
  margin: 0 auto 16px;
  background: #FAF7EE;
  border: 1px dashed #E8E1D2;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.pw-auth-wechat-qr img {
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 12px;
}
.pw-auth-wechat-qr-placeholder {
  color: #B8AFA0;
  font-size: 13px;
  text-align: center;
  line-height: 1.7;
  padding: 20px;
}
.pw-auth-wechat-tip {
  font-size: 13px;
  color: #4B5563;
  letter-spacing: 1px;
  margin-bottom: 6px;
  font-family: 'Noto Serif SC', serif;
  font-weight: 600;
}
.pw-auth-wechat-sub {
  font-size: 12px;
  color: #8A8278;
  line-height: 1.7;
}

/* ===== 底部信息 ===== */
.pw-auth-foot {
  text-align: center;
  font-size: 11.5px;
  color: #A89F8C;
  margin-top: 16px;
  line-height: 1.8;
  position: relative;
  z-index: 2;
}
.pw-auth-foot a {
  color: #C89B40;
  text-decoration: none;
}
.pw-auth-foot a:hover { text-decoration: underline; }
.pw-auth-foot-hint {
  text-align: center;
  font-size: 11.5px;
  color: #A89F8C;
  margin-top: 10px;
  position: relative;
  z-index: 2;
}

/* ===== 已登录状态：账号下拉菜单（导航栏点击展开）===== */
.pw-auth-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: #FDFAF3;
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.06);
  padding: 14px 16px;
  z-index: 500;
  display: none;
  animation: pwAuthMenuFade 0.18s ease;
}
.pw-auth-menu.is-open { display: block; }
@keyframes pwAuthMenuFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.pw-auth-menu-head {
  padding-bottom: 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.pw-auth-menu-name {
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  color: #1A1A2E;
  font-size: 14px;
  margin-bottom: 2px;
}
.pw-auth-menu-id {
  font-size: 11.5px;
  color: #8A8278;
}
.pw-auth-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 6px;
  border-radius: 8px;
  color: #4B5563;
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.pw-auth-menu-item:hover {
  background: rgba(200, 155, 64, 0.10);
  color: #1A1A2E;
}
.pw-auth-menu-item svg { flex-shrink: 0; color: #8A8278; }
.pw-auth-menu-item:hover svg { color: #C89B40; }
.pw-auth-menu-item.is-logout { color: #C8473A; }
.pw-auth-menu-item.is-logout svg { color: #C8473A; }
.pw-auth-menu-item.is-logout:hover { background: rgba(200, 71, 58, 0.08); }

/* ===== 深色模式适配 ===== */
[data-theme="dark"] .pw-auth-modal {
  background: #1F1D1A;
  color: #EDE8DC;
}
[data-theme="dark"] .pw-auth-brand-title { color: #EDE8DC; }
[data-theme="dark"] .pw-auth-brand-sub { color: #B5AFA0; }
[data-theme="dark"] .pw-auth-site-switch { background: #2A2724; }
[data-theme="dark"] .pw-auth-site-btn { color: #B5AFA0; }
[data-theme="dark"] .pw-auth-site-btn.is-active {
  background: #C89B40;
  color: #1A1A2E;
}
[data-theme="dark"] .pw-auth-tabs { border-color: rgba(255, 255, 255, 0.10); }
[data-theme="dark"] .pw-auth-tab { color: #B5AFA0; }
[data-theme="dark"] .pw-auth-tab.is-active { color: #EDE8DC; }
[data-theme="dark"] .pw-auth-input {
  background: #14110C;
  border-color: rgba(255, 255, 255, 0.10);
  color: #EDE8DC;
}
[data-theme="dark"] .pw-auth-input::placeholder { color: #6E6659; }
[data-theme="dark"] .pw-auth-phone-code {
  background: #1A1815;
  border-color: rgba(255, 255, 255, 0.10);
  color: #EDE8DC;
}
[data-theme="dark"] .pw-auth-menu { background: #1F1D1A; }
[data-theme="dark"] .pw-auth-menu-head { border-color: rgba(255, 255, 255, 0.10); }
[data-theme="dark"] .pw-auth-menu-name { color: #EDE8DC; }
[data-theme="dark"] .pw-auth-menu-item { color: #B5AFA0; }
[data-theme="dark"] .pw-auth-menu-item:hover { background: rgba(200, 155, 64, 0.15); color: #EDE8DC; }
[data-theme="dark"] .pw-auth-wechat-qr {
  background: #14110C;
  border-color: rgba(255, 255, 255, 0.10);
}

/* ===== 移动端 ===== */
@media (max-width: 480px) {
  .pw-auth-overlay { padding: 12px; align-items: flex-end; }
  .pw-auth-modal {
    padding: 26px 22px 22px;
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    animation: pwAuthSlideUpMobile 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  }
  @keyframes pwAuthSlideUpMobile {
    from { opacity: 0; transform: translateY(100%); }
    to { opacity: 1; transform: translateY(0); }
  }
  .pw-auth-brand-title { font-size: 22px; letter-spacing: 4px; }
  .pw-auth-tabs { gap: 20px; }
  .pw-auth-tab { font-size: 13.5px; }
  .pw-auth-submit { font-size: 14px; letter-spacing: 2px; }
  .pw-auth-wechat-qr { width: 180px; height: 180px; }
}

/* ============ 账号抽屉里的登录入口块（accAuthBlock） · 2026-07-12 ============ */
.acc-auth-block { margin: 10px 0 18px; }

/* 未登录：登录按钮（大块） */
.acc-auth-login-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #1A1A2E 0%, #2A2A4E 100%);
  border: none;
  border-radius: 14px;
  color: #EDE8DC;
  cursor: pointer;
  text-align: left;
  transition: transform .18s, box-shadow .18s, background .22s;
  box-shadow: 0 6px 20px rgba(26,26,46,0.22);
}
.acc-auth-login-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #C89B40 0%, #D4A94E 100%);
  box-shadow: 0 10px 28px rgba(200,155,64,0.35);
  color: #fff;
}
.acc-auth-login-icon {
  font-size: 22px;
  flex-shrink: 0;
  filter: grayscale(0.3);
}
.acc-auth-login-text { flex: 1; min-width: 0; }
.acc-auth-login-title {
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1.5px;
  margin-bottom: 3px;
}
.acc-auth-login-sub {
  font-size: 12px;
  opacity: 0.75;
  line-height: 1.5;
}
.acc-auth-login-arrow {
  font-size: 24px;
  opacity: 0.6;
  flex-shrink: 0;
  font-family: serif;
  line-height: 1;
}

/* 已登录：显示用户卡片 */
.acc-auth-logged {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #FEFAEE 0%, #FBF1DC 100%);
  border: 1px solid rgba(200,155,64,0.30);
  border-radius: 14px;
}
.acc-auth-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1A1A2E, #2A2A4E);
  color: #EDE8DC;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 18px;
  flex-shrink: 0;
}
.acc-auth-info { flex: 1; min-width: 0; }
.acc-auth-name {
  font-family: 'Noto Serif SC', serif;
  font-weight: 700;
  font-size: 15px;
  color: #1A1A2E;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acc-auth-sub {
  font-size: 12px;
  color: #7A6A48;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acc-auth-points {
  display: inline-block;
  background: rgba(200,155,64,0.16);
  color: #C89B40;
  padding: 1px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
}
.acc-auth-logout {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid rgba(122,106,72,0.35);
  color: #7A6A48;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: 'Noto Serif SC', serif;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all .18s;
}
.acc-auth-logout:hover {
  background: #7A6A48;
  color: #FEFAEE;
  border-color: #7A6A48;
}

/* 深色模式 */
[data-theme="dark"] .acc-auth-login-btn {
  background: linear-gradient(135deg, #C89B40 0%, #D4A94E 100%);
  color: #1A1A2E;
}
[data-theme="dark"] .acc-auth-logged {
  background: linear-gradient(135deg, #2a2310 0%, #2f281a 100%);
  border-color: rgba(229,199,122,0.30);
}
[data-theme="dark"] .acc-auth-name { color: #EDE8DC; }
[data-theme="dark"] .acc-auth-sub { color: #C5BFB0; }
[data-theme="dark"] .acc-auth-points { background: rgba(229,199,122,0.20); color: #E5C77A; }
[data-theme="dark"] .acc-auth-logout {
  border-color: rgba(197,191,176,0.30);
  color: #C5BFB0;
}
[data-theme="dark"] .acc-auth-logout:hover {
  background: #C5BFB0;
  color: #2a2310;
}

/* 抽屉里的"我的档案"小标题 */
.acc-list-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 13px;
  color: #999;
  letter-spacing: 2px;
  margin: 8px 0 10px;
  padding-left: 4px;
}
[data-theme="dark"] .acc-list-title { color: #888; }

@media (max-width: 480px) {
  .acc-auth-login-btn { padding: 14px 16px; gap: 12px; }
  .acc-auth-login-title { font-size: 14px; }
  .acc-auth-login-sub { font-size: 11.5px; }
  .acc-auth-logged { padding: 12px 14px; gap: 10px; }
  .acc-auth-avatar { width: 40px; height: 40px; font-size: 16px; }
}

/* ============ 国际站 · OAuth 按钮组（Google / GitHub） · 2026-07-12 ============ */
.pw-auth-oauth {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.pw-auth-oauth-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 18px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  color: #1F1F1F;
  cursor: pointer;
  transition: all .18s;
  letter-spacing: 0.2px;
}
.pw-auth-oauth-btn:hover {
  background: #F7F5EF;
  border-color: rgba(0,0,0,0.24);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.pw-auth-oauth-icon {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}
.pw-auth-oauth-btn[data-action="oauth-github"] {
  background: #1F1F1F;
  color: #fff;
  border-color: #1F1F1F;
}
.pw-auth-oauth-btn[data-action="oauth-github"]:hover {
  background: #333;
  border-color: #333;
}
.pw-auth-oauth-btn[data-action="oauth-github"] .pw-auth-oauth-icon svg {
  color: #fff;
}
[data-theme="dark"] .pw-auth-oauth-btn {
  background: #2A2A3E;
  color: #EDE8DC;
  border-color: rgba(255,255,255,0.14);
}
[data-theme="dark"] .pw-auth-oauth-btn:hover {
  background: #333350;
}

/* 分割线 "or continue with email" */
.pw-auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 18px;
  color: #999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 12.5px;
  letter-spacing: 0.5px;
}
.pw-auth-divider::before,
.pw-auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(0,0,0,0.10);
}
[data-theme="dark"] .pw-auth-divider::before,
[data-theme="dark"] .pw-auth-divider::after {
  background: rgba(255,255,255,0.10);
}
[data-theme="dark"] .pw-auth-divider { color: #888; }

/* 密码显示切换按钮 */
.pw-auth-pwd-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #999;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color .15s;
}
.pw-auth-pwd-toggle:hover { color: #666; }
.pw-auth-pwd-toggle.is-shown { color: #C89B40; }

/* 忘记密码链接 */
.pw-auth-forgot {
  float: right;
  color: #999;
  font-size: 12px;
  font-weight: 400;
  text-decoration: none;
  letter-spacing: 0;
}
.pw-auth-forgot:hover { color: #C89B40; text-decoration: underline; }

/* 底部切换注册链接 */
.pw-auth-foot-switch {
  text-align: center;
  color: #999;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  margin-top: 12px;
}
.pw-auth-foot-switch a {
  color: #C89B40;
  font-weight: 600;
  text-decoration: none;
}
.pw-auth-foot-switch a:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .pw-auth-oauth-btn { padding: 11px 16px; font-size: 14px; }
}

/* site-panel 容器（国内站/国际站切换）· 2026-07-12 */
.pw-auth-site-panel { display: block; }
.pw-auth-site-panel[hidden] { display: none !important; }
