/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #2D6A4F;
  --primary-dark: #1B4332;
  --primary-light: #40916C;
  --bg-light: #F0F7F4;
  --accent: #D4A373;
  --accent-light: #E9C9A0;
  --text: #333333;
  --text-light: #666666;
  --white: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e0e0e0;
  --gray-300: #cccccc;
  --gray-400: #999999;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg-light);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-light);
}

img {
  max-width: 100%;
  height: auto;
}

ul {
  list-style: none;
}

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

/* ===== Navigation ===== */
.navbar {
  background: var(--white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.95);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo:hover {
  color: var(--primary-dark);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a.active {
  color: var(--primary);
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  padding: 4px;
  background: none;
  border: none;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: var(--transition);
  border-radius: 2px;
}

/* ===== Hero Section ===== */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-shape {
  position: absolute;
  top: -120px;
  right: -120px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(45,106,79,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-shape-2 {
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(212,163,115,0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  display: block;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 16px;
  line-height: 1.3;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.8;
}

.hero-badge {
  display: inline-block;
  background: rgba(45,106,79,0.1);
  color: var(--primary);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 16px;
}

/* ===== Section Titles ===== */
.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 12px;
  text-align: center;
}

.section-subtitle {
  font-size: 1rem;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 40px;
}

/* ===== Category Cards ===== */
.categories-section {
  padding: 40px 0 60px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.category-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.category-card .cat-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}

.category-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.category-card p {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
}

.category-card .count {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--primary);
  background: var(--bg-light);
  padding: 2px 12px;
  border-radius: 10px;
}

/* ===== Resource Cards ===== */
.resources-section {
  padding: 40px 0 60px;
  background: var(--white);
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.resource-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
  cursor: pointer;
}

.resource-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
  transform: translateY(-2px);
}

.resource-card .card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  position: relative;
}

.resource-card .res-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
  border-radius: 10px;
}

.resource-card .res-info {
  flex: 1;
  min-width: 0;
}

.resource-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
}

.resource-card .source-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 4px;
  color: var(--white);
}

.resource-card p {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.5;
}

.resource-card .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.resource-card .tag {
  font-size: 0.75rem;
  color: var(--text-light);
  background: var(--gray-100);
  padding: 2px 10px;
  border-radius: 4px;
}

/* ===== Page Header ===== */
.page-header {
  padding: 40px 0;
  text-align: center;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.page-header p {
  color: var(--text-light);
  font-size: 1rem;
}

/* ===== Category Page ===== */
.category-page {
  padding: 40px 0 60px;
}

.category-page .category-info {
  text-align: center;
  margin-bottom: 40px;
}

.category-page .category-info .cat-icon-large {
  font-size: 3rem;
  margin-bottom: 12px;
  display: block;
}

.category-page .category-info h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.category-page .category-info p {
  color: var(--text-light);
  margin-top: 4px;
}

/* ===== Resource Detail Page ===== */
.resource-detail {
  padding: 40px 0 60px;
}

.resource-detail .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.resource-detail .back-link:hover {
  color: var(--primary);
}

.detail-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}

.detail-card .detail-header {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--gray-200);
}

.detail-card .detail-header .res-icon-large {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}

.detail-card .detail-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.detail-card .detail-header .meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-card .detail-body {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.9;
}

.detail-card .detail-body p {
  margin-bottom: 16px;
}

.detail-card .detail-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.detail-card .detail-footer .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-card .detail-footer .tag {
  font-size: 0.8rem;
  color: var(--primary);
  background: var(--bg-light);
  padding: 4px 12px;
  border-radius: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--primary-dark);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--white);
}

/* ===== Related Resources ===== */
.related-section {
  padding: 40px 0 60px;
  background: var(--white);
}

/* ===== Search ===== */
.search-bar {
  max-width: 600px;
  margin: 0 auto 40px;
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: 12px 20px 12px 48px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
  background: var(--white);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45,106,79,0.1);
}

