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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f7f9fa;
  padding: 20px;
  line-height: 1.6;
}

.container {
  max-width: 50%;
  margin: 0 auto;
}

/* 移动端适配 */
@media (max-width: 1024px) {
  body {
    padding: 10px;
  }

  .container {
    max-width: 100%;
  }
}

header {
  background: white;
  padding: 30px;
  border-radius: 12px;
  margin-bottom: 30px;
  box-shadow: 0 2px 4px rgba(2, 2, 2, 0.06);
}

h1 {
  color: #1d9bf0;
  font-size: 28px;
  margin-bottom: 10px;
}

.subtitle {
  color: #536471;
  font-size: 14px;
  margin-bottom: 16px;
}

/* 用户列表 */
.header-users {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e1e8ed;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.2s;
  position: relative;
}

.header-user:hover {
  background: #f7f9fa;
}

.header-user.inactive {
  opacity: 0.3;
  filter: grayscale(100%);
}

.header-user.selected {
  background: #e8f5fe;
  border: 2px solid #1d9bf0;
  padding: 6px;
}

.user-close-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1d9bf0;
  color: white;
  border: 2px solid white;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.user-close-btn:hover {
  background: #e74c3c;
  transform: scale(1.1);
}

.user-close-btn:active {
  transform: scale(0.95);
}

.header-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e1e8ed;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.header-user-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  background: #e1e8ed;
}

.header-user-avatar img.loaded {
  background: none;
}

.header-user-name {
  color: #0f1419;
  font-size: 14px;
  font-weight: 600;
}

.digest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.digest-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.digest-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(29,155,240,0.1);
}

.digest-title {
  color: #0f1419;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.digest-meta {
  color: #536471;
  font-size: 13px;
  margin-bottom: 12px;
}

.digest-preview {
  color: #536471;
  font-size: 14px;
  line-height: 1.4;
}

.latest-badge {
  display: inline-block;
  background: #1d9bf0;
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  margin-left: 8px;
  font-weight: 500;
}

.current-digest {
  background: white;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.current-digest h2 {
  color: #0f1419;
  font-size: 20px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.current-digest iframe {
  width: 100%;
  height: 600px;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
}

.no-digests {
  background: white;
  border-radius: 12px;
  padding: 60px 30px;
  text-align: center;
  color: #536471;
}

.refresh-btn {
  background: #1d9bf0;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.refresh-btn:hover {
  background: #1a8cd8;
}

/* 时间线容器 */
.timeline {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* 时间分隔线 */
.time-divider {
  position: relative;
  display: flex;
  align-items: center;
  padding: 24px 16px;
  background: #f7f9fa;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, #1d9bf0, transparent);
}

.divider-content {
  padding: 0 20px;
  text-align: center;
}

.divider-time {
  color: #1d9bf0;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.divider-stats {
  color: #536471;
  font-size: 13px;
  margin-bottom: 12px;
}

.divider-avatars {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.divider-user {
  display: flex;
  align-items: center;
  gap: 4px;
}

.divider-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #e1e8ed;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.divider-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.divider-count {
  color: #536471;
  font-size: 13px;
  font-weight: 500;
}

/* 推文卡片 */
.tweet {
  border-bottom: 1px solid #e1e8ed;
  padding: 16px;
  transition: background 0.2s;
}

.tweet:hover {
  background: #f7f9fa;
}

.tweet:last-child {
  border-bottom: none;
}

.tweet-header {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
}

.user-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-right: 12px;
  background: #e1e8ed;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.user-info {
  flex: 1;
}

.user-name {
  font-weight: 700;
  color: #0f1419;
  font-size: 15px;
}

.user-screen-name {
  color: #536471;
  font-size: 14px;
}

.tweet-time {
  color: #536471;
  font-size: 14px;
}

.tweet-content {
  margin-bottom: 12px;
}

.tweet-text {
  color: #0f1419;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.tweet-media {
  margin-top: 12px;
  border-radius: 12px;
  overflow: hidden;
}

.tweet-media img, .tweet-media video {
  width: 100%;
  height: auto;
  max-height: 480px;
  display: block;
  object-fit: contain;
  background: #f0f0f0;
}

.media-grid {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(2, 1fr);
}

.media-grid.single {
  grid-template-columns: 1fr;
}

.media-grid.single img {
  max-height: 640px;
}

.media-grid img {
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  background: #f0f0f0;
}

.tweet-stats {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e1e8ed;
}

.stat {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #536471;
  font-size: 13px;
}

.ai-summary {
  background: #fff3cd;
  padding: 8px 12px;
  border-radius: 8px;
  margin-top: 8px;
  font-size: 14px;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.view-original {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 16px;
  background: #1d9bf0;
  color: white;
  text-decoration: none;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s;
}

.view-original:hover {
  background: #1a8cd8;
}

/* 加载动画 */
.loading-indicator {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  background: white;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e1e8ed;
  border-top-color: #1d9bf0;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  margin-left: 15px;
  color: #536471;
  font-size: 14px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 图片/视频加载骨架屏 */
.tweet-media img,
.tweet-media video {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

.tweet-media img.loaded,
.tweet-media video.loaded {
  animation: none;
  background: none;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.user-avatar img {
  background: #e1e8ed;
}

.user-avatar img.loaded {
  background: none;
}

/* 时段导航按钮 */
.divider-nav {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: white;
  color: #1d9bf0;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.2s;
}

.nav-btn:hover {
  background: #1d9bf0;
  color: white;
  transform: scale(1.1);
}

.nav-btn:active {
  transform: scale(0.95);
}

/* 移动端优化 */
@media (max-width: 1024px) {
  /* 头部适配 */
  header {
    padding: 20px;
  }

  h1 {
    font-size: 22px;
  }

  .subtitle {
    font-size: 13px;
  }

  /* 用户列表适配 */
  .header-users {
    gap: 12px;
  }

  .header-user {
    padding: 6px;
  }

  .header-user-avatar {
    width: 28px;
    height: 28px;
  }

  .header-user-name {
    font-size: 13px;
  }

  .user-close-btn {
    width: 18px;
    height: 18px;
    font-size: 14px;
    top: -5px;
    right: -5px;
  }

  /* 推文卡片适配 */
  .tweet {
    padding: 12px;
  }

  .user-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  .user-name {
    font-size: 14px;
  }

  .user-screen-name,
  .tweet-time {
    font-size: 13px;
  }

  .tweet-text {
    font-size: 14px;
  }

  /* 时间分隔线适配 */
  .time-divider {
    padding: 16px 12px;
  }

  .divider-time {
    font-size: 14px;
  }

  .divider-stats {
    font-size: 12px;
  }

  .divider-avatar {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .divider-count {
    font-size: 12px;
  }

  .divider-avatars {
    gap: 12px;
  }

  /* 导航按钮适配 */
  .divider-nav {
    position: static;
    flex-direction: row;
    margin-top: 12px;
    justify-content: center;
  }

  .nav-btn {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  /* 按钮适配 */
  .refresh-btn,
  .view-original {
    font-size: 13px;
    padding: 6px 14px;
  }

  /* 统计信息适配 */
  .stat {
    font-size: 12px;
  }

  /* 媒体内容适配 */
  .tweet-media img,
  .tweet-media video {
    max-height: 300px;
  }

  .media-grid img {
    max-height: 250px;
  }

  .media-grid.single img {
    max-height: 400px;
  }

  /* 加载指示器适配 */
  .loading-indicator {
    padding: 30px;
  }

  .loading-spinner {
    width: 32px;
    height: 32px;
  }

  .loading-text {
    font-size: 13px;
  }
}
