/* ==========================================================================
   登录弹窗 · kisslove-pc-gadget-login-modal
   颜色全部走站点主题变量，取不到时回退 kisslove.cn 的实际取值
   ========================================================================== */

.klm-mask {
  --klm-p: var(--ls-primary-hover, #13c2c2);
  --klm-p-rgb: 19, 194, 194;
  --klm-p-soft: rgba(19, 194, 194, .1);
  --klm-ink: var(--ls-text, #1f2937);
  --klm-ink2: var(--ls-text-secondary, #4b5563);
  --klm-muted: var(--ls-text-muted, #9ca3af);
  --klm-line: var(--ls-border, #e5e7eb);
  --klm-card: var(--ls-card-bg, #fff);
  --klm-danger: var(--ls-danger, #ef4444);

  position: fixed;
  inset: 0;
  z-index: 99990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 32, 34, .44);
  -webkit-backdrop-filter: blur(7px) saturate(1.1);
  backdrop-filter: blur(7px) saturate(1.1);
  opacity: 0;
  visibility: hidden;
  transition: opacity .26s ease, visibility .26s;
}

.klm-mask.klm-on {
  opacity: 1;
  visibility: visible;
}

.klm-mask,
.klm-mask * {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------------ 卡片 */

.klm-modal {
  position: relative;
  width: min(920px, 100%);
  max-height: min(620px, 92vh);
  display: grid;
  grid-template-columns: 44% 56%;
  background: var(--klm-card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 32px 90px -28px rgba(9, 40, 40, .42), 0 8px 24px -12px rgba(9, 40, 40, .18), 0 0 0 1px rgba(15, 23, 42, .05);
  transform: translateY(14px) scale(.965);
  opacity: 0;
  transition: transform .42s cubic-bezier(.16, 1, .3, 1), opacity .3s ease;
}

.klm-mask.klm-on .klm-modal {
  transform: none;
  opacity: 1;
}

.klm-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #6b7280;
  background: #f4f6f7;
  transition: .2s;
}

.klm-close:hover {
  background: #e8eef0;
  color: #111827;
  transform: rotate(90deg);
}

.klm-close svg {
  width: 15px;
  height: 15px;
  display: block;
}

/* ------------------------------------------------------------ 左侧配图区 */

.klm-visual {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: #0f766e;
  min-width: 0;
}

.klm-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-image: linear-gradient(150deg, #0f766e 0%, #0d9488 42%, #14b8a6 74%, #2dd4bf 100%);
  transform: scale(1.02);
  transition: transform 6s ease;
}

.klm-mask.klm-on .klm-bg {
  transform: scale(1.08);
}

.klm-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.klm-decor::before {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  left: -90px;
  top: -80px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 68%);
  filter: blur(2px);
}

.klm-decor::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  right: -100px;
  bottom: -70px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(251, 113, 133, .5), rgba(251, 113, 133, 0) 70%);
}

.klm-wm {
  position: absolute;
  right: -14px;
  top: -26px;
  font-size: 190px;
  line-height: 1;
  color: rgba(255, 255, 255, .09);
  font-family: Georgia, "Songti SC", serif;
}

.klm-ring {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .22);
  right: -40px;
  top: 52px;
}

.klm-ring + .klm-ring {
  width: 270px;
  height: 270px;
  right: -76px;
  top: 18px;
  border-color: rgba(255, 255, 255, .13);
}

.klm-streak {
  position: absolute;
  left: -140px;
  top: 150px;
  width: 620px;
  height: 110px;
  transform: rotate(-24deg);
  filter: blur(8px);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .18) 45%, rgba(255, 255, 255, 0));
}

.klm-dots {
  position: absolute;
  left: 26px;
  bottom: 96px;
  width: 96px;
  height: 96px;
  opacity: .5;
  background-image: radial-gradient(rgba(255, 255, 255, .6) 1.2px, transparent 1.2px);
  background-size: 12px 12px;
}

.klm-note {
  position: absolute;
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .3);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  box-shadow: 0 18px 40px -22px rgba(0, 0, 0, .6);
}

