/* ===== 双皮奶点餐系统 · 小清新小资风格（移动端优先，无外部依赖） ===== */
:root {
  --bg: #faf7f1;            /* 奶白底 */
  --surface: #ffffff;
  --primary: #88a87d;       /* 抹茶绿 - 点缀 */
  --primary-d: #6b8a61;
  --sun: #efa31a;           /* 蜂蜜黄 - 交互按钮（美团风） */
  --sun-d: #cf8610;
  --accent: #cf9163;        /* 焦糖暖色 - 价格 */
  --accent-d: #b9774c;
  --text: #4b4138;
  --muted: #a89c8e;
  --line: #ece2d6;
  --shadow: 0 6px 22px rgba(120,100,80,0.08);
  --shadow-sm: 0 2px 8px rgba(120,100,80,0.06);
  --radius: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
}
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; padding-bottom: 86px; }
img { max-width: 100%; display: block; }

/* 顶部店铺 banner（小资感：柔和渐变 + 衬线店名 + 留白） */
.shop-header {
  background: linear-gradient(160deg, #eef3ea 0%, #faf7f1 72%);
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--line);
}
.shop-header .badge {
  display: inline-block; background: rgba(136,168,125,0.16); color: var(--primary-d);
  font-size: 11px; font-weight: 700; letter-spacing: 1px; padding: 3px 10px; border-radius: 999px; margin-bottom: 10px;
}
.shop-header h1 {
  margin: 0 0 6px; font-size: 24px; letter-spacing: 2px; color: var(--text);
  font-family: "Songti SC", "STSong", "SimSun", serif; font-weight: 700;
}
.shop-header .notice { font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* 点单布局：左分类 + 右菜品（类似美团） */
.order-layout { display: flex; align-items: flex-start; }
.cat-side {
  position: sticky; top: 0; align-self: flex-start;
  width: 92px; flex: 0 0 92px;
  background: #eef2ea; min-height: calc(100vh - 200px);
  padding: 8px 0;
}
.cat-tab {
  padding: 14px 8px; font-size: 13px; color: var(--muted);
  text-align: center; cursor: pointer; line-height: 1.35;
  border-left: 3px solid transparent; transition: all .15s;
}
.cat-tab.active { background: var(--surface); color: var(--primary-d); font-weight: 700; border-left-color: var(--primary); }
.cat-tab .dot { display:inline-block; min-width:16px; height:16px; line-height:16px; background:var(--accent); color:#fff; font-size:10px; border-radius:8px; margin-left:3px; padding:0 4px; vertical-align:middle; }

.dish-scroll { flex: 1; padding: 4px 12px 8px; }
.menu-section { scroll-margin-top: 6px; }
.section-title { padding: 14px 2px 8px; font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: 1px; }

/* 菜品行（美团风：左图右文） */
.dish {
  display: flex; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line);
  align-items: center; cursor: pointer;
}
.dish:active { background: rgba(136,168,125,0.06); }
.dish-detail-hint { font-size: 11px; color: var(--primary); margin-top: 5px; }
.dish:last-child { border-bottom: none; }
.dish-img {
  width: 76px; height: 76px; flex: 0 0 76px; border-radius: 14px;
  background: #f3ede2; display: flex; align-items: center; justify-content: center; font-size: 40px;
  overflow: hidden; box-shadow: var(--shadow-sm);
}
.dish-img img { width: 100%; height: 100%; object-fit: cover; }
.dish-info { flex: 1; min-width: 0; }
.dish-name { font-weight: 700; font-size: 15px; color: var(--text); }
.dish-desc { color: var(--muted); font-size: 12px; margin: 3px 0 8px; min-height: 16px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.dish-bottom { display: flex; align-items: center; justify-content: space-between; }
.price { color: var(--accent); font-weight: 800; font-size: 17px; }
.price small { font-size: 11px; font-weight: 600; }
.add-btn {
  width: 30px; height: 30px; border-radius: 50%; border: none;
  background: var(--sun); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; box-shadow: var(--shadow-sm);
}
.add-btn:active { transform: scale(0.9); }

/* 底部购物车栏（小清新：白底 + 焦糖主按钮） */
.cart-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  max-width: 480px; margin: 0 auto;
  background: var(--surface); color: var(--text);
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; height: 66px; box-shadow: 0 -4px 18px rgba(120,100,80,0.10);
  border-top: 1px solid var(--line);
}
.cart-icon {
  position: relative; width: 50px; height: 50px; border-radius: 50%;
  background: transparent; color: var(--text); display: flex; align-items: center; justify-content: center;
  font-size: 26px; margin-top: -22px; cursor: pointer;
}
.cart-badge {
  position: absolute; top: -2px; right: -2px; background: #ec5b46; color: #fff;
  font-size: 11px; font-weight: 800; min-width: 18px; height: 18px; line-height: 18px;
  border-radius: 9px; text-align: center; padding: 0 4px; border: 2px solid var(--surface);
}
.cart-info { flex: 1; padding-left: 14px; }
.cart-total { font-size: 19px; font-weight: 800; color: var(--accent); }
.cart-total small { font-size: 12px; color: var(--muted); font-weight: 600; }
.cart-hint { font-size: 11px; color: var(--muted); }
.checkout-btn {
  background: var(--sun); color: #fff; border: none;
  padding: 11px 22px; border-radius: 999px; font-weight: 700; font-size: 15px; cursor: pointer; box-shadow: var(--shadow-sm);
}
.checkout-btn:disabled { background: #d8cfc4; color: #fff; cursor: not-allowed; box-shadow: none; }

/* 弹层通用 */
.mask { position: fixed; inset: 0; background: rgba(60,50,40,0.42); z-index: 40; display: none; align-items: flex-end; justify-content: center; }
.mask.show { display: flex; }
.sheet { background: var(--surface); width: 100%; max-width: 480px; border-radius: 20px 20px 0 0; max-height: 86vh; overflow-y: auto; padding: 18px 18px 26px; animation: up .22s ease; }
@keyframes up { from { transform: translateY(40px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.sheet h3 { margin: 0 0 14px; font-size: 17px; display: flex; justify-content: space-between; align-items: center; font-family: "Songti SC","STSong",serif; letter-spacing: 1px; }
.sheet .close { font-size: 24px; color: var(--muted); cursor: pointer; line-height: 1; border: none; background: none; }

/* 购物车条目 */
.cart-line { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line .ci-thumb { width: 46px; height: 46px; border-radius: 12px; background: #f3ede2; font-size: 24px; display:flex; align-items:center; justify-content:center; flex:0 0 auto; overflow:hidden; }
.cart-line .ci-thumb img { width:100%; height:100%; object-fit:cover; }
.cart-line .ci-main { flex: 1; min-width: 0; }
.cart-line .ci-name { font-weight: 700; font-size: 14px; }
.cart-line .ci-price { color: var(--accent); font-weight: 700; font-size: 13px; }
.cart-line .ci-remark { font-size: 12px; color: var(--muted); margin-top: 3px; }
.cart-line .ci-remark input { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 5px 8px; font-size: 12px; margin-top: 4px; }
.stepper { display: flex; align-items: center; gap: 9px; }
.stepper button { width: 27px; height: 27px; border-radius: 50%; border: 1px solid var(--primary); background: #fff; color: var(--primary); font-size: 16px; line-height: 1; cursor: pointer; }
.stepper span { min-width: 18px; text-align: center; font-weight: 700; }
.cart-empty { text-align: center; color: var(--muted); padding: 34px 0; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; font-size: 14px; font-family: inherit; background: #fbf8f3; color: var(--text); }
.field textarea { resize: vertical; min-height: 58px; }
.radio-row { display: flex; gap: 10px; }
.radio-row label { flex: 1; text-align: center; border: 1px solid var(--line); border-radius: 12px; padding: 11px; cursor: pointer; font-weight: 600; font-size: 14px; background: #fbf8f3; }
.radio-row input { display: none; }
.radio-row label.active { border-color: var(--primary); background: rgba(136,168,125,0.12); color: var(--primary-d); }
.primary-btn { width: 100%; background: var(--sun); color: #fff; border: none; padding: 14px; border-radius: 14px; font-size: 16px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow-sm); }
.primary-btn:active { transform: scale(.99); }

/* 结果框 / 收款卡片 */
.result-box { background: #fbf8f3; border: 1px dashed var(--primary); border-radius: 12px; padding: 13px; font-size: 13px; white-space: pre-wrap; word-break: break-all; max-height: 240px; overflow-y: auto; color: var(--text); line-height: 1.6; }
.pay-card { background: #f3f8ee; border: 1.5px solid rgba(136,168,125,0.5); border-radius: 14px; padding: 12px 14px; }
.pay-card-hd { font-size: 13px; color: var(--primary-d); font-weight: 700; margin-bottom: 6px; }
.pay-wx { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: .5px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.pay-wx-empty { font-size: 14px; font-weight: 600; color: var(--muted); }
.pay-copy { font-size: 12px; font-weight: 600; color: var(--sun-d); background: rgba(239,163,26,0.16); padding: 2px 9px; border-radius: 999px; }
.pay-tip { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

/* 商品详情弹层 */
.detail-sheet { padding-top: 0; }
.detail-sheet .close { position: absolute; top: 12px; right: 14px; z-index: 2; }
.detail-img {
  position: relative; width: calc(100% + 36px); margin: -18px -18px 14px;
  height: 190px; border-radius: 20px 20px 0 0; background: #f3ede2;
  display: flex; align-items: center; justify-content: center; font-size: 76px; overflow: hidden;
}
.detail-img img { width: 100%; height: 100%; object-fit: cover; }
.detail-name { font-size: 19px; margin: 0 0 6px; font-family: "Songti SC","STSong",serif; letter-spacing: 1px; }
.detail-desc { color: var(--muted); font-size: 13px; line-height: 1.6; margin-bottom: 12px; }
.detail-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.detail-price { color: var(--accent); font-weight: 800; font-size: 22px; }
.detail-price small { font-size: 13px; font-weight: 600; }
/* 规格选择 chips */
.spec-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.spec-chip {
  border: 1px solid var(--line); background: #fbf8f3; color: var(--text);
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; line-height: 1.3;
}
.spec-chip.active { border-color: var(--sun); background: rgba(239,163,26,0.12); color: var(--sun-d); }
.price-from { font-size: 11px; color: var(--muted); margin-left: 3px; font-weight: 600; }
.ci-spec { color: var(--primary-d); font-weight: 600; }
.toast { position: fixed; left: 50%; top: 40%; transform: translate(-50%,-50%); background: rgba(60,50,40,0.85); color: #fff; padding: 12px 20px; border-radius: 10px; font-size: 14px; z-index: 60; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

/* ===== 商家后台（沿用同色板） ===== */
.admin-wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.admin-wrap h2 { font-size: 18px; margin: 0 0 4px; font-family: "Songti SC","STSong",serif; letter-spacing: 1px; }
.admin-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 14px; margin: 12px 0; }
.admin-card h3 { margin: 0 0 10px; font-size: 15px; color: var(--primary-d); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 11px; font-size: 13.5px; cursor: pointer; font-weight: 600; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.danger { background: var(--surface); color: #d9534f; border-color: #f0cfcc; }
.btn.small { padding: 5px 10px; font-size: 12.5px; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.admin-table th, table.admin-table td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
table.admin-table th { color: var(--muted); font-weight: 600; }
.thumb-sm { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; background:#f3ede2; }
.tag { display:inline-block; background: rgba(136,168,125,0.16); color: var(--primary-d); border-radius:999px; padding:2px 9px; font-size:12px; font-weight:600; }
/* 后台规格编辑行 */
.spec-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.spec-row .spec-name { flex: 1; min-width: 0; }
.spec-row .spec-plus { color: var(--muted); font-size: 13px; }
.spec-row .spec-add { width: 86px; }
.status-new { color: var(--accent-d); font-weight: 700; }
.status-done { color: var(--primary-d); font-weight: 700; }
.muted { color: var(--muted); font-size: 12.5px; }
.qr-box { text-align: center; padding: 8px; }
.qr-box img, .qr-box canvas { margin: 0 auto; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 8px; overflow-x: auto; }
.tabs .tab { padding: 9px 13px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs .tab.active { color: var(--primary-d); border-bottom-color: var(--primary); }
.hidden { display: none !important; }
.login-box { max-width: 320px; margin: 80px auto; background: var(--surface); padding: 26px; border-radius: var(--radius); box-shadow: var(--shadow); }
.code-preview { background: #3a2f26; color: #fff; border-radius: 10px; padding: 12px; font-size: 12px; white-space: pre-wrap; max-height: 280px; overflow: auto; word-break: break-all; }
