/* 骨架屏动画 */
@keyframes skeleton-loading {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.skeleton-line, .skeleton-circle {
  background: linear-gradient(90deg, var(--border) 25%, var(--glass) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

.skeleton-line {
  height: 12px;
  border-radius: 4px;
}

.skeleton-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.skeleton-item {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 顶部按钮激活状态 */
.btn-icon.active {
  background: rgba(255, 184, 28, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

/* 关键词卡片样式 */
.keyword-card {
  border-top: 4px solid #ff4d4f;
}

.keyword-card .hot-card-header {
  background: linear-gradient(135deg, rgba(255, 77, 79, 0.1) 0%, rgba(255, 77, 79, 0.05) 100%);
}

.keyword-platform-section {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 12px;
}

.keyword-platform-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.keyword-platform-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
}

.hot-item-platform-tag {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  margin-left: 8px;
}

/* Tab切换样式 */
.hot-tracking-tabs {
  display: flex;
  gap: 4px;
  margin: 0 auto 24px auto;
  padding: 4px;
  background: var(--bg-2);
  border-radius: 12px;
  border: 1px solid var(--border);
  width: fit-content;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 10;
}

.hot-tab {
  padding: 8px 24px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

.hot-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.hot-tab.active {
  color: #ff4d4f;
  background: rgba(255, 77, 79, 0.15);
  font-weight: 600;
}

.hot-tab-content {
  display: none;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  flex-direction: column;
}

.hot-tab-content.active {
  display: flex;
}

/* 热点追踪模式样式 */
.hot-mode-active body {
  overflow: hidden;
}

.hot-tracking-container {
  padding: 20px;
  height: calc(100vh - 80px);
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.hot-tracking-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.hot-tracking-title-area h2 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--text-primary);
}

.hot-tracking-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.hot-tracking-actions {
  display: flex;
  gap: 12px;
}

.hot-tracking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 40px;
  flex: 1;
  min-height: 0; /* 确保flex子元素可以正确收缩 */
  height: 100%; /* 确保占满父容器高度 */
  width: 100%; /* 确保占满父容器宽度 */
}

/* 并排布局样式 */
.hot-tracking-split-layout {
  display: flex;
  flex: 1;
  gap: 20px;
  min-height: 0;
  overflow: hidden;
}

.hot-tracking-split-left,
.hot-tracking-split-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.hot-tracking-split-header {
  padding: 12px 0;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hot-tracking-split-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.hot-tracking-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--accent);
  color: #111;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.hot-tracking-add-btn:hover {
  background: rgba(255, 184, 28, 0.9);
  transform: translateY(-1px);
}

.hot-tracking-add-btn svg {
  flex-shrink: 0;
}

.hot-tab-content-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
  padding: 0 4px;
}

.hot-tracking-split-left .hot-tracking-grid,
.hot-tracking-split-right .hot-tracking-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 20px;
  grid-template-columns: 1fr; /* 并排布局时，每列显示一个卡片，垂直排列 */
  gap: 16px; /* 减小间距以适应较窄的列 */
}

.hot-tracking-split-divider {
  width: 1px;
  background: var(--border);
  flex-shrink: 0;
}

/* 隐藏滚动条但保留功能 */
.hot-tracking-grid::-webkit-scrollbar {
  width: 6px;
}

.hot-tracking-grid::-webkit-scrollbar-track {
  background: transparent;
}

.hot-tracking-grid::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 10px;
}

/* 热门平台卡片 */
.hot-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 500px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.hot-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.hot-card-header {
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}

.hot-card-platform {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hot-card-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border-radius: 6px;
}

.hot-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.hot-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.hot-card-actions {
  display: flex;
  gap: 8px;
}

.hot-card-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.hot-card-btn:hover {
  background: var(--glass);
  color: var(--text-primary);
}

.hot-card-btn.favorite-active {
  color: var(--accent);
}

.hot-card-btn.favorite-active:hover {
  color: var(--accent);
  background: rgba(255, 184, 28, 0.1);
}

.hot-card-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.hot-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.2s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.hot-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.hot-item-rank {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.hot-item:nth-child(1) .hot-item-rank { color: #ff4d4f; }
.hot-item:nth-child(2) .hot-item-rank { color: #fa8c16; }
.hot-item:nth-child(3) .hot-item-rank { color: #fadb14; }

.hot-item-info {
  flex: 1;
  min-width: 0;
}

.hot-item-title {
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}

.hot-item-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--text-muted);
}

.hot-item-heat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hot-item-tag {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  background: rgba(255, 77, 79, 0.1);
  color: #ff4d4f;
}

/* 平台特定样式 */
.hot-card.zhihu { border-top: 4px solid #0066ff; }
.hot-card.weibo { border-top: 4px solid #ff0000; }
.hot-card.coolapk { border-top: 4px solid #00c250; }
.hot-card.wallstreet { border-top: 4px solid #0055ff; }
.hot-card.douyin { border-top: 4px solid #000000; }
.hot-card.hupu { border-top: 4px solid #c01d2f; }

/* 加载状态 */
.loading-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 0;
  color: var(--text-muted);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border);
  border-top: 4px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

/* 弹窗中的平台选项 */
.hot-platform-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
}

.filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-tab {
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  font-size: 13px;
  transition: all 0.2s;
}

.filter-tab.active {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
}

.search-box input {
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 200px;
}

.hot-platform-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

.platform-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}

.platform-option:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
}

.platform-option.selected {
  background: rgba(255, 184, 28, 0.05);
  border-color: var(--accent);
}

.platform-option-check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.platform-option.selected .platform-option-check {
  background: var(--accent);
  border-color: var(--accent);
}

.platform-option.selected .platform-option-check::after {
  content: '✓';
  color: #111;
  font-size: 12px;
  font-weight: bold;
}

.platform-option-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.platform-option-name {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

