/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f7fa;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 头部样式 */
header {
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 {
  font-size: 1.8rem;
  color: #2c3e50;
  text-align: center;
  margin-bottom: 1rem;
}

nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

nav a {
  text-decoration: none;
  color: #3498db;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  font-weight: 500;
}

nav a:hover {
  background-color: #e3f2fd;
}

nav a.active {
  background-color: #3498db;
  color: white;
}

nav a.logout {
  color: #e74c3c;
  margin-left: auto;
}

nav a.logout:hover {
  background-color: #ffebee;
}

/* 主内容区域 */
main {
  padding: 2rem 0;
  min-height: calc(100vh - 200px);
}

section {
  background-color: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

section h2 {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  text-align: center;
}

.subtitle {
  text-align: center;
  color: #7f8c8d;
  margin-bottom: 2rem;
  font-size: 1rem;
}

/* 表单样式 */
form {
  max-width: 800px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #555;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.form-actions {
  margin-top: 2rem;
  text-align: center;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0 0.5rem;
}

.btn-primary,
.upload-btn,
.search-btn {
  background-color: #3498db;
  color: white;
}

.btn-primary:hover,
.upload-btn:hover,
.search-btn:hover {
  background-color: #2980b9;
}

.btn-secondary {
  background-color: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.btn-warning {
  background-color: #f39c12;
  color: white;
}

.btn-warning:hover {
  background-color: #e67e22;
}

/* 拖拽上传区域 */
.drop-zone {
  border: 2px dashed #3498db;
  border-radius: 8px;
  padding: 3rem;
  text-align: center;
  transition: all 0.3s ease;
  background-color: #f8f9fa;
  cursor: pointer;
  margin-bottom: 1rem;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: #2980b9;
  background-color: #e3f2fd;
}

.drop-zone-content .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.drop-zone-content h3 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.browse-btn {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  margin-bottom: 1rem;
  transition: background-color 0.3s ease;
}

.browse-btn:hover {
  background-color: #2980b9;
}

.hint {
  color: #7f8c8d;
  font-size: 0.9rem;
}

/* 文件列表 */
.file-list {
  margin: 1rem 0;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 1rem;
  background-color: #f8f9fa;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 1px solid #eee;
}

.file-item:last-child {
  border-bottom: none;
}

.file-item .file-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.file-item .file-name {
  font-weight: 500;
}

.file-item .file-size {
  font-size: 0.8rem;
  color: #7f8c8d;
}

.remove-file {
  background: none;
  border: none;
  color: #e74c3c;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.25rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.remove-file:hover {
  background-color: #ffebee;
}

/* 上传按钮 */
.upload-btn {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  width: 100%;
  max-width: 400px;
}

.upload-btn:disabled {
  background-color: #bdc3c7;
  cursor: not-allowed;
}

/* 功能特性区域 */
.features {
  text-align: center;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.feature-item {
  padding: 2rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.feature-item h3 {
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.feature-item p {
  color: #7f8c8d;
  font-size: 0.9rem;
}

/* 结果页面 */
.result-section {
  text-align: center;
}

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.summary-icon {
  font-size: 2rem;
}

.summary-content h3 {
  color: #7f8c8d;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.summary-content .number {
  font-size: 1.8rem;
  font-weight: bold;
  color: #2c3e50;
}

/* 表格样式 */
.results-table-container,
.contacts-table-container {
  overflow-x: auto;
  margin: 2rem 0;
}

.results-table,
.contacts-table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.results-table th,
.results-table td,
.contacts-table th,
.contacts-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.results-table th,
.contacts-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #2c3e50;
  position: sticky;
  top: 0;
  z-index: 10;
}

.results-table tr:hover,
.contacts-table tr:hover {
  background-color: #f8f9fa;
}

.status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.status.success {
  background-color: #d4edda;
  color: #155724;
}

.status.warning {
  background-color: #fff3cd;
  color: #856404;
}

.status.error {
  background-color: #f8d7da;
  color: #721c24;
}

/* 联系人表格特定样式 */
.contacts-table .name {
  font-weight: 600;
}

.contacts-table .email,
.contacts-table .phone {
  color: #3498db;
  text-decoration: none;
}

.contacts-table .email:hover,
.contacts-table .phone:hover {
  text-decoration: underline;
}

.contacts-table .date {
  font-size: 0.9rem;
  color: #7f8c8d;
}

/* 分页样式 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.page-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  color: #3498db;
  transition: all 0.3s ease;
}

.page-link:hover {
  background-color: #f8f9fa;
  border-color: #3498db;
}

.page-link.active {
  background-color: #3498db;
  color: white;
  border-color: #3498db;
}

/* 搜索页面样式 */
.search-section {
  max-width: 800px;
  margin: 0 auto;
}

.search-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  background-color: #f8f9fa;
  color: #7f8c8d;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.tab-btn.active {
  background-color: #3498db;
  color: white;
}

.search-form-container {
  display: none;
}

.search-form-container.active {
  display: block;
}

.simple-search-form {
  display: flex;
  gap: 0.5rem;
}

.search-input-group {
  display: flex;
  flex: 1;
}

.search-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px 0 0 4px;
  font-size: 1rem;
}

.search-btn {
  border-radius: 0 4px 4px 0;
  padding: 0.75rem 1.5rem;
}

.advanced-search-form {
  background-color: #f8f9fa;
  padding: 2rem;
  border-radius: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

/* 重复联系人页面样式 */
.duplicates-section {
  max-width: 1000px;
  margin: 0 auto;
}

.duplicates-stats {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.duplicate-group {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background-color: #f8f9fa;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.match-type {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background-color: #fff3cd;
  color: #856404;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 500;
}

.duplicate-cards {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: center;
}

.duplicate-arrow {
  font-size: 2rem;
  color: #3498db;
}

.duplicate-card {
  background-color: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #eee;
}

.card-header h4 {
  color: #2c3e50;
}

.card-id {
  font-size: 0.8rem;
  color: #7f8c8d;
  background-color: #f8f9fa;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.card-content p {
  margin-bottom: 0.5rem;
}

.import-time {
  margin-top: 1rem;
  color: #7f8c8d;
}

/* 空状态样式 */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #7f8c8d;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

/* 无结果样式 */
.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: #7f8c8d;
  background-color: #f8f9fa;
  border-radius: 8px;
  margin-top: 2rem;
}

/* 警报样式 */
.alert {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  text-align: center;
  font-weight: 500;
}

.alert.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* 部分头部样式 */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.header-actions {
  display: flex;
  gap: 1rem;
}

/* 联系人统计样式 */
.contacts-stats {
  margin-bottom: 1.5rem;
  font-size: 1.1rem;
  color: #7f8c8d;
}

/* 页脚样式 */
footer {
  background-color: #2c3e50;
  color: white;
  text-align: center;
  padding: 2rem 0;
  margin-top: 2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    padding: 0 10px;
  }

  section {
    padding: 1.5rem 1rem;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .duplicate-cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .duplicate-arrow {
    transform: rotate(90deg);
  }

  .section-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .header-actions {
    flex-direction: column;
    width: 100%;
  }

  .header-actions .btn {
    width: 100%;
    margin: 0;
  }

  .simple-search-form {
    flex-direction: column;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .search-tabs {
    flex-direction: column;
  }

  .tab-btn {
    width: 100%;
  }

  .results-table th,
  .results-table td,
  .contacts-table th,
  .contacts-table td {
    padding: 0.5rem;
    font-size: 0.9rem;
  }

  /* 表格滚动优化 */
  .results-table-container,
  .contacts-table-container {
    margin: 1rem -1rem;
    border-radius: 0;
  }
}

@media (max-width: 480px) {
  header h1 {
    font-size: 1.5rem;
  }

  nav {
    gap: 0.5rem;
  }

  nav a {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }

  .drop-zone {
    padding: 2rem 1rem;
  }

  .summary {
    grid-template-columns: 1fr;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .page-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
  }
}