/* ==========================================================================
   基础服务条例弹窗（会员中心全站）
   - 每次页面加载都会弹出，必须点击「同意并继续」才能操作页面
   - 无关闭按钮 / 点遮罩不关闭 / ESC 不关闭
   - 文件位置：assets_custom/css/policy-modal.css
   ========================================================================== */

/* 弹窗打开时锁定页面滚动，避免背景跟随滚动 */
html.pm-lock,
html.pm-lock body {
  overflow: hidden !important;
  height: 100%;
}

.pm-mask {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  background: rgba(20, 22, 26, .58);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  -webkit-text-size-adjust: 100%;
  transition: opacity .22s ease;
}

.pm-mask.pm-hide {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.pm-mask.pm-hide .pm-dialog {
  transform: translateY(12px) scale(.98);
}

.pm-dialog {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, .3);
  overflow: hidden;
  animation: pmIn .28s cubic-bezier(.22, .61, .36, 1);
  transition: transform .22s ease;
}

@keyframes pmIn {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ------------------------------ 头部 ------------------------------ */
.pm-head {
  flex: 0 0 auto;
  padding: 20px 24px 14px;
  text-align: center;
  border-bottom: 1px solid #f0f1f3;
}

.pm-title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
  color: #e60012;
  letter-spacing: .5px;
}

.pm-sub {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.65;
  color: #9aa0a6;
}

/* ------------------------------ 正文 ------------------------------ */
.pm-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 24px 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.pm-body::-webkit-scrollbar { width: 6px; }
.pm-body::-webkit-scrollbar-track { background: transparent; }
.pm-body::-webkit-scrollbar-thumb { background: #d9dde3; border-radius: 3px; }
.pm-body::-webkit-scrollbar-thumb:hover { background: #c3c9d1; }

/* 顶部公告条：红字 + 加粗，用于站点改版等需要强提示的内容 */
.pm-notice {
  margin: 0 0 16px;
  padding: 11px 14px;
  border-radius: 6px;
  background: #fff1f0;
  border: 1px solid #ffd8d5;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.85;
  color: #e60012;
  text-align: justify;
  word-break: break-word;
}

.pm-sec + .pm-sec { margin-top: 16px; }

.pm-sec-title {
  margin: 0 0 9px;
  padding-left: 9px;
  border-left: 3px solid #e60012;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.4;
  color: #1f2329;
}

.pm-note {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.8;
  color: #5b6068;
}

.pm-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: pm-counter;
}

.pm-list li {
  position: relative;
  margin-bottom: 7px;
  padding-left: 25px;
  font-size: 13.5px;
  line-height: 1.85;
  color: #3d4148;
  text-align: justify;
  word-break: break-word;
}

.pm-list li::before {
  counter-increment: pm-counter;
  content: counter(pm-counter) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
  color: #e60012;
}

/* 关键词高亮（浅粉底 + 红字），用于强调免责 / 不退等硬性条款 */
.pm-hl {
  padding: 0 3px;
  border-radius: 2px;
  background: #ffe3ec;
  color: #d81e06;
  font-weight: 600;
}

.pm-body-end {
  height: 10px;
}

/* ------------------------------ 底部 ------------------------------ */
.pm-foot {
  flex: 0 0 auto;
  padding: 12px 24px 18px;
  border-top: 1px solid #f0f1f3;
  background: #fff;
}

.pm-btn {
  display: block;
  width: 100%;
  height: 46px;
  border: 0;
  border-radius: 6px;
  background: #2fb344;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  pointer-events: auto !important;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .2s ease, opacity .2s ease;
}

.pm-btn:hover { background: #29a03d; }
.pm-btn:active { background: #248c35; }

.pm-btn:disabled {
  background: #c8cdd5;
  cursor: not-allowed;
}

/* 未勾选就点按钮时的抖动提示 */
.pm-shake { animation: pmShake .42s ease; }

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

/* ------------------------------ 移动端 ------------------------------ */
@media (max-width: 640px) {
  .pm-mask { padding: 10px; }

  .pm-dialog {
    max-width: none;
    max-height: 90vh;
    border-radius: 10px;
  }

  .pm-head { padding: 16px 16px 12px; }
  .pm-title { font-size: 17px; }
  .pm-sub { font-size: 11.5px; }

  .pm-body { padding: 12px 16px 4px; }
  .pm-notice { font-size: 12.5px; padding: 10px 12px; margin-bottom: 14px; }
  .pm-sec-title { font-size: 14px; }
  .pm-list li { font-size: 13px; line-height: 1.8; padding-left: 22px; }

  .pm-foot { padding: 10px 16px 14px; }
  .pm-btn { height: 44px; font-size: 14.5px; }
}

@media (max-width: 360px) {
  .pm-list li { font-size: 12.5px; }
}

/* 打印时不显示弹窗 */
@media print {
  .pm-mask { display: none !important; }
}
