/**
 * Resources Page Styles (resources.php)
 * Fully responsive – optimized for all screen sizes
 * 字体已按全线统一标准调大（桌面+0.2，平板+0.15，移动+0.15）
 */

/* ===== Page Header ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.page-header h1 {
  margin: 0;
  font-size: 1.7rem; /* 原1.5 +0.2 */
  font-weight: 700;
  color: #260000;
}

.page-header h1 i {
  color: #921818;
  margin-right: 8px;
}

.btn-primary {
  background: #9c061f;
  color: white;
  border: none;
  padding: 8px 22px;
  border-radius: 30px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s, transform 0.1s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem; /* 新增显式，统一桌面按钮大小 */
}

.btn-primary:hover {
  background: #1a5f8a;
}

.btn-primary:active {
  transform: scale(0.96);
}

.btn-primary i {
  font-size: 1rem;
}

/* ===== Resource Grid ===== */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.res-card {
  background: white;
  border-radius: 18px;
  padding: 24px 20px 60px;
  border: 1px solid #edf2f7;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
  position: relative;
}

.res-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}

.res-card .icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem; /* 图标大小不变 */
  margin-bottom: 16px;
  flex-shrink: 0;
}

.icon-wrap.blue {
  background: #e6f0fa;
  color: #940505;
}
.icon-wrap.green {
  background: #e0f0e6;
  color: #2a9d8f;
}
.icon-wrap.purple {
  background: #ede6f5;
  color: #7b4fa0;
}
.icon-wrap.orange {
  background: #fef0e0;
  color: #d48c2c;
}
.icon-wrap.red {
  background: #fde8e8;
  color: #b33c3c;
}

.res-card h4 {
  font-size: 1.25rem; /* 原1.05 +0.2 */
  margin: 0 0 4px;
  color: #260000;
  font-weight: 700;
  line-height: 1.3;
}

.res-card p {
  font-size: 1.05rem; /* 原0.85 +0.2 */
  color: #6f8ea3;
  margin: 0;
  line-height: 1.5;
}

.res-card .meta {
  position: absolute;
  bottom: 18px;
  right: 18px;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.res-card .meta i {
  color: #b0c8dd;
}

.res-card .badge {
  background: #eef3fc;
  color: #1f6390;
  font-size: 0.9rem; /* 原0.7 +0.2 */
  font-weight: 700;
  padding: 3px 14px;
  border-radius: 30px;
  white-space: nowrap;
}

.badge.green {
  background: #e0f0e6;
  color: #1f7a5a;
}

.badge.orange {
  background: #fef0e0;
  color: #b87a1f;
}

.badge.red {
  background: #fde8e8;
  color: #b33c3c;
}

/* ===== Responsive ===== */

/* flat (≤1024px) */
@media (max-width: 1024px) {
  .resource-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }

  .res-card {
    padding: 20px 16px;
  }

  .res-card .icon-wrap {
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
  }

  .res-card h4 {
    font-size: 1.15rem; /* 原1.0 +0.15 */
  }

  .res-card p {
    font-size: 0.95rem; /* 原0.82 +0.13 ≈0.95 */
  }
}

/* Mobile phone landscape mode / tablet (≤768px) */
@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .page-header h1 {
    font-size: 1.45rem; /* 原1.3 +0.15 */
  }

  .btn-primary {
    align-self: flex-start;
    padding: 6px 18px;
    font-size: 1.05rem; /* 原0.9 +0.15 */
  }

  .resource-grid {
    gap: 16px;
  }

  .res-card {
    padding: 18px 14px;
  }

  .res-card .icon-wrap {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
    margin-bottom: 12px;
  }

  .res-card h4 {
    font-size: 1.1rem; /* 原0.95 +0.15 */
  }

  .res-card p {
    font-size: 0.95rem; /* 原0.8 +0.15 */
  }

  .res-card .meta {
    margin-top: 12px;
    padding-top: 10px;
    font-size: 0.85rem;
  }

  .res-card .badge {
    font-size: 0.8rem; /* 原0.65 +0.15 */
    padding: 2px 12px;
  }
}

/* Mobile phone portrait mode (≤480px) – The button changes to a circular icon */
@media (max-width: 480px) {
  .page-header {
    flex-direction: row;           /* Restore to horizontal arrangement */
    justify-content: space-between;
    align-items: center;
    gap: 8px;
  }

  .page-header h1 {
    font-size: 1.25rem; /* 原1.1 +0.15 */
    flex: 1;
  }

  /* The button changes to a circular icon */
  .btn-primary {
    align-self: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    font-size: 0;                /* Hidden text */
    background: #9c061f;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    gap: 0;
  }

  .btn-primary i {
    font-size: 1.4rem;          /* icon enlargement */
    margin: 0;
  }

  /* Ensure that the text nodes within the button are completely hidden. */
  .btn-primary span,
  .btn-primary .btn-text {
    display: none;
  }

  /* The card grid becomes a single column */
  .resource-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .res-card {
    padding: 18px 16px 58px;
  }

  .res-card .icon-wrap {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .res-card h4 {
    font-size: 1.1rem; /* 原0.95 +0.15 */
  }

  .res-card p {
    font-size: 0.95rem; /* 原0.8 +0.15 */
  }

  .res-card .meta {
    position: absolute;
    bottom: 16px;
    right: 16px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
  }

  /* Improve tap targets and spacing on very small screens */
  .res-card {
    border-radius: 14px;
    padding: 18px 16px 58px;
    box-shadow: 0 8px 22px rgba(15,54,92,0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
  }

  .res-card:active {
    transform: translateY(1px) scale(0.998);
  }

  .res-card .icon-wrap {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 1.2rem;
  }

  .res-card h4 { font-size: 1.1rem; }
  .res-card p { font-size: 0.95rem; color: #56728f; }
  .resource-grid { gap: 12px; }
}

/* Very small screens (≤400px) – Button slightly smaller */
@media (max-width: 400px) {
  .content {
    padding: 8px 6px 0;
  }

  .res-card {
    padding: 14px 12px;
  }

  .res-card h4 {
    font-size: 1.0rem; /* 原0.9 +0.1 */
  }

  .res-card p {
    font-size: 0.85rem; /* 原0.75 +0.1 */
  }

  .btn-primary {
    width: 38px;
    height: 38px;
  }

  .btn-primary i {
    font-size: 1.2rem;
  }
}