/* ===== 顶部简单栏 ===== */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, #7ed957, #2e7d32);
  box-shadow: 0 2px 12px rgba(46, 125, 50, 0.25);
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}
.top-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}
.top-logo span:first-child { font-size: 24px; }

.top-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.15);
  transition: background .2s;
}
.top-user:hover { background: rgba(255,255,255,0.28); }
.top-user .avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  overflow: hidden;
}

/* ===== 主内容区（给底部 tab 留出空间） ===== */
.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 100px;   /* ★ 底部 100px，防止内容被 tab 挡住 */
}

/* ===== 底部固定 Tab 导航 ===== */
.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  height: 60px;
  background: #fff;
  display: flex;
  align-items: stretch;
  box-shadow: 0 -2px 12px rgba(46, 125, 50, 0.1);
  border-top: 1px solid #e8f0e8;
  /* 适配 iPhone 底部安全区 */
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #9aaa9a;
  font-size: 11px;
  transition: color .2s;
  position: relative;
}
.tab-item .tab-icon {
  font-size: 22px;
  line-height: 1;
  transition: transform .2s;
}
.tab-item .tab-text {
  font-size: 11px;
}
.tab-item:hover { color: #2e7d32; }
.tab-item.active {
  color: #2e7d32;
  font-weight: 600;
}
.tab-item.active .tab-icon {
  transform: scale(1.15);
}
.tab-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 3px;
  background: linear-gradient(90deg, #7ed957, #2e7d32);
  border-radius: 0 0 4px 4px;
}

/* ===== 页面通用标题 ===== */
.page-title {
  font-size: 22px;
  color: #1b5e20;
  margin-bottom: 6px;
  font-weight: 600;
}
.page-sub {
  font-size: 13px;
  color: #6b7a6b;
  margin-bottom: 24px;
}

/* ===== 卡片 ===== */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(46, 125, 50, 0.08);
  padding: 20px;
}

/* ===== 种子商城网格 ===== */
.tree-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.tree-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(46, 125, 50, 0.08);
  transition: transform .25s, box-shadow .25s;
  display: flex;
  flex-direction: column;
  position: relative;
}
.tree-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(46, 125, 50, 0.15);
}

.tree-cover {
  height: 160px;
  background: linear-gradient(135deg, #c8e6c9, #a5d6a7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  position: relative;
  overflow: hidden;
}
.tree-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tree-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  color: #fff;
  background: rgba(46, 125, 50, 0.85);
}
.tree-badge.couple { background: rgba(233, 30, 99, 0.85); }

.tree-body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.tree-name {
  font-size: 16px;
  font-weight: 600;
  color: #1b5e20;
  margin-bottom: 4px;
}
.tree-intro {
  font-size: 12px;
  color: #6b7a6b;
  margin-bottom: 12px;
  min-height: 32px;
}
.tree-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #a8b8a8;
  margin-bottom: 12px;
}
.tree-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}
.tree-price {
  color: #d32f2f;
  font-size: 18px;
  font-weight: 700;
}
.tree-price small { font-size: 12px; font-weight: 400; }

.btn-buy {
  padding: 8px 16px;
  background: linear-gradient(135deg, #7ed957, #2e7d32);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(86,171,47,0.3);
  transition: all .2s;
}
.btn-buy:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(86,171,47,0.4);
}

/* ===== 空状态 ===== */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: #a8b8a8;
}
.empty .emoji {
  font-size: 56px;
  margin-bottom: 12px;
}

/* ===== toast 提示 ===== */
.toast {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(46, 125, 50, 0.95);
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: all .3s;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.error {
  background: rgba(211, 47, 47, 0.95);
}

/* ===== 移动端适配 ===== */
@media (max-width: 640px) {
  .top-bar { padding: 0 14px; height: 52px; }
  .top-logo { font-size: 16px; }
  .top-logo span:first-child { font-size: 22px; }
  .app-main { padding: 16px 14px 100px; }
  .tab-bar { height: 58px; }
}