/* ============================================================
   李李蛋糕 · H5 选款工具
   设计语言：深棕 + 米白 + 焦糖金，玻璃拟态卡片，移动优先
   ============================================================ */

:root {
  --bg: #F6F3ED;
  --bg-deep: #1D1B18;
  --bg-deep-2: #2A2723;
  --card: #FFFFFF;
  --glass: rgba(255, 255, 255, 0.82);
  --gold: #C9A15B;
  --gold-light: #E4D3B0;
  --text: #2B2824;
  --text-sub: #8B8479;
  --line: rgba(43, 40, 36, 0.09);
  --shadow: 0 12px 32px rgba(45, 36, 24, 0.07), 0 2px 8px rgba(45, 36, 24, 0.04);
  --serif: Georgia, "Times New Roman", "Songti SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --radius: 18px;
}

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

html, body {
  font-family: var(--sans);
  background: #EDE9E1;
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(40, 32, 20, 0.12);
}

/* ================= 页面切换 ================= */
.page {
  display: none;
  min-height: 100vh;
  padding-bottom: 76px;
  animation: pageIn 0.28s ease both;
}
.page.active { display: block; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.bottom-space { height: 20px; }

/* ================= 品牌头 ================= */
.brand-header {
  background: var(--bg-deep);
  padding: calc(env(safe-area-inset-top) + 16px) 20px 56px;
  border-radius: 0 0 32px 32px;
}
.brand-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  backdrop-filter: blur(8px);
}
.brand-logo {
  width: 60px; height: 60px; flex: 0 0 60px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}
.brand-info h1 {
  color: #F6F1E7;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 2px;
}
.brand-en {
  color: rgba(246,241,231,0.5);
  font-size: 9px;
  letter-spacing: 1.2px;
  line-height: 1.5;
  margin-top: 3px;
}
.brand-tags { display: flex; gap: 6px; margin-top: 9px; }
.brand-tags span {
  font-size: 9px;
  color: var(--gold-light);
  border: 1px solid rgba(228,211,176,0.32);
  border-radius: 20px;
  padding: 3px 8px;
  letter-spacing: 0.5px;
}

/* ================= 首页主体 ================= */
.home-body {
  padding: 0 20px;
  margin-top: -30px;
  position: relative;
  z-index: 2;
}
.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 10px 2px 16px;
}
.title-en {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 3px;
  color: var(--gold);
  font-weight: 700;
}
.section-title h2 {
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: 1px;
  margin-top: 2px;
}
.title-note { font-size: 10px; color: var(--text-sub); padding-bottom: 4px; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 15px;
  background: var(--glass);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 14px;
  color: var(--text-sub);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--text);
  font-family: var(--sans);
}
.search-bar input::placeholder { color: #B0A99D; }

/* ============ 分组 + 商品：左侧分组在前 ============ */
.menu-layout {
  display: flex;
  gap: 0;
  margin: 0 -20px; /* 撑满 home-body 的左右 padding */
  align-items: stretch;
}
.category-sidebar {
  width: 92px;
  flex: 0 0 92px;
  background: rgba(240, 234, 223, 0.65);
  border-right: 1px solid var(--line);
  padding: 10px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: calc(100vh - 260px);
}
.category-sidebar .loading-state { padding: 20px 8px; font-size: 11px; }
.category-tab {
  position: relative;
  width: 100%;
  padding: 13px 8px;
  border: none;
  background: transparent;
  font-size: 12px;
  color: var(--text-sub);
  font-family: var(--sans);
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.5px;
  transition: all 0.2s;
}
.category-tab::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 0;
  background: var(--gold);
  border-radius: 0 3px 3px 0;
  transition: height 0.2s;
}
.category-tab.active {
  background: var(--card);
  color: var(--bg-deep);
  font-weight: 700;
}
.category-tab.active::before { height: 22px; }

.product-column {
  flex: 1;
  min-width: 0;
  padding: 12px 14px 20px;
}
.column-title {
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  padding: 2px 2px 12px;
  letter-spacing: 0.5px;
}
.product-column .product-list { gap: 10px; }
.product-column .product-card {
  padding: 11px;
  min-height: 96px;
  gap: 9px;
}
.product-column .product-art {
  width: 68px; height: 68px; flex-basis: 68px;
}
.product-column .product-art svg { width: 58px; height: 58px; }
.product-column .product-name { font-size: 14px; }
.product-column .product-desc { -webkit-line-clamp: 2; }

