.article-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  height: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: #d1d5db;
}

.article-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #6b7280;
  line-height: 1.6;
  font-size: 0.875rem;
}

.article-image-container {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
}

.article-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-card:hover .article-image {
  transform: scale(1.05);
}

/* List view styles */
.article-list-item {
  transition: all 0.2s ease;
  cursor: pointer;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.article-list-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.article-list-image-container {
  width: 200px;
  height: 120px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.article-list-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.article-list-excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #4b5563;
  margin-bottom: 0.5rem;
}

@media (max-width: 640px) {
  .article-image-container {
    height: 180px;
  }
  .article-excerpt {
    -webkit-line-clamp: 2;
  }
  .article-list-image-container {
    width: 100%;
    height: 150px;
  }
  .article-card-content {
    padding: 1rem;
  }
  .article-card-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
  }
  .article-card-meta {
    padding-top: 0.5rem;
  }
}

.article-link {
  text-decoration: none;
  color: inherit;
}

/* Tag filter section styles */
.tag-filter-section {
  background: white;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: all 0.2s ease;
  padding: 1rem 1.25rem;
}

.tag-filter-section.active-filter {
  box-shadow: 0 2px 6px rgba(24, 160, 88, 0.08);
  border-left: 2px solid #18a058;
}

.tag-filter-content {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* Tag styles */
.tag-filter {
  transition: all 0.15s ease;
  border-radius: 16px;
  font-size: 0.85rem;
  padding: 0.35rem 0.85rem;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.tag-filter:hover {
  transform: translateY(-1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tag-filter.active {
  transform: scale(1.02);
  font-weight: 500;
  box-shadow: 0 1px 4px rgba(24, 160, 88, 0.15);
}

.tag-filter-count {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-left: 0.1rem;
  font-weight: normal;
}

.tag-filter-clear {
  background-color: #fef2f2;
  color: #ef4444;
  font-weight: 500;
}

.tag-filter-clear:hover {
  background-color: #fee2e2;
}

/* Article card tag styles */
.article-tag {
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
}

.article-tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Special tag styles */
.article-special-tag {
  background: linear-gradient(135deg, #18a058 0%, #0d7a3d 100%) !important;
  color: white !important;
  font-weight: 600 !important;
  border: none !important;
  border-radius: 6px !important;
}

.article-special-tag:hover {
  background: linear-gradient(135deg, #0d7a3d 0%, #18a058 100%) !important;
  box-shadow: 0 3px 8px rgba(24, 160, 88, 0.3) !important;
}

/* Regular tag styles */
.article-regular-tag {
  background: #f3f4f6 !important;
  color: #4b5563 !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 6px !important;
}

.article-regular-tag:hover {
  background: #e5e7eb !important;
  color: #374151 !important;
  border-color: #d1d5db !important;
}

/* Article date style */
.article-date {
  color: #9ca3af;
  font-weight: 500;
  transition: all 0.2s ease;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
}

.article-date:hover {
  color: #18a058;
  background: #f0f9f4;
}

/* Article card content */
.article-card-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.article-card-title {
  font-weight: 700;
  font-size: 1.125rem;
  line-height: 1.4;
  color: #111827;
  margin-bottom: 0.75rem;
  transition: color 0.2s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card:hover .article-card-title {
  color: #18a058;
}

.article-card-meta {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid #f3f4f6;
}

/* Article grid animation */
.article-grid-enter-active,
.article-grid-leave-active {
  transition: opacity 0.3s ease;
}

.article-grid-enter-from,
.article-grid-leave-to {
  opacity: 0;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .tag-filter-section {
    padding: 1rem;
  }

  .tag-filter {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
  }
}

/* View toggle button styles */
.view-toggle-section {
  background: white;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
}

.view-toggle-button {
  transition: all 0.15s ease;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid #e5e7eb;
  background: white;
  color: #6b7280;
}

.view-toggle-button:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.view-toggle-button.active {
  background: #18a058;
  color: white;
  border-color: #18a058;
}

/* Tag count selector styles */
.tag-count-selector {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background-color: white;
  color: #6b7280;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 140px;
  height: 40px;
}

.tag-count-selector:hover {
  background-color: #f9fafb;
  border-color: #d1d5db;
}

.tag-count-selector:focus {
  outline: none;
  border-color: #18a058;
  box-shadow: 0 0 0 2px rgba(24, 160, 88, 0.1);
}

/* Tag filter expand/collapse button styles */
.tag-filter-expand-button {
  transition: all 0.2s ease;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background-color: white;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
}

.tag-filter-expand-button:hover {
  background-color: #f9fafb;
  border-color: #d1d5db;
  color: #374151;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tag-filter-expand-button.active {
  background-color: #18a058;
  border-color: #18a058;
  color: white;
  box-shadow: 0 2px 4px rgba(24, 160, 88, 0.2);
}

/* Tag container and grid styles */
.tag-tags-container {
  width: 100%;
  min-width: 0;
}

.tag-tags-viewport {
  --tag-collapsed-height: 132px;
  max-height: var(--tag-collapsed-height);
  overflow: hidden;
}

/* Fade the tags themselves into the panel, without a gray overlay. */
.tag-tags-viewport.has-overflow:not(.expanded) {
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 48px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 48px), transparent 100%);
}

.tag-tags-viewport.expanded {
  max-height: none;
}

.tag-tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
  width: 100%;
  padding: 2px 1px;
}

.tag-tags-grid .tag-filter {
  max-width: 100%;
}

.tag-tags-grid .n-tag__content {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Controls stay outside the clipped and masked tag viewport. */
.right-controls {
  display: flex;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
  .tag-tags-viewport {
    --tag-collapsed-height: 108px;
  }

  .tag-filter-expand-button {
    min-width: 36px;
    height: 36px;
    padding: 0.375rem;
  }
}
