/* ==========================================================================
   苍匣 CangXia · 首页账户面板
   轻量白底样式，与 pre-3d 的软蓝首页保持一致。
   ========================================================================== */

.auth-shell [hidden] { display: none !important; }

body.auth-open { overflow: hidden; }

/* 头部账户入口 ------------------------------------------------------------ */

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-strong, #d5deec);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink-soft, #364156);
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.24s ease, background-color 0.24s ease, color 0.24s ease, box-shadow 0.24s ease, transform 0.24s ease;
}

.account-chip:hover {
  border-color: #b9c9e4;
  background: var(--blue-soft, #edf5ff);
  color: var(--blue-dark, #1f55e0);
  transform: translateY(-1px);
}

.account-chip:active { transform: translateY(0) scale(0.98); }

/* 登录后的名字可能很长：截断而不是把页头撑开 */
.account-chip [data-account-label] {
  display: inline-block;
  max-width: 8em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.account-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-2, #9aa4b6);
  transition: background-color 0.24s ease, box-shadow 0.24s ease;
}

.account-chip.is-on {
  border-color: #cfe0ff;
  background: #f2f7ff;
  color: var(--blue-dark);
}

.account-chip.is-on .account-dot {
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.14);
}

/* 遮罩与卡片 -------------------------------------------------------------- */

.auth-shell {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 31, 55, 0.3);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.26s ease, visibility 0.26s ease;
}

body.auth-open .auth-shell {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.auth-card {
  position: relative;
  width: min(100%, 424px);
  max-height: calc(100dvh - 48px);
  padding: 28px 28px 24px;
  border: 1px solid #e3ebf7;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 34px 90px rgba(20, 38, 80, 0.26);
  overflow-y: auto;
  opacity: 0;
  transform: translateY(16px) scale(0.975);
  transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.auth-open .auth-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.auth-card.is-shaking { animation: auth-shake 0.42s cubic-bezier(0.36, 0.1, 0.2, 1); }

.auth-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.auth-head h2 {
  margin: 0;
  color: var(--ink, #141a26);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
}

.auth-close {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong, #d5deec);
  border-radius: 50%;
  background: #ffffff;
  color: var(--muted, #707b90);
  font-size: 20px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.auth-close:hover {
  background: var(--ink, #141a26);
  color: #ffffff;
  transform: rotate(90deg);
}

.auth-lede {
  margin: 10px 0 0;
  color: var(--muted, #707b90);
  font-size: 14px;
  line-height: 1.75;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-top: 20px;
  padding: 4px;
  border-radius: 13px;
  background: var(--sky, #f2f9ff);
}

.auth-tab {
  min-height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted, #707b90);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}

.auth-tab:hover { color: var(--ink, #141a26); }

.auth-tab.is-active {
  background: #ffffff;
  color: var(--blue-dark, #1f55e0);
  box-shadow: 0 3px 10px rgba(31, 54, 105, 0.1);
}

.auth-form { margin-top: 16px; }

.auth-field {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.auth-field:first-child { margin-top: 0; }

.auth-field > span {
  color: var(--ink-soft, #364156);
  font-size: 13px;
  font-weight: 500;
}

.auth-field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong, #d5deec);
  border-radius: 12px;
  background: #fbfdff;
  color: var(--ink, #141a26);
  font-size: 14px;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease;
}

.auth-field input::placeholder { color: var(--muted-2, #9aa4b6); }

.auth-field input:hover { border-color: #b9c9e4; }

.auth-field input:focus {
  border-color: rgba(47, 107, 255, 0.62);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(47, 107, 255, 0.11);
}

.auth-field input:disabled { opacity: 0.55; cursor: wait; }

.auth-error {
  margin: 12px 0 0;
  padding: 9px 12px;
  border: 1px solid #ffd7e2;
  border-radius: 10px;
  background: #fff5f8;
  color: #b83d63;
  font-size: 13px;
  line-height: 1.6;
}

.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  margin-top: 16px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--blue, #2f6bff);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(47, 107, 255, 0.2);
  transition: background-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.auth-submit:hover {
  background: var(--blue-dark, #1f55e0);
  box-shadow: 0 13px 26px rgba(47, 107, 255, 0.26);
  transform: translateY(-1px);
}

.auth-submit:active { transform: translateY(0); }

.auth-submit:disabled {
  cursor: wait;
  filter: saturate(0.7) brightness(0.94);
}

.auth-submit span:last-child { transition: transform 0.22s ease; }
.auth-submit:hover span:last-child { transform: translateX(3px); }

.auth-form.is-busy .auth-field { opacity: 0.62; }

.auth-session { margin-top: 18px; }

.auth-session-name {
  display: block;
  color: var(--ink, #141a26);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.auth-session-copy {
  margin: 6px 0 0;
  color: var(--muted, #707b90);
  font-size: 14px;
  line-height: 1.75;
}

.auth-session-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 17px;
}

.auth-session-actions .auth-submit {
  flex: 1;
  margin-top: 0;
}

.auth-quiet {
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line-strong, #d5deec);
  border-radius: 12px;
  background: #ffffff;
  color: var(--muted, #707b90);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.22s ease, background-color 0.22s ease, color 0.22s ease;
}

.auth-quiet:hover {
  border-color: #b9c9e4;
  background: var(--sky, #f2f9ff);
  color: var(--ink, #141a26);
}

.auth-fineprint {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line, #e8edf5);
  color: var(--muted-2, #9aa4b6);
  font-size: 12px;
  line-height: 1.7;
}

.auth-back {
  display: block;
  margin: 10px auto 0;
  padding: 4px 8px;
  border: 0;
  background: transparent;
  color: var(--muted, #707b90);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s ease;
}

.auth-back:hover { color: var(--blue-dark, #1f55e0); }

@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px) rotate(-0.5deg); }
  40% { transform: translateX(6px) rotate(0.4deg); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

/* 小屏 -------------------------------------------------------------------- */

@media (max-width: 900px) {
  .account-chip { margin-left: 0; }
}

@media (max-width: 760px) {
  .site-header .header-inner { gap: 12px; }
  .site-header .account-chip { margin-left: auto; }
  .site-header .mobile-nav { margin-left: 0; }
}

@media (max-width: 620px) {
  .account-chip {
    min-height: 32px;
    padding: 0 11px;
    gap: 6px;
    font-size: 12px;
  }
  .auth-shell { padding: 12px; }
  .auth-card {
    max-height: calc(100dvh - 24px);
    padding: 22px 18px 18px;
    border-radius: 22px;
  }
  .auth-head h2 { font-size: 22px; }
  .auth-lede { font-size: 13px; }
  .auth-field input { min-height: 42px; font-size: 13.5px; }
  .auth-submit { min-height: 44px; }
  .auth-quiet { min-height: 42px; }
  .auth-fineprint { margin-top: 14px; padding-top: 12px; }
}

@media (max-width: 380px) {
  .account-dot { display: none; }
  .account-chip { padding: 0 10px; font-size: 12px; }
  .auth-session-actions { flex-wrap: wrap; }
  .auth-session-actions .auth-submit { flex-basis: 100%; }
  .auth-quiet { width: 100%; }
}

@media (max-height: 590px) {
  .auth-card { max-height: calc(100dvh - 20px); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-shell,
  .auth-card { transition: none; }
  .auth-card.is-shaking { animation: none; }
}