.klm-note-a {
  right: 24px;
  top: 106px;
  width: 158px;
  transform: rotate(6deg);
  animation: klm-float 7s ease-in-out infinite;
}

.klm-note-b {
  left: 22px;
  top: 246px;
  width: 130px;
  transform: rotate(-5deg);
  animation: klm-float 8s ease-in-out infinite .8s;
}

@keyframes klm-float {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -8px; }
}

.klm-line {
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .55);
  margin-bottom: 7px;
}

.klm-line.klm-dim { background: rgba(255, 255, 255, .3); }
.klm-line.klm-w1 { width: 100%; }
.klm-line.klm-w2 { width: 72%; }
.klm-line.klm-w3 { width: 46%; }

.klm-dot {
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .75);
  margin-bottom: 9px;
}

.klm-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top,
    rgba(5, 32, 30, var(--klm-a, .82)) 0%,
    rgba(5, 32, 30, calc(var(--klm-a, .82) * .82)) 18%,
    rgba(5, 32, 30, calc(var(--klm-a, .82) * .55)) 40%,
    rgba(5, 32, 30, calc(var(--klm-a, .82) * .3)) 62%,
    rgba(5, 32, 30, calc(var(--klm-a, .82) * .14)) 82%,
    rgba(5, 32, 30, calc(var(--klm-a, .82) * .06)) 100%);
}

.klm-visual.klm-has-img .klm-decor,
.klm-visual.klm-has-img .klm-note {
  display: none;
}

.klm-content {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 30px 32px 26px;
  color: #fff;
}

.klm-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 5px 13px 5px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .28);
  font-size: 12.5px;
  letter-spacing: .6px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.klm-brand i {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .9);
  color: #0f766e;
  font-style: normal;
  font-size: 11px;
}

.klm-title {
  margin: auto 0 0;
  font-size: 26px;
  line-height: 1.42;
  font-weight: 700;
  letter-spacing: .3px;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, .25);
}

.klm-title em {
  font-style: normal;
  white-space: nowrap;
  padding: 0 3px;
  border-radius: 3px;
  background-image: linear-gradient(to top, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, .26) 34%, transparent 34%);
}

.klm-desc {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.85;
  color: rgba(255, 255, 255, .8);
  text-shadow: 0 1px 10px rgba(0, 0, 0, .2);
}

.klm-list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  gap: 9px;
}

.klm-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .9);
}

.klm-list svg {
  flex: none;
  width: 14px;
  height: 14px;
}

.klm-foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .18);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, .8);
}

.klm-stack {
  display: flex;
}

.klm-stack span {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(15, 32, 30, .5);
  margin-left: -8px;
}

