body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(circle at 82% 2%, rgba(210, 166, 122, 0.13), transparent 28%),
    linear-gradient(180deg, #faf7f2 0%, #f4ede3 100%);
  color: #2a2019;
}

/* ===== 页面标题 ===== */
.lib-header {
  width: min(1320px, calc(100% - 64px));
  margin: 0 auto;
  padding: 42px 0 24px;
}

.lib-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lib-header h1 {
  font-size: 30px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0;
}

.lib-header p {
  max-width: 620px;
  margin: 10px 0 0 39px;
  color: #7a6b5f;
  font-size: 14px;
  line-height: 1.8;
  letter-spacing: 0.02em;
}

.lib-back-btn {
  width: 28px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #17120f;
  cursor: pointer;
  font-size: 42px;
  font-family: Arial, sans-serif;
  line-height: 30px;
  transition: transform 0.2s ease, color 0.2s ease;
}

.lib-back-btn:hover {
  color: #8b5e3c;
  transform: translateX(-3px);
}

/* ===== 容器 ===== */
.lib-container {
  width: min(1320px, calc(100% - 64px));
  margin: 0 auto;
  padding: 10px 0 56px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
}

/* ===== 卡片 ===== */
.lib-card {
  min-width: 0;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 12px 32px rgba(72, 49, 31, 0.08);
  cursor: pointer;
  transition: transform 0.28s ease, box-shadow 0.28s ease;
  border: 1px solid rgba(91, 63, 42, 0.08);
  backdrop-filter: blur(8px);
}

.lib-card:focus-visible {
  outline: 3px solid rgba(138, 94, 62, 0.28);
  outline-offset: 4px;
}

.lib-card:hover {
  transform: translateY(-7px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.95) inset,
    0 22px 46px rgba(72, 49, 31, 0.15);
}

/* 图片 */
.lib-img {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background:
    linear-gradient(145deg, rgba(203, 173, 143, 0.22), rgba(242, 233, 222, 0.72)),
    #eee7df;
  overflow: hidden;
}

.lib-img img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.lib-card:hover .lib-img img {
  transform: scale(1.045);
}

.lib-img img.is-missing {
  display: none;
}

.image-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(92, 65, 46, 0.45);
  font-size: 13px;
  letter-spacing: 0.18em;
}

/* 信息区 */
.lib-info {
  padding: 18px 18px 20px;
}

.lib-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lib-info h3 {
  overflow: hidden;
  margin: 0;
  font-size: 16px;
  line-height: 1.45;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lib-card-arrow {
  flex: 0 0 auto;
  color: #9a7254;
  font-size: 17px;
  transition: transform 0.2s ease;
}

.lib-card:hover .lib-card-arrow {
  transform: translate(2px, -2px);
}

.lib-info p {
  min-height: 2.9em;
  margin: 8px 0 0;
  color: #7a6b5f;
  font-size: 13px;
  line-height: 1.55;
}

.library-loading,
.library-empty {
  grid-column: 1 / -1;
  padding: 72px 24px;
  border: 1px dashed rgba(91, 63, 42, 0.14);
  border-radius: 22px;
  color: #7a6b5f;
  background: rgba(255, 255, 255, 0.38);
  text-align: center;
}

.library-empty > span {
  display: block;
  color: #9a7254;
  font-size: 28px;
}

.library-empty h2 {
  margin: 12px 0 6px;
  color: #2a2019;
  font-size: 20px;
}

.library-empty p {
  margin: 0;
  font-size: 13px;
}

/* ===== 平板端 ===== */
@media (max-width: 1024px) {
  .lib-container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ===== 手机端 ===== */
@media (max-width: 600px) {
  .lib-header {
    width: calc(100% - 36px);
    padding: 26px 0 18px;
  }

  .lib-header p {
    margin: 8px 0 0 34px;
    font-size: 13px;
    line-height: 1.65;
  }

  .lib-container {
    width: calc(100% - 36px);
    padding: 6px 0 36px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .lib-header h1 {
    font-size: 25px;
  }

  .lib-info {
    padding: 13px 13px 15px;
  }

  .lib-info h3 {
    font-size: 14px;
  }

  .lib-info p {
    margin-top: 6px;
    font-size: 12px;
  }

  .lib-card {
    border-radius: 16px;
  }

  .lib-card-arrow {
    display: none;
  }
}
