/* 豆瓣 RSS 展示样式 - 极简设计 */
.douban-rss-container {
  margin: 30px 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  max-width: 1200px;
}

.douban-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
  justify-content: start;
}

/* 响应式布局 - 自适应列数 */
@media (min-width: 1400px) {
  .douban-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
  }
}

@media (max-width: 768px) {
  .douban-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .douban-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
  }

  .douban-rss-container {
    margin: 20px 0;
  }
}

.douban-item-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.2s ease;
  cursor: pointer;
}

.douban-item-link:hover {
  /* 移除导致弹跳的上移动画 */
  /* transform: translateY(-3px); */
}

.douban-item {
  display: flex;
  flex-direction: column;
  background: transparent;
  overflow: hidden;
  height: 100%;
}

.douban-poster {
  position: relative;
  width: 100%;
  /* 按照豆瓣海报比例 270:390 ≈ 0.69 */
  aspect-ratio: 0.69;
  overflow: hidden;
  background: #f5f5f5;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s ease;
}

.douban-poster:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.douban-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s ease;
  opacity: 0.9;
}

.douban-item-link:hover .douban-poster img {
  opacity: 1;
}

.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: #f0f0f0;
  color: #999;
  font-size: 12px;
  transition: opacity 0.2s ease;
  opacity: 0.9;
}

.douban-item-link:hover .no-image {
  opacity: 1;
}

.douban-info {
  padding: 12px 4px 0 4px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.douban-title {
  margin-bottom: 6px;
}

.douban-title-text {
  color: #111;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.douban-item-link:hover .douban-title-text {
  color: #007722;
}

.douban-rating {
  margin-bottom: 6px;
  font-size: 12px;
  color: #ffc107;
  font-weight: 500;
}

.douban-tags {
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.douban-tag {
  font-size: 11px;
  line-height: 1.2;
  color: #05802f;
  background-color: #edf4ed;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
}

/* 移除默认的星星前缀，改用动态星级显示 */

.douban-action {
  font-size: 10px;
  color: #999;
  background: #f8f8f8;
  padding: 1px 4px;
  border-radius: 2px;
  margin-left: 6px;
  display: inline-block;
}

.douban-remark {
  margin-bottom: 8px;
  font-size: 12px;
  color: #666;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 4; /* 增加显示行数 */
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
}

.douban-date {
  margin-top: auto;
  font-size: 11px;
  color: #ccc;
}

.douban-loading,
.douban-error {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
  background: #f9f9f9;
  border-radius: 8px;
  margin: 20px 0;
}

.douban-error {
  color: #d73a49;
  background: #ffeef0;
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
  .douban-item {
    background: transparent;
    color: #e1e1e1;
  }

  .douban-poster {
    background: #2d2d2d;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  }

  .douban-poster:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  }

  .douban-title-text {
    color: #e1e1e1;
  }

  .douban-item-link:hover {
    .douban-title-text {
      color: #4ade80;
    }
    .douban-remark[title] {
      color: #ccc;
    }
    .douban-date {
      color: #bbb;
    }
  }

  .douban-rating {
    color: #fbbf24;
  }
 
  .douban-remark {
    color: #aaa;
  }

  .douban-date {
    color: #666;
  }

  .no-image {
    background: #2d2d2d;
    color: #888;
  }

  .douban-loading {
    background: transparent;
    color: #aaa;
  }

  .douban-error {
    background: transparent;
    color: #ff6b6b;
  }

  .douban-action {
    background: #333;
    color: #ccc;
  }
}
