/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 20px 50px;
}

/* 头部样式 */
header {
  text-align: center;
  margin-bottom: 40px;
}

header h1 {
  font-size: 2.8em;
  color: #2c3e50;
  margin-bottom: 10px;
}

header p {
  color: #7f8c8d;
  font-size: 1.2em;
}

/* 分类区块 */
.category {
  margin-bottom: 40px;
  background: white;
  padding: 25px;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease;
}

.category:hover {
  transform: translateY(-5px);
}

.category h2 {
  font-size: 1.5em;
  color: #2980b9;
  margin-bottom: 20px;
  padding-left: 12px;
  border-left: 6px solid #3498db;
}

/* 链接容器 */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.links a {
  flex: 1 1 200px;
  background: #f8f9fa;
  color: #2c3e50;
  text-decoration: none;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
  transition: all 0.3s ease;
  border: 1px solid #eaeaea;
  position: relative;
  padding-right: 28px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 删除按钮 × */
.links a .delete-btn {
  float: right;
  color: #e74c3c;
  font-size: 1.4em;
  font-weight: bold;
  line-height: 0.8;
  opacity: 0;
  transition: opacity 0.2s;
  margin-left: 8px;
}

.links a:hover .delete-btn {
  opacity: 1;
}

.links a:hover {
  background: #3498db;
  color: white;
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3);
}

/* 表单样式 */
.add-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.add-form input {
  flex: 1 1 180px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1em;
  max-width: 250px;
}

.add-form input::placeholder {
  color: #aaa;
}

.add-form button {
  background: #27ae60;
  color: white;
  border: none;
  padding: 0 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s;
}

.add-form button:hover {
  background: #219653;
}

/* 导入导出按钮组 */
.import-export {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.import-export button,
.import-export span {
  background: #8e44ad;
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s;
  text-align: center;
}

.import-export span:hover,
.import-export button:hover {
  background: #7d3c98;
}

/* 底部 */
footer {
  text-align: center;
  margin-top: 30px;
  color: #95a5a6;
  font-size: 0.95em;
}

/* 响应式设计 */
@media (max-width: 768px) {
  header h1 {
    font-size: 2.2em;
  }

  .category {
    padding: 20px;
  }

  .links a {
    min-width: 140px;
    font-size: 0.95em;
    padding: 14px;
  }

  .import-export {
    gap: 10px;
  }

  .import-export button,
  .import-export span {
    padding: 8px 12px;
    font-size: 0.95em;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 15px;
  }

  .add-form {
    gap: 8px;
  }

  .add-form input,
  .add-form button {
    font-size: 1em;
    padding: 10px;
  }

  .links a {
    flex: 1 1 100%;
  }

  footer {
    font-size: 0.85em;
  }
}
