:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --text: #2b2622;
  --muted: #8a8079;
  --line: #ece6dd;
  --brand: #e2603f;
  --brand-dark: #c44c2e;
  --brand-soft: #fdeee8;
  --green: #2f9e6a;
  --green-soft: #e5f5ec;
  --amber: #c98a12;
  --amber-soft: #fbf2dd;
  --gray-soft: #f1eeea;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(60, 40, 20, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
a { color: var(--brand); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* 顶部 */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(250, 247, 242, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; height: 56px; }
.logo { font-weight: 700; font-size: 18px; letter-spacing: .5px; margin-right: auto; display: flex; align-items: center; gap: 8px; }
.logo-dot { width: 26px; height: 26px; border-radius: 8px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 14px; }

.btn {
  border: 0; border-radius: 999px; padding: 9px 18px;
  background: var(--brand); color: #fff; font-weight: 600;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: scale(.98); }
.btn:disabled { background: #d9cfc7; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--card); }
.btn.green { background: #07c160; }
.btn.green:hover { background: #06a853; }
.btn.small { padding: 5px 12px; font-size: 13px; }
.btn.block { width: 100%; padding: 12px; font-size: 16px; }
.link-btn { background: none; border: 0; color: var(--muted); padding: 4px 6px; }
.link-btn:hover { color: var(--text); }

/* 首屏 */
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: 26px; margin: 0 0 4px; }
.hero p { margin: 0; color: var(--muted); }

.tabs { display: flex; gap: 8px; margin: 18px 0 14px; overflow-x: auto; }
.tab {
  border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 999px; padding: 6px 16px; white-space: nowrap;
}
.tab.active { background: var(--text); color: #fff; border-color: var(--text); }

.section-title { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 12px; }
.section-title h2 { font-size: 18px; margin: 0; }
.section-title span { color: var(--muted); font-size: 13px; }

/* 商品网格 */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 920px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column;
  transition: transform .15s;
}
.card:hover { transform: translateY(-2px); }
.card .thumb { position: relative; aspect-ratio: 1; background: var(--gray-soft); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.price { color: var(--brand); font-weight: 700; font-size: 17px; }
.price small { font-size: 12px; margin-right: 1px; }
.stock { font-size: 12px; color: var(--muted); }
.stock.low { color: var(--amber); }
.stock.out { color: #b3aaa3; }
.badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
}
.soldout-mask {
  position: absolute; inset: 0; background: rgba(255,255,255,.55);
  display: grid; place-items: center; font-weight: 700; color: var(--muted); letter-spacing: 2px;
}
.no-img { width: 100%; height: 100%; display: grid; place-items: center; color: #c6bcb3; font-size: 13px; }

.empty { text-align: center; color: var(--muted); padding: 48px 0; }

/* 弹窗 */
.modal-bg {
  position: fixed; inset: 0; background: rgba(30, 20, 10, .45); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .15s;
}
@media (min-width: 640px) { .modal-bg { align-items: center; padding: 24px; } }
.modal {
  background: var(--card); width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; animation: up .2s;
}
@media (min-width: 640px) { .modal { border-radius: 20px; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 4px; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 12px 18px 22px; }
.close-x { border: 0; background: var(--gray-soft); width: 32px; height: 32px; border-radius: 50%; font-size: 18px; line-height: 1; color: var(--muted); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }

/* 商品详情 */
.gallery { position: relative; aspect-ratio: 1; background: var(--gray-soft); }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery .dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.gallery .dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.6); }
.gallery .dots i.on { background: #fff; }
.gallery .nav { position: absolute; top: 50%; transform: translateY(-50%); border: 0; background: rgba(255,255,255,.8); width: 34px; height: 34px; border-radius: 50%; font-size: 18px; }
.gallery .nav.prev { left: 10px; }
.gallery .nav.next { right: 10px; }
.gallery .x { position: absolute; top: 12px; right: 12px; }
.detail { padding: 16px 18px 22px; }
.detail h3 { margin: 0 0 6px; font-size: 20px; }
.detail .desc { color: #5d554f; white-space: pre-wrap; margin: 10px 0 18px; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.field label b { color: var(--brand); font-weight: 400; }
.input {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: #fff; outline: none; transition: border .15s;
}
.input:focus { border-color: var(--brand); }
textarea.input { resize: vertical; min-height: 64px; }
.inline { display: flex; gap: 8px; }
.inline .input { flex: 1; min-width: 0; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { border: 0; background: var(--gray-soft); width: 38px; height: 38px; font-size: 18px; }
.qty input { width: 54px; text-align: center; border: 0; height: 38px; outline: none; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.dev-tip { background: var(--amber-soft); color: #7a5a10; font-size: 13px; border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; }

/* 状态标签 */
.tag { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.tag.pending { background: var(--amber-soft); color: var(--amber); }
.tag.confirmed { background: var(--brand-soft); color: var(--brand); }
.tag.done { background: var(--green-soft); color: var(--green); }
.tag.cancelled { background: var(--gray-soft); color: #a39a93; }

/* 我的预约 */
.booking-item { display: flex; gap: 12px; background: var(--card); padding: 12px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 10px; }
.booking-item img, .booking-item .no-img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--gray-soft); }
.booking-item .info { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); }
.booking-item .info .t { color: var(--text); font-weight: 600; font-size: 15px; display: flex; justify-content: space-between; gap: 8px; }

/* 提示 */
.toast {
  position: fixed; left: 50%; top: 72px; transform: translateX(-50%); z-index: 100;
  background: rgba(30, 25, 20, .9); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px;
  animation: fade .2s; max-width: calc(100% - 32px); text-align: center;
}
.success-box { text-align: center; padding: 12px 0 4px; }
.success-box .icon { width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; font-size: 32px; margin: 0 auto 12px; }

footer { text-align: center; color: var(--muted); font-size: 12px; padding: 40px 0 28px; }
.hidden { display: none !important; }

/* 语言切换 / 用户 */
.lang-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 999px; padding: 4px 12px; font-size: 13px; font-weight: 600;
}
.lang-btn:hover { border-color: var(--text); }
.user-name { font-size: 13px; color: var(--muted); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
@media (max-width: 380px) { .user-name { display: none; } }

/* 产品介绍 */
.card .intro {
  font-size: 12px; color: var(--muted); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 4px;
}
.desc-box { margin: 16px 0 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.desc-box h4 { margin: 0 0 6px; font-size: 14px; }
.desc-box .desc { margin: 0; line-height: 1.7; }

/* 打折 */
.badge.sale { left: auto; right: 8px; background: #d9364b; }
.price-wrap { display: inline-flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.orig { color: #b3aaa3; font-size: 12px; }
.tag.sale-tag { background: #fde6e9; color: #d9364b; }

/* 幸运转盘 */
.wheel-card { background: var(--card); border-radius: 20px; box-shadow: var(--shadow); padding: 22px 16px 18px; text-align: center; }
.wheel-card h2 { margin: 0 0 4px; font-size: 22px; }
.wheel-box { position: relative; width: min(320px, 100%); aspect-ratio: 1; margin: 0 auto; }
.wheel-box::before {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 60%, transparent 61%), conic-gradient(#f6c453 0 25%, #e2603f 0 50%, #f6c453 0 75%, #e2603f 0);
  box-shadow: 0 6px 24px rgba(226, 96, 63, .25);
}
.wheel-svg { position: relative; width: 100%; height: 100%; border-radius: 50%; display: block; }
.wheel-pointer {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%); z-index: 3;
  width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 28px solid var(--text);
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.2));
}
.wheel-btn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: 78px; height: 78px; border-radius: 50%; border: 5px solid #fff;
  background: var(--brand); color: #fff; font-weight: 800; font-size: 16px; letter-spacing: 1px;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
.wheel-btn:disabled { background: #c9bfb7; cursor: not-allowed; }
.wheel-btn:not(:disabled):hover { background: var(--brand-dark); }
.wheel-left { margin: 18px 0 0; font-weight: 600; color: var(--brand); }
.prize-item { display: flex; gap: 12px; align-items: center; background: var(--card); padding: 12px 14px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 10px; }
.prize-item.used { opacity: .55; }
.prize-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
.code { font-family: ui-monospace, Consolas, monospace; letter-spacing: 1px; color: var(--text); }
.wheel-fab {
  position: fixed; right: 16px; bottom: 20px; z-index: 30;
  width: 56px; height: 56px; border-radius: 50%; border: 0;
  background: var(--brand); font-size: 26px; box-shadow: 0 6px 18px rgba(226, 96, 63, .4);
  animation: wobble 2.5s ease-in-out infinite;
}
@keyframes wobble { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-12deg); } 90% { transform: rotate(12deg); } 95% { transform: rotate(-6deg); } }

/* 登录 */
.prefix { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--gray-soft); font-size: 14px; white-space: nowrap; }
.wx-btn { display: block; text-align: center; text-decoration: none; }
