* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2332;
  --bg-hover: #243047;
  --bg-active: #1e3a5f;
  --text-primary: #e8ecf1;
  --text-secondary: #8b95a5;
  --text-muted: #5a6474;
  --accent: #3b82f6;
  --accent-glow: rgba(59, 130, 246, 0.3);
  --hot: #ef4444;
  --border: #1e293b;
  --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.app { display: flex; flex-direction: column; height: 100vh; }

/* 顶部栏 */
.top-bar {
  display: flex; align-items: center; gap: 20px;
  padding: 12px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.logo {
  font-size: 20px; font-weight: 700;
  background: var(--gradient-3);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.source-tabs {
  display: flex; gap: 4px; flex: 1;
  overflow-x: auto; scrollbar-width: none;
}
.source-tabs::-webkit-scrollbar { display: none; }
.source-tab {
  padding: 6px 16px; border-radius: 20px;
  font-size: 13px; cursor: pointer;
  white-space: nowrap; transition: all 0.2s;
  background: transparent; color: var(--text-secondary);
  border: 1px solid transparent;
}
.source-tab:hover { background: var(--bg-hover); color: var(--text-primary); }
.source-tab.active {
  background: var(--accent); color: #fff;
  border-color: var(--accent);
}
.clock {
  font-size: 14px; color: var(--text-secondary);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* 主布局 */
.main-layout {
  display: flex; flex: 1; overflow: hidden;
}

/* 左侧边栏 */
.sidebar {
  width: 380px; min-width: 380px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.sidebar-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.sidebar-title { font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.auto-scroll-btn {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-secondary); cursor: pointer;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; transition: all 0.2s;
}
.auto-scroll-btn.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.auto-scroll-btn:hover { border-color: var(--accent); }

.feed-list-wrapper {
  flex: 1; overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--bg-hover) transparent;
}
.feed-list-wrapper::-webkit-scrollbar { width: 4px; }
.feed-list-wrapper::-webkit-scrollbar-track { background: transparent; }
.feed-list-wrapper::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 2px; }

.feed-list { list-style: none; }
.feed-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px;
  cursor: pointer; transition: all 0.15s;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.feed-item:hover { background: var(--bg-hover); }
.feed-item.active {
  background: var(--bg-active);
  border-left: 3px solid var(--accent);
  padding-left: 15px;
}
.feed-item.active::after {
  content: ''; position: absolute;
  right: 0; top: 50%; transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: var(--bg-primary);
}
.feed-rank {
  flex-shrink: 0; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; font-size: 12px; font-weight: 700;
  background: var(--bg-card); color: var(--text-muted);
  margin-top: 2px;
}
.feed-rank.top-1 { background: #ef4444; color: #fff; }
.feed-rank.top-2 { background: #f97316; color: #fff; }
.feed-rank.top-3 { background: #eab308; color: #fff; }
.feed-info { flex: 1; min-width: 0; }
.feed-title-text {
  font-size: 14px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.feed-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 6px; font-size: 11px; color: var(--text-muted);
}
.feed-hot {
  color: var(--hot); font-weight: 600;
}
.feed-source-badge {
  padding: 1px 6px; border-radius: 3px;
  background: var(--bg-card); font-size: 10px;
}
.feed-author {
  color: var(--accent); font-weight: 600;
}

/* 右侧内容区 */
.content-area {
  flex: 1; overflow-y: auto; padding: 40px 60px;
  background: var(--bg-primary);
}
.content-placeholder {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  height: 100%; color: var(--text-muted);
}
.placeholder-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.5; }
.content-placeholder p { font-size: 16px; }

.content-detail { animation: fadeIn 0.3s ease; max-width: 800px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.detail-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px;
}
.detail-source {
  padding: 4px 12px; border-radius: 16px;
  font-size: 12px; font-weight: 600;
  background: var(--accent); color: #fff;
}
.detail-hot {
  font-size: 13px; color: var(--hot); font-weight: 600;
}
.detail-title {
  font-size: 28px; font-weight: 700; line-height: 1.4;
  margin-bottom: 16px;
}
.detail-meta {
  font-size: 13px; color: var(--text-secondary);
  margin-bottom: 24px; line-height: 1.6;
}
.detail-desc {
  font-size: 16px; line-height: 1.8; color: var(--text-secondary);
  margin-bottom: 24px;
  padding: 20px; border-radius: 12px;
  background: var(--bg-secondary); border: 1px solid var(--border);
}
.detail-image-wrapper {
  margin-bottom: 24px; border-radius: 12px; overflow: hidden;
  background: var(--bg-secondary);
}
.detail-image {
  width: 100%; max-height: 400px; object-fit: cover;
  display: block;
}
.detail-link {
  display: inline-block;
  padding: 10px 24px; border-radius: 8px;
  background: var(--accent); color: #fff;
  text-decoration: none; font-size: 14px; font-weight: 600;
  transition: all 0.2s;
}
.detail-link:hover {
  background: #2563eb;
  box-shadow: 0 4px 20px var(--accent-glow);
}

/* Full article body */
.detail-body {
  font-size: 16px; line-height: 1.9; color: var(--text-primary);
  margin-bottom: 32px;
  padding: 28px 32px; border-radius: 12px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  overflow-wrap: break-word; word-break: break-word;
}
.detail-body h1, .detail-body h2, .detail-body h3,
.detail-body h4, .detail-body h5, .detail-body h6 {
  color: var(--text-primary); margin: 24px 0 12px; line-height: 1.4;
}
.detail-body h1 { font-size: 24px; }
.detail-body h2 { font-size: 20px; }
.detail-body h3 { font-size: 18px; }
.detail-body p { margin: 12px 0; }
.detail-body a { color: var(--accent); text-decoration: underline; }
.detail-body a:hover { color: #60a5fa; }
.detail-body img {
  max-width: 100%; height: auto; border-radius: 8px;
  margin: 16px 0; display: block;
}
.detail-body pre {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 16px; overflow-x: auto;
  font-size: 14px; line-height: 1.6; margin: 16px 0;
}
.detail-body code {
  background: var(--bg-card); padding: 2px 6px; border-radius: 4px;
  font-size: 14px;
}
.detail-body pre code { background: none; padding: 0; }
.detail-body blockquote {
  border-left: 3px solid var(--accent); padding: 8px 16px;
  margin: 16px 0; color: var(--text-secondary);
  background: var(--bg-card); border-radius: 0 8px 8px 0;
}
.detail-body ul, .detail-body ol {
  padding-left: 24px; margin: 12px 0;
}
.detail-body li { margin: 6px 0; }
.detail-body table {
  width: 100%; border-collapse: collapse; margin: 16px 0;
}
.detail-body th, .detail-body td {
  border: 1px solid var(--border); padding: 8px 12px; text-align: left;
}
.detail-body th { background: var(--bg-card); font-weight: 600; }
.detail-body hr {
  border: none; border-top: 1px solid var(--border); margin: 24px 0;
}

/* Loading dots */
.detail-body-loading {
  text-align: center; padding: 40px 0; color: var(--text-muted);
}
.detail-body-loading p { margin-top: 12px; font-size: 14px; }
.loading-dots { display: flex; justify-content: center; gap: 6px; }
.loading-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); animation: dotPulse 1.2s infinite ease-in-out;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1.2); }
}

/* 加载动画 */
.loading-skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.skeleton-item {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.skeleton-line {
  height: 14px; margin-bottom: 8px; border-radius: 4px;
}
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w50 { width: 50%; }
.skeleton-line.w30 { width: 30%; }

/* 滚动动画 */
.feed-item.highlight-enter {
  animation: highlightPulse 0.6s ease;
}
@keyframes highlightPulse {
  0% { background: var(--bg-hover); }
  50% { background: var(--bg-active); }
  100% { background: transparent; }
}

@media (max-width: 768px) {
  .sidebar { width: 100%; min-width: unset; max-height: 40vh; }
  .main-layout { flex-direction: column; }
  .content-area { padding: 20px; }
  .detail-title { font-size: 20px; }
  .feed-item.active::after { display: none; }
}
