/* 文库页：Heo 式信息罗列，使用梦溪笔谈现有玻璃色板 */
.article-library {
  --library-border: rgba(155, 201, 172, 0.24);
  --library-panel: rgba(22, 59, 56, 0.3);
  padding: clamp(22px, 4vw, 48px) !important;
}

.library-heading {
  margin-bottom: 28px;
}

.library-kicker {
  color: var(--scene-cream);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  opacity: 0.85;
}

.library-heading h1 {
  margin: 8px 0 8px;
  color: #e8d6a4 !important;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
  background: linear-gradient(112deg, #8f6a2a 0%, #d8b866 18%, #fff1b8 34%, #c9953d 51%, #f7e7a5 68%, #a87325 86%, #efd27d 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 1px 0 rgba(255, 245, 190, 0.22), 0 8px 24px rgba(112, 78, 25, 0.24);
}

.library-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.library-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.library-filter {
  padding: 7px 13px;
  border: 1px solid var(--library-border);
  border-radius: 999px;
  background: rgba(22, 59, 56, 0.22);
  color: var(--text-glass-muted);
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1.2;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.library-filter:hover {
  border-color: rgba(232, 214, 164, 0.62);
  color: #fff;
  transform: translateY(-1px);
}

.library-filter.is-active {
  border-color: var(--scene-cream);
  background: var(--scene-coral);
  color: #fff;
  font-weight: 650;
}

.library-year-filters {
  padding-top: 10px;
  border-top: 1px solid rgba(155, 201, 172, 0.2);
}

.library-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 18px;
  align-items: start;
}

.library-list {
  overflow: hidden;
  border: 1px solid var(--library-border);
  border-radius: 18px;
  background: rgba(22, 59, 56, 0.2);
}

.library-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 24px;
  gap: 16px;
  align-items: center;
  min-height: 98px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(155, 201, 172, 0.18);
  transition: background 0.2s ease;
}

.library-item:last-child {
  border-bottom: 0;
}

.library-item:hover {
  background: rgba(63, 116, 108, 0.3);
}

.library-item[hidden] {
  display: none;
}

.library-item-cover {
  display: flex;
  overflow: hidden;
  justify-content: center;
  align-items: center;
  width: 112px;
  height: 70px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--scene-teal), var(--scene-ink));
}

.library-item-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.library-item:hover .library-item-cover img {
  transform: scale(1.04);
}

.library-item-initial {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.8rem;
  font-weight: 750;
}

.library-item-body {
  min-width: 0;
}

.library-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 6px;
  color: var(--text-glass-muted);
  font-size: 0.76rem;
}

.library-item-meta span:first-child {
  color: var(--scene-cream);
}

.library-item-separator {
  opacity: 0.45;
}

.library-item-title {
  display: -webkit-box;
  overflow: hidden;
  color: #fff !important;
  font-size: 1.02rem;
  font-weight: 650;
  line-height: 1.45;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.library-item-description {
  display: -webkit-box;
  overflow: hidden;
  margin: 5px 0 0;
  color: var(--text-glass-muted) !important;
  font-size: 0.8rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.library-item-arrow {
  color: var(--scene-cream) !important;
  font-size: 1.25rem;
  text-align: center;
  transition: transform 0.2s ease, color 0.2s ease;
}

.library-item:hover .library-item-arrow {
  color: var(--scene-coral) !important;
  transform: translateX(3px);
}

.library-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.library-summary-card,
.library-summary-link {
  padding: 16px;
  border: 1px solid var(--library-border);
  border-radius: 16px;
  background: var(--library-panel);
}

.library-summary-label {
  color: var(--text-glass-muted);
  font-size: 0.78rem;
}

.library-summary-count {
  margin: 4px 0;
  color: var(--scene-cream);
  font-size: 2.2rem;
  font-weight: 750;
  line-height: 1;
}

.library-summary-card p {
  margin: 8px 0 0;
  color: var(--text-glass-muted) !important;
  font-size: 0.8rem;
}

.library-summary-tag {
  display: inline-block;
  margin: 7px 5px 0 0;
  padding: 4px 8px;
  border: 1px solid rgba(155, 201, 172, 0.24);
  border-radius: 999px;
  color: var(--text-glass-body);
  font-size: 0.75rem;
}

.library-summary-link a {
  color: var(--scene-cream) !important;
  font-size: 0.86rem;
  font-weight: 650;
}

.library-empty {
  padding: 48px 20px;
  color: var(--text-glass-muted);
  text-align: center;
}

@media screen and (max-width: 900px) {
  .library-layout {
    grid-template-columns: 1fr;
  }

  .library-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 600px) {
  .article-library {
    padding: 20px 14px !important;
  }

  .library-item {
    grid-template-columns: 76px minmax(0, 1fr) 18px;
    gap: 10px;
    min-height: 82px;
    padding: 11px 12px;
  }

  .library-item-cover {
    width: 76px;
    height: 58px;
  }

  .library-item-title {
    font-size: 0.92rem;
  }

  .library-item-description {
    display: none;
  }

  .library-summary {
    grid-template-columns: 1fr;
  }
}
