/* ===== 通用组件样式 ===== */

/* 顶部导航栏 */
.nav-bar {
  height: 52px;
  background: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  color: white;
  font-size: 17px;
  font-weight: 700;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav-bar .nav-back {
  position: absolute;
  left: 14px;
  font-size: 20px;
  cursor: pointer;
}
.nav-bar .nav-right {
  position: absolute;
  right: 14px;
  font-size: 20px;
  cursor: pointer;
}

/* 搜索栏 */
.search-bar {
  background: var(--green);
  padding: 10px 14px;
  display: flex;
  gap: 8px;
}
.search-input {
  flex: 1;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 20px;
  padding: 7px 14px;
  color: white;
  font-size: 13px;
  outline: none;
}
.search-input::placeholder { color: rgba(255,255,255,0.7); }
.search-btn {
  background: var(--orange);
  border: none;
  border-radius: 20px;
  padding: 7px 14px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* 卡片 */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

/* 段落间距 */
.section { padding: 14px; }
.section + .section { padding-top: 0; }

/* 章节标题 */
.sec-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sec-title .more {
  font-size: 12px;
  color: var(--text-sec);
  font-weight: 400;
}

/* Banner 轮播 */
.banner-wrap {
  position: relative;
  overflow: hidden;
  height: 160px;
  background: linear-gradient(135deg, var(--green-dark), var(--green-light));
}
.banner-slide {
  width: 100%;
  height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 24px;
  color: white;
}
.banner-slide h2 { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.banner-slide p { font-size: 13px; opacity: 0.88; }
.banner-slide .banner-tag {
  display: inline-block;
  background: var(--orange);
  color: white;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
  margin-bottom: 8px;
}
.banner-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
}
.banner-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
}
.banner-dots span.active { background: white; width: 16px; border-radius: 3px; }

/* 功能入口宫格 */
.grid-menu {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  background: white;
  padding: 14px 0 10px;
}
.grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 4px 0;
}
.grid-item:active { opacity: 0.7; }
.grid-icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.grid-label { font-size: 11px; color: var(--text-sec); }

/* 标签 */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.tag-green  { background: #E8F5E9; color: #2E7D32; }
.tag-orange { background: #FFF3E0; color: #E65100; }
.tag-blue   { background: #E3F2FD; color: #1565C0; }
.tag-red    { background: #FFEBEE; color: #B71C1C; }
.tag-purple { background: #F3E5F5; color: #6A1B9A; }
.tag-teal   { background: #E0F2F1; color: #00695C; }

/* 列表项 */
.list-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: white;
  border-bottom: 1px solid #F5F5F5;
  cursor: pointer;
  gap: 12px;
  transition: background 0.15s;
}
.list-item:last-child { border-bottom: none; }
.list-item:active { background: #F9F9F9; }
.list-item .item-thumb {
  width: 60px; height: 60px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.list-item .item-info { flex: 1; overflow: hidden; }
.list-item .item-title { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .item-desc  { font-size: 12px; color: var(--text-sec); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .item-meta  { font-size: 11px; color: #BDBDBD; margin-top: 4px; }
.list-item .item-right { text-align: right; flex-shrink: 0; }
.list-item .item-price { font-size: 16px; font-weight: 700; color: var(--red); }
.list-item .item-arrow { color: #BDBDBD; font-size: 16px; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  font-size: 14px;
}
.btn:active { opacity: 0.8; transform: scale(0.97); }
.btn-primary { background: var(--green); color: white; padding: 10px 24px; }
.btn-primary:hover { background: var(--green-dark); }
.btn-orange  { background: var(--orange); color: white; padding: 10px 24px; }
.btn-outline { background: white; color: var(--green); border: 1.5px solid var(--green); padding: 9px 20px; }
.btn-sm { padding: 6px 16px; font-size: 12px; border-radius: 16px; }
.btn-full { width: 100%; border-radius: 12px; padding: 14px; font-size: 16px; }

/* 进度条 */
.progress-bar {
  height: 8px;
  background: #E0E0E0;
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar .progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--green), var(--green-light));
  transition: width 0.6s ease;
}

/* 数字统计卡 */
.stat-row {
  display: flex;
  background: white;
}
.stat-item {
  flex: 1;
  text-align: center;
  padding: 14px 0;
  border-right: 1px solid #F5F5F5;
}
.stat-item:last-child { border-right: none; }
.stat-num { font-size: 22px; font-weight: 800; color: var(--green-dark); }
.stat-label { font-size: 11px; color: var(--text-sec); margin-top: 2px; }

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px;
  color: var(--text-sec);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* 分隔线 */
.divider { height: 8px; background: var(--bg); }

/* 通知公告条 */
.notice-bar {
  background: #FFF8E1;
  border-left: 3px solid var(--orange);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #795548;
}

/* 圆形头像 */
.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: linear-gradient(135deg, var(--green), var(--green-light));
  color: white;
  flex-shrink: 0;
}

/* 商品卡片网格 */
.goods-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 14px 14px;
}
.goods-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  cursor: pointer;
}
.goods-card:active { opacity: 0.9; transform: scale(0.99); }
.goods-img {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}
.goods-info { padding: 8px 10px 10px; }
.goods-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goods-desc { font-size: 11px; color: var(--text-sec); margin: 2px 0 6px; }
.goods-price { font-size: 16px; font-weight: 800; color: var(--red); }
.goods-origin { font-size: 11px; color: #BDBDBD; text-decoration: line-through; margin-left: 4px; }
.goods-buy {
  float: right;
  background: var(--green);
  color: white;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-top: -2px;
}
