.header {
  text-align: center;
}

.tool-name,
.letter-filter {
  border-bottom: 1px solid #eee;
  padding-bottom: 30px;
}

.title {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  color: #2563eb;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

/* 搜索框 */
.search-container {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 42rem;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 1rem;
}

.search-input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  font-size: 1rem;
  background-color: white;
  color: #1e293b;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-input::placeholder {
  color: #94a3b8;
}

/* 字母筛选栏 */
.letter-filter {
  overflow-x: auto;
}

.letter-container {
  display: flex;
  gap: 0.25rem;
  justify-content: center;
  min-width: max-content;
}

.letter-btn {
  padding: 0.5rem 0.875rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.5rem;
  background-color: white;
  color: #64748b;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 2.5rem;
  text-align: center;
}

.letter-btn:hover {
  border-color: #cbd5e1;
  background-color: #f8fafc;
}

.letter-btn.active {
  background-color: #2563eb;
  color: white;
  border-color: #2563eb;
}

/* 主内容区 */
.main-content {
  padding: 2rem 0;
}

/* 国家卡片网格 */
.country-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .country-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .country-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .country-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* 国家卡片 */
.country-card {
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.country-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border-color: #cbd5e1;
}

/* 国旗 */
.flag {
  width: 4rem;
  height: auto;
  border-radius: 0.375rem;
  object-fit: cover;
  border: 1px solid #e2e8f0;
  flex-shrink: 0;
}

/* 国家信息 */
.country-info {
  flex: 1;
}

.country-name {
  font-weight: 700;
  font-size: 1.125rem;
  color: #1e293b;
  margin-bottom: 0.125rem;
}

.country-name-en {
  font-size: 0.875rem;
  color: #64748b;
  display: block;
  margin-bottom: 0.5rem;
}

/* 区号和其他代码 */
.phone-code {
  color: #2563eb;
  font-weight: 600;
  margin-top: 0.5rem;
  font-size: 1.125rem;
}

.code-item {
  font-size: 0.8125rem;
  color: #475569;
  margin-top: 0.25rem;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 5rem 0;
}

.empty-icon {
  font-size: 3rem;
  color: #cbd5e1;
  margin-bottom: 1rem;
}

.empty-text {
  color: #64748b;
  font-size: 1.125rem;
}

.hidden {
  display: none !important;
}

/* 复制成功提示 */
.copy-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: #10b981;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  font-weight: 500;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 移动端优化 */
@media (max-width: 640px) {
  .header {
    padding: 1rem 0;
  }

  .title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }

  .search-input {
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    font-size: 0.9375rem;
    width: auto;
  }

  .country-card {
    padding: 1rem;
  }

  .flag {
    width: 3.5rem;
    height: 2.625rem;
  }

  .country-name {
    font-size: 1rem;
  }

  .phone-code {
    font-size: 1rem;
  }
}