/* ==========================================================================
   auth.css — 官网登录态（顶栏入口 / 扫码弹层 / 个人中心）
   视觉与主站一致：发丝边框、墨色按钮、品牌蓝只给关键动作
   ========================================================================== */

/* ------------------------------------------------------- 顶栏登录位 */
.auth-slot { position: relative; display: flex; align-items: center; gap: 10px; }

.auth-btn[hidden], .auth-user[hidden] { display: none; }
.auth-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 15px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 13px; font-weight: 500; letter-spacing: .01em;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.auth-btn:hover { border-color: var(--ink); background: var(--surface); }
.auth-btn svg { color: var(--ink-2); }

/* 已登录：头像 + 昵称 */
.auth-user {
  display: inline-flex; align-items: center; gap: 9px;
  height: 36px; padding: 0 13px 0 6px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--ink);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.auth-user:hover { border-color: var(--ink); box-shadow: var(--sh-1); }
.auth-user .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--blue), #2E3FA8);
  color: #fff; font-size: 12.5px; font-weight: 700;
  overflow: hidden;
}
.auth-user .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth-user .name { max-width: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 下拉菜单 */
.auth-menu {
  position: absolute; right: 0; top: calc(100% + 10px);
  width: 232px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  box-shadow: var(--sh-3); padding: 8px; z-index: 60;
}
.auth-menu[hidden] { display: none; }
.auth-menu .m-head {
  padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px;
}
.auth-menu .m-head b { display: block; font-size: 14px; }
.auth-menu .m-head span { font-size: 11.5px; color: var(--ink-3); font-family: var(--font-mono); }
.auth-menu button {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; height: 40px; padding: 0 12px;
  background: transparent; border: none; border-radius: var(--r-sm);
  font-size: 13.5px; color: var(--ink-2); text-align: left;
}
.auth-menu button:hover { background: var(--paper); color: var(--ink); }
.auth-menu button.danger:hover { background: rgba(240, 68, 56, .08); color: #D92D20; }

/* ------------------------------------------------------- 弹层 */
.auth-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-modal[hidden] { display: none; }
.auth-backdrop {
  position: absolute; inset: 0; background: rgba(10, 12, 17, .42);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: fade-in var(--dur-base) var(--ease-out);
}
.auth-panel {
  position: relative; width: 100%; max-width: 396px;
  background: var(--surface); border-radius: var(--r-lg);
  border: 1px solid var(--line);
  box-shadow: var(--sh-3);
  padding: 32px 28px 26px;
  animation: panel-in 380ms var(--ease-out);
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
}
.auth-close {
  position: absolute; top: 14px; right: 14px;
  width: 34px; height: 34px; border-radius: var(--r-sm);
  background: transparent; border: 1px solid transparent;
  color: var(--ink-3); font-size: 20px; line-height: 1;
}
.auth-close:hover { background: var(--paper); color: var(--ink); border-color: var(--line); }

.auth-panel h3 { font-size: 21px; letter-spacing: -.01em; }
.auth-sub { margin-top: 6px; font-size: 13.5px; color: var(--ink-3); }

/* 二维码区：白底黑边，保证扫码识别率（不要给二维码加滤镜/圆角裁切） */
.qr-box {
  position: relative; margin: 22px auto 18px;
  width: 208px; height: 208px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: #fff; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.qr-box img { width: 192px; height: 192px; display: block; }
.qr-box img[hidden] { display: none; }
.qr-skeleton {
  width: 192px; height: 192px; border-radius: 8px;
  background: linear-gradient(100deg, #F2F4F9 30%, #FAFBFD 50%, #F2F4F9 70%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.qr-mask {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: rgba(255, 255, 255, .94); text-align: center;
}
.qr-mask[hidden] { display: none; }
.qr-mask span { font-size: 13px; color: var(--ink-2); }
.qr-mask button {
  height: 34px; padding: 0 16px; border-radius: var(--r-sm);
  background: var(--ink); color: #fff; border: none; border-radius: 999px;
  font-size: 12.5px; font-weight: 500;
}

/* 状态行 */
.auth-status {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 26px; font-size: 13.5px; color: var(--ink-2);
}
.auth-status .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3);
  display: inline-block; flex: 0 0 auto;
}
.auth-status.is-wait .dot { background: var(--blue); animation: pulse 1.4s ease-in-out infinite; }
.auth-status.is-scan .dot { background: var(--blue); animation: pulse 1.1s ease-in-out infinite; }
.auth-status.is-ok .dot { background: #12B76A; }
.auth-status.is-err .dot { background: #F04438; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.8); } }

.auth-steps {
  margin: 16px 0 0; padding: 14px 0 0; border-top: 1px solid var(--line);
  list-style: none; display: grid; gap: 7px;
}
.auth-steps li {
  display: flex; gap: 10px; align-items: baseline;
  font-size: 12.5px; color: var(--ink-3); line-height: 1.6;
}
.auth-steps li i {
  font-style: normal; font-family: var(--font-mono); color: var(--ink-3);
  font-size: 10.5px; min-width: 15px; letter-spacing: .06em;
}

/* ------------------------------------------------------- 个人中心视图 */
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.profile-head .big-avatar {
  width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--blue), #2E3FA8);
  color: #fff; font-size: 20px; font-weight: 600; overflow: hidden;
}
.profile-head .big-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-head .who b { display: block; font-size: 17px; }
.profile-head .who span { font-size: 12px; color: var(--ink-3); font-family: var(--font-mono); letter-spacing: .04em; }

.stat-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
}
.stat-grid div { padding: 14px 12px; text-align: center; border-right: 1px solid var(--line); }
.stat-grid div:last-child { border-right: none; }
.stat-grid b { display: block; font-family: var(--font-mono); font-size: 20px; }
.stat-grid span { font-size: 11px; color: var(--ink-3); letter-spacing: .04em; }

.profile-note {
  margin-top: 16px; font-size: 12.5px; color: var(--ink-3); line-height: 1.7;
}
.profile-actions { display: flex; gap: 10px; margin-top: 22px; }
.profile-actions button {
  flex: 1; height: 44px; border-radius: 999px; font-size: 13.5px; font-weight: 500;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.profile-actions button:hover { border-color: var(--ink); }
.profile-actions button.danger { color: #D92D20; border-color: rgba(240, 68, 56, .35); }
.profile-actions button.danger:hover { background: rgba(240, 68, 56, .07); }

@media (max-width: 760px) {
  .auth-btn span { display: none; }
  .auth-btn { padding: 0 13px; }
  .auth-user .name { display: none; }
  .top-cta { display: none; }
  .auth-panel { padding: 26px 20px 22px; }
}
