/* Home page stylesheet extracted from index.html */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif;
  background: #f7f8fb;
  min-height: 100vh;
  color: #1d1d1f
}

/* Hero banner */
.hero {
  background:
    radial-gradient(1200px 480px at 50% -120px, rgba(10, 132, 255, .22), rgba(0, 0, 0, 0) 60%),
    linear-gradient(135deg, #e8f1ff 0%, #f7f8fb 60%, #ffffff 100%);
  padding: 56px 0 36px;
  border-bottom: 1px solid rgba(0, 0, 0, .06)
}

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

/* Page paddings to keep left/right gaps like reference */
.main-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 18px;
}

@media(min-width:1280px) {
  .main-container {
    padding: 0 24px;
  }
}

@media(min-width:1440px) {
  .main-container {
    padding: 0 32px;
  }
}

.hero-search {
  display: flex;
  justify-content: center;
}

.hero-search-box {
  position: relative;
  width: 100%;
  max-width: 680px;
}

.hero-search-input {
  width: 100%;
  height: 56px;
  padding: 0 64px 0 20px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, .08);
  background: #fff;
  font-size: 15px;
  box-shadow: 0 6px 24px rgba(10, 132, 255, .06)
}

.hero-search-input:focus {
  outline: none;
  border-color: #0a84ff;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, .12);
}

.hero-search-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #0a84ff, #0066cc);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(10, 132, 255, .25)
}

.hero-search-btn:hover {
  transform: translateY(-50%) scale(1.05);
}

/* Utilities */
.hidden {
  display: none !important
}

/* Compact resource list */
.resource-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px
}

.resource-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 48px
}

.resource-row:hover {
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04)
}

.row-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0
}

.row-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5ff;
  border: 1px solid rgba(10, 132, 255, .15);
  color: #0a84ff;
  font-size: 14px;
  flex-shrink: 0
}

.row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: #1d1d1f;
  letter-spacing: -.1px
}

.row-title-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0
}

.row-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, .08);
  background: #f8fafc;
  color: #6b7280;
  cursor: pointer
}

.row-preview:hover {
  color: #0a84ff;
  border-color: rgba(10, 132, 255, .35);
  background: #eef6ff
}

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

.row-hot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e03131;
  font-weight: 600;
  background: rgba(224, 49, 49, .06);
  border: 1px solid rgba(224, 49, 49, .15);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px
}

.btn-download {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 8px
}

@media (max-width:768px) {
  .resource-row {
    padding: 10px
  }

  .row-hot {
    display: none
  }
}

/* Header */
.header {
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, .06);
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 100
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center
}

.logo {
  display: flex;
  align-items: center;
  gap: 15px
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #0a84ff, #0066cc);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  border: 1px solid rgba(255, 255, 255, .25)
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  display: none
}

.logo-text h1 {
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, #1d1d1f 0%, #3a3a3c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -.2px
}

.logo-text p {
  font-size: 14px;
  color: #666;
  margin-top: 2px
}

.header-actions {
  display: flex;
  gap: 15px;
  align-items: center
}

.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all .2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px
}

.btn-primary {
  background: linear-gradient(135deg, #0a84ff, #0066cc);
  color: #fff;
  border: 1px solid rgba(0, 102, 204, .35)
}

.btn-primary:hover {
  transform: translateY(-1px)
}

.btn-outline {
  background: transparent;
  color: #0a84ff;
  border: 1px solid rgba(10, 132, 255, .4)
}

.btn-outline:hover {
  background: rgba(10, 132, 255, .08);
  color: #0a84ff
}

/* Announcement */
.announcement {
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 16px auto;
  max-width: 920px;
  color: #1d1d1f;
  text-align: left
}

.announcement.hidden {
  display: none
}

.announcement-content a {
  color: #0a84ff;
  text-decoration: underline
}

.announcement .close-btn {
  border: none;
  background: transparent;
  color: #666;
  cursor: pointer
}

/* Search */
.search-container {
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 24px;
  border: 1px solid rgba(0, 0, 0, .06)
}

.search-box {
  position: relative;
  max-width: 600px;
  margin: 0 auto
}

.search-input {
  width: 100%;
  padding: 10px 42px 10px 12px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: all .2s ease;
  background: rgba(255, 255, 255, .95)
}

.search-input:focus {
  border-color: #0a84ff;
  box-shadow: 0 0 0 2px rgba(10, 132, 255, .1)
}

.search-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, #0a84ff, #0066cc);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 16px 0 12px;
  justify-content: center;
}

.tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, .08);
  background: #fff;
  color: #333;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: .2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04);
  transition: all .2s ease;
}

.tab:hover {
  border-color: rgba(10, 132, 255, .25);
  box-shadow: 0 3px 12px rgba(10, 132, 255, .06)
}

.tab.active {
  background: linear-gradient(135deg, #0a84ff, #0066cc);
  color: #fff;
  border-color: rgba(10, 132, 255, .4);
  box-shadow: 0 6px 18px rgba(10, 132, 255, .18)
}



.search-btn {
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s ease;
  border: 1px solid rgba(0, 102, 204, .35)
}

.search-btn:hover {
  transform: translateY(-50%) scale(1.05)
}

/* Filters bar */
.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 16px
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.chip {
  border: 1px solid rgba(0, 0, 0, .08);
  background: #f6f8fa;
  color: #24292f;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer
}

.chip.active {
  background: #0a84ff;
  color: #fff;
  border-color: rgba(0, 102, 204, .35)
}

.sort-group {
  display: flex;
  align-items: center;
  gap: 8px
}

.sort-select {
  border: 1px solid rgba(0, 0, 0, .08);
  background: #fff;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px
}

/* Resource grid */
.resources-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px
}