.klm-stack span:first-child { margin-left: 0; }
.klm-stack span:nth-child(1) { background: linear-gradient(140deg, #fbcfe8, #f472b6); }
.klm-stack span:nth-child(2) { background: linear-gradient(140deg, #bae6fd, #38bdf8); }
.klm-stack span:nth-child(3) { background: linear-gradient(140deg, #fde68a, #f59e0b); }
.klm-stack span:nth-child(4) { background: linear-gradient(140deg, #bbf7d0, #34d399); }

/* ------------------------------------------------------------ 右侧表单区 */

.klm-panel {
  position: relative;
  min-width: 0;
  padding: 40px 46px 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(180deg, #fff 0%, #fdfefe 100%);
  color: var(--klm-ink);
}

.klm-h2 {
  margin: 0 0 7px;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: .3px;
  color: var(--klm-ink);
}

.klm-sub {
  margin: 0 0 22px;
  color: var(--klm-muted);
  font-size: 13px;
}

.klm-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: #f4f7f8;
  margin-bottom: 22px;
}

.klm-tabs:empty {
  display: none;
}

.klm-tab {
  flex: 1;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 13.5px;
  color: #6b7280;
  font-family: inherit;
  font-weight: 500;
  transition: .2s;
}

.klm-tab[aria-selected="true"] {
  background: #fff;
  color: var(--klm-p);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .1), 0 0 0 1px rgba(var(--klm-p-rgb), .18);
}

.klm-panel form {
  display: none;
}

.klm-panel form.klm-on {
  display: block;
  animation: klm-fade .3s ease both;
}

@keyframes klm-fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.klm-field {
  margin-bottom: 15px;
}

.klm-field > label {
  display: block;
  font-size: 13px;
  color: var(--klm-ink2);
  margin-bottom: 7px;
  font-weight: 500;
}

.klm-ctrl {
  position: relative;
  display: flex;
  align-items: center;
}

.klm-ctrl > svg {
  position: absolute;
  left: 14px;
  width: 17px;
  height: 17px;
  color: #9aa5b1;
  pointer-events: none;
  transition: color .2s;
}

.klm-ctrl input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 42px;
  border: 1px solid var(--klm-line);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  color: var(--klm-ink);
  font-family: inherit;
  outline: 0;
  transition: border-color .2s, box-shadow .2s;
}

.klm-ctrl input::placeholder { color: #b6bec8; }
.klm-ctrl input:hover { border-color: #dbe3e9; }
.klm-ctrl input:focus {
  border-color: var(--klm-p);
  box-shadow: 0 0 0 4px rgba(var(--klm-p-rgb), .13);
}

.klm-ctrl:focus-within > svg { color: var(--klm-p); }

.klm-eye {
  position: absolute;
  right: 8px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  color: #9aa5b1;
  display: grid;
  place-items: center;
  transition: .18s;
}

.klm-eye:hover { background: #f3f6f7; color: var(--klm-ink2); }
.klm-eye svg { width: 17px; height: 17px; }

.klm-code-btn {
  position: absolute;
  right: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid rgba(var(--klm-p-rgb), .25);
  background: var(--klm-p-soft);
  color: var(--klm-p);
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 600;
  transition: .18s;
}

.klm-code-btn:hover { background: rgba(var(--klm-p-rgb), .18); }
.klm-code-btn:disabled { background: #f3f6f7; border-color: var(--klm-line); color: var(--klm-muted); cursor: not-allowed; }

.klm-err {
  display: none;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--klm-danger);
}

.klm-err svg { width: 12px; height: 12px; flex: none; }
.klm-field.klm-bad .klm-err { display: flex; }
.klm-field.klm-bad .klm-ctrl input { border-color: #fca5a5; box-shadow: 0 0 0 4px rgba(239, 68, 68, .08); }

.klm-shake { animation: klm-shake .4s; }

@keyframes klm-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.klm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 20px;
  gap: 10px;
}

.klm-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--klm-ink2);
  user-select: none;
}

.klm-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.klm-box {
  width: 17px;
  height: 17px;
  border-radius: 5px;
  border: 1.5px solid #d3dbe3;
  background: #fff;
  display: grid;
  place-items: center;
  transition: .2s;
}

.klm-box svg { width: 11px; height: 11px; opacity: 0; transform: scale(.6); transition: .2s; color: #fff; }
.klm-check input:checked + .klm-box { background: var(--klm-p); border-color: var(--klm-p); }
.klm-check input:checked + .klm-box svg { opacity: 1; transform: none; }
.klm-check input:focus-visible + .klm-box { box-shadow: 0 0 0 4px rgba(var(--klm-p-rgb), .16); }

.klm-link {
  color: var(--klm-p);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
  transition: .18s;
}

.klm-link:hover { filter: brightness(.88); text-decoration: underline; text-underline-offset: 3px; }

.klm-submit {
  position: relative;
  width: 100%;
  height: 47px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 1.2px;
  font-family: inherit;
  background: linear-gradient(135deg, #1fd0d0, #0fbcbc 55%, #0dacac);
  box-shadow: 0 12px 24px -12px rgba(19, 194, 194, .95);
  overflow: hidden;
  transition: transform .18s, box-shadow .22s, filter .2s;
}

.klm-submit::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 45%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-18deg);
  transition: left .55s ease;
}

.klm-submit:hover { transform: translateY(-1px); box-shadow: 0 16px 30px -12px rgba(19, 194, 194, 1); }
.klm-submit:hover::after { left: 115%; }
.klm-submit:active { transform: translateY(0) scale(.995); }
.klm-submit[data-state="loading"] { pointer-events: none; filter: saturate(.9); }
.klm-submit[data-state="loading"] .klm-t { opacity: 0; }

.klm-submit[data-state="loading"]::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 50%;
  top: 50%;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .42);
  border-top-color: #fff;
  animation: klm-spin .7s linear infinite;
}

@keyframes klm-spin { to { transform: rotate(360deg); } }

.klm-submit[data-state="ok"] {
  background: linear-gradient(135deg, #34d399, #10b981);
  box-shadow: 0 12px 24px -12px rgba(16, 185, 129, .9);
}

.klm-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  color: #adb5bf;
  font-size: 12px;
}

.klm-divider:empty { display: none; }
.klm-divider::before,
.klm-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #edf1f4, transparent);
}

.klm-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.klm-socials:empty { display: none; }

.klm-social {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--klm-line);
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #6b7280;
  font-size: 20px;
  transition: .2s;
  text-decoration: none;
}

.klm-social:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--klm-p-rgb), .35);
  box-shadow: 0 8px 18px -10px rgba(19, 194, 194, .7);
  color: var(--klm-p);
}

