/* ==== 原 index.html 内联样式 ==== */
body {
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  overflow-x: hidden;
}

.app-container {
  display: flex;
  justify-content: center;
}

.main-wrapper {
  width: 100%;
  max-width: 1920px;
  display: flex;
  position: relative; /* 为右侧边栏的绝对定位提供参考 */
}

.side-nav-container {
  width: 160px;
  flex-shrink: 0;
  position: sticky;
  top: 4.5rem;
  height: calc(100vh - 4.5rem);
  overflow-y: auto;
  z-index: 30;
  background: white;
  border-right: 1px solid #f0f0f0;
}

.main-content-container {
  flex: 1;
  padding-bottom: 4rem;
}

.right-sidebar {
  width: 300px;
  flex-shrink: 0;
  padding: 1rem;
  background: white;
  border-left: 1px solid #e2e8f0;
}

.side-nav-container::-webkit-scrollbar,
.right-sidebar::-webkit-scrollbar {
  display: none;
}

.side-nav-container,
.right-sidebar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.nav-category {
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  color: #999;
  letter-spacing: 1px;
  font-weight: 500;
  border-bottom: 1px solid #f5f5f5;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 11px 16px;
  font-size: 14px;
  color: #333;
  text-decoration: none;
  transition: all 0.15s ease;
}

.nav-item:hover:not(.nav-active) {
  background-color: #f8f9fa;
  color: #0078FF;
}

.nav-item i {
  width: 20px;
  text-align: center;
  margin-right: 10px;
  font-size: 15px;
}

.nav-item.hot i {
  color: #FF7D00;
}

.nav-new {
  position: relative;
}

.nav-new::after {
  content: "新";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  background-color: #00C48C;
  color: white;
  padding: 1px 4px;
  border-radius: 3px;
}

.sidebar-section {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.sidebar-title {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 0.75rem;
  color: #1e293b;
  display: flex;
  align-items: center;
}

.sidebar-title i {
  margin-right: 0.5rem;
}

.ad-item {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1px solid #bae6fd;
  border-radius: 6px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ad-item:hover {
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  transform: translateY(-1px);
}

.ad-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0284c7;
  margin-bottom: 0.25rem;
}

.ad-desc {
  font-size: 0.8rem;
  color: #64748b;
}

.notice-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.notice-item:last-child {
  border-bottom: none;
}

.notice-link {
  font-size: 0.85rem;
  color: #475569;
  transition: color 0.2s ease;
}

.notice-link:hover {
  color: #0078FF;
}

.latest-item {
  padding: 0.5rem 0;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
}

.latest-item:last-child {
  border-bottom: none;
}

.latest-link {
  font-size: 0.85rem;
  color: #475569;
  transition: color 0.2s ease;
}

.latest-link:hover {
  color: #0078FF;
}

.latest-date {
  font-size: 0.75rem;
  color: #94a3b8;
}

.top-header,
.footer-wrapper {
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
}

.content-section {
  transition: background-color 0.2s ease;
}

.content-section:hover {
  background-color: rgba(0, 120, 255, 0.02);
}

.card-item {
  transition: all 0.2s ease;
}

/* 延迟加载图标样式 */
.lazy-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lazy-icon.loaded {
  opacity: 1;
}

/* 搜索历史下拉框样式 */
.search-history-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-top: 4px;
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
}

.search-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
}

.search-history-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #1e293b;
}

.clear-all-btn {
  font-size: 0.75rem;
  color: #64748b;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.clear-all-btn:hover {
  color: #ef4444;
  background: #fef2f2;
}

.search-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.search-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.2s ease;
  cursor: pointer;
}

.search-history-item:last-child {
  border-bottom: none;
}

.search-history-item:hover {
  background: #f8fafc;
}

.search-history-item.pinned {
  background: #fef3c7;
}

.search-history-item.pinned:hover {
  background: #fde68a;
}

.search-history-keyword {
  flex: 1;
  font-size: 0.875rem;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-right: 0.5rem;
}

.search-history-actions {
  display: flex;
  gap: 0.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.search-history-item:hover .search-history-actions {
  opacity: 1;
}

.history-action-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
  color: #64748b;
  transition: all 0.2s ease;
  font-size: 0.75rem;
}

.history-action-btn:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.history-action-btn.delete-btn:hover {
  background: #fef2f2;
  color: #ef4444;
}

.history-action-btn.pin-btn:hover {
  background: #fef3c7;
  color: #f59e0b;
}

.search-history-item.pinned .pin-btn {
  color: #f59e0b;
}

.search-history-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: #94a3b8;
  font-size: 0.875rem;
}

/* 搜索历史下拉框滚动条样式 */
.search-history-dropdown::-webkit-scrollbar {
  width: 6px;
}

.search-history-dropdown::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 3px;
}

.search-history-dropdown::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.search-history-dropdown::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 图标容器样式优化 */
.w-8.h-8.rounded {
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.w-8.h-8.rounded img {
  max-width: 100%;
  max-height: 100%;
}

/* 热门标签链接样式 */
.tag-link {
  display: inline-block;
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  font-weight: 500;
}

/* 不同颜色的标签 */
.tag-blue {
  background-color: #dbeafe;
  color: #1e40af;
}

.tag-green {
  background-color: #d1fae5;
  color: #065f46;
}

.tag-purple {
  background-color: #e9d5ff;
  color: #6b21a8;
}

.tag-orange {
  background-color: #fed7aa;
  color: #9a3412;
}

.tag-red {
  background-color: #fee2e2;
  color: #991b1b;
}

.tag-teal {
  background-color: #ccfbf1;
  color: #134e4a;
}

.tag-pink {
  background-color: #fce7f3;
  color: #831843;
}

.tag-indigo {
  background-color: #e0e7ff;
  color: #3730a3;
}

/* 标签悬停效果 */
.tag-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  opacity: 0.9;
}

.tag-blue:hover {
  background-color: #3b82f6;
  color: white;
}

.tag-green:hover {
  background-color: #10b981;
  color: white;
}

.tag-purple:hover {
  background-color: #a855f7;
  color: white;
}

.tag-orange:hover {
  background-color: #f97316;
  color: white;
}

.tag-red:hover {
  background-color: #ef4444;
  color: white;
}

.tag-teal:hover {
  background-color: #14b8a6;
  color: white;
}

.tag-pink:hover {
  background-color: #ec4899;
  color: white;
}

.tag-indigo:hover {
  background-color: #6366f1;
  color: white;
}

/* 标签点击效果 */
.tag-link:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 响应式：中小屏优化布局，提升手机端体验 */
@media (max-width: 1024px) {
  .main-wrapper {
    display: block;
  }

  .side-nav-container {
    width: 100%;
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #f0f0f0;
  }

  .right-sidebar {
    position: static;
    width: 100%;
    height: auto;
    margin-top: 1rem;
    border-left: none;
    border-top: 1px solid #e2e8f0;
    top: auto; /* 重置顶部定位 */
    align-self: auto; /* 重置对齐方式 */
  }
}

@media (max-width: 768px) {
  /* 移动端隐藏左侧导航栏 */
  .side-nav-container {
    display: none;
  }
  
  /* 移动端隐藏右侧边栏 */
  .right-sidebar {
    display: none;
  }
  
  .content-section {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}
