/* ── 基础 ─────────────────────────────────────────────────────── */
:root {
  --primary: #2d6a4f;
  --primary-dark: #1f4f3a;
  --primary-light: #e8f3ec;
  --price: #e4393c;
  --text: #222;
  --text-2: #666;
  --text-3: #999;
  --line: #eee;
  --bg: #f5f5f5;
  --card: #fff;
  --radius: 12px;
  --header-h: 0px; /* 顶部导航和搜索框不再吸顶，分类栏贴顶 */
  --tabbar-h: 56px;
  --page-max: 960px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
img { display: block; }
[hidden] { display: none !important; }

.page { max-width: var(--page-max); margin: 0 auto; min-height: 100vh; background: var(--bg); }
.page.with-tabbar { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

/* ── 价格 ─────────────────────────────────────────────────────── */
.price { color: var(--price); font-weight: 700; white-space: nowrap; }
.price .yen { font-size: .6em; margin-right: 1px; }
.price .int { font-size: 1.5em; }
.price .dec { font-size: .8em; }
.price-origin { color: var(--text-3); text-decoration: line-through; font-size: 12px; margin-left: 4px; }
.price-tag { color: var(--price); font-size: 12px; }

/* ── 顶部（首页）──────────────────────────────────────────────── */
.home-header { position: relative; z-index: 20; background: transparent; }
.home-header .search-box { margin: 10px 16px 10px; background: #fff; border: 1px solid #e6ddd1; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 999px; padding: 4px 4px 4px 14px;
}
.search-box svg { width: 18px; height: 18px; color: var(--text-3); flex-shrink: 0; }
.search-box input { flex: 1; min-width: 0; border: 0; outline: 0; font-size: 15px; padding: 6px 0; background: none; color: var(--text); }
.search-box button {
  background: var(--primary); color: #fff; border-radius: 999px;
  padding: 6px 18px; font-weight: 700; font-size: 15px;
}

.notice {
  margin: 12px 16px 0; padding: 8px 12px; border-radius: 8px;
  background: #fff8e6; color: #8a5a00; font-size: 13px;
  display: flex; gap: 6px; align-items: center;
}

/* ── 分类 + 列表 ─────────────────────────────────────────────── */
.catalog { display: flex; align-items: flex-start; margin-top: 12px; background: var(--card); border-radius: var(--radius) var(--radius) 0 0; min-height: 60vh; }
.sidebar {
  position: sticky; top: var(--header-h);
  width: 88px; flex-shrink: 0;
  max-height: calc(100vh - var(--header-h) - var(--tabbar-h));
  overflow-y: auto;
  background: #f7f7f7;
  border-radius: var(--radius) 0 0 0;
}
.sidebar button {
  display: block; width: 100%; padding: 16px 6px; text-align: center;
  font-size: 14px; color: var(--text-2); position: relative;
}
.sidebar button .icon { display: block; font-size: 20px; margin-bottom: 2px; }
.sidebar button.active { background: var(--card); color: var(--text); font-weight: 700; }
.sidebar button.active::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 20px; border-radius: 0 3px 3px 0; background: var(--primary);
}
.list { flex: 1; min-width: 0; padding: 0 12px 24px; }
.section-title { font-size: 14px; font-weight: 700; color: var(--text-2); padding: 14px 0 4px; scroll-margin-top: calc(var(--header-h) + 8px); }
.empty { text-align: center; color: var(--text-3); padding: 48px 0; font-size: 14px; }

.item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item-img { position: relative; width: 108px; height: 108px; flex-shrink: 0; border-radius: 10px; overflow: hidden; background: #f0f0f0; }
.item-img img { width: 100%; height: 100%; object-fit: cover; }
.item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-name { font-size: 16px; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-name .from { color: #a0522d; }
.item-sub { font-size: 13px; color: #b07a2a; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-sales { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.item-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding-top: 6px; }
.item-price { line-height: 1.1; }
.item-price .price { font-size: 16px; }
.item-btn {
  flex-shrink: 0; background: var(--primary); color: #fff;
  border-radius: 16px 4px 16px 4px; padding: 7px 14px; font-size: 15px; font-weight: 700;
}
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 5px; border-radius: 4px; margin-right: 4px; vertical-align: 2px; background: var(--price); color: #fff; }

/* ── 底部导航 ─────────────────────────────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-inner { max-width: var(--page-max); margin: 0 auto; display: flex; height: var(--tabbar-h); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 11px; color: var(--text-3); gap: 2px; position: relative; }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.active { color: var(--primary); font-weight: 600; }
.tabbar .dot { position: absolute; top: 4px; left: 50%; margin-left: 6px; background: var(--price); color: #fff; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px; display: flex; align-items: center; justify-content: center; }

/* ── 普通顶栏（内页）─────────────────────────────────────────── */
.topbar { position: relative; z-index: 1; height: 48px; display: flex; align-items: center; justify-content: center; background: #fff; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 17px; }
.topbar .back { position: absolute; left: 4px; top: 0; height: 48px; width: 48px; display: flex; align-items: center; justify-content: center; }
.topbar .back svg { width: 24px; height: 24px; }

/* ── 表单卡片（登录/注册）──────────────────────────────────────── */
.form-card { background: #fff; margin: 16px; padding: 24px 20px; border-radius: var(--radius); }
.form-card h1 { margin: 0 0 4px; font-size: 22px; }
.form-card .hint { color: var(--text-3); font-size: 13px; margin: 0 0 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field input { width: 100%; font-size: 16px; padding: 12px; border: 1px solid #ddd; border-radius: 10px; outline: 0; background: #fff; color: var(--text); }
.field input:focus { border-color: var(--primary); }
.btn-primary { display: block; width: 100%; background: var(--primary); color: #fff; font-size: 17px; font-weight: 700; padding: 13px; border-radius: 999px; }
.btn-primary:disabled { opacity: .6; }
.btn-outline { display: block; width: 100%; border: 1px solid var(--primary); color: var(--primary); font-size: 17px; font-weight: 700; padding: 12px; border-radius: 999px; background: #fff; }
.form-error { color: var(--price); font-size: 14px; min-height: 20px; margin: 4px 0 10px; }
.form-foot { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-2); }
.form-foot a { color: var(--primary); font-weight: 600; }
.wechat-tip { background: var(--primary-light); color: var(--primary-dark); font-size: 13px; padding: 10px 12px; border-radius: 8px; margin-bottom: 16px; }

/* ── 详情页 ───────────────────────────────────────────────────── */
/* 大图：手机上宽高 2:1（原来是正方形），整张图完整显示在中间，两边用同一张图模糊铺底 */

/* 配方小图：名字和价格叠在图片底部（半透明灰底），整体只有一张图的高度 */

.block { background: #fff; margin-top: 10px; padding: 14px 16px; }
.block h3 { margin: 0 0 10px; font-size: 16px; }
.block p { margin: 0; color: var(--text-2); font-size: 14px; white-space: pre-line; }

.buy-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff;
  border-top: 1px solid var(--line); padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
}
.buy-bar-inner { max-width: var(--page-max); margin: 0 auto; display: flex; gap: 10px; }
.buy-bar .btn-outline, .buy-bar .btn-primary { flex: 1; }

/* ── 个人中心 ─────────────────────────────────────────────────── */
.my-hero { background: linear-gradient(160deg, var(--primary) 0%, #3c8563 100%); color: #fff; padding: 24px 20px 56px; }
.my-hero .row { display: flex; align-items: center; gap: 14px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 700; overflow: hidden; }
.my-hero .name { font-size: 19px; font-weight: 700; }
.my-hero .phone { font-size: 13px; opacity: .85; }
.member-tag { display: inline-block; font-size: 11px; background: #f5c26b; color: #6b4200; padding: 1px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; font-weight: 700; }
.balance-card { background: #fff; margin: -40px 16px 0; border-radius: var(--radius); padding: 18px 20px; position: relative; box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.balance-card .label { color: var(--text-2); font-size: 13px; }
.balance-card .amount { font-size: 34px; font-weight: 800; color: var(--text); margin-top: 2px; }
.balance-card .amount .yen { font-size: 18px; margin-right: 2px; }
.balance-card .tip { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.log { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.log:last-child { border-bottom: 0; }
.log .t { font-size: 15px; }
.log .d { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.log .a { font-size: 16px; font-weight: 700; }
.log .a.plus { color: var(--primary); }
.menu a, .menu button { display: flex; width: 100%; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 15px; text-align: left; }
.menu > :last-child { border-bottom: 0; }

/* ── 提示 ─────────────────────────────────────────────────────── */
.toast { position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%); background: rgba(0,0,0,.78); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; z-index: 100; max-width: 80vw; text-align: center; }

/* ── 电脑端 ───────────────────────────────────────────────────── */
@media (min-width: 900px) {
  .home-header .search-box { margin: 8px 24px 10px; }
  .sidebar { width: 120px; }
  .list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; padding: 0 20px 24px; align-content: start; }
  .list .section-title, .list .empty { grid-column: 1 / -1; }
  .item:last-child { border-bottom: 1px solid var(--line); }
  
  
  
  
}

/* ── 通用控件 ─────────────────────────────────────────────────── */
.stepper { display: inline-flex; align-items: center; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; }
.stepper button { width: 34px; height: 30px; font-size: 18px; color: var(--text); background: #fafafa; }
.stepper button:disabled { color: #ccc; }
.stepper span { min-width: 40px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; background: #f2f2f2; border-radius: 8px; padding: 2px; }
.seg button { padding: 4px 10px; font-size: 12px; border-radius: 6px; color: var(--text-2); }
.seg button.active { background: #fff; color: var(--primary); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--text-3); font-size: 12px; }
input[type=range] { accent-color: var(--primary); }
.card { background: #fff; border-radius: var(--radius); margin: 12px 16px 0; padding: 14px 16px; }
.card h3 { margin: 0 0 10px; font-size: 16px; }
.link { color: var(--primary); font-weight: 600; }
.btn-sm { padding: 6px 14px; border-radius: 999px; font-size: 13px; border: 1px solid #ddd; background: #fff; }
.btn-sm.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-sm.danger { color: var(--price); border-color: #f3c2c2; }

/* ── 规格选择弹层 ─────────────────────────────────────────────── */

.addon-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; font-size: 14px; }
.fr { display: grid; grid-template-columns: 56px 1fr 44px 46px; align-items: center; gap: 8px; padding: 6px 0; font-size: 14px; }
.fr.off { color: #bbb; }
.fr .pct { text-align: right; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.fr button { font-size: 12px; color: var(--primary); padding: 4px 0; }
.fr button:disabled { color: #ccc; }
.fr.extra .name { color: #b76e00; }
.chip-btn { display: inline-block; font-size: 13px; padding: 5px 10px; border-radius: 999px; border: 1px dashed #bbb; color: var(--text-2); margin: 0 6px 6px 0; }
.chip-btn:disabled { opacity: .4; }
.paid-row { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; font-size: 14px; }

/* ── 自由搭配 ─────────────────────────────────────────────────── */
.diy-row { display: grid; grid-template-columns: 56px 1fr 40px; align-items: center; column-gap: 8px; row-gap: 0; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.diy-row .info { grid-column: 2; }
.diy-row:last-child { border-bottom: 0; }
.diy-row.off { color: #bbb; }
.diy-row .info { font-size: 12px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.diy-row button { font-size: 12px; color: var(--primary); }
.diy-cat { font-size: 12px; color: var(--text-3); margin-top: 10px; }
.bottom-price-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #fff; border-top: 1px solid var(--line);
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
}
.bottom-price-bar .inner { max-width: var(--page-max); margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.bottom-price-bar .sum { flex: 1; min-width: 0; line-height: 1.2; }
.bottom-price-bar .sum .price { font-size: 16px; }
.bottom-price-bar .sum small { display: block; font-size: 11px; color: var(--text-3); }
.bottom-price-bar .btn-primary, .bottom-price-bar .btn-outline { width: auto; padding: 10px 18px; font-size: 15px; flex-shrink: 0; }

/* ── 购物车 / 下单 / 订单 ─────────────────────────────────────── */
.cart-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-item:last-child { border-bottom: 0; }
.cart-item img { width: 76px; height: 76px; border-radius: 8px; object-fit: cover; background: #eee; flex-shrink: 0; }
.cart-item .body { flex: 1; min-width: 0; }
.cart-item .name { font-weight: 600; font-size: 15px; }
.cart-item .sum { font-size: 12px; color: var(--text-2); margin-top: 2px; line-height: 1.4; }
.cart-item .err { font-size: 12px; color: var(--price); margin-top: 2px; }
.cart-item .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.del { font-size: 12px; color: var(--text-3); }
.tabs-seg { display: flex; gap: 8px; }
.tabs-seg button { flex: 1; padding: 10px 4px; border-radius: 10px; background: #f5f5f5; font-size: 14px; border: 1px solid transparent; }
.tabs-seg button.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary-dark); font-weight: 700; }
.kv { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; }
.kv span:first-child { color: var(--text-2); }
.kv.total { font-weight: 700; font-size: 16px; }
select { width: 100%; font-size: 16px; padding: 12px; border: 1px solid #ddd; border-radius: 10px; background: #fff; color: var(--text); }
textarea { width: 100%; font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid #ddd; border-radius: 10px; resize: vertical; }
.pay-opt { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid #e5e5e5; border-radius: 10px; margin-top: 8px; width: 100%; text-align: left; }
.pay-opt.active { border-color: var(--primary); background: var(--primary-light); }
.pay-opt:disabled { opacity: .5; }
.pay-opt .radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #ccc; flex-shrink: 0; }
.pay-opt.active .radio { border: 5px solid var(--primary); }
.pay-opt .t { font-weight: 600; }
.pay-opt .d { font-size: 12px; color: var(--text-2); }
.status-hero { background: linear-gradient(160deg, var(--primary), #3c8563); color: #fff; padding: 20px 20px 28px; }
.status-hero.warn { background: linear-gradient(160deg, #e0782f, #f09a4a); }
.status-hero.gray { background: linear-gradient(160deg, #888, #aaa); }
.status-hero h1 { margin: 0; font-size: 22px; }
.status-hero p { margin: 4px 0 0; opacity: .9; font-size: 14px; }
.qr { width: 200px; height: 200px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); margin: 6px auto 10px; }
.pickup-code { font-size: 40px; font-weight: 800; letter-spacing: 4px; color: var(--primary-dark); text-align: center; font-variant-numeric: tabular-nums; }
.order-card { display: block; padding: 12px 0; border-bottom: 1px solid var(--line); }
.order-card:last-child { border-bottom: 0; }
.order-card .st { color: var(--price); font-size: 13px; font-weight: 600; }
.order-card .items { font-size: 14px; margin: 6px 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.status-tabs { display: flex; gap: 4px; overflow-x: auto; margin: 0 -4px 6px; scrollbar-width: none; }
.status-tabs button { flex-shrink: 0; padding: 6px 10px; font-size: 13px; color: var(--text-2); border-radius: 999px; }
.status-tabs button.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; }
/* 不显眼的文字按钮（如「调整配料」） */
.quiet-link { font-size: 13px; font-weight: 400; color: var(--text-3); padding: 2px 0; }
.custom-note { margin-top: 10px; font-size: 12px; color: #b07a2a; line-height: 1.6; }

/* ── 全站顶部导航 ─────────────────────────────────────────────── */
.snav { background: #fff; border-bottom: 1px solid #ece7e0; box-shadow: 0 1px 6px rgba(0,0,0,.04); position: relative; z-index: 25; }
.snav-inner { max-width: var(--page-max); margin: 0 auto; height: 56px; padding: 0 14px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.snav-burger { display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 36px; height: 36px; padding: 6px; justify-self: start; }
.snav-burger span { display: block; width: 20px; height: 2px; background: #555; border-radius: 2px; transition: transform .2s, opacity .2s; }
.snav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.snav-burger.open span:nth-child(2) { opacity: 0; }
.snav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.snav-logo { display: flex; align-items: center; justify-content: center; height: 56px; }
.snav-logo img { height: 46px; width: auto; transition: filter .2s; }
/* 鼠标放上去（手机上按住）Logo 变成主题绿，和原来的商城一样 */
.snav-logo:hover img, .snav-logo:active img { filter: brightness(0) saturate(100%) invert(27%) sepia(50%) saturate(600%) hue-rotate(110deg) brightness(85%); }
.snav-logo:hover .snav-logo-text { color: var(--primary); }
.snav-logo-text { font-size: 18px; font-weight: 800; color: var(--primary-dark); letter-spacing: 1px; }
.snav-right { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.snav-link { font-size: 14px; color: var(--text-2); }
.snav-cart { position: relative; color: #555; display: flex; }
.snav-badge { position: absolute; top: -6px; right: -9px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px; display: flex; align-items: center; justify-content: center; }
.snav-menu { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid #ece7e0; box-shadow: 0 8px 20px rgba(0,0,0,.08); max-height: 70vh; overflow-y: auto; }
.snav-menu-link { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid #f5f2ee; max-width: var(--page-max); margin: 0 auto; }
.snav-menu-link img, .snav-menu-icon { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: #f5f0ea; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.snav-menu-link b { display: block; font-size: 15px; font-weight: 600; color: var(--text); }
.snav-menu-link small { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; line-height: 1.4; }
.snav-menu-link.home b { color: var(--primary); }

/* ── 页脚 ─────────────────────────────────────────────────────── */
.sfooter { text-align: center; font-size: 12px; color: var(--text-3); padding: 20px 16px; margin-top: 16px; border-top: 1px solid #ece7e0; background: #fff; }
/* 底部操作按钮：圆角和详情页的数量按钮一致（10px） */
.buy-bar .btn-outline, .buy-bar .btn-primary,
.bottom-price-bar .btn-outline, .bottom-price-bar .btn-primary { border-radius: 10px; font-weight: 400; }
.buy-bar .btn-outline, .buy-bar .btn-primary { white-space: nowrap; padding-left: 10px; padding-right: 10px; }
.buy-bar .btn-primary { flex: 1.25; }

/* 首页：搜索区、公告区、左侧分类栏用详情页的暖米色 */
body.warm { background: #f5f0ea; }
body.warm .page { background: transparent; }
body.warm .notice { background: #fff; color: #6b6158; border: 1px solid #ece5dc; }
body.warm .sidebar { background: #f5f0ea; }
body.warm .sidebar button.active { background: #fff; }
/* 左侧分类栏那一列从上到下都是暖米色（分类少时下面不露白） */
body.warm .catalog { background: linear-gradient(to right, #f5f0ea 88px, #fff 88px); }
@media (min-width: 900px) { body.warm .catalog { background: linear-gradient(to right, #f5f0ea 120px, #fff 120px); } }
/* 选中的分类：左边两个角圆角（露出暖米色），上下相邻两项靠右的角向内圆角（露出白色），和右侧列表连成一体 */
body.warm .sidebar { background: linear-gradient(to right, #f5f0ea 14px, #fff 14px); }
body.warm .sidebar button { background: #f5f0ea; }
body.warm .sidebar button.active { background: #fff; border-radius: 14px 0 0 14px; }
body.warm .sidebar button:has(+ button.active) { border-bottom-right-radius: 14px; }
body.warm .sidebar button.active + button { border-top-right-radius: 14px; }
/* 最后一个分类被选中时，下面也要有向内的圆角：在分类栏底部补一段暖米色收尾 */
body.warm .sidebar::after { content: ""; display: block; height: 14px; background: #f5f0ea; }
body.warm .sidebar:has(button:last-of-type.active)::after { border-top-right-radius: 14px; }
/* 首页圆角统一为 10px（和底部按钮、数量按钮一致）；商品卡上叶子形的「购买」按钮保持原样 */
.home-header .search-box { border-radius: 10px; }
.home-header .search-box button { border-radius: 8px; }
body.warm .notice { border-radius: 10px; }

/* ── 首页轮播图 ───────────────────────────────────────────────── */
.hero { position: relative; margin: 10px 16px 0; border-radius: 12px; overflow: hidden; aspect-ratio: 2 / 1; background: #e9e1d6; }
.hero-track { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hero-track::-webkit-scrollbar { display: none; }
.hero-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: start; display: block; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-dots { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 5px; }
.hero-dots i { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.55); transition: width .2s; }
.hero-dots i.on { width: 14px; background: #fff; }
/* 公告气泡：内容多长气泡多长 */
.hero-notice { position: absolute; left: 12px; bottom: 10px; max-width: calc(100% - 90px); padding: 5px 12px; border-radius: 999px; background: rgba(0,0,0,.42); color: #fff; font-size: 13px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
/* 搜索：叠在图片左上角，平时只是放大镜 */
.home-header .search-box .search-icon { display: flex; padding: 0; color: var(--text-3); background: none; }
.home-header .search-box .search-icon svg { width: 18px; height: 18px; }
.search-box.floating { position: absolute; left: 10px; top: 10px; z-index: 2; margin: 0; width: 38px; height: 38px; padding: 0; gap: 6px; border: 0; border-radius: 19px; background: rgba(255,255,255,.88); box-shadow: 0 2px 8px rgba(0,0,0,.12); transition: width .25s; overflow: hidden; }
.search-box.floating .search-icon { display: flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex-shrink: 0; padding: 0; color: #555; background: none; }
.search-box.floating .search-icon svg { width: 18px; height: 18px; color: #555; }
.search-box.floating input, .search-box.floating button[type=submit] { display: none; }
.search-box.floating.open { width: calc(100% - 20px); background: #fff; border-radius: 10px; padding-right: 4px; }
.search-box.floating.open input { display: block; font-size: 15px; }
.search-box.floating.open button[type=submit] { display: block; padding: 5px 14px; font-size: 14px; border-radius: 8px; }
/* 轮播图上的搜索和公告：用页面的暖米色 */
.search-box.floating { background: rgba(245, 240, 234, .92); }
.search-box.floating.open { background: #f5f0ea; }
.search-box.floating.open input { background: transparent; }
.hero-notice { color: #f5f0ea; }
/* 搜索圆圈和展开后的搜索条：半透明暖米色 + 背景模糊（毛玻璃） */
.search-box.floating, .search-box.floating.open {
  background: rgba(245, 240, 234, .55);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  box-shadow: 0 2px 10px rgba(0,0,0,.10), inset 0 0 0 1px rgba(255,255,255,.35);
}
.search-box.floating.open input::placeholder { color: #5a4f46; }
/* 去掉描边，只留很淡的阴影 */
.search-box.floating, .search-box.floating.open { border: 0; box-shadow: 0 1px 6px rgba(0,0,0,.08); }

/* ── 确认弹窗（代替浏览器自带的 confirm）──────────────────────── */
.cdlg-mask { position: fixed; inset: 0; z-index: 90; background: rgba(40, 32, 24, .45); display: flex; align-items: center; justify-content: center; padding: 24px; animation: cdlg-fade .15s ease-out; }
.cdlg { width: min(320px, 100%); background: #f5f0ea; border-radius: 14px; padding: 22px 20px 16px; box-shadow: 0 12px 40px rgba(0,0,0,.18); animation: cdlg-pop .18s ease-out; }
.cdlg-title { font-size: 17px; font-weight: 700; color: #3a3228; text-align: center; }
.cdlg-msg { margin-top: 8px; font-size: 14px; color: #6b6158; line-height: 1.6; text-align: center; white-space: pre-line; }
.cdlg-btns { display: flex; gap: 10px; margin-top: 18px; }
.cdlg-btns button { flex: 1; padding: 11px 0; border-radius: 10px; font-size: 15px; }
.cdlg-cancel { background: #fff; color: #6b6158; border: 1px solid #e6ddd1; }
.cdlg-ok { background: var(--primary); color: #fff; }
.cdlg-ok.danger { background: #c0504d; }
@keyframes cdlg-fade { from { opacity: 0; } }
@keyframes cdlg-pop { from { opacity: 0; transform: scale(.94); } }

/* 轮播图：宽度始终铺满（左右不裁），比例不同的图上下留暖米色 */
.hero { aspect-ratio: 750 / 350; }
.hero-slide { display: flex; align-items: center; background: #efe8de; overflow: hidden; }
.hero-slide img { width: 100%; height: auto; object-fit: initial; }