/* 商品卡片 */
.product-list { display: flex; flex-direction: column; gap: 12px; }
.loading-state, .empty-state {
  text-align: center;
  color: var(--text-sub);
  padding: 40px 0;
  font-size: 13px;
}
.product-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  min-height: 108px;
  background: var(--glass);
  border: 1px solid rgba(255,255,255,0.95);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
  animation: cardIn 0.35s ease both;
}
.product-card:active { transform: scale(0.985); }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.product-info { flex: 1; min-width: 0; }
.product-badge {
  display: inline-block;
  font-size: 9px;
  color: var(--gold);
  border: 1px solid rgba(201,161,91,0.45);
  border-radius: 10px;
  padding: 1px 7px;
  margin-bottom: 5px;
  letter-spacing: 0.5px;
}
.product-name {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product-desc {
  font-size: 10px;
  color: var(--text-sub);
  margin-top: 4px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 9px;
}
.product-price { font-size: 17px; font-weight: 700; color: var(--bg-deep); }
.product-price small { font-size: 11px; margin-right: 1px; }
.add-circle {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--bg-deep);
  color: #F6F1E7;
  border: none;
  font-size: 17px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(29,27,24,0.22);
  transition: transform 0.15s;
}
.add-circle:active { transform: scale(0.88); }
.product-art {
  width: 82px; height: 82px;
  flex: 0 0 82px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(201,161,91,0.10), rgba(201,161,91,0.02));
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.product-art svg { width: 70px; height: 70px; }
.product-art .thumb-img { width: 100%; height: 100%; object-fit: cover; }

/* ================= 选款清单浮层 ================= */
.cart-float {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom) + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(min(100%, 480px) - 40px);
  height: 58px;
  background: var(--bg-deep);
  border-radius: 30px;
  display: flex;
  align-items: center;
  padding: 0 8px 0 16px;
  gap: 12px;
  box-shadow: 0 12px 30px rgba(29,27,24,0.35);
  z-index: 20;
  transition: opacity 0.25s, transform 0.25s;
}
.cart-float.hidden { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(20px); }
.cart-icon { position: relative; color: var(--gold-light); display: flex; }
.cart-badge {
  position: absolute; top: -8px; right: -10px;
  min-width: 17px; height: 17px;
  background: var(--gold);
  color: #1D1B18;
  border-radius: 9px;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.cart-price { flex: 1; display: flex; flex-direction: column; }
.cart-price small { font-size: 9px; color: rgba(246,241,231,0.55); letter-spacing: 0.5px; }
.cart-price strong { font-family: var(--serif); font-size: 19px; color: #F6F1E7; }
.cart-price strong span { font-size: 19px; }
.cart-btn {
  height: 42px;
  padding: 0 20px;
  border: none;
  border-radius: 22px;
  background: var(--gold);
  color: #1D1B18;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--sans);
  cursor: pointer;
  letter-spacing: 0.5px;
}

/* ================= 通用头部 ================= */
.simple-header {
  height: calc(env(safe-area-inset-top) + 56px);
  background: var(--bg-deep);
  color: #F6F1E7;
  display: flex;
  align-items: flex-end;
  padding: 0 18px 14px;
  justify-content: space-between;
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 1px;
}
.simple-header.dark { background: var(--bg-deep); }
.header-sub { font-size: 9px; letter-spacing: 2px; color: var(--gold); }
.back-btn {
  width: 34px; height: 34px;
  border: none;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  color: #F6F1E7;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.back-btn.light { background: rgba(255,255,255,0.1); }
.text-btn {
  border: none; background: none;
  color: var(--gold-light);
  font-size: 12px;
  font-family: var(--sans);
  cursor: pointer;
}

/* ================= 商品详情 ================= */
.detail-top {
  position: relative;
  height: 340px;
  background: var(--bg-deep);
  border-radius: 0 0 30px 30px;
  padding: calc(env(safe-area-inset-top) + 14px) 18px 0;
}
.detail-top .back-btn, .detail-top .share-btn {
  position: relative;
  z-index: 3;
  background: rgba(255,255,255,0.1);
}
.detail-top-title {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 22px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-size: 15px;
  color: rgba(246,241,231,0.85);
  letter-spacing: 2px;
  z-index: 3;
}
.detail-art {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 190px; height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #F0E4CC, #DCC9A4);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3), inset 0 2px 6px rgba(255,255,255,0.6);
}
.detail-art svg { width: 150px; height: 150px; filter: drop-shadow(0 8px 10px rgba(60,45,25,0.2)); }
.detail-art .detail-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.detail-body {
  padding: 0 20px;
  margin-top: -22px;
  position: relative;
  z-index: 2;
}
.detail-card {
  background: var(--card);
  border-radius: 22px;
  padding: 22px 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.95);
}
.detail-en {
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--gold);
  font-weight: 700;
}
.detail-card h2 {
  font-family: var(--serif);
  font-size: 24px;
  margin-top: 4px;
  letter-spacing: 1px;
}
.detail-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.7;
  margin-top: 10px;
}
.detail-price {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin: 14px 0 18px;
}
.detail-price span { font-size: 15px; font-weight: 700; }
.detail-price strong { font-family: var(--serif); font-size: 32px; font-weight: 700; }
.detail-price small { font-size: 11px; color: var(--text-sub); margin-left: 8px; }
.option-label {
  font-size: 11px;
  color: var(--text-sub);
  letter-spacing: 1px;
  margin: 16px 0 10px;
  padding-left: 2px;
}
.spec-list, .option-list { display: flex; flex-wrap: wrap; gap: 9px; }
.spec-item, .option-item {
  padding: 8px 15px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #FAF8F4;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.18s;
  font-family: var(--sans);
}
.spec-item small { color: var(--text-sub); font-size: 10px; margin-left: 3px; }
.spec-item.active, .option-item.active {
  background: var(--bg-deep);
  color: #F6F1E7;
  border-color: var(--bg-deep);
}
.spec-item.active small, .option-item.active { color: var(--gold-light); }

