/* 通用样式 */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: #ede7f6;
  color: #333;
}

/* 动画效果 */
.animated-hover {
  transition: all 0.3s ease;
}

.animated-hover:hover {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 卡片样式 */
.card {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* 按钮样式 */
.btn {
  border-radius: 5px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-gradient {
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  color: white;
  border: none;
}

.btn-gradient:hover {
  background: linear-gradient(135deg, #5900b3 0%, #1a68e0 100%);
  color: white;
}

/* 表单样式 */
.form-control {
  border-radius: 5px;
  padding: 0.75rem 1rem;
}

/* 导航栏样式 */
.navbar {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* 导航栏右侧按钮 */
.navbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.navbar-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #495057;
  text-decoration: none;
  transition: all 0.2s ease;
}

.navbar-action:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #2575fc;
}

/* 网站卡片 */
.website-card {
  display: flex;
  align-items: center;
  padding: 15px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  margin-bottom: 15px;
  transition: all 0.3s ease;
  text-decoration: none;
  color: #333;
}

.website-card:hover {
  /* 移除上移效果，增加厚重感 */
  /* transform: translateY(-3px); */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(112, 73, 240, 0.2);
}

.website-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  background: #f8f9fa;
  border-radius: 10px;
  font-size: 1.5rem;
}

.website-info {
  flex: 1;
}

.website-title {
  font-weight: 600;
  margin-bottom: 3px;
}

.website-description {
  color: #6c757d;
  font-size: 0.875rem;
}

/* 管理面板样式 */
.admin-card {
  background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
  color: white;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.admin-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("../images/pattern.svg");
  opacity: 0.1;
}

.admin-card-value {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.admin-card-label {
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 1px;
  opacity: 0.8;
}

.admin-card-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 3rem;
  opacity: 0.2;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* 闪现消息样式 */
.flash-messages {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  width: 300px;
}

.flash-messages .alert {
  margin-bottom: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* 管理侧边栏 */
.admin-sidebar {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
}

.admin-sidebar-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  color: #495057;
  text-decoration: none;
  border-radius: 5px;
  margin-bottom: 5px;
  transition: all 0.2s ease;
}

.admin-sidebar-item:hover {
  background-color: #f8f9fa;
  color: #2575fc;
}

.admin-sidebar-item.active {
  background-color: #e9ecef;
  color: #2575fc;
  font-weight: 500;
}

.admin-sidebar-item i {
  margin-right: 10px;
  font-size: 1.1rem;
}

/* 默认网站图标样式 */
.default-site-icon {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6e8efb, #a777e3);
  border-radius: 8px;
  color: white;
  font-size: 16px;
  text-transform: uppercase;
  font-weight: bold;
}

.default-site-icon.small {
  font-size: 12px;
  border-radius: 4px;
}

/* 卡片容器 */
.card-container {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -10px;
  overflow: hidden;
}

/* 搜索结果卡片样式 */
.site-card {
  text-decoration: none;
  color: inherit;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.3s ease;
  margin: 0 10px 20px 10px;
  width: calc(20% - 20px);
  display: block;
  position: relative;
  border: 3px solid transparent;
  box-sizing: border-box;
}

/* 调整不同屏幕尺寸下卡片宽度 */
@media (max-width: 1200px) {
  .site-card {
    width: calc(25% - 20px);
  }
}

@media (max-width: 992px) {
  .site-card {
    width: calc(33.333% - 20px);
  }
}

@media (max-width: 768px) {
  .site-card {
    width: calc(50% - 20px);
  }
}

@media (max-width: 576px) {
  .site-card {
    width: calc(100% - 20px);
  }
}

/* 搜索结果少于5个时的特殊规则 */
.card-container.results-4 .site-card {
  width: calc(25% - 20px);
}

.card-container.results-3 .site-card {
  width: calc(33.333% - 20px);
}

.card-container.results-2 .site-card {
  width: calc(50% - 20px);
}

.card-container.results-1 .site-card {
  width: calc(100% - 20px);
}

.site-card:hover {
  box-shadow: 0 8px 20px rgba(74, 136, 252, 0.3);
  border: 1px solid #4a88fc;
  filter: drop-shadow(0 0 5px rgba(74, 136, 252, 0.5));
}

/* 卡片拖拽样式 */
.card-container.draggable {
  padding-top: 10px;
  padding-bottom: 10px;
}

.site-card.draggable {
  cursor: move;
  position: relative;
}

.site-card.drag-ghost {
  opacity: 0.6;
  transform: scale(0.95);
  border: 2px dashed #7049f0;
}

.site-card.drag-over {
  box-shadow: 0 0 15px rgba(112, 73, 240, 0.5);
  transform: translateY(-2px);
}

.site-card.dragging {
  opacity: 0.6;
  border: 2px solid rgba(112, 73, 240, 0.5);
  z-index: 100;
}

/* 更具体地限定拖拽手柄 */
.drag-handle {
  display: none !important; /* 默认隐藏所有拖拽手柄 */
}

/* 站点卡片中的拖拽手柄 */
.site-card .drag-handle {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: rgba(112, 73, 240, 0.1);
  color: #7049f0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 12px;
  cursor: move;
}

/* 处理右上角独立显示的拖拽手柄 */
.sidebar-content .drag-handle:not(.sidebar-drag-handle) {
  display: none !important;
}

.site-card:hover .drag-handle {
  opacity: 1;
}

.drag-instructions {
  display: none;
  padding: 8px 16px;
  background-color: rgba(112, 73, 240, 0.1);
  border-radius: 20px;
  color: #7049f0;
  font-size: 13px;
  margin-bottom: 10px;
  text-align: center;
}

.drag-instructions.active {
  display: block;
}

/* 编辑对话框样式 */
.modal-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color 0.15s ease-in-out;
}

.modal-input:focus {
  border-color: #7049f0;
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(112, 73, 240, 0.25);
}

textarea.modal-input {
  resize: vertical;
  min-height: 100px;
  white-space: pre-wrap;
  overflow-y: auto;
}

/* 排序权重输入框样式 */
.form-control-sm {
  height: 32px;
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}
