.tag-list,
.category-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 24px;
  align-items: stretch;
}

.tag-chip,
.category-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  box-shadow: var(--shadow-glass);
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  transition:
    transform var(--transition-smooth) var(--ease-out-cubic),
    border-color var(--transition-smooth) var(--ease-out-cubic),
    background var(--transition-smooth) var(--ease-out-cubic);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

@media (hover: none) and (pointer: coarse) {
  .tag-chip,
  .category-chip {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
  }
}

body.theme-light .tag-chip,
body.theme-light .category-chip {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(15, 23, 42, 0.04);
}

.tag-chip::before,
.category-chip::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(125, 211, 252, 0.2),
    transparent
  );
  transition: left var(--transition-smooth);
}

.tag-chip:hover,
.category-chip:hover {
  transform: translateY(-3px);
  border-color: rgba(125, 211, 252, 0.45);
  background: rgba(255, 255, 255, 0.05);
}

body.theme-light .tag-chip:hover,
body.theme-light .category-chip:hover {
  background: rgba(15, 23, 42, 0.06);
}

.tag-chip:hover::before,
.category-chip:hover::before {
  left: 100%;
}

.tag-chip:active,
.category-chip:active {
  transform: translateY(0);
}

.tag-hash,
.category-hash {
  color: var(--text-dim);
  font-weight: 600;
}

.tag-name,
.category-name {
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.tag-count,
.category-count {
  font-size: 0.8rem;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.archive.tags-page,
.archive.categories-page {
  min-height: 60vh;
  text-align: center;
}

.archive.tags-page h1,
.archive.categories-page h1 {
  font-size: clamp(2rem, 3vw, 3rem);
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tags-header,
.categories-header {
  margin-bottom: 18px;
}

.tags-intro,
.categories-intro {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.archive-list {
  display: flex;
  flex-direction: column;
  margin-top: 12px;
}

.archive-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

@supports (content-visibility: auto) {
  .archive-item {
    content-visibility: auto;
    contain-intrinsic-size: 72px;
  }
}

.archive-item:last-child {
  border-bottom: none;
}

.archive-title {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.archive-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
}

.archive-actions .btn {
  padding: 6px 14px;
}

.archive.link-page {
  min-height: 60vh;
}

.archive.link-page h1 {
  font-size: clamp(2rem, 3vw, 3rem);
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.link-content {
  margin: 20px 0 28px;
  display: grid;
  gap: 12px;
  color: var(--text-muted);
}

.link-content h3 {
  font-size: 1.1rem;
  color: var(--text);
}

.link-content ul {
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.link-groups {
  display: grid;
  gap: 32px;
}

.link-group-header {
  display: grid;
  gap: 6px;
}

.link-group-header h2 {
  font-size: 1.35rem;
}

.link-group-header p {
  color: var(--text-muted);
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}

.link-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: none;
  box-shadow: none;
  overflow: hidden;
  transition:
    transform var(--transition-smooth) var(--ease-out-cubic),
    border-color var(--transition-smooth) var(--ease-out-cubic);
}

.link-card:hover {
  transform: translateY(-4px);
  border-color: rgba(125, 211, 252, 0.45);
}

.link-avatar {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  overflow: hidden;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.08);
}

.link-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-avatar-fallback {
  font-size: 1.2rem;
  color: var(--text-muted);
}

.link-info {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.link-name {
  font-weight: 600;
  color: var(--text);
  font-size: 1.02rem;
}

.link-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.link-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 0.82rem;
}

.link-site {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.link-action {
  margin-left: auto;
  font-weight: 600;
  color: var(--accent-light);
}
