/* 新罗区云翼软件工作室 - 网络食品交易平台 - 前台样式 */
:root {
  --primary: #2d5a27;
  --primary-light: #3d7a35;
  --accent: #e8a838;
  --accent-hover: #f5bc4a;
  --bg: #faf8f5;
  --card: #ffffff;
  --text: #2c2c2c;
  --text-muted: #666;
  --border: #e8e4df;
  --shadow: 0 4px 20px rgba(45, 90, 39, 0.08);
  --radius: 12px;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* 顶部公告条 */
.top-notice {
  background: linear-gradient(90deg, #fef3c7 0%, #fde68a 100%);
  color: #92400e;
  padding: 0.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  border-bottom: 1px solid #fcd34d;
}
.top-notice a { color: #b45309; font-weight: 500; }
.top-notice a:hover { color: #92400e; text-decoration: underline; }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--primary-light); }

/* 顶部导航 */
.site-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 0.8rem 2rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo span { font-size: 1.8rem; }

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}
.nav-links a {
  color: rgba(255,255,255,0.95);
  font-weight: 500;
}
.nav-links a:hover { color: var(--accent); }
.nav-links .btn-admin {
  background: var(--accent);
  color: #2c2c2c;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  font-weight: 600;
}
.nav-links .btn-admin:hover {
  background: var(--accent-hover);
  color: #2c2c2c;
}

/* 主视觉 Banner */
.hero {
  background: linear-gradient(135deg, rgba(45,90,39,0.95) 0%, rgba(61,122,53,0.9) 100%),
    url('https://images.unsplash.com/photo-1498654896293-37aacf113fd9?w=1200') center/cover;
  color: #fff;
  padding: 4rem 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.hero p {
  font-size: 1.1rem;
  opacity: 0.95;
  max-width: 560px;
  margin: 0 auto 1.5rem;
}

/* 平台数据条 */
.stats-bar {
  max-width: 1200px;
  margin: -2rem auto 2rem;
  padding: 0 2rem;
  position: relative;
  z-index: 2;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 2rem;
}

.stat-item {
  text-align: center;
}
.stat-item .num {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary);
  display: block;
}
.stat-item .label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* 主内容区 */
.main-content {
  max-width: 1200px;
  margin: 0 auto 3rem;
  padding: 0 2rem;
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.section-title .section-more-link { font-size: 0.95rem; font-weight: 500; }
.section-more { margin-top: 1rem; text-align: center; }
.section-more a { font-weight: 500; }

/* 首页 - 平台简介 */
.home-intro { margin-bottom: 2.5rem; }
.intro-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.intro-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border);
  text-align: center;
  transition: box-shadow 0.2s;
}
.intro-card:hover { box-shadow: var(--shadow); }
.intro-card .intro-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.intro-card h3 { font-size: 1.05rem; margin-bottom: 0.35rem; color: var(--primary); }
.intro-card p { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; margin: 0; }

/* 首页 - 最新公告 */
.home-notice { margin-bottom: 2.5rem; }
.notice-list-inline { list-style: none; margin: 0 0 0.5rem; padding: 0; }
.notice-list-inline li { margin-bottom: 0.5rem; font-size: 0.95rem; }
.notice-list-inline .notice-date { color: var(--text-muted); font-size: 0.9rem; margin-left: 0.5rem; }

/* 分类筛选 */
.categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.cat-btn {
  padding: 0.5rem 1rem;
  border: 2px solid var(--border);
  background: var(--card);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.2s;
}
.cat-btn:hover,
.cat-btn.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

/* 商品网格 */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(45, 90, 39, 0.12);
}

.product-card .img-wrap {
  aspect-ratio: 1;
  overflow: hidden;
  background: #f0ede8;
}
.product-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card .info {
  padding: 1rem;
}
.product-card .name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card .seller {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.product-card .price-wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.product-card .price {
  color: #c0392b;
  font-size: 1.25rem;
  font-weight: 700;
}
.product-card .price small { font-size: 0.85rem; font-weight: 400; color: var(--text-muted); }
.product-card .sales {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.product-card .rating {
  color: var(--accent);
  font-size: 0.9rem;
}

/* 页脚 */
.site-footer {
  background: var(--text);
  color: #bbb;
  padding: 2rem;
  text-align: center;
  margin-top: 3rem;
}
.site-footer a { color: #ddd; }
.site-footer p { margin-bottom: 0.5rem; font-size: 0.9rem; }
.site-footer .footer-extra,
.site-footer .footer-icp { font-size: 0.85rem; color: #999; }

/* 商品详情页 */
.product-detail {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.product-detail .gallery {
  aspect-ratio: 1;
  background: #f0ede8;
}
.product-detail .gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-detail .meta h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.product-detail .meta .category { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.5rem; }
.product-detail .meta .price { font-size: 1.8rem; color: #c0392b; font-weight: 700; margin: 0.75rem 0; }
.product-detail .meta .desc { color: var(--text-muted); line-height: 1.7; margin-bottom: 1rem; }
.product-detail .meta .seller, .product-detail .meta .sales { font-size: 0.9rem; margin-bottom: 0.25rem; }

@media (max-width: 768px) {
  .hero { padding: 2.5rem 1rem; }
  .hero h1 { font-size: 1.6rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); padding: 1rem; }
  .product-detail { grid-template-columns: 1fr; }
  .header-inner { justify-content: center; }
}
