/* Resources Page Styles */
/* Author: khw */

.resources-section {
  padding: 100px 0 60px;
  min-height: 600px;
}

.resources-header {
  text-align: center;
  margin-bottom: 40px;
}

.resources-title {
  font-size: 42px;
  font-weight: 700;
  color: #1d1d1f;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.resources-description {
  font-size: 18px;
  color: #6e6e73;
  font-weight: 400;
}

/* Tab导航样式 */
.category-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: white;
  border: 1px solid #e5e5e7;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #6e6e73;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  border-color: #007aff;
  color: #007aff;
}

.tab-btn.active {
  background: #007aff;
  border-color: #007aff;
  color: white;
}

.tab-btn svg {
  flex-shrink: 0;
}

/* 资源列表容器 */
.resources-container {
  max-width: 680px;
  margin: 0 auto;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 资源列表样式 */
.resource-list {
  background: white;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.resource-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  transition: background 0.15s ease;
  text-decoration: none;
  border-bottom: 1px solid #f0f0f2;
}

.resource-item:last-child {
  border-bottom: none;
}

.resource-item:hover {
  background: #f8f9fa;
}

.resource-item:active {
  background: #f0f0f2;
}

/* 图标样式 */
.item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f0f0f2, #e8e8ed);
  flex-shrink: 0;
  color: #6e6e73;
  transition: all 0.2s ease;
}

.resource-item:hover .item-icon {
  background: linear-gradient(135deg, #007aff, #0055cc);
  color: white;
}

/* 特殊颜色图标 */
.resource-item.wheat .item-icon {
  background: linear-gradient(135deg, #fef3e2, #fde5c4);
  color: #d4860a;
}
.resource-item.wheat:hover .item-icon {
  background: linear-gradient(135deg, #f5a623, #e69100);
  color: white;
}

.resource-item.maize .item-icon {
  background: linear-gradient(135deg, #fff8e1, #ffecb3);
  color: #ffa000;
}
.resource-item.maize:hover .item-icon {
  background: linear-gradient(135deg, #ffb300, #ff8f00);
  color: white;
}

.resource-item.rice .item-icon {
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  color: #43a047;
}
.resource-item.rice:hover .item-icon {
  background: linear-gradient(135deg, #66bb6a, #43a047);
  color: white;
}

.resource-item.video .item-icon {
  background: linear-gradient(135deg, #ffebee, #ffcdd2);
  color: #e53935;
}
.resource-item.video:hover .item-icon {
  background: linear-gradient(135deg, #ef5350, #e53935);
  color: white;
}

/* 信息区域 */
.item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.item-title {
  font-size: 17px;
  font-weight: 600;
  color: #1d1d1f;
  line-height: 1.3;
}

.item-desc {
  font-size: 14px;
  color: #8e8e93;
}

/* 箭头 */
.item-arrow {
  flex-shrink: 0;
  color: #c7c7cc;
  transition: color 0.15s ease, transform 0.15s ease;
}

.resource-item:hover .item-arrow {
  color: #007aff;
  transform: translateX(2px);
}

/* 详情面板样式 */
.resource-detail-panel {
  max-width: 900px;
  margin: 0 auto;
  animation: fadeIn 0.25s ease;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: white;
  border: 1px solid #e5e5e7;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #6e6e73;
  margin-bottom: 20px;
  transition: all 0.15s ease;
}

.back-btn:hover {
  border-color: #007aff;
  color: #007aff;
}

.detail-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e5e7;
}

.selected-category {
  font-size: 26px;
  font-weight: 700;
  color: #1d1d1f;
  margin: 0 0 6px 0;
}

.selected-desc {
  font-size: 15px;
  color: #8e8e93;
  margin: 0;
}

.detail-container {
  min-height: 300px;
}

/* PDF预览 */
.pdf-viewer {
  width: 100%;
  height: 750px;
  border: none;
  border-radius: 12px;
  background: white;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.pdf-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  color: #8e8e93;
  font-size: 15px;
}

/* 变量参数表图片展示 */
.variables-images {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.variable-image-item {
  background: #f5f5f7;
  border-radius: 12px;
  padding: 20px;
}

.variable-image-title {
  font-size: 16px;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0 0 12px 0;
}

.variable-image-wrapper {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e5e7;
}

.variable-image {
  width: 100%;
  height: auto;
  display: block;
  cursor: zoom-in;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .resources-section {
    padding: 80px 0 40px;
  }

  .resources-title {
    font-size: 32px;
  }

  .resources-description {
    font-size: 16px;
  }

  .category-tabs {
    gap: 6px;
  }

  .tab-btn {
    padding: 10px 14px;
    font-size: 13px;
  }

  .tab-btn span {
    display: none;
  }

  .tab-btn svg {
    width: 20px;
    height: 20px;
  }

  .resource-item {
    padding: 14px 16px;
    gap: 12px;
  }

  .item-icon {
    width: 38px;
    height: 38px;
  }

  .item-title {
    font-size: 15px;
  }

  .item-desc {
    font-size: 13px;
  }

  .resource-detail-panel {
    padding: 0 4px;
  }

  .selected-category {
    font-size: 22px;
  }

  .pdf-viewer {
    height: 500px;
  }
}

@media (max-width: 480px) {
  .resources-header {
    margin-bottom: 28px;
  }

  .resources-title {
    font-size: 28px;
  }

  .category-tabs {
    justify-content: center;
  }

  .tab-btn {
    padding: 10px 16px;
  }
}

/* 论文列表骨架屏样式 */
.skeleton-paper-item {
  background: #fff;
  border: 1px solid #e5e5e7;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 12px;
}

.skeleton-paper-header {
  display: flex;
  align-items: start;
  gap: 14px;
}

.skeleton-paper-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 8px;
}

.skeleton-paper-content {
  flex: 1;
  min-width: 0;
}

.skeleton-paper-title {
  width: 75%;
  height: 18px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
  margin-bottom: 10px;
}

.skeleton-paper-meta {
  display: flex;
  gap: 12px;
}

.skeleton-paper-meta-item {
  width: 70px;
  height: 14px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}

.skeleton-paper-button {
  flex-shrink: 0;
  width: 56px;
  height: 32px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 6px;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
