/* Oh My Mahjong 风格 —— 米白底 + 优雅衬线 + 马卡龙点缀 */
:root {
  --bg: #fdfbf7;
  --ink: #2b2b2b;
  --muted: #8a8378;
  --line: #ece5da;
  --pink: #e8a0b4;
  --pink-dark: #c9748f;
  --green: #7fb8b0;
  --accent: #1f6f5c;
  --card: #ffffff;
  --radius: 14px;
  --serif: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
  --sans: "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); }
a { color: inherit; text-decoration: none; }
img { display: block; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253, 251, 247, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { font-family: var(--serif); font-size: 26px; letter-spacing: 1px; }
.brand em { color: var(--pink-dark); font-style: normal; }
.nav { display: flex; gap: 22px; align-items: center; font-size: 14px; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; padding: 8px 16px;
  border-radius: 999px; cursor: pointer; font-size: 14px;
}
.cart-btn:hover { border-color: var(--pink); }
.cart-badge {
  background: var(--pink-dark); color: #fff; font-size: 11px;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 5px;
}

/* Hero */
.hero { text-align: center; padding: 56px 24px 28px; }
.hero h1 { font-family: var(--serif); font-size: 40px; font-weight: 400; letter-spacing: 2px; }
.hero p { color: var(--muted); margin-top: 10px; font-size: 15px; }

/* 分类筛选 */
.filters { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; padding: 8px 24px 32px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  padding: 7px 18px; border-radius: 999px; font-size: 13px; cursor: pointer; transition: all .15s;
}
.chip:hover { border-color: var(--pink); color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* 商品网格 */
.grid {
  max-width: 1200px; margin: 0 auto; padding: 0 24px 72px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 28px;
}
.card { cursor: pointer; }
.card .thumb {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: #f4efe8; aspect-ratio: 1;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card:hover .thumb img { transform: scale(1.045); }
.badge {
  position: absolute; top: 12px; left: 12px; background: #fff;
  font-size: 11px; letter-spacing: 1px; padding: 5px 10px; border-radius: 999px;
  color: var(--pink-dark); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.card .cat { color: var(--muted); font-size: 12px; margin-top: 12px; letter-spacing: .5px; }
.card h3 { font-family: var(--serif); font-weight: 400; font-size: 18px; margin-top: 4px; }
.card .price { margin-top: 6px; font-size: 15px; color: var(--accent); font-weight: 600; }
.card .quickadd {
  margin-top: 10px; width: 100%; padding: 9px 0; border-radius: 999px;
  border: 1px solid var(--ink); background: #fff; cursor: pointer; font-size: 13px; transition: all .15s;
}
.card .quickadd:hover { background: var(--ink); color: #fff; }

/* 详情页 */
.detail { max-width: 1150px; margin: 0 auto; padding: 40px 24px 80px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 48px; }
@media (max-width: 880px) { .detail { grid-template-columns: 1fr; } }
.gallery-main { border-radius: var(--radius); overflow: hidden; background: #f4efe8; aspect-ratio: 1; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-top: 12px; }
.thumbs .t { border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid transparent; aspect-ratio: 1; background: #f4efe8; }
.thumbs .t.on { border-color: var(--ink); }
.thumbs .t img { width: 100%; height: 100%; object-fit: cover; }
.pd-cat { color: var(--muted); font-size: 13px; letter-spacing: 1px; }
.pd-title { font-family: var(--serif); font-weight: 400; font-size: 34px; margin-top: 8px; }
.pd-price { font-size: 24px; color: var(--accent); font-weight: 700; margin-top: 14px; }
.pd-desc { margin-top: 22px; color: #555; line-height: 1.9; font-size: 14.5px; white-space: pre-line; border-top: 1px solid var(--line); padding-top: 22px; }
.qty-row { display: flex; align-items: center; gap: 14px; margin-top: 26px; }
.qty { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty button { width: 38px; height: 40px; border: 0; background: #fff; font-size: 17px; cursor: pointer; }
.qty input { width: 46px; text-align: center; border: 0; font-size: 15px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 28px; border-radius: 999px; border: 1px solid var(--ink);
  background: var(--ink); color: #fff; font-size: 14px; cursor: pointer; transition: opacity .15s;
}
.btn:hover { opacity: .85; }
.btn.ghost { background: #fff; color: var(--ink); }
.btn.pink { background: var(--pink-dark); border-color: var(--pink-dark); }
.btn.sm { padding: 8px 16px; font-size: 13px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* 购物车抽屉/页面 */
.cart-list { max-width: 860px; margin: 0 auto; padding: 40px 24px 80px; }
.cart-item {
  display: grid; grid-template-columns: 84px 1fr auto auto auto; gap: 16px;
  align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line);
}
.cart-item .ci-img { width: 84px; height: 84px; border-radius: 10px; overflow: hidden; background: #f4efe8; }
.cart-item .ci-img img { width: 100%; height: 100%; object-fit: cover; }
.ci-title { font-family: var(--serif); font-size: 16px; }
.ci-cat { color: var(--muted); font-size: 12px; margin-top: 3px; }
.ci-price { color: var(--accent); font-weight: 600; }
.ci-del { color: var(--muted); background: none; border: 0; cursor: pointer; font-size: 13px; }
.ci-del:hover { color: #c0392b; }
.cart-total { display: flex; justify-content: space-between; align-items: center; padding: 22px 0; font-size: 18px; }
.cart-total b { color: var(--accent); font-size: 24px; }
.empty { text-align: center; color: var(--muted); padding: 80px 0; }

/* 表单 */
.field { margin-top: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 14px; background: #fff; font-family: inherit;
}
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--pink); border-color: transparent; }

/* 弹层 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(40,35,30,.45); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff; border-radius: 16px; padding: 28px; width: 100%; max-width: 520px;
  max-height: 88vh; overflow: auto;
}
.modal h3 { font-family: var(--serif); font-weight: 400; font-size: 22px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 22px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 200;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.footer { border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 13px; padding: 30px; }
