:root {
  --brand: #ff4d6d;
  --brand-soft: #fff0f3;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #15171c;
  --text-2: #8b909a;
  --line: #eef0f4;
  --r: 16px;
  --shadow: 0 6px 20px rgba(20, 22, 26, 0.06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; border: 0; background: none; color: inherit; cursor: pointer; }

/* 外层：手机上满屏，桌面居中模拟手机 */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 24px;
}
.app.has-buybar { padding-bottom: 96px; }

@media (min-width: 481px) {
  body { background: #e8eaef; }
  .app { box-shadow: 0 0 40px rgba(0, 0, 0, 0.08); }
}

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-size: 20px; font-weight: 800; letter-spacing: 2px; color: var(--brand); }
.search {
  flex: 1; height: 34px; border-radius: 17px; background: var(--bg);
  color: var(--text-2); font-size: 13px; display: flex; align-items: center; padding: 0 14px;
}

/* 横幅 */
.banner { padding: 16px; }
.banner-inner {
  height: 150px; border-radius: var(--r);
  background: linear-gradient(135deg, #ff8fa3, #ff4d6d);
  color: #fff; padding: 24px;
  display: flex; flex-direction: column; justify-content: center;
  box-shadow: var(--shadow);
}
.banner-inner h2 { margin: 0 0 8px; font-size: 22px; }
.banner-inner p { margin: 0; font-size: 13px; opacity: 0.9; }

/* 分类 */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  white-space: nowrap; padding: 7px 16px; border-radius: 16px;
  background: #fff; color: var(--text-2); font-size: 13px; border: 1px solid var(--line);
}
.chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* 商品网格 */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 16px; }
.card { background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.card-img { aspect-ratio: 1 / 1; background: #f0f1f4; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 10px 12px 14px; }
.card-name {
  font-size: 14px; font-weight: 600; line-height: 1.35; min-height: 38px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-tags { display: flex; gap: 6px; margin: 6px 0; }
.card-tags span { font-size: 11px; color: var(--brand); background: var(--brand-soft); padding: 2px 7px; border-radius: 6px; }
.card-price { display: flex; align-items: baseline; gap: 6px; }
.card-price b { color: var(--brand); font-size: 17px; }
.card-price s { color: var(--text-2); font-size: 12px; }

/* 详情页 */
.back {
  position: fixed; top: 14px; left: 14px; z-index: 20;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.35); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.detail-img { aspect-ratio: 1 / 1; background: #f0f1f4; }
.detail-img img { width: 100%; height: 100%; object-fit: cover; }
.detail-body {
  background: #fff; padding: 18px 16px; position: relative;
  border-radius: var(--r) var(--r) 0 0; margin-top: -16px;
}
.detail-name { font-size: 19px; font-weight: 700; margin: 0 0 10px; }
.detail-price { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.detail-price b { color: var(--brand); font-size: 26px; }
.detail-price s { color: var(--text-2); font-size: 14px; }
.detail-meta { color: var(--text-2); font-size: 12px; margin-bottom: 16px; }
.size-title { font-size: 14px; font-weight: 600; margin: 18px 0 10px; }
.sizes { display: flex; flex-wrap: wrap; gap: 10px; }
.size { padding: 8px 18px; border-radius: 10px; border: 1px solid var(--line); background: #fafbfc; font-size: 13px; }
.size.active { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.desc { margin-top: 20px; font-size: 14px; line-height: 1.7; color: #444; }

/* 底部购买栏 */
.buybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  display: flex; gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  max-width: 480px; margin: 0 auto;
}
.buybar .btn { flex: 1; height: 46px; border-radius: 23px; background: var(--brand); color: #fff; font-size: 16px; font-weight: 600; }

/* 页脚 */
.footer { text-align: center; color: var(--text-2); font-size: 12px; padding: 28px 16px; }
.footer p { margin: 4px 0; }
