/* ============================================================
   KPOP.WANG 全站登录弹层（2026-09-14）
   用途：点击导航「登录」/ 客户中心「去登录」时，在**当前页面**弹出
        「左扫码 + 右表单」双栏登录卡片，不再跳转独立登录页 /member/login。
   引入：comm/head.html · index.html · client/index.html · craft/index.html
   依赖：无。登录提交 POST /member/login/ ，验证码图 /core/code.php
   规范：品牌蓝 #1677FF / 深 #0958D9 ｜ 卡片 #FFFFFF ｜ 主文字 #1D2129
        次文字 #4E5969 ｜ 弱文字 #86909C ｜ 描边 #E5E6EB
   ⚠️ 命名空间 .kplm-*，与登录页的 .kpl-* 完全隔离（互不影响）。
   ⚠️ 所有选择器带 html body 前缀：压过 skin/css/style.css 的
      a{color:var(--gold)} 与 kp-ipage.css / kp-mobile.css 的层级。
   ⚠️ 媒体查询必须写在全部基础规则之后（同特异性反压陷阱）。
   ============================================================ */

/* ---------- 0. 根容器 / 遮罩 ---------- */
html body .kplm {
  position: fixed;
  inset: 0;
  z-index: 9980;
  visibility: hidden;
  opacity: 0;
  transition: opacity .2s ease, visibility .2s ease;
}
html body .kplm.kplm-on { visibility: visible; opacity: 1; }

html body .kplm-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .44);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
html body .kplm-wrap {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  overflow-y: auto;
  display: flex;
  padding: 28px 18px;
}

/* ---------- 1. 卡片 ---------- */
html body .kplm-card {
  position: relative;
  margin: auto;
  width: min(904px, 100%);
  min-height: 0;
  background: #FFFFFF;
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .26), 0 4px 14px rgba(29, 33, 41, .06);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  transform: translateY(10px) scale(.985);
  transition: transform .26s cubic-bezier(.2, .8, .3, 1);
}
html body .kplm-on .kplm-card { transform: none; }