.detail-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 480px);
  height: calc(72px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px env(safe-area-inset-bottom);
  z-index: 30;
}
.qty-control {
  display: flex; align-items: center;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: #FAF8F4;
}
.qty-control button {
  width: 36px; height: 40px;
  border: none; background: none;
  font-size: 19px; color: var(--text);
  cursor: pointer;
}
.qty-control span { min-width: 26px; text-align: center; font-size: 14px; font-weight: 600; }
.add-btn {
  flex: 1;
  height: 44px;
  border: none;
  border-radius: 22px;
  background: var(--bg-deep);
  color: #F6F1E7;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--sans);
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(29,27,24,0.2);
}

/* ================= 选款清单页 ================= */
.list-body { padding: 20px; }
.list-item {
  display: flex;
  gap: 12px;
  padding: 13px;
  background: var(--card);
  border-radius: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  align-items: center;
}
.list-item .product-art { width: 62px; height: 62px; flex-basis: 62px; border-radius: 12px; }
.list-item .product-art svg { width: 54px; height: 54px; }
.list-item .product-art .thumb-img { width: 100%; height: 100%; object-fit: cover; }
.list-item-info { flex: 1; min-width: 0; }
.list-item-info h4 { font-family: var(--serif); font-size: 15px; font-weight: 600; }
.list-item-info p { font-size: 10px; color: var(--text-sub); margin-top: 4px; }
.list-item-right { text-align: right; }
.list-item-right strong { display: block; font-size: 15px; }
.list-item-right button {
  border: none; background: none; color: var(--text-sub);
  font-size: 10px; margin-top: 8px; cursor: pointer; text-decoration: underline;
}
.list-footer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 480px);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  z-index: 30;
}
.list-summary { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--text-sub); }
.list-total { font-family: var(--serif); font-size: 24px; color: var(--bg-deep); }
.list-actions { display: flex; gap: 10px; margin-top: 12px; }
.ghost-btn, .primary-btn {
  flex: 1; height: 42px; border-radius: 21px;
  font-size: 13px; font-family: var(--sans); cursor: pointer;
}
.ghost-btn { border: 1px solid var(--line); background: #FAF8F4; color: var(--text); }
.primary-btn { border: none; background: var(--bg-deep); color: #F6F1E7; font-weight: 600; letter-spacing: 0.5px; }

/* ================= 底部导航 ================= */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 480px);
  height: calc(60px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 25;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar.hidden { display: none; }
.tab {
  flex: 1;
  border: none; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  color: #A9A197;
  font-size: 10px;
  font-family: var(--sans);
  cursor: pointer;
  transition: color 0.2s;
}
.tab.active { color: var(--bg-deep); }
.tab.active svg { stroke: var(--gold); }

/* ================= Toast & 弹层 ================= */
.toast {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: rgba(29,27,24,0.92);
  color: #F6F1E7;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 13px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  max-width: 80%;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.modal-mask {
  position: fixed; inset: 0;
  background: rgba(29,27,24,0.55);
  display: none;
  align-items: center; justify-content: center;
  z-index: 90;
  padding: 24px;
}
.modal-mask.show { display: flex; }
.modal-card {
  width: 100%; max-width: 340px;
  background: var(--card);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.modal-card h3 { font-family: var(--serif); font-size: 18px; margin-bottom: 8px; }
.modal-card p { font-size: 11px; color: var(--text-sub); }
.share-code {
  margin: 18px 0;
  padding: 12px;
  background: #FAF8F4;
  border: 1px dashed var(--line);
  border-radius: 10px;
  font-family: var(--serif);
  font-size: 13px;
  word-break: break-all;
  color: var(--text);
}
.modal-actions { display: flex; gap: 10px; }

/* ================= 响应式 ================= */
@media (min-width: 481px) {
  body { padding: 20px 0; align-items: flex-start; }
  #app { min-height: calc(100vh - 40px); border-radius: 28px; }
  .page { min-height: calc(100vh - 40px); }
}
@media (max-width: 360px) {
  .category-sidebar { width: 80px; flex-basis: 80px; }
  .product-column { padding: 10px 10px 20px; }
  .product-column .product-art { width: 58px; height: 58px; flex-basis: 58px; }
  .product-column .product-art svg { width: 50px; height: 50px; }
  .detail-art { width: 160px; height: 160px; }
  .detail-art svg { width: 125px; height: 125px; }
}
