/* 阅读指南网站首页样式 - 苹果风格设计 */

/* 全局容器样式 */
.container {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif;
  background-color: #ffffff;
  color: #1d1d1f;
  line-height: 1.47059;
  letter-spacing: -0.022em;
  min-height: 100vh;
}

/* 主内容区域 */
.main {
  display: flex;
  max-width: 1440px;
  margin: 0 auto;
  padding: 80px 20px;
}

/* 左侧菜单区域 */
.sidebar {
  width: 240px;
  padding-right: 40px;
  position: sticky;
  top: 100px;
  align-self: flex-start;
  height: calc(100vh - 200px);
  overflow-y: auto;
}

.sidebarTitle {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
  color: #1d1d1f;
}

.menuList {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menuItem {
  margin-bottom: 16px;
}

.menuLink {
  display: block;
  padding: 10px 16px;
  border-radius: 10px;
  color: #1d1d1f;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.menuLink:hover {
  background-color: #f5f5f7;
  color: #0066cc;
}

.menuLinkActive {
  background-color: #f5f5f7;
  color: #0066cc;
  font-weight: 600;
}

/* 右侧内容区域 */
.content {
  flex: 1;
  padding-left: 20px;
}

/* 分类区块 */
.section {
  margin-bottom: 60px;
  scroll-margin-top: 100px;
}

.sectionTitle {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid #d2d2d7;
  color: #1d1d1f;
}

/* 资源卡片网格 */
.resourceGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.resourceCard {
  background-color: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.resourceCard:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.cardImage {
  width: 100%;
  height: 120px;
  position: relative;
  background-color: #f5f5f7;
}

.cardContent {
  padding: 12px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cardTitle {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #1d1d1f;
}

.cardDescription {
  font-size: 13px;
  color: #6e6e73;
  margin-bottom: 12px;
  flex: 1;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cardTags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

/* 官方推荐标识 */
.officialRecommend {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(90deg, #0066cc, #5ac8fa);
  color: white;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.3s ease;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 12px rgba(0, 102, 204, 0.4);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.3);
  }
}

.resourceCard:hover .officialRecommend {
  animation: pulse 2s infinite;
}

.cardTag {
  padding: 3px 8px;
  background-color: #f5f5f7;
  border-radius: 12px;
  font-size: 11px;
  color: #6e6e73;
}

.cardLink {
  display: inline-block;
  padding: 6px 12px;
  background-color: #0071e3;
  color: #fff;
  text-decoration: none;
  border-radius: 980px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  transition: all 0.3s ease;
}

.cardLink:hover {
  background-color: #0077ED;
}

/* 页面顶部横幅 */
.hero {
  background: linear-gradient(180deg, #fbfbfd 0%, #fff 100%);
  padding: 120px 20px 40px;
  text-align: center;
  margin-bottom: 40px;
}

.heroTitle {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 16px;
  background: linear-gradient(90deg, #0066cc 0%, #5ac8fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
}

.heroSubtitle {
  font-size: 24px;
  font-weight: 400;
  color: #6e6e73;
  max-width: 700px;
  margin: 0 auto 30px;
}

/* 搜索栏 */
.searchBar {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
}

/* 搜索站点选择器 */
.searchSiteSelector {
  display: flex;
  justify-content: center;
  margin-bottom: 15px;
  gap: 10px;
  flex-wrap: wrap;
}

/* 分类选择器 - 苹果风格 */
.categorySelectorWrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.categorySelectorWrapper::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Edge */
}

.categorySelector {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 4px;
  background-color: rgba(0, 0, 0, 0.03);
  border-radius: 12px;
}

.categoryBtn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  background-color: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #6e6e73;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.categoryBtn:hover {
  color: #1d1d1f;
}

.categoryBtnActive {
  background-color: #ffffff;
  color: #1d1d1f;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.categoryBtn svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.categoryBtnActive svg {
  opacity: 1;
}

/* 搜索模式切换按钮 */
.searchModeToggle {
  background: rgba(0, 0, 0, 0.04);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #6e6e73;
  margin-left: 5px;
}

.searchModeToggle:hover {
  background: rgba(0, 0, 0, 0.08);
  color: #1d1d1f;
}

.searchModeToggle svg {
  width: 18px;
  height: 18px;
}

.siteSelectorBtn {
  padding: 8px 16px;
  border-radius: 980px;
  border: none;
  background-color: rgba(0, 0, 0, 0.04);
  font-size: 14px;
  color: #6e6e73;
  cursor: pointer;
  transition: all 0.2s ease;
}

.siteSelectorBtn:hover {
  background-color: rgba(0, 0, 0, 0.08);
}

.siteSelectorBtnActive {
  background-color: #0071e3;
  color: #fff;
}

.searchInputWrapper {
  position: relative;
  display: flex;
}

.searchInput {
  flex: 1;
  padding: 14px 20px;
  border-radius: 980px 0 0 980px;
  border: none;
  background-color: rgba(0, 0, 0, 0.04);
  font-size: 16px;
  outline: none;
  transition: all 0.3s ease;
}

.searchInput:focus {
  background-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1);
}

/* 清除搜索按钮 */
.clearSearchBtn {
  position: absolute;
  right: 80px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 20px;
  color: #6e6e73;
  cursor: pointer;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.clearSearchBtn:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: #1d1d1f;
}

/* 搜索提交按钮 */
.searchSubmitBtn {
  padding: 14px 20px;
  border-radius: 0 980px 980px 0;
  border: none;
  background-color: #0071e3;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.searchSubmitBtn:hover {
  background-color: #0077ED;
}

/* 搜索结果区域 */
.searchResults {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px;
}

/* 外部内容包装器 */
.externalContentWrapper {
  width: 100%;
  height: 800px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  background-color: #fff;
  position: relative;
}

.externalContent {
  width: 100%;
  height: 100%;
  border: none;
}

/* 加载指示器 */
.loadingIndicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.9);
  z-index: 10;
}

.loadingSpinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #0071e3;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.searchResultsHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid #d2d2d7;
}

.searchResultsHeader h2 {
  font-size: 24px;
  font-weight: 600;
  color: #1d1d1f;
}

.backButton {
  padding: 8px 16px;
  background-color: #f5f5f7;
  border: none;
  border-radius: 980px;
  font-size: 14px;
  color: #0066cc;
  cursor: pointer;
  transition: all 0.2s ease;
}

.backButton:hover {
  background-color: #e8e8ed;
}

.noResults {
  width: 100%;
  text-align: center;
  padding: 40px 0;
  font-size: 16px;
  color: #6e6e73;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .main {
    padding: 60px 20px;
  }
}

@media (max-width: 768px) {
  .main {
    flex-direction: column;
    padding: 40px 20px;
  }

  .sidebar {
    width: 100%;
    padding-right: 0;
    position: relative;
    top: 0;
    height: auto;
    margin-bottom: 40px;
  }

  .content {
    padding-left: 0;
  }

  .resourceGrid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .heroTitle {
    font-size: 36px;
  }

  .heroSubtitle {
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .resourceGrid {
    grid-template-columns: 1fr;
  }

  .heroTitle {
    font-size: 28px;
  }

  .heroSubtitle {
    font-size: 18px;
  }

  .searchSiteSelector {
    flex-wrap: wrap;
  }

  .siteSelectorBtn {
    font-size: 12px;
    padding: 6px 12px;
  }

  .searchInputWrapper {
    flex-direction: column;
  }

  .searchInput {
    border-radius: 980px;
    margin-bottom: 10px;
  }

  .searchSubmitBtn {
    border-radius: 980px;
  }

  .clearSearchBtn {
    right: 15px;
  }

  .externalContentWrapper {
    height: 600px;
  }
}
