/* ===== 资源分享盒子 - 全局样式(中老年友好:大字号、高对比、清晰) ===== */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  background: #f7f8fa;
}

a { color: #2563eb; text-decoration: none; }
a:hover { color: #1d4ed8; text-decoration: underline; }

img { max-width: 100%; display: block; }

button { font-family: inherit; cursor: pointer; border: none; outline: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== 顶部导航 ===== */
.topbar {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
  text-decoration: none;
}
.logo-icon { font-size: 28px; }
.logo-text { white-space: nowrap; }

.search {
  flex: 1;
  max-width: 500px;
  display: flex;
  height: 40px;
  background: #f3f4f6;
  border-radius: 8px;
  overflow: hidden;
}
.search input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0 16px;
  font-size: 15px;
  outline: none;
}
.search button {
  padding: 0 20px;
  background: #2563eb;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
.search button:hover { background: #1d4ed8; }

.topnav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 15px;
}
.topnav a { color: #4b5563; font-weight: 500; }
.topnav a:hover { color: #2563eb; text-decoration: none; }

.user-box { display: flex; gap: 8px; align-items: center; }
.btn-login {
  padding: 7px 16px;
  border: 1px solid #2563eb;
  border-radius: 6px;
  color: #2563eb !important;
}
.btn-reg {
  padding: 7px 16px;
  background: #2563eb;
  color: #fff !important;
  border-radius: 6px;
}

/* ===== 大横幅 ===== */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 60px 0 50px;
  text-align: center;
}
.hero h1 { font-size: 36px; font-weight: 700; margin-bottom: 12px; }
.hero p { font-size: 18px; opacity: 0.95; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn-primary {
  display: inline-block;
  padding: 12px 32px;
  background: #fff;
  color: #4f46e5 !important;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.1s;
}
.btn-primary:hover { transform: translateY(-1px); text-decoration: none; }
.btn-secondary {
  display: inline-block;
  padding: 12px 32px;
  background: rgba(255,255,255,0.18);
  color: #fff !important;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.4);
}
.btn-secondary:hover { background: rgba(255,255,255,0.28); text-decoration: none; }

/* ===== Section ===== */
.section { padding: 40px 0; }
.section-title { font-size: 24px; font-weight: 700; color: #1f2937; margin-bottom: 20px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 20px; }
.section-head .section-title { margin-bottom: 0; }
.link-more { color: #6b7280; font-size: 14px; }
.link-more:hover { color: #2563eb; }

/* ===== 分类网格 ===== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.cat-card {
  background: #fff;
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  border: 1px solid #e5e7eb;
  transition: all 0.15s;
  cursor: pointer;
  text-decoration: none;
  color: #1f2937;
  display: block;
}
.cat-card:hover {
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.1);
  text-decoration: none;
}
.cat-icon { font-size: 32px; display: block; margin-bottom: 8px; }
.cat-name { font-size: 16px; font-weight: 600; }
.cat-count { font-size: 13px; color: #6b7280; margin-top: 4px; }
.cat-skeleton {
  background: #f3f4f6;
  color: #9ca3af;
  border-style: dashed;
}

/* ===== 资源卡片 ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  transition: all 0.15s;
  text-decoration: none;
  color: #1f2937;
  display: block;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  text-decoration: none;
  border-color: #d1d5db;
}
.card-cover {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  background: #f3f4f6;
  padding: 12px;
}
.card-body { padding: 14px 16px; }
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 44px;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #6b7280;
  margin-top: 8px;
}
.card-price {
  color: #ef4444;
  font-weight: 700;
  font-size: 16px;
}
.card-vip-badge {
  display: inline-block;
  padding: 1px 6px;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}
.card-skeleton { height: 280px; background: #f3f4f6; border-style: dashed; color: #9ca3af; display: flex; align-items: center; justify-content: center; }

/* ===== VIP banner ===== */
.vip-banner {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-radius: 12px;
  color: #fff;
  margin: 0 auto;
}
.vip-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 30px 40px;
}
.vip-inner h2 { font-size: 24px; margin-bottom: 6px; }
.vip-inner p { font-size: 16px; opacity: 0.95; }
.vip-inner .btn-primary { background: #fff; color: #f59e0b !important; }

/* ===== 页脚 ===== */
.footer {
  background: #1f2937;
  color: #9ca3af;
  padding: 40px 0 24px;
  margin-top: 60px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}
.footer-col h4 {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}
.footer-col a { display: block; color: #9ca3af; margin-bottom: 8px; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-col p { margin-bottom: 6px; font-size: 14px; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 12px 0; gap: 12px; }
  .search { order: 3; width: 100%; max-width: none; }
  .topnav { gap: 12px; font-size: 14px; }
  .hero h1 { font-size: 26px; }
  .hero p { font-size: 15px; }
  .section-title { font-size: 20px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .vip-inner { padding: 20px; }
  .vip-inner h2 { font-size: 18px; }
}

/* ===== 通用:面包屑/分页/空状态(其它页用) ===== */
.breadcrumb {
  padding: 14px 0;
  font-size: 14px;
  color: #6b7280;
}
.breadcrumb a { color: #6b7280; }
.breadcrumb a:hover { color: #2563eb; }

.empty {
  text-align: center;
  padding: 60px 20px;
  color: #6b7280;
}
.empty-icon { font-size: 56px; margin-bottom: 12px; }
.empty-text { font-size: 15px; }

.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 30px 0;
}
.pagination a, .pagination span {
  display: inline-block;
  min-width: 36px;
  height: 36px;
  line-height: 36px;
  text-align: center;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  color: #4b5563;
  text-decoration: none;
  font-size: 14px;
  padding: 0 10px;
}
.pagination a:hover { background: #f3f4f6; text-decoration: none; }
.pagination .active { background: #2563eb; color: #fff; border-color: #2563eb; }
.pagination .disabled { color: #d1d5db; pointer-events: none; }
