/* ============ 妹妹甜品单 · 简洁现代风 ============ */
:root {
  --bg: #faf9f7;
  --card: #ffffff;
  --primary: #e8694a;      /* 陶土橙 */
  --primary-dark: #d4553a;
  --text: #1c1917;
  --text-light: #8b8580;
  --line: #ece9e6;
  --shadow: 0 2px 8px rgba(28, 25, 23, 0.05);
  --radius: 14px;
}

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

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-bottom: 76px;
  letter-spacing: 0.2px;
}

/* ---------- 顶部栏 ---------- */
.app-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(250, 249, 247, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 14px 18px calc(12px + env(safe-area-inset-top));
}
.header-inner { display: flex; align-items: center; justify-content: space-between; max-width: 600px; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-emoji { font-size: 26px; line-height: 1; }
.brand-text h1 { font-size: 19px; font-weight: 700; letter-spacing: 1px; color: var(--text); }
.brand-text p { font-size: 12px; color: var(--text-light); }
.icon-btn {
  border: 1px solid var(--line); background: var(--card); font-size: 16px;
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- 主内容 ---------- */
.app-main { max-width: 600px; margin: 0 auto; padding: 16px 16px 24px; }
.view { animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- 分类筛选 ---------- */
.category-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; scrollbar-width: none; }
.category-chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--card);
  color: var(--text-light); border-radius: 999px; padding: 6px 18px; font-size: 13px;
  cursor: pointer; transition: all .15s;
}
.chip.active { background: var(--text); border-color: var(--text); color: #fff; font-weight: 600; }

/* ---------- 甜品卡片 ---------- */
.dessert-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.dessert-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); cursor: pointer; transition: transform .15s;
}
.dessert-card:active { transform: scale(0.97); }
.card-img {
  position: relative; height: 140px; overflow: hidden; background: #f5f2ee;
}
.card-tag {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: rgba(255,255,255,0.92); color: var(--primary);
  font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--line);
}
.dessert-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .35s ease;
}
.dessert-card:hover .dessert-img { transform: scale(1.04); }
.dessert-img.fallback {
  display: flex; align-items: center; justify-content: center;
  font-size: 54px; width: 100%; height: 100%;
}
.card-body { padding: 12px 14px 14px; }
.card-name { font-size: 15px; font-weight: 700; }
.card-desc {
  font-size: 12px; color: var(--text-light); margin: 2px 0 10px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot { display: flex; align-items: center; justify-content: flex-end; }
.card-plus {
  width: 30px; height: 30px; border-radius: 9px; border: none; background: var(--primary);
  color: #fff; font-size: 18px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* ---------- 详情页 ---------- */
.detail-hero {
  position: relative; height: 260px; border-radius: 0 0 20px 20px;
  overflow: hidden; background: #f5f2ee;
}
.dessert-img.hero-img { width: 100%; height: 100%; object-fit: cover; }
.dessert-img.hero-img.fallback { font-size: 92px; }
.back-btn {
  position: absolute; top: 14px; left: 14px; z-index: 2;
  border: 1px solid var(--line); background: rgba(255,255,255,0.92); color: var(--text);
  padding: 6px 14px; border-radius: 999px; font-size: 14px; cursor: pointer; font-weight: 600;
}
.detail-body { padding: 20px 4px 0; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.detail-head h2 { font-size: 24px; font-weight: 800; letter-spacing: 0.5px; }
.detail-desc { font-size: 13px; color: var(--text-light); margin-top: 4px; }
.detail-price { color: var(--primary); font-weight: 800; font-size: 24px; white-space: nowrap; }
.detail-price small { font-size: 14px; font-weight: 500; color: var(--text-light); }

.recipe-meta { display: flex; gap: 8px; margin: 16px 0; flex-wrap: wrap; }
.meta-item {
  background: #f1ede9; color: #6d655f; border-radius: 999px;
  padding: 5px 12px; font-size: 12px; font-weight: 600;
}

.panel {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  border: 1px solid var(--line); margin-bottom: 14px;
}
.panel-title { font-size: 15px; font-weight: 800; margin-bottom: 12px; }

.ingredient-list { list-style: none; }
.ingredient-list li {
  display: flex; justify-content: space-between; padding: 9px 2px;
  border-bottom: 1px solid var(--line); font-size: 14px;
}
.ingredient-list li:last-child { border-bottom: none; }
.ingredient-list .amt { color: var(--text-light); font-size: 13px; white-space: nowrap; margin-left: 12px; }

.step-list { list-style: none; counter-reset: step; }
.step-list li {
  counter-increment: step; position: relative; padding: 0 0 14px 38px; font-size: 14px;
}
.step-list li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 8px;
  background: var(--text); color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.step-list li:not(:last-child)::after {
  content: ""; position: absolute; left: 12px; top: 30px; bottom: 2px; width: 2px;
  background: var(--line);
}
.tips-text { font-size: 13px; color: #6d655f; background: #f7f5f2; border-radius: 10px; padding: 10px 12px; }

.detail-actions { display: flex; gap: 10px; margin-top: 6px; }
.detail-actions .btn { flex: 1; padding: 14px 0; font-size: 16px; }

/* ---------- 按钮 ---------- */
.btn {
  border: none; border-radius: 10px; cursor: pointer; font-weight: 700;
  font-family: inherit; transition: all .15s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-outline { background: var(--card); color: var(--text); border: 1px solid var(--text); }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.link-btn { border: none; background: none; color: var(--text-light); font-size: 13px; cursor: pointer; }

/* ---------- 购物车 ---------- */
.view-title-row { display: flex; align-items: center; justify-content: space-between; margin: 6px 2px 14px; }
.view-title-row h2 { font-size: 20px; font-weight: 800; }
.view-sub { font-size: 13px; color: var(--text-light); }

.cart-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.cart-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--radius); padding: 12px;
  border: 1px solid var(--line);
}
.cart-item-thumb {
  width: 56px; height: 56px; border-radius: 10px; flex: 0 0 auto;
  overflow: hidden; background: #f5f2ee;
}
.dessert-img.cart-img { width: 100%; height: 100%; object-fit: cover; }
.dessert-img.cart-img.fallback { font-size: 30px; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 15px; font-weight: 700; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; font-size: 16px; cursor: pointer; color: var(--text);
}
.stepper .num { min-width: 22px; text-align: center; font-weight: 700; font-size: 15px; }

/* ---------- 表单 ---------- */
.form-field { margin-bottom: 14px; }
.form-field label { display: block; font-size: 13px; font-weight: 700; color: var(--text-light); margin-bottom: 6px; }
.form-field input, .form-field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 13px; font-size: 14px; font-family: inherit; background: var(--card); color: var(--text);
  outline: none; resize: none;
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--text); }
.seg-control { display: flex; background: #f1ede9; border-radius: 10px; padding: 3px; }
.seg-item {
  flex: 1; border: none; background: transparent; padding: 9px 0; border-radius: 8px;
  font-size: 14px; font-weight: 600; color: var(--text-light); cursor: pointer;
}
.seg-item.active { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

.checkout-bar {
  position: sticky; bottom: 84px; display: flex;
  background: var(--card); border-radius: var(--radius); padding: 12px 14px;
  border: 1px solid var(--line);
}
.checkout-bar .btn { flex: 1; }

/* ---------- 订单 ---------- */
.order-list { display: flex; flex-direction: column; gap: 12px; }
.order-card { background: var(--card); border-radius: var(--radius); padding: 14px; border: 1px solid var(--line); }
.order-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-no { font-size: 12px; color: var(--text-light); }
.order-status { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.order-status.pending { background: #fbf3e8; color: #b07d1f; }
.order-status.done { background: #e9f3ec; color: #2e8b57; }
.order-items { font-size: 13px; color: #5d5650; }
.order-items div { padding: 2px 0; }
.order-info { font-size: 12px; color: var(--text-light); margin-top: 8px; border-top: 1px dashed var(--line); padding-top: 8px; }
.order-actions { display: flex; gap: 8px; margin-top: 10px; }
.order-actions .btn { flex: 1; padding: 8px 0; font-size: 13px; }

/* ---------- 空状态 ---------- */
.empty-state { text-align: center; padding: 60px 0; color: var(--text-light); }
.empty-emoji { font-size: 56px; margin-bottom: 12px; filter: saturate(0.6); }
.empty-state p { margin-bottom: 16px; font-size: 14px; }
.empty-state p.empty-tip { font-size: 12px; color: var(--text-light); opacity: .75; max-width: 260px; margin: -6px auto 0; line-height: 1.6; }

/* ---------- 底部导航 ---------- */
.tab-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: rgba(255,255,255,0.94); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex; padding-bottom: env(safe-area-inset-bottom);
}
.tab-item {
  flex: 1; border: none; background: none; padding: 9px 0 7px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 11px; color: var(--text-light); cursor: pointer; position: relative;
}
.tab-item .tab-emoji { font-size: 21px; filter: grayscale(1) opacity(0.55); transition: all .2s; }
.tab-item.active { color: var(--text); font-weight: 700; }
.tab-item.active .tab-emoji { filter: none; }
.tab-badge {
  position: absolute; top: 3px; right: calc(50% - 26px);
  background: var(--primary); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 17px; height: 17px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%) translateY(10px);
  background: rgba(28,25,23,0.92); color: #fff; font-size: 14px;
  padding: 10px 20px; border-radius: 10px; z-index: 99;
  opacity: 0; pointer-events: none; transition: all .25s; max-width: 82vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 备案信息 ---------- */
.site-footer {
  max-width: 600px; margin: 0 auto;
  padding: 8px 16px 78px;
  text-align: center;
  font-size: 11px; line-height: 1.7;
  color: var(--text-light);
}
.site-footer a {
  color: var(--text-light);
  text-decoration: none;
  transition: color .15s;
}
.site-footer a:hover, .site-footer a:active { color: var(--primary); }

/* ---------- 桌面适配 ---------- */
@media (min-width: 720px) {
  .dessert-grid { grid-template-columns: repeat(3, 1fr); }
  .app-header .header-inner, .app-main, .site-footer { max-width: 720px; }
}