.search-bar .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 1.2rem;
  pointer-events: none;
}

.search-results-info {
  text-align: center;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--text-light);
}

/* ===== Tags Filter ===== */
.tags-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
}

.tag-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  font-size: 0.85rem;
  color: var(--text-light);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.tag-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.tag-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.page-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  background: var(--white);
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.page-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.page-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== About Page ===== */
.about-content {
  padding: 40px 0 60px;
}

.about-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-sm);
  max-width: 720px;
  margin: 0 auto;
}

.about-card h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 28px 0 12px;
}

.about-card h2:first-child {
  margin-top: 0;
}

.about-card p {
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 12px;
}

.about-card ul {
  padding-left: 20px;
  list-style: disc;
  margin-bottom: 16px;
}

.about-card ul li {
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 4px;
}

.about-card .disclaimer {
  background: #fff8e6;
  border: 1px solid #f0dca0;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 0.9rem;
  color: #8a6d2b;
  margin-top: 24px;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.empty-state h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text);
}

/* ===== Back to Top ===== */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  z-index: 999;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* ===== Footer ===== */
.footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.8);
  padding: 40px 0 24px;
  margin-top: auto;
}

.footer .container {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}

.footer h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: 12px;
}

.footer-links a {
  display: block;
  color: rgba(255,255,255,0.7);
  font-size: 0.88rem;
  margin-bottom: 8px;
}

.footer-links a:hover {
  color: var(--white);
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.7);
  font-size: 0.88rem;
  margin-bottom: 8px;
}

.footer-social a:hover {
  color: var(--white);
}

.footer-bottom {
  grid-column: 1 / -1;
  padding-top: 24px;
  margin-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.6;
}

/* ===== Animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Loading Spinner ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 20px;
    gap: 16px;
    box-shadow: var(--shadow-md);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: var(--transition);
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .hamburger {
    display: flex;
  }

  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .categories-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .resources-grid {
    grid-template-columns: 1fr;
  }

  .detail-card {
    padding: 24px;
  }

  .detail-card .detail-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer .container {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .back-to-top {
    bottom: 16px;
    right: 16px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.6rem;
  }

  .categories-grid {
    grid-template-columns: 1fr 1fr;
  }

  .section-title {
    font-size: 1.3rem;
  }
}

/* ===== Buy Section ===== */
.buy-section {
  margin-top: 2rem;
  background: #fef9f4;
  border-radius: var(--radius);
  padding: 1.5rem;
}

.buy-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.buy-info {
  flex: 1;
  min-width: 200px;
}

.buy-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #E67E22;
  margin-bottom: 6px;
}

.buy-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.buy-price {
  display: inline-block;
  font-size: 1rem;
  font-weight: 700;
  color: #E67E22;
  margin-bottom: 6px;
}

.buy-reason {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
}

.btn-buy {
  background: #E67E22;
  color: var(--white);
  white-space: nowrap;
}

.btn-buy:hover {
  background: #D35400;
  color: var(--white);
}

.buy-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--white);
  background: #E67E22;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 4px;
}

@media (max-width: 600px) {
  .buy-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .buy-section {
    padding: 1rem;
  }
}

/* ===== Goods Image ===== */
.buy-image {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.buy-image-emoji {
  font-size: 4rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.card-thumb {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 12px;
}
.thumb-emoji {
  font-size: 1.6rem;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

@media (max-width: 600px) {
  .buy-image {
    width: 120px;
    height: 120px;
  }
  .buy-image-emoji {
    font-size: 3rem;
  }
}

/* ===== Goods Badge & Price ===== */
.card-goods-badge {
  position: absolute;
  top: -4px;
  right: 0;
  font-size: 0.75rem;
  font-weight: 600;
  background: #D4A373;
  color: #fff;
  padding: 2px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.card-price {
  font-size: 0.9rem;
  color: #D4A373;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
