/* 首页登录 / 注册浮窗：点首页「登录」「注册」弹出，不再单独开页面（/login、/register 只跳回首页打开它）。只用白+蓝 */
.hm-pop [hidden] { display: none !important; }

.hm-pop {
  --faint: #9aa6b8;
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  padding: 64px 16px 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
}
.hm-pop[hidden] { display: none; }
.pop-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 35, 61, .28);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .22s ease;
}
.pop-card {
  position: relative;
  width: min(440px, 100%);
  margin: auto;
  padding: 24px 30px 28px;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: 0 44px 90px -40px rgba(20, 35, 61, .6), 0 0 0 1px rgba(27, 58, 115, .05);
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(20px) scale(.96);
  transition: opacity .22s ease, transform .34s cubic-bezier(.2, .9, .25, 1.12);
}
.pop-card:focus { outline: none; }
.hm-pop.on .pop-mask { opacity: 1; }
.hm-pop.on .pop-card { opacity: 1; transform: none; }
.pop-card.shake { animation: pop-shake .4s ease; }

/* 卡片顶上站一排郁金香：跟首页花田的圆花不一样。打开时一棵棵长出来，然后轻轻摆 */
.pop-bloom {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 2px);
  display: flex;
  align-items: flex-end;
  gap: 18px;
  transform: translateX(-50%);
  pointer-events: none;
}
.pop-bloom i {
  position: relative;
  display: block;
  width: 16px;
  height: 38px;
  transform: scaleY(0);
  transform-origin: 50% 100%;
}
.pop-bloom i:nth-child(even) { height: 29px; }
.pop-bloom i::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 0;
  left: 7px;
  width: 2px;
  border-radius: 2px;
  background: #7d9fd6;
}
.pop-bloom i::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 16px;
  height: 15px;
  border-radius: 2px 2px 8px 8px;
  background: var(--blue);
  clip-path: polygon(0 0, 25% 30%, 50% 0, 75% 30%, 100% 0, 100% 100%, 0 100%);
}
.pop-bloom i:nth-child(2)::after,
.pop-bloom i:nth-child(4)::after { background: #7fb2ff; }
.pop-bloom i:nth-child(3)::after { background: var(--navy); }
.hm-pop.on .pop-bloom i { animation: pop-grow .55s cubic-bezier(.2, .9, .3, 1.35) both, pop-sway 3.6s ease-in-out infinite; }
.hm-pop.on .pop-bloom i:nth-child(1) { animation-delay: .1s, .8s; }
.hm-pop.on .pop-bloom i:nth-child(2) { animation-delay: .18s, 1.1s; }
.hm-pop.on .pop-bloom i:nth-child(3) { animation-delay: .26s, .95s; }
.hm-pop.on .pop-bloom i:nth-child(4) { animation-delay: .34s, 1.25s; }
.hm-pop.on .pop-bloom i:nth-child(5) { animation-delay: .42s, 1.05s; }

.pop-x {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, transform .2s ease;
}
.pop-x:hover { background: #eef4ff; color: var(--navy); transform: rotate(90deg); }
.pop-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

/* 登录 / 注册切换：白色滑块跟着走 */
.pop-seg {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 210px;
  margin: 0 auto 20px;
  padding: 4px;
  border-radius: 999px;
  background: #edf3fd;
  box-sizing: border-box;
}
.pop-seg::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 6px 14px -8px rgba(27, 58, 115, .5);
  transition: transform .3s cubic-bezier(.3, .9, .3, 1.1);
}
.hm-pop[data-mode="register"] .pop-seg::before { transform: translateX(100%); }
.pop-seg button {
  position: relative;
  z-index: 1;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: color .2s ease;
}
.pop-seg button[aria-selected="true"] { color: var(--navy); }

.hm-pop[data-mode="login"] #pane-login { animation: pop-from-l .3s ease both; }
.hm-pop[data-mode="register"] #pane-register { animation: pop-from-r .3s ease both; }
.hm-pop .pop-title { margin: 0; color: var(--ink); font-size: 28px; font-weight: 800; line-height: 1.2; text-align: center; letter-spacing: -.01em; }
.pop-lead { margin: 8px 0 22px; color: var(--muted); font-size: 14.5px; line-height: 1.6; text-align: center; }

.pop-form { display: grid; gap: 12px; }

/* 每一栏是一颗胶囊：左边栏名，右边输入 */
.au-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  margin: 0;
  padding: 0 8px 0 20px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #f8fbff;
  box-sizing: border-box;
  cursor: text;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.au-pill:hover { border-color: #c9dbf8; }
.au-pill:focus-within {
  border-color: var(--blue);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(58, 131, 247, .14);
}
.au-pill > span:first-child,
.au-pill > label {
  flex: none;
  width: 4.4em;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  transition: color .15s ease;
}
.au-pill:focus-within > span:first-child,
.au-pill:focus-within > label { color: var(--blue-d); }
.hm-pop .au-pill input {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 50px;
  min-height: 0;
  margin: 0;
  padding: 0 12px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font: inherit;
  font-size: 15.5px;
}
.hm-pop .au-pill input:focus,
.hm-pop .au-pill input:focus-visible { border: 0; outline: none; background: transparent; box-shadow: none; }
.hm-pop .au-pill input::placeholder { color: var(--faint); }
.hm-pop .au-pill input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 40px #ffffff inset;
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
}
/* Edge 密码框自带的小眼睛，跟我们自己的重了 */
.hm-pop input::-ms-reveal,
.hm-pop input::-ms-clear { display: none; }

.hm-pop .au-pill .auth-pass { position: relative; display: flex; flex: 1; align-self: stretch; align-items: center; min-width: 0; }
.hm-pop .au-pill .auth-pass input { padding-right: 46px; }
.hm-pop .auth-eye {
  top: 50%;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transform: translateY(-50%);
  transition: background-color .15s ease;
}
.hm-pop .auth-eye:hover { background-color: #eef4ff; }

/* 滑块拼图：拖动条跟输入框一样是胶囊；拼图在条上方浮出来，鼠标停上来或按住滑块时才显示。缺口位置只在服务器 */
.sl { position: relative; }
.sl-pane {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 3;
  padding: 8px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 26px 50px -22px rgba(20, 35, 61, .55), 0 0 0 1px rgba(27, 58, 115, .06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px) scale(.98);
  transform-origin: 50% 100%;
  transition: opacity .18s ease, transform .24s cubic-bezier(.2, .9, .3, 1.2), visibility .18s;
}
.sl.show .sl-pane { opacity: 1; visibility: visible; transform: none; }
.sl-img { position: relative; aspect-ratio: 15 / 8; border-radius: 15px; overflow: hidden; background: #e9f1ff; }
.sl-bg { display: block; width: 100%; height: 100%; }
.sl-pc { position: absolute; left: 0; display: block; height: auto; filter: drop-shadow(0 3px 5px rgba(20, 35, 61, .45)); }
.sl-bg:not([src]), .sl-pc:not([src]) { visibility: hidden; }
.sl-spin {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 2.5px solid rgba(58, 131, 247, .25);
  border-top-color: var(--blue);
  border-radius: 50%;
  opacity: 0;
}
.sl.wait .sl-spin { opacity: 1; animation: pop-spin .7s linear infinite; }
.sl-new {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--blue-d);
  cursor: pointer;
  transition: transform .3s ease;
}
.sl-new:hover { transform: rotate(-60deg); }
.sl-new svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.sl-track {
  position: relative;
  height: 54px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #f8fbff;
  overflow: hidden;
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select: none;
  transition: border-color .2s ease;
}
.sl:hover .sl-track, .sl.drag .sl-track { border-color: #c9dbf8; }
.sl-fill { position: absolute; top: 0; bottom: 0; left: 0; width: 0; border-radius: 999px; background: #e3edff; }
.sl-tip { position: absolute; inset: 0; display: grid; place-items: center; padding-left: 44px; color: var(--muted); font-size: 14px; pointer-events: none; transition: color .2s ease; }
.sl.drag .sl-tip { color: transparent; }
.sl-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--navy);
  box-shadow: 0 8px 16px -8px rgba(27, 58, 115, .8);
  color: #ffffff;
  cursor: grab;
  touch-action: none;
  transition: background-color .2s ease;
}
.sl.drag .sl-knob { cursor: grabbing; }
.sl-knob svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.sl-knob .sl-ok, .sl.ok .sl-knob .sl-go { display: none; }
.sl.ok .sl-knob .sl-ok { display: block; }
.sl:not(.drag) .sl-knob, .sl:not(.drag) .sl-pc { transition: transform .3s ease, background-color .2s ease; }
.sl:not(.drag) .sl-fill { transition: width .3s ease, background-color .2s ease; }
.sl.wait .sl-knob { cursor: progress; }
.sl.ok .sl-track { border-color: #b9d1f7; }
.sl.ok .sl-fill { background: #dceaff; }
.sl.ok .sl-tip { padding: 0 52px 0 0; color: var(--blue-d); font-weight: 700; }
.sl.ok .sl-knob { background: var(--blue); cursor: default; }
.sl.bad .sl-track, .sl.need .sl-track { border-color: #e7b3ad; }
.sl.bad .sl-fill { background: #fbeceb; }
.sl.bad .sl-tip { color: #c2483d; }
.sl.bad .sl-knob { background: #c2483d; }
.sl.need .sl-knob { animation: sl-need .5s ease 2; }
@keyframes sl-need { 50% { transform: translateX(10px); } }

.hm-pop .auth-invite { display: grid; gap: 6px; }
.hm-pop .auth-invite small { padding-left: 20px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.hm-pop .auth-invite.ok small { color: var(--blue-d); }
.hm-pop .auth-invite.bad small { color: #c2483d; }
.hm-pop .auth-invite.bad .au-pill { border-color: #e7b3ad; }
.hm-pop .auth-invite input::placeholder { letter-spacing: normal; }

.hm-pop .auth-remember {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 8px;
  margin: 0 0 0 20px;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}
.hm-pop .auth-remember input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); }
.hm-pop .err { margin: 0; color: #c2483d; font-size: 14px; text-align: center; }

/* 提交：跟首页「登录」同一颗深蓝胶囊 */
.hm-pop .au-go {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  margin-top: 4px;
  padding: 0 28px;
  border: 1.5px solid var(--navy);
  border-radius: 999px;
  background: var(--navy);
  box-shadow: 0 18px 34px -18px rgba(27, 58, 115, .8);
  color: #ffffff;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .06em;
  cursor: pointer;
  overflow: hidden;
  box-sizing: border-box;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
}
.hm-pop .au-go::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform .7s ease;
}
.hm-pop .au-go:hover { border-color: var(--navy-d); background: var(--navy-d); transform: translateY(-2px); }
.hm-pop .au-go:hover::before { transform: translateX(100%); }
.hm-pop .au-go:active { transform: translateY(0) scale(.98); }
.hm-pop .au-go:disabled { cursor: default; transform: none; opacity: .75; }
.hm-pop .au-go > span { position: relative; }
.pop-form.busy .au-go > span::before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 10px;
  vertical-align: -2px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: pop-spin .7s linear infinite;
}

@keyframes pop-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes pop-sway { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes pop-from-l { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes pop-from-r { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes pop-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes pop-spin { to { transform: rotate(360deg); } }

@media (max-width: 520px) {
  .hm-pop { padding: 56px 12px 20px; }
  .pop-mask { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(20, 35, 61, .34); }
  .pop-card { padding: 20px 18px 22px; border-radius: 24px; }
  .hm-pop .pop-title { font-size: 25px; }
  .pop-lead { margin-bottom: 18px; font-size: 14px; }
  .au-pill { padding-left: 16px; }
  .au-pill > span:first-child,
  .au-pill > label { font-size: 13.5px; }
  .hm-pop .au-pill input { font-size: 16px; }
  .sl-tip { font-size: 13.5px; }
  .hm-pop .auth-remember { margin-left: 16px; }
  .hm-pop .auth-invite small { padding-left: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .hm-pop *, .hm-pop *::before, .hm-pop *::after { animation: none !important; transition: none !important; }
  .pop-bloom i { transform: none; }
}