.klm-reg {
  margin: 20px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--klm-muted);
}

.klm-reg a {
  color: var(--klm-p);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.klm-reg a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 成功态 */
.klm-done {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(255, 255, 255, .93);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: .3s;
  border-radius: 16px;
}

.klm-done.klm-on { opacity: 1; visibility: visible; }

.klm-tick {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #34d399, #10b981);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 16px 32px -14px rgba(16, 185, 129, .9);
  animation: klm-pop .45s cubic-bezier(.2, 1.4, .4, 1) both;
}

.klm-tick svg { width: 30px; height: 30px; }

@keyframes klm-pop {
  from { transform: scale(.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.klm-done h4 { margin: 0; font-size: 17px; color: var(--klm-ink); }
.klm-done p { margin: 0; font-size: 13px; color: var(--klm-muted); }

/* 入场错峰 */
.klm-mask.klm-on .klm-brand { animation: klm-in .5s cubic-bezier(.16, 1, .3, 1) .08s both; }
.klm-mask.klm-on .klm-title { animation: klm-in .55s cubic-bezier(.16, 1, .3, 1) .14s both; }
.klm-mask.klm-on .klm-desc { animation: klm-in .55s cubic-bezier(.16, 1, .3, 1) .2s both; }
.klm-mask.klm-on .klm-list { animation: klm-in .55s cubic-bezier(.16, 1, .3, 1) .26s both; }
.klm-mask.klm-on .klm-foot { animation: klm-in .55s cubic-bezier(.16, 1, .3, 1) .32s both; }
.klm-mask.klm-on .klm-panel { animation: klm-in .55s cubic-bezier(.16, 1, .3, 1) .1s both; }

@keyframes klm-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* 窄屏 */
@media (max-width: 880px) {
  .klm-mask { padding: 14px; }

  .klm-modal {
    width: calc(100vw - 28px);
    max-width: calc(100vw - 28px);
    grid-template-columns: 1fr;
    max-height: 94vh;
    overflow: auto;
  }

  .klm-modal > * { min-width: 0; width: 100%; }
  .klm-visual { min-height: 220px; }
  .klm-note, .klm-ring, .klm-dots { display: none; }
  .klm-content { padding: 24px 22px 20px; }
  .klm-title { font-size: 22px; }
  .klm-desc { font-size: 12.5px; margin-top: 10px; }
  .klm-list { display: none; }
  .klm-foot { margin-top: 16px; padding-top: 13px; flex-wrap: wrap; gap: 8px; }
  .klm-panel { padding: 26px 22px 28px; }

  .klm-close {
    top: 12px;
    left: 12px;
    right: auto;
    width: 30px;
    height: 30px;
    background: rgba(8, 40, 38, .42);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .35);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }

  .klm-close:hover { background: rgba(8, 40, 38, .66); color: #fff; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .klm-mask,
  .klm-mask * {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

body.klm-lock {
  overflow: hidden !important;
}
