* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

body {
  background-color: #f6f9fc;
  color: #333;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 删除以下部分 */
/* Header Styles - Improved */

/* 只给有子菜单的链接添加箭头 */
.nav-item .has-submenu:after {
  content: "▾";
  font-size: 10px;
  margin-left: 4px;
  transition: transform 0.3s ease;
}

.nav-item:hover .has-submenu:after {
  transform: rotate(180deg);
}

/* Main Content */
.main-content {
  padding: 20px 0;
  display: flex;
  gap: 20px;
}

.waterfall-container {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  grid-auto-flow: dense;
}

.card {
  background-color: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  border: 1px solid rgba(14, 165, 233, 0.1);
  display: flex;
  flex-direction: column;
  break-inside: avoid;
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
  max-height: 400px; /* 添加最大高度限制 */
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card:hover {
  box-shadow: 0 8px 20px rgba(14, 165, 233, 0.15);
  transform: translateY(-5px);
}

.card-header {
  padding: 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.card-info {
  flex: 1;
}

.card-author {
  font-size: 14px;
  font-weight: 500;
  color: #0f172a;
}

.card-date {
  font-size: 12px;
  color: #64748b;
}

.card-body {
  padding: 15px;
  flex: 1;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #0f172a;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-title a {
  color: inherit;
  text-decoration: none;
  background: linear-gradient(to right, #0f172a, #0f172a);
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.3s ease;
}

.card-title a:hover {
  background-size: 100% 1px;
  color: #0ea5e9;
}

.card-excerpt {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 15px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.card-tags {
  display: flex;
  gap: 5px;
}

.card-tag {
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 12px;
  background-color: #f1f5f9;
  color: #64748b;
}

.card-meta {
  display: flex;
  gap: 15px;
  font-size: 12px;
  color: #64748b;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Sidebar */
.sidebar {
  width: 300px;
  flex-shrink: 0;
}

.sidebar-section {
  background-color: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.sidebar-header {
  padding: 15px;
  font-weight: 600;
  color: #0f172a;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-icon {
  color: #0ea5e9;
}

.sidebar-content {
  padding: 15px;
}

.notification-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-dot {
  width: 10px;
  height: 10px;
  background-color: #ef4444;
  border-radius: 50%;
  margin-top: 6px;
}

.notification-content {
  flex: 1;
}

.notification-date {
  font-size: 12px;
  color: #64748b;
}

.notification-text {
  font-size: 14px;
  color: #334155;
  margin-bottom: 5px;
}

.popular-list {
  list-style: none;
}

.popular-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.popular-item:last-child {
  border-bottom: none;
}

.popular-item a {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  text-decoration: none;
  color: #334155;
  font-size: 14px;
  transition: color 0.2s ease;
}

.popular-item a:hover {
  color: #0ea5e9;
}

.popular-number {
  background-color: #f1f5f9;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
}

.popular-item:nth-child(-n + 3) .popular-number {
  background-color: #ef4444;
  color: white;
}

/* Floating Message Panel */
.floating-panel {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 300px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(14, 165, 233, 0.2);
  transition: all 0.3s ease;
  transform: translateY(0);
  opacity: 1;
  overflow: hidden;
}

.floating-panel.collapsed {
  transform: translateY(calc(100% - 50px));
}

.floating-header {
  padding: 12px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(90deg, #0ea5e9, #06b6d4);
  color: white;
  cursor: pointer;
}

.floating-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.floating-body {
  max-height: 300px;
  overflow-y: auto;
}

.message-item {
  padding: 12px 15px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.message-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: rgba(14, 165, 233, 0.1);
  color: #0ea5e9;
}

.message-content {
  flex: 1;
}

.message-title {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 4px;
  color: #0f172a;
}

.message-text {
  font-size: 13px;
  color: #64748b;
}

.message-time {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 4px;
}

/* Tech background effect */
.tech-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.03;
}

/* Animation keyframes */
@keyframes pulse {
  0% {
    opacity: 0.5;
  }

  50% {
    opacity: 1;
  }

  100% {
    opacity: 0.5;
  }
}

/* Responsive styles */
@media (max-width: 1200px) {
  .waterfall-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 992px) {
  .main-content {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .submenu {
    left: 0;
  }
}

@media (max-width: 768px) {
  .search-box input {
    width: 150px;
  }

  .nav-wrapper {
    margin: 0 10px;
  }

  .submenu {
    left: -50px;
  }
}

@media (max-width: 576px) {
  .waterfall-container {
    grid-template-columns: 1fr;
  }

  .search-box {
    display: none;
  }

  .logo-text {
    display: none;
  }

  .submenu {
    width: 200px;
    left: -80px;
  }
}
