:root {
  --green: #4CAF50;
  --green-dark: #388E3C;
  --red: #f44336;
  --bg: #f5f5f5;
  --card: #fff;
  --text: #333;
  --border: #ddd;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  padding-bottom: 70px;
}

/* 头部 */
.header {
  background: var(--green);
  color: white;
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
}
.brand { font-size: 1.3em; font-weight: bold; }
.sub { font-size: 0.9em; opacity: 0.9; }

/* 容器 */
.container { padding: 16px; max-width: 800px; margin: auto; }

/* 卡片网格 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.product-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.product-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}
.product-card .info { padding: 12px; }
.price { color: var(--green); font-weight: bold; }

/* 购物车栏 */
.cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
  z-index: 10;
}

/* 按钮 */
.btn {
  background: var(--green);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--green);
  color: var(--green);
}
.btn-full { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; background: rgba(255,255,255,0.2); color: white; border: none; border-radius: 6px; }

/* 表单 */
.form-control {
  width: 100%;
  padding: 10px 12px;
  margin: 8px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
}

/* 模态弹窗 */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}
.modal-content {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
}
.hidden { display: none !important; }

/* 表格卡片式 */
.list-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
.list-item .meta { flex: 1; }

/* 顶部栏 */
.top-bar {
  background: var(--green);
  color: white;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 标签导航 */
.tab-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: white;
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 14px;
  cursor: pointer;
}
.tab-btn.active { background: var(--green); color: white; border-color: var(--green); }

/* 内容区域 */
.content-area { padding: 16px; }

/* 辅助 */
.error-msg { color: var(--red); margin-top: 8px; }
.loading { text-align: center; padding: 40px; color: #888; }

/* 手机适配 */
@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}