/* ============================================================
   macOS Desktop Theme - Desktop Widgets (左侧小组件)
   ============================================================ */

.desktop-widgets {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 280px;
  max-height: calc(100vh - var(--macos-statusbar-height) - var(--macos-dock-height) - 60px);
  overflow-y: auto;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-right: 4px;
}

.desktop-widgets.right {
  left: auto;
  right: 20px;
}

.desktop-widgets::-webkit-scrollbar {
  width: 4px;
}

.desktop-widgets::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.widget {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  animation: widgetSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.widget:nth-child(1) { animation-delay: 0.1s; }
.widget:nth-child(2) { animation-delay: 0.2s; }
.widget:nth-child(3) { animation-delay: 0.3s; }
.widget:nth-child(4) { animation-delay: 0.4s; }
.widget:nth-child(5) { animation-delay: 0.5s; }

@keyframes widgetSlideIn {
  from {
    opacity: 0;
    transform: translateX(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.widget-title {
  padding: 14px 18px 8px;
  font-size: 13px;
  font-weight: 700;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.3px;
}

.widget-title i {
  color: #667eea;
  font-size: 14px;
}

.widget-content {
  padding: 0 18px 18px;
}

/* ===== 作者卡片 ===== */
.profile-widget .widget-content {
  text-align: center;
  padding: 20px 18px 22px;
}

.profile-avatar {
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35);
  position: relative;
  animation: avatarPulse 3s ease-in-out infinite;
}

@keyframes avatarPulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(102, 126, 234, 0.35); }
  50% { box-shadow: 0 6px 28px rgba(102, 126, 234, 0.55); }
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  font-size: 28px;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 30px;
}

.profile-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
  color: #1d1d1f;
}

.profile-signature {
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
  line-height: 1.5;
  font-style: italic;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 16px;
  padding: 12px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.profile-stat {
  text-align: center;
}

.profile-stat-num {
  font-size: 18px;
  font-weight: 700;
  color: #667eea;
  display: block;
}

.profile-stat-label {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

.profile-social {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.social-link {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  color: #555;
  font-size: 14px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.social-link:hover {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  transform: translateY(-3px) scale(1.1);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ===== 实时热搜 ===== */
.hot-search-widget .widget-content {
  padding: 0 14px 14px;
}

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

.hot-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  animation: hotItemIn 0.4s ease both;
}

.hot-search-item:hover {
  background: rgba(102, 126, 234, 0.08);
  transform: translateX(4px);
}

.hot-search-rank {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.08);
  color: #888;
}

.hot-search-item:nth-child(1) .hot-search-rank {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  color: #fff;
}

.hot-search-item:nth-child(2) .hot-search-rank {
  background: linear-gradient(135deg, #ffa726, #ff9800);
  color: #fff;
}

.hot-search-item:nth-child(3) .hot-search-rank {
  background: linear-gradient(135deg, #ffca28, #ffc107);
  color: #fff;
}

.hot-search-text {
  flex: 1;
  font-size: 13px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hot-search-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 107, 107, 0.12);
  color: #ff6b6b;
  font-weight: 600;
  flex-shrink: 0;
}

@keyframes hotItemIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== 最近文章 ===== */
.recent-list li,
.category-list li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.recent-list li:last-child,
.category-list li:last-child {
  border-bottom: none;
}

.recent-list a,
.category-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #444;
  transition: color 0.2s;
}

.recent-list a:hover,
.category-list a:hover {
  color: #667eea;
}

.recent-list i,
.category-list i {
  color: #aaa;
  font-size: 11px;
  width: 14px;
}

.category-list .count {
  margin-left: auto;
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* ===== 标签云 ===== */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-cloud-item {
  padding: 4px 10px;
  background: rgba(102, 126, 234, 0.08);
  border-radius: 12px;
  color: #667eea;
  font-size: 12px;
  transition: all 0.2s;
}

.tag-cloud-item:hover {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  transform: translateY(-2px);
}

/* ===== 归档 ===== */
.archive-link {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #444;
  padding: 8px 0;
}

.archive-link:hover {
  color: #667eea;
}

.archive-link .count {
  margin-left: auto;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

/* 响应式 */
@media (max-width: 900px) {
  .desktop-widgets {
    display: none;
  }
}
