/* 通用样式 */
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) {
  .main-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
    display: block !important;
  }
  .content-container {
    padding-left: 0.8rem;
    padding-right: 0.8rem;
    box-sizing: border-box;
    max-width: 100vw;
  }
  .card-container {
    margin: 0;
    padding: 0;
  }
  .site-card {
    width: 100%;
    margin: 0 0 20px 0;
    box-sizing: border-box;
  }
  .site-description {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: normal !important;
  }
}

/* 搜索结果少于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 {
  padding-top: 5px;
  padding-bottom: 5px;
}

.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;
}

/* 高亮显示卡片样式 */
@keyframes highlightPulse {
  0% {
    border: 3px solid rgba(255, 0, 0, 0.8);
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.6);
    transform: scale(1);
  }
  50% {
    border: 3px solid rgba(255, 0, 0, 1);
    box-shadow: 0 0 20px 8px rgba(255, 0, 0, 0.8);
    transform: scale(1.04);
  }
  85% {
    border: 3px solid rgba(255, 0, 0, 0.3);
    box-shadow: 0 0 10px 4px rgba(255, 0, 0, 0.4);
    transform: scale(1.01);
  }
  100% {
    border: 3px solid rgba(255, 0, 0, 0);
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
    transform: scale(1);
  }
}

.highlight-card {
  animation: highlightPulse 1.5s ease-in-out 4;
  background: rgba(255, 0, 0, 0.05) !important;
  z-index: 10;
  position: relative;
}

/* 临时通知样式 */
.quick-add-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  transition: opacity 0.3s ease;
  min-width: 200px;
}

.quick-add-notification.success {
  background: linear-gradient(145deg, #4caf50, #43a047);
  color: white;
  border-left: 4px solid #2e7d32;
}

.quick-add-notification.warning {
  background: linear-gradient(145deg, #ff9800, #f57c00);
  color: white;
  border-left: 4px solid #e65100;
}

.quick-add-notification.error {
  background: linear-gradient(145deg, #f44336, #e53935);
  color: white;
  border-left: 4px solid #c62828;
}

.quick-add-notification.info {
  background: linear-gradient(145deg, #2196f3, #1e88e5);
  color: white;
  border-left: 4px solid #0d47a1;
}

.quick-add-notification i {
  font-size: 18px;
  margin-right: 10px;
}

/* 卡片删除中样式 */
.site-card.deleting {
  position: relative;
  overflow: hidden;
}

.site-card.deleting::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.3);
  z-index: 2;
  border-radius: 10px;
}

.site-card.deleting::after {
  content: "";
  position: absolute;
  width: 30px;
  height: 30px;
  border: 2px solid rgba(112, 73, 240, 0.7);
  border-radius: 50%;
  border-top-color: transparent;
  left: calc(50% - 15px);
  top: calc(50% - 15px);
  z-index: 3;
  animation: spinner-rotate 0.8s linear infinite;
}

@keyframes spinner-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 公告弹窗美化 */
.announcement-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}
.announcement-modal.show {
  display: flex;
  opacity: 1;
  animation: fadeInModal 0.3s;
}
@keyframes fadeInModal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.announcement-content {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  max-width: 420px;
  width: 90%;
  padding: 0 1.5rem 1.5rem 1.5rem;
  position: relative;
  animation: fadeInCard 0.3s;
  overflow: hidden;
  margin: 0 10px;
}
@keyframes fadeInCard {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
.announcement-gradient-bar {
  height: 6px;
  width: 100%;
  background: linear-gradient(90deg, #ff4b2b, #ff416c, #ffb347, #ff416c);
  margin-bottom: 1.2rem;
}
.announcement-header {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}
.announcement-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #d9534f;
  margin: 0 auto;
  text-align: center;
}
.announcement-close {
  position: absolute;
  right: 0;
  top: 0;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #aaa;
  cursor: pointer;
  transition: color 0.2s;
}
.announcement-close:hover {
  color: #d9534f;
}
.announcement-body {
  color: #333;
  font-size: 1.08rem;
  line-height: 1.8;
  margin-bottom: 1.8rem;
  word-break: break-word;
}
.announcement-footer {
  display: flex;
  justify-content: center;
  align-items: center;
}
.announcement-confirm-btn {
  background: linear-gradient(90deg, #ff4b2b, #ff416c);
  color: #fff;
  font-size: 1rem;
  font-weight: 400;
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.5rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 75, 43, 0.12);
  transition: background 0.2s, transform 0.1s;
  width: 80%;
  letter-spacing: 0.5rem;
}
.announcement-confirm-btn:hover {
  background: linear-gradient(90deg, #ff416c, #ff4b2b);
  transform: translateY(-2px) scale(1.03);
}
@media (max-width: 600px) {
  .announcement-content {
    max-width: 98vw;
    padding: 0 0.5rem 1.2rem 0.5rem;
  }
  .announcement-title {
    font-size: 1.1rem;
  }
  .announcement-body {
    font-size: 0.8rem;
    margin-bottom: 1.2rem;
  }
  .announcement-confirm-btn {
    font-size: 0.7rem;
    padding: 0.7rem 1rem;
    width: 70%;
  }
}

/* 搜索框样式 */
.search-form {
  display: flex;
  align-items: center;
  margin-right: 15px;
}

.search-form input[type="search"] {
  width: 200px;
  height: 38px;
  border: 1px solid #dee2e6;
  border-radius: 20px;
  padding: 0 15px;
  font-size: 16px !important;
  transition: all 0.3s ease;
  -webkit-text-size-adjust: 100%;
  -webkit-appearance: none;
  appearance: none;
  max-height: none !important;
  line-height: normal !important;
  transform: none !important;
}

.search-form input[type="search"]:focus {
  width: 250px;
  border-color: #7049f0;
  box-shadow: 0 0 0 0.2rem rgba(112, 73, 240, 0.25);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .search-form {
    flex: 1;
    margin-right: 10px;
  }

  .search-form input[type="search"] {
    width: 100%;
    height: 44px;
    padding: 8px 15px;
    font-size: 16px !important;
    -webkit-text-size-adjust: 100%;
    -webkit-appearance: none;
    appearance: none;
    max-height: none !important;
    line-height: normal !important;
    transform: none !important;
  }

  .search-form input[type="search"]:focus {
    width: 100%;
  }

  .search-form .btn {
    height: 44px;
    width: 44px;
  }
}

/* 图标加载状态样式 - 已移除，保留智能加载机制 */
