/* 网络资源：浅底 + 白色圆角卡片。手机端朋友圈式单列，网页端论坛式双列。 */
.web-resources {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 400px at 80% -10%, rgba(14, 116, 144, 0.08), transparent 60%),
    linear-gradient(180deg, #f6f8fb, #eef1f6);
  color: #1f2937;
}
.wr-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 28px 56px;
}

/* ---------- 顶部 ---------- */
.wr-hero { margin-bottom: 22px; }
.wr-hero-badge {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, #0e7490, #155e75);
  box-shadow: 0 10px 22px rgba(14, 116, 144, 0.28);
  margin-bottom: 14px;
}
.wr-hero-badge svg { width: 28px; height: 28px; }
.wr-hero h1 {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.wr-hero p { margin: 0; color: #6b7280; font-size: 14.5px; }

/* ---------- 筛选 chips ---------- */
.wr-filters {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 -28px 22px;
  padding: 12px 28px;
  background: rgba(246, 248, 251, 0.86);
  backdrop-filter: blur(10px);
}
.wr-chips { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.wr-chips::-webkit-scrollbar { display: none; }
.wr-chip {
  flex: 0 0 auto;
  border: 1px solid #e2e6ee;
  background: #fff;
  color: #4b5563;
  font-size: 13.5px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.wr-chip:hover { border-color: #0e7490; color: #0e7490; }
.wr-chip.active {
  background: #0e7490;
  border-color: #0e7490;
  color: #fff;
  box-shadow: 0 6px 14px rgba(14, 116, 144, 0.26);
}

/* ---------- 卡片列表 ---------- */
.wr-list { display: flex; flex-direction: column; gap: 18px; }
.wr-card {
  background: #fff;
  border: 1px solid #eceff4;
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 6px 20px rgba(31, 41, 55, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.wr-card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(31, 41, 55, 0.1); }

.wr-card-head { display: flex; align-items: center; gap: 12px; }
.wr-avatar {
  width: 44px; height: 44px;
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 13px;
  font-size: 18px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #0e7490, #7c3aed);
}
.wr-head-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wr-head-meta strong { font-size: 15px; font-weight: 700; }
.wr-head-meta span { font-size: 12.5px; color: #9ca3af; }
.wr-grade-tag {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 12px; font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  color: #0e7490;
  background: rgba(14, 116, 144, 0.1);
}
.wr-grade-tag.custom { color: #7c3aed; background: rgba(124, 58, 237, 0.1); }
.wr-grade-tag.general { color: #6b7280; background: #f3f4f6; }

.wr-content {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: #374151;
  white-space: pre-wrap;
  word-break: break-all;
}
.wr-actions { display: flex; margin-top: 12px; }
.wr-copy-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid #d7e3e8;
  background: #f4f9fa;
  color: #0e7490;
  font-size: 13px; font-weight: 700;
  padding: 8px 15px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.wr-copy-btn:hover { background: #0e7490; color: #fff; border-color: #0e7490; }
.wr-copy-btn svg { width: 16px; height: 16px; }

/* ---------- 图片九宫格 ---------- */
.wr-images { display: grid; gap: 7px; margin-top: 14px; }
.wr-count-1 { grid-template-columns: 1fr; max-width: 72%; }
.wr-count-2, .wr-count-3 { grid-template-columns: repeat(3, 1fr); }
.wr-count-4 { grid-template-columns: repeat(2, 1fr); max-width: 78%; }
.wr-count-5, .wr-count-6, .wr-count-7, .wr-count-8, .wr-count-9 {
  grid-template-columns: repeat(3, 1fr);
}
.wr-image-cell {
  margin: 0; padding: 0;
  border: none;
  border-radius: 11px;
  overflow: hidden;
  aspect-ratio: 1;
  background: #f0f2f6;
  cursor: zoom-in;
}
.wr-count-1 .wr-image-cell { aspect-ratio: auto; max-height: 380px; cursor: zoom-in; }
.wr-image-cell img {
  width: 100%; height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.25s ease;
}
.wr-count-1 .wr-image-cell img { object-fit: contain; background: #f7f9fb; }
.wr-image-cell:hover img { transform: scale(1.04); }

/* ---------- 空 / 加载 ---------- */
.wr-empty, .wr-loading {
  text-align: center;
  padding: 60px 20px;
  color: #9ca3af;
  font-size: 14px;
}
/* 加载态撑满视口剩余高度，避免加载窗口期文档塌缩、滚轮"卡死"，并给出明确加载反馈 */
.wr-loading {
  min-height: calc(100dvh - 320px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.wr-loading-spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid #d7e3e8; border-top-color: #0e7490;
  animation: wr-spin 0.8s linear infinite;
}
@keyframes wr-spin { to { transform: rotate(360deg); } }
.wr-empty svg { width: 46px; height: 46px; margin-bottom: 12px; }
.wr-empty p { margin: 0; }

/* ---------- 灯箱 ---------- */
.wr-lightbox {
  position: fixed; inset: 0;
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 20, 30, 0.9);
  padding: 40px;
}
.wr-lightbox-img {
  max-width: 100%; max-height: 100%;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.wr-lightbox-close {
  position: absolute; top: 20px; right: 22px;
  width: 44px; height: 44px;
  border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}
.wr-lightbox-close:hover { background: rgba(255, 255, 255, 0.28); }
.wr-lightbox-close svg { width: 22px; height: 22px; }
.wr-lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 50px; height: 50px;
  border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}
.wr-lightbox-nav:hover { background: rgba(255, 255, 255, 0.26); }
.wr-lightbox-nav svg { width: 24px; height: 24px; }
.wr-lightbox-nav.prev { left: 24px; }
.wr-lightbox-nav.next { right: 24px; }

/* ---------- 网页端：论坛式双列 ---------- */
@media (min-width: 920px) {
  .wr-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    align-items: start;
  }
  .wr-card { align-self: start; }
}

/* ---------- 手机端：朋友圈式单列 ---------- */
@media (max-width: 640px) {
  .wr-wrap { padding: 24px 16px 40px; }
  .wr-filters { margin: 0 -16px 18px; padding: 10px 16px; }
  .wr-hero h1 { font-size: 25px; }
  .wr-card { padding: 16px; border-radius: 16px; }
  .wr-count-1 { max-width: 100%; }
  .wr-count-4 { max-width: 100%; }
  .wr-lightbox { padding: 20px; }
  .wr-lightbox-nav.prev { left: 8px; }
  .wr-lightbox-nav.next { right: 8px; }
}
