/* ═══════════ 国家选择器 ═══════════ */

/* 触发按钮（在输入框左侧） */
.cc-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px 0 12px;
  align-self: stretch;
  background: transparent;
  border: none;
  border-right: 1.5px solid var(--line);
  cursor: pointer;
  font-family: inherit;
  color: var(--text-2);
  flex: 0 0 auto;
  transition: background .15s;
}
.cc-trigger:active { background: rgba(255,255,255,.05); }
.cc-flag {
  font-size: 17px;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.3));
}
.cc-dial {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.cc-arrow {
  width: 7px;
  height: 5px;
  margin-left: 1px;
  opacity: .65;
}
.cc-arrow path {
  stroke: var(--text-2);
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
}

/* 选择器遮罩 */
.cc-mask {
  position: fixed;
  inset: 0;
  background: rgba(8,5,14,.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: ccFade .18s ease-out;
}
.cc-mask[hidden] { display: none; }
@keyframes ccFade { from { opacity: 0; } to { opacity: 1; } }

/* 面板 */
.cc-panel {
  width: 100%;
  max-width: 480px;
  height: 76vh;
  max-height: 640px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border-radius: 24px 24px 0 0;
  border-top: 1px solid rgba(255,255,255,.1);
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: ccUp .26s cubic-bezier(.2,.9,.3,1);
}
@keyframes ccUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.cc-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,.2);
  margin: 8px auto 6px;
  flex: 0 0 auto;
}

.cc-head {
  padding: 4px 18px 10px;
  flex: 0 0 auto;
}
.cc-head h3 {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.01em;
  text-align: center;
}

/* 搜索框 */
.cc-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.06);
  border: 1.5px solid var(--line);
  border-radius: 11px;
  transition: border-color .16s;
}
.cc-search-wrap:focus-within { border-color: var(--pink); }
.cc-search-icon {
  padding: 0 8px 0 12px;
  font-size: 13px;
  opacity: .5;
  flex: 0 0 auto;
}
.cc-search {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  padding: 11px 12px 11px 0;
}
.cc-search::placeholder { color: var(--text-3); }
.cc-clear {
  padding: 0 12px;
  background: transparent;
  border: none;
  color: var(--text-3);
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  flex: 0 0 auto;
}
.cc-clear[hidden] { display: none; }

/* 列表 */
.cc-list {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 10px 12px;
  scrollbar-width: thin;
}
.cc-list::-webkit-scrollbar { width: 4px; }
.cc-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 2px; }

.cc-group-label {
  padding: 12px 8px 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--text-3);
  text-transform: uppercase;
}

.cc-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-family: inherit;
  color: var(--text);
}
.cc-item:active { background: rgba(255,255,255,.07); }
.cc-item.active { background: rgba(255,61,113,.14); }

.cc-item .i-flag {
  font-size: 21px;
  line-height: 1;
  flex: 0 0 auto;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.35));
}
.cc-item .i-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.cc-item .i-name {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cc-item .i-iso {
  font-size: 9.5px;
  color: var(--text-3);
  font-weight: 600;
  letter-spacing: .04em;
}
.cc-item .i-dial {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}
.cc-item.active .i-dial { color: var(--pink); }
.cc-item .i-check {
  font-size: 13px;
  color: var(--pink);
  width: 14px;
  flex: 0 0 auto;
}

.cc-empty {
  padding: 40px 20px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
  line-height: 1.6;
}

/* 顶栏换成国家选择器时为小尺寸 */
.lang-select-hidden { display: none; }
