/* country-modal version: viewport-center
 * 当前版：弹层挂到 body，强制屏幕正中间（兼容 html scale）
 */
.pv-country-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.45);
  /* 挂到 body 后需显式恢复，避免继承 body { line-height: 0 } */
  line-height: normal;
  font-family: var(--font);
  color: var(--text-dark);
}
.pv-country-modal.open {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.pv-country-panel {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  flex: 0 0 auto;
  align-self: center;
  width: min(72rem, calc(100vw - 3rem));
  max-height: 80vh;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pv-country-hd {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.875rem 1.25rem;
}
.pv-country-hd-title {
  font-size: var(--kerui-fs-body);
  font-weight: 700;
  color: var(--text-dark);
  flex-shrink: 0;
}
.pv-country-letters {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  margin-left: auto;
  flex-wrap: nowrap;
  overflow: hidden;
}
.pv-country-letters span {
  cursor: pointer;
  padding: 0.125rem 0.3125rem;
  font-size: var(--kerui-fs-caption);
  color: var(--text-mid);
  font-family: var(--kerui-font-digits);
}
.pv-country-letters span:hover { color: var(--primary); }
.pv-country-letters span.active {
  color: var(--primary);
  font-weight: 700;
  background: #eef3fb;
  border-radius: 2px;
}
.pv-country-letter-all {
  margin-right: 0.25rem;
  padding: 0.125rem 0.35rem;
  font-weight: 600;
}
.pv-country-search {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  width: 11rem;
  height: 1.75rem;
  background: #f3f4f7;
  border: 1px solid #e4e7ed;
  border-radius: 2px;
  padding: 0 0.625rem;
  flex-shrink: 0;
}
.pv-country-search input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: var(--kerui-fs-caption);
  color: var(--text-dark);
}
.pv-country-search span {
  width: 0.875rem;
  height: 0.875rem;
  background: url("/Style/Home/images/kerui/icon_search.png") center/contain no-repeat;
  font-size: 0;
  flex-shrink: 0;
}
.pv-country-close {
  border: none;
  background: transparent;
  font-size: 1.125rem;
  line-height: 1;
  color: #8a8f99;
  cursor: pointer;
  padding: 0.25rem;
  flex-shrink: 0;
}
.pv-country-close:hover { color: var(--text-dark); }
.pv-country-bd {
  overflow-y: auto;
  padding: 0.75rem 1.25rem 1.25rem;
}
.pv-country-group { margin-bottom: 0.5rem; }
.pv-country-group-hd {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 0;
  font-size: var(--kerui-fs-caption);
  font-weight: 700;
  color: var(--text-dark);
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid #e0e4ea;
  margin-bottom: 0.375rem;
}
.pv-country-group-hd::after {
  content: "▾";
  font-size: 0.625rem;
  color: #8a8f99;
}
.pv-country-group.collapsed .pv-country-group-hd::after { content: "▸"; }
.pv-country-group.collapsed .pv-country-list { display: none; }
.pv-country-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.375rem 0.75rem;
  padding-bottom: 0.375rem;
}
.pv-country-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.5rem;
  font-size: var(--kerui-fs-caption);
  color: var(--text-mid);
  cursor: pointer;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
}
.pv-country-item:hover { background: #f3f6fc; color: var(--primary); }
.pv-country-item.active {
  color: var(--primary);
  font-weight: 700;
  background: #eef3fb;
}
.pv-country-item .pv-country-flag {
  font-size: 0.875rem;
  flex-shrink: 0;
  display: inline-flex;
  overflow: hidden;
  border-radius: 0.25rem;
  line-height: 0;
}
.pv-flag-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.25rem;
  display: block;
}
.pv-country-item .pv-country-flag .pv-flag-img {
  width: 1.125rem;
  height: 0.8125rem;
  border-radius: 0.25rem;
}
.pv-country-item .pv-country-new {
  flex-shrink: 0;
  width: 15px;
  margin-left: 5px;
  transform: translateY(-0.3125rem);
}
.pv-country-empty {
  padding: 2rem 0;
  text-align: center;
  color: var(--text-light);
  font-size: var(--kerui-fs-caption);
}
