/**
 * @file
 * 火彩商城 - 茶园列表页面样式
 * 基于 design-prototypes/tea-garden-list.html 设计
 */

/* ========== 茶园列表页面容器 ========== */
.tea-garden-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 136px 16px 100px;
}

/* ========== 页面头部 ========== */
.page-header {
  background: linear-gradient(135deg, #2E7D32 0%, #1B5E20 100%);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 24px;
  color: white;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-subtitle {
  font-size: 14px;
  opacity: 0.9;
}

/* ========== 搜索区块 ========== */
.search-section-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.search-results-info {
  margin-top: 12px;
  font-size: 13px;
  color: #6E6E73;
}

.search-results-info #resultsCount {
  font-weight: 600;
  color: #2E7D32;
}

.search-input-box {
  display: flex;
  gap: 8px;
}

.search-input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  border: 1.5px solid rgba(0, 0, 0, 0.15);
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.search-input:focus {
  border-color: #2E7D32;
}

.search-btn {
  padding: 11px 18px;
  background: #2E7D32;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.search-btn:hover {
  background: #1B5E20;
}

/* ========== 筛选标签 ========== */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  padding: 8px 16px;
  background: white;
  border: 2px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  color: #6E6E73;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  text-decoration: none;
}

.filter-tab:hover {
  border-color: #2E7D32;
  color: #2E7D32;
}

.filter-tab.active {
  background: #2E7D32;
  border-color: #2E7D32;
  color: white;
}

/* ========== 茶园列表 ========== */
.garden-list {
  display: grid;
  gap: 16px;
}

.garden-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.garden-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.garden-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, #A5D6A7 0%, #81C784 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.garden-bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.garden-icon {
  font-size: 64px;
  z-index: 1;
}

/* 当有背景图片时，隐藏emoji图标 */
.garden-image:not([style*="background-image:"]) .garden-icon {
  display: block;
}

.garden-image[style*="background-image:"] .garden-icon {
  display: none;
}

.garden-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.95);
  color: #2E7D32;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
}

.garden-content {
  padding: 20px;
}

.garden-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1D1D1F;
}

.garden-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #6E6E73;
  margin-bottom: 12px;
}

.garden-location svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.garden-description {
  font-size: 14px;
  color: #6E6E73;
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.garden-info {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid #F5F5F7;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #6E6E73;
}

.info-item svg {
  width: 16px;
  height: 16px;
  color: #2E7D32;
  flex-shrink: 0;
}

/* ========== 加载更多 ========== */
.garden-list-footer {
  text-align: center;
  padding: 24px;
}

.load-more-btn {
  padding: 14px 40px;
  background: #2E7D32;
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.load-more-btn:hover:not(:disabled) {
  background: #1B5E20;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.load-more-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.load-more-btn .loading-icon {
  animation: spin 1s linear infinite;
}

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

/* ========== 空状态 ========== */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #6E6E73;
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  opacity: 0.5;
}

.empty-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1D1D1F;
}

.empty-text {
  font-size: 14px;
  color: #6E6E73;
}

/* ========== 响应式设计 ========== */
@media (min-width: 768px) {
  .tea-garden-container {
    padding: 136px 0 100px;
  }

  .search-section-card {
    padding: 24px;
  }

  .garden-list {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .garden-image {
    height: 240px;
  }
}

/* ========== 深色模式支持（已隐藏） ========== */
/*
@media (prefers-color-scheme: dark) {
  .search-section-card,
  .garden-card {
    background: #1C1C1E;
  }

  .garden-name {
    color: #F5F5F7;
  }

  .garden-description {
    color: #86868B;
  }

  .garden-info {
    border-top-color: #2C2C2E;
  }

  .load-more-btn {
    background: #2E7D32;
    color: white;
  }

  .load-more-btn:hover:not(:disabled) {
    background: #1B5E20;
  }

  .search-results-info {
    color: #86868B;
  }

  .search-results-info #resultsCount {
    color: #4CAF50;
  }

  .empty-title {
    color: #F5F5F7;
  }

  .empty-text {
    color: #86868B;
  }

  .filter-tab {
    background: #1C1C1E;
    border-color: #38383A;
    color: #86868B;
  }

  .filter-tab:hover {
    border-color: #2E7D32;
    color: #2E7D32;
  }

  .filter-tab.active {
    background: #2E7D32;
    border-color: #2E7D32;
    color: white;
  }

  .search-input {
    background: #1C1C1E;
    border-color: #38383A;
    color: #F5F5F7;
  }

  .search-input:focus {
    border-color: #2E7D32;
  }

  .search-input::placeholder {
    color: #86868B;
  }
}
*/

/* ========== 无障碍增强 ========== */
@media (prefers-reduced-motion: reduce) {
  .garden-card,
  .filter-tab,
  .search-btn,
  .load-more-btn,
  .search-input {
    transition: none;
  }
}

/* 聚焦可见性增强 */
.filter-tab:focus-visible,
.search-btn:focus-visible,
.load-more-btn:focus-visible,
.garden-card:focus-visible {
  outline: 2px solid #0066CC;
  outline-offset: 2px;
}