@media(max-width:1024px) {
  .resources-grid {
    grid-template-columns: repeat(2, 1fr)
  }
}

@media(max-width:768px) {
  .resources-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .resource-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 16px;
  }

  .resource-card__header {
    min-height: auto;
    width: 100%;
  }

  .resource-info {
    width: 100%;
  }

  .resource-info h3 {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    font-size: 15px;
    line-height: 1.3;
    max-height: 3.9em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 6px;
  }

  .resource-links {
    flex-direction: row;
    gap: 8px;
    width: 100%;
    justify-content: space-between;
  }

  .resource-links .btn {
    padding: 8px 12px;
    font-size: 12px;
    flex: 1;
    text-align: center;
    justify-content: center;
  }
}

.resource-card {
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid rgba(0, 0, 0, .06);
  transition: all .2s ease;
  position: relative
}

.resource-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 84px
}

.resource-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(135deg, #0a84ff, #0066cc);
  opacity: .85
}

.resource-card:hover {
  transform: translateY(-1px)
}

.resource-icon {
  width: 48px;
  height: 48px;
  background: #f1f5ff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0a84ff;
  font-size: 20px;
  border: 1px solid rgba(10, 132, 255, .15)
}

.resource-info h3 {
  font-size: 16px;
  margin-bottom: 4px
}

.resource-info .meta {
  display: flex;
  gap: 10px;
  align-items: center;
  color: #666;
  font-size: 12px
}

.resource-links {
  display: flex;
  gap: 10px;
  align-items: center
}

.resource-links .btn {
  padding: 10px 14px
}

/* Pagination */
.pagination-container {
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, .06)
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap
}

.page-btn {
  background: #fff;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer
}

.page-btn[disabled] {
  opacity: .5;
  cursor: not-allowed
}

.page-info {
  font-size: 14px;
  color: #666
}

/* Loading & empty */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 30px
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e5e9f2;
  border-top-color: #0a84ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

.empty-state {
  text-align: center;
  color: #666;
  padding: 30px
}

/* Image modal */
.image-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .65);
  align-items: center;
  justify-content: center;
  z-index: 1000
}

.image-modal .modal-content {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3)
}

.image-modal .modal-content img {
  display: block;
  max-width: 90vw;
  max-height: 70vh
}

.image-modal-title {
  margin-top: 10px;
  text-align: center;
  color: #fff;
  font-weight: 600
}

/* Announcement modal */
.announcement-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 1000;
  align-items: center;
  justify-content: center
}

.announcement-modal .announcement-modal-content {
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  max-width: 560px;
  width: 92%;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .18);
  line-height: 1.7;
}

/* 结构化头部与关闭按钮 */
.announcement-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.announcement-modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #24292f;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.announcement-modal-close {
  border: 1px solid #d0d7de;
  background: #f6f8fa;
  color: #24292f;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.announcement-modal-close:hover { background: #eef2f6; }

/* 正文与链接可读性 */
.announcement-modal-body {
  font-size: 15px;
  color: #1f2937;
}
.announcement-modal-body p { margin: 10px 0; }
.announcement-modal-body a {
  color: #0969da;
  text-decoration: underline;
}

/* 底部主按钮 */
.announcement-modal-footer {
  margin-top: 16px;
  display: flex;
  justify-content: center; /* 居中按钮 */
}
.announcement-modal-footer .btn {
  min-width: 140px;
  text-align: center; /* 文本居中（非 flex 元素时） */
  justify-content: center; /* flex 子元素居中，确保文字真正居中 */
}

@media (max-width: 768px) {
  .announcement-modal .announcement-modal-content {
    padding: 18px;
    width: 94%;
  }
  .announcement-modal-footer .btn {
    width: 100%;
  }
}

/* 分页与资源卡片的间距优化 */
.pagination-container { margin-top: 18px; }

/* 右上角“提交资源需求”按钮弱化样式 */
.header-request-btn {
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 8px;
  color: #656d76; /* 中性文字色 */
  border: 1px solid #d0d7de; /* 低强调边框 */
  background: transparent;
}
.header-request-btn:hover {
  background: #f6f8fa;
  color: #0969da;
}

/* 资源需求模态框的输入框优化 */
.request-modal .form-control {
  display: block;
  width: 100%;
  max-width: 520px; /* 居中且更宽 */
  margin: 12px auto; /* 居中 + 上下间距 */
  height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
  outline: none;
}
.request-modal .form-control::placeholder { color: #9aa0a6; }
.request-modal .form-control:focus {
  border-color: #0a84ff;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, .12);
}

/* Responsive tweaks */
@media (max-width:768px) {
  .filters-bar {
    gap: 8px;
  }

  /* --- Featured row and hot badge (strong, conflict-free) --- */
  .nav-grid.featured {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }

  .nav-grid.featured .nav-card {
    min-height: 78px;
    padding: 14px 14px;
  }

  @media(max-width:1024px) {
    .nav-grid.featured {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  .hot-badge {
    z-index: 2
  }

  /* ensure left area aligns content to start */
  .nav-left {
    justify-content: flex-start
  }
}

/* 页脚样式 - 简约版 */
.site-footer {
  margin-top: 48px;
  padding: 24px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: transparent;
}

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

.footer-content {
  text-align: center;
}

.footer-text {
  font-size: 12px;
  color: #666;
  line-height: 1.5;
  margin-bottom: 4px;
}

.footer-beian {
  font-size: 11px;
  color: #999;
  line-height: 1.5;
}

/* 页脚响应式 */
@media (max-width: 768px) {
  .site-footer {
    padding: 20px 0;
    margin-top: 32px;
  }

  .footer-text,
  .footer-beian {
    font-size: 11px;
  }
}