html body .kplm-close {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 3;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #86909C;
  font-size: 21px;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  transition: background .18s, color .18s;
}
html body .kplm-close:hover { background: #F2F3F5; color: #1D2129; }

/* ---------- 2. 左栏：扫码登录（预留 · 公众号未配置） ---------- */
html body .kplm-left {
  width: 304px;
  flex: none;
  padding: 46px 26px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #FCFDFF 0%, #F5FAFF 100%);
  position: relative;
}
html body .kplm-left::after {
  content: '';
  position: absolute;
  right: 0;
  top: 12%;
  bottom: 12%;
  width: 1px;
  background: linear-gradient(180deg, rgba(229, 230, 235, 0) 0%, #EAECF0 14%, #EAECF0 86%, rgba(229, 230, 235, 0) 100%);
}
html body .kplm-qr-title {
  margin: 0 0 24px;
  font-size: 20px;
  font-weight: 600;
  color: #1D2129;
  letter-spacing: 3px;
  line-height: 1.2;
  text-align: center;
}
html body .kplm-qr-box {
  position: relative;
  width: 176px;
  height: 176px;
  box-sizing: border-box;
  padding: 8px;
  background: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 0 0 1px #EEF0F4, 0 10px 26px rgba(29, 33, 41, .06);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
html body .kplm-qr-box canvas {
  display: block;
  width: 160px;
  height: 160px;
  border-radius: 6px;
}
html body .kplm-qr-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, #1677FF, #0958D9);
  color: #FFFFFF;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 4px #FFFFFF, 0 4px 10px rgba(22, 119, 255, .3);
}
html body .kplm-qr-tag {
  position: absolute;
  top: -11px;
  right: -11px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #FFF7E8;
  border: 1px solid #FFE4BA;
  color: #FF7D00;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}
html body .kplm-qr-tip {
  margin: 38px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: #86909C;
  text-align: center;
}
html body .kplm-qr-tip b { color: #07C160; font-weight: 600; }

/* ---------- 3. 右栏：品牌 + 表单 ---------- */
html body .kplm-right {
  flex: 1;
  min-width: 0;
  padding: 36px 44px 32px;
  box-sizing: border-box;
  overflow-y: auto;
}
html body .kplm-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  padding-right: 34px;
}
html body .kplm-brand-mark {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 11px;
  background: linear-gradient(135deg, #1677FF, #0958D9);
  color: #FFFFFF;
  font-weight: 800;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(22, 119, 255, .28);
}
html body .kplm-brand-text { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
html body .kplm-brand-cn {
  font-size: 18px;
  font-weight: 800;
  color: #1D2129;
  letter-spacing: .6px;
  line-height: 1.1;
}
html body .kplm-brand-en {
  margin-top: 3px;
  font-size: 9px;
  color: #86909C;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  white-space: nowrap;
}
html body .kplm-brand-div { width: 1px; height: 28px; flex: none; background: #E5E6EB; }
html body .kplm-brand-sub {
  font-size: 18px;
  font-weight: 700;
  color: #1D2129;
  letter-spacing: 1.4px;
  white-space: nowrap;
}

/* ---------- 4. Tab ---------- */
html body .kplm-tabs { display: flex; gap: 32px; }
html body .kplm-tab {
  position: relative;
  padding: 0 2px 11px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 15.5px;
  color: #4E5969;
  cursor: pointer;
  transition: color .18s;
}
html body .kplm-tab:hover { color: #1677FF; }
html body .kplm-tab.active { color: #1677FF; font-weight: 600; }
html body .kplm-tab.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: #1677FF;
}

/* ---------- 5. 表单 ---------- */
html body .kplm-pane { display: none; padding-top: 2px; }
html body .kplm-pane.active { display: block; }
html body .kplm-field { margin-top: 16px; }
html body .kplm-label {
  display: block;
  margin-bottom: 1px;
  font-size: 13.5px;
  color: #1D2129;
  line-height: 1.6;
}
html body .kplm-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-bottom: 1px solid #E5E6EB;
  border-radius: 0;
  background: transparent;
  outline: none;
  padding: 8px 0 10px;
  font-family: inherit;
  font-size: 15px;
  color: #1D2129;
  line-height: 1.4;
  box-shadow: none;
  transition: border-color .18s;
}
html body .kplm-input::placeholder { color: #C9CDD4; }
html body .kplm-input:focus { border-bottom-color: #1677FF; box-shadow: none; }
html body .kplm-pwd { position: relative; }
html body .kplm-pwd .kplm-input { padding-right: 40px; }
html body .kplm-eye {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #86909C;
  font-size: 15px;
  cursor: pointer;
  transition: color .18s;
}
html body .kplm-eye:hover,
html body .kplm-eye.on { color: #1677FF; }
/* 密码显隐图标：两个内联 SVG 按 .on 互斥显示（不依赖 icon font） */
html body .kplm-eye svg { width: 17px; height: 17px; display: block; }
html body .kplm-eye .kplm-eye-off { display: none; }
html body .kplm-eye.on .kplm-eye-on { display: none; }
html body .kplm-eye.on .kplm-eye-off { display: block; }

html body .kplm-code-row { display: flex; align-items: flex-end; gap: 14px; }
html body .kplm-code-row .kplm-input { flex: 1; min-width: 0; }
html body .kplm-code-img {
  flex: none;
  height: 34px !important;
  width: auto !important;
  border: 1px solid #E5E6EB;
  border-radius: 6px;
  background: #FFFFFF;
  cursor: pointer;
}
html body .kplm-send {
  flex: none;
  height: 34px;
  padding: 0 14px;
  border: 1px solid #1677FF;
  border-radius: 8px;
  background: #FFFFFF;
  color: #1677FF;
  font-family: inherit;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: background .18s;
}
html body .kplm-send:hover { background: #F2F7FF; }

html body .kplm-aux { margin-top: 12px; font-size: 13.5px; text-align: right; line-height: 1.6; }
html body .kplm-aux a { color: #86909C !important; }
html body .kplm-aux a:hover { color: #1677FF !important; }

html body .kplm-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 26px;
}
html body .kplm-btn {
  min-width: 126px;
  height: 44px;
  padding: 0 32px;
  border: 0;
  border-radius: 22px;
  background: #1677FF;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 3px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(22, 119, 255, .26);
  transition: background .18s, box-shadow .18s;
}
html body .kplm-btn:hover { background: #0958D9; }
html body .kplm-btn[disabled] { opacity: .62; cursor: not-allowed; box-shadow: none; }
html body .kplm-register { font-size: 13.5px; color: #1D2129 !important; white-space: nowrap; }
html body .kplm-register:hover { color: #1677FF !important; }

/* ---------- 6. 其他登录方式（预留） ---------- */
html body .kplm-oauth { margin-top: 24px; }
html body .kplm-oauth-hd {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: #86909C;
}
html body .kplm-oauth-hd::before,
html body .kplm-oauth-hd::after { content: ''; flex: 1; height: 1px; background: #EEF0F4; }
html body .kplm-oauth-list { display: flex; flex-direction: column; gap: 0; }
html body .kplm-oauth-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 11px;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s;
}
html body .kplm-oauth-item:hover { background: #F7F9FC; text-decoration: none; }
html body .kplm-oauth-ico {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 700;
}
html body .kplm-oauth-ico.wechat { background: #07C160; }
html body .kplm-oauth-ico.alipay { background: #1677FF; font-size: 16px; }
/* 微信图标用内联 SVG（client/craft 物理静态页无 icon font） */
html body .kplm-oauth-ico svg { width: 19px; height: 19px; display: block; }
html body .kplm-oauth-tx { display: flex; flex-direction: column; min-width: 0; }
html body .kplm-oauth-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 500;
  color: #1D2129 !important;
  line-height: 1.4;
}
html body .kplm-oauth-desc { margin-top: 2px; font-size: 11.5px; color: #86909C; line-height: 1.5; }
html body .kplm-badge-soon {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 400;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 4px;
  background: #FFF7E8;
  border: 1px solid #FFE4BA;
  color: #FF7D00;
  white-space: nowrap;
}

/* ---------- 7. 轻提示（弹层内） ---------- */
html body .kplm-toast {
  position: fixed;
  left: 50%;
  top: 34px;
  transform: translate(-50%, -16px);
  max-width: 80vw;
  padding: 11px 20px;
  border-radius: 10px;
  background: rgba(29, 33, 41, .92);
  color: #FFFFFF;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s, transform .24s;
  z-index: 9999;
}
html body .kplm-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 8. 锁滚动 ----------
   ⚠️ class 由 JS 挂在 <html> 上（documentElement），不是 body：
      html 上的 overflow:hidden 才能可靠阻止背景滚动；body 一并兜底 iOS。 */
html.kplm-lock,
html.kplm-lock body { overflow: hidden !important; }

/* ============================================================
   9. 响应式（必须置于全部基础规则之后）
   ============================================================ */
@media (max-width: 900px) {
  html body .kplm-wrap { padding: 18px 14px; }
  html body .kplm-card { width: 100%; display: block; border-radius: 18px; }
  html body .kplm-left { display: none; }   /* 手机端同屏无法自扫，隐藏扫码区 */
  html body .kplm-right { padding: 30px 22px 26px; max-height: calc(100vh - 36px); }
  html body .kplm-close { right: 8px; top: 8px; }
  html body .kplm-brand {
    margin-bottom: 20px;
    gap: 10px;
    padding-right: 32px;
    flex-wrap: wrap;
  }
  html body .kplm-brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 15px; }
  html body .kplm-brand-cn { font-size: 16.5px; }
  html body .kplm-brand-en { display: none; }
  html body .kplm-brand-sub { font-size: 15px; letter-spacing: .6px; }
  html body .kplm-brand-div { height: 24px; }
  html body .kplm-tabs { gap: 26px; }
  html body .kplm-tab { font-size: 15px; }
  html body .kplm-field { margin-top: 15px; }
  html body .kplm-input { font-size: 16px; }     /* 防 iOS 聚焦自动放大 */
  html body .kplm-actions { flex-direction: column; gap: 12px; margin-top: 24px; }
  html body .kplm-btn { width: 100%; }
  html body .kplm-register { text-align: center; }
  html body .kplm-oauth { margin-top: 22px; }
}
@media (max-width: 380px) {
  html body .kplm-right { padding: 26px 16px 22px; }
  html body .kplm-brand-sub { display: none; }
  html body .kplm-brand-div { display: none; }
}
