/* === 产品列表页样式 === */

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

.product-list-header {
  text-align: center;
  margin-bottom: 32px;
}

.product-list-header h1 {
  font-size: 36px;
  font-weight: 700;
  color: var(--text, #1a1a1a);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.product-list-header p {
  color: var(--text-light, #666);
  font-size: 17px;
}

.product-list-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}

.product-list-main {
  min-width: 0;
}

.product-list-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 移动端 (<768px): 单列堆叠 */
@media (max-width: 768px) {
  .product-list-grid {
    grid-template-columns: 1fr;
  }
}

/* 工具栏 */
.product-list-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--white, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  flex-wrap: wrap;
}

.product-list-toggle {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary, #f5f5f5);
  padding: 4px;
  border-radius: 8px;
}

.product-list-toggle-btn {
  padding: 8px 16px;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-light, #666);
  transition: all 0.15s;
}

.product-list-toggle-btn:hover {
  color: var(--text, #1a1a1a);
}

.product-list-toggle-btn.active {
  background: var(--primary, #0969da);
  color: #fff;
  font-weight: 500;
}

.product-list-search {
  flex: 1;
  min-width: 200px;
  position: relative;
}

.product-list-search input {
  width: 100%;
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}

.product-list-search input:focus {
  outline: none;
  border-color: var(--primary, #0969da);
}

.product-list-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--text-light, #666);
  cursor: pointer;
  padding: 0 4px;
}

.product-list-search-clear:hover {
  color: var(--text, #1a1a1a);
}

.product-list-count {
  font-size: 13px;
  color: var(--text-light, #666);
  white-space: nowrap;
}

/* 产品行 */
.product-list-row {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: var(--white, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  margin-bottom: 12px;
  transition: all 0.15s;
}

.product-list-row:hover {
  border-color: var(--primary, #0969da);
  box-shadow: 0 2px 12px rgba(9, 105, 218, 0.06);
}

.product-list-row-thumb {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  background-size: cover;
  background-position: center;
}

.product-list-row-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.product-list-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.product-list-row-title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text, #1a1a1a);
}

.product-list-row-pricing {
  display: flex;
  gap: 12px;
  font-size: 14px;
  color: var(--text-light, #666);
  margin-bottom: 8px;
}

.product-list-row-pricing .price-tier-amount {
  color: var(--primary, #0969da);
  font-weight: 500;
}

.product-list-row-platform {
  font-size: 13px;
  color: var(--text-light, #666);
}

.product-list-row-desc {
  font-size: 14px;
  color: var(--text-light, #666);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-list-row-action {
  margin-top: auto;
  align-self: flex-end;
}

.product-list-row-btn {
  padding: 8px 20px;
  background: var(--primary, #0969da);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.product-list-row-btn:hover {
  background: var(--primary-dark, #0550ae);
}

/* Badge (复用已有 CSS, 但确保 .product-list-row 内的 badge 也显示) */
.product-list-row .product-card-category-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 500;
}

/* 分页 */
.product-list-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
}

.product-list-pagination button {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border, #e5e7eb);
  background: var(--white, #fff);
  color: var(--text, #1a1a1a);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}

.product-list-pagination button:hover:not(:disabled) {
  border-color: var(--primary, #0969da);
  color: var(--primary, #0969da);
}

.product-list-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.product-list-pagination button.active {
  background: var(--primary, #0969da);
  color: #fff;
  border-color: var(--primary, #0969da);
  font-weight: 500;
}

.product-list-pagination .ellipsis {
  padding: 0 4px;
  color: var(--text-light, #666);
  display: inline-flex;
  align-items: center;
}

/* 空/错误状态 */
.product-list-empty,
.product-list-error {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-light, #666);
}

.product-list-error {
  color: #cf222e;
}

.product-list-empty .clear-search-btn {
  margin-top: 12px;
  padding: 6px 16px;
  background: var(--primary, #0969da);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

/* 侧栏卡片 */
.sidebar-card {
  background: var(--white, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 20px;
}

.sidebar-card h3 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #1a1a1a);
}

.sidebar-card-link {
  display: block;
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--primary, #0969da);
  text-decoration: none;
}

.sidebar-card-link:hover {
  text-decoration: underline;
}

/* FAQ accordion (侧栏) */
.sidebar-faq-item {
  border-bottom: 1px solid var(--border, #e5e7eb);
  padding: 12px 0;
}

.sidebar-faq-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.sidebar-faq-item:first-child {
  padding-top: 0;
}

.sidebar-faq-q {
  font-size: 14px;
  font-weight: 500;
  color: var(--text, #1a1a1a);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-faq-q::after {
  content: '▸';
  font-size: 12px;
  color: var(--text-light, #666);
  transition: transform 0.15s;
}

.sidebar-faq-item.open .sidebar-faq-q::after {
  transform: rotate(90deg);
}

.sidebar-faq-a {
  display: none;
  font-size: 13px;
  color: var(--text-light, #666);
  line-height: 1.6;
  margin-top: 8px;
}

.sidebar-faq-item.open .sidebar-faq-a {
  display: block;
}

.sidebar-faq-loading {
  padding: 16px 0;
  text-align: center;
  color: var(--text-light, #666);
  font-size: 13px;
}

/* 移动端产品行适配 */
@media (max-width: 768px) {
  .product-list-row {
    flex-direction: column;
  }

  .product-list-row-thumb {
    width: 100%;
    height: 160px;
  }

  .product-list-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}
