:root {
  --bg: #fff6ec;
  --bg-2: #ffe8d2;
  --card: #ffffff;
  --ink: #4a3a2e;
  --muted: #a08c76;
  --accent: #e8734f;
  --accent-soft: #fbe1d3;
  --accent-2: #f6c39b;
  --line: #f0e3d5;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(190, 130, 80, 0.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  min-height: 100%;
}

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

.brand {
  text-align: center;
  padding: 22px 0 6px;
  line-height: 1.25;
}
.brand .zh {
  font-size: 16px;
  color: var(--muted);
  margin-top: 6px;
  letter-spacing: .12em;
}
.brand .vi {
  font-size: 32px;
  font-weight: 700;
  font-family: Georgia, serif;
  color: var(--accent);
  letter-spacing: .12em;
}
.brand .tagline {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}
.store-meta {
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.store-meta div { margin: 0; }
.socials { display: flex; justify-content: center; gap: 12px; margin-top: 14px; }
.soc {
  width: 52px; height: 52px; border-radius: 50%;
  color: #fff; font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; box-shadow: var(--shadow);
}
.soc.zalo { background: #0068ff; }
.soc.fb { background: #1877f2; font-size: 24px; }
.soc.wa { background: #25d366; }

.switcher {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 8px;
}
.switcher button {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
}
.switcher button.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 26px 4px 12px;
  font-size: 17px;
  font-weight: 700;
}
.section-title .ico { font-size: 20px; }

.dish {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.dish .thumb {
  width: 62px; height: 62px;
  border-radius: 16px;
  background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  flex: 0 0 auto;
  overflow: hidden;
}
.dish .thumb img { width: 100%; height: 100%; object-fit: cover; }
.dish .thumb a { display: block; width: 100%; height: 100%; }
.dish .info { flex: 1; min-width: 0; }
.dish .name-vi { font-size: 17px; font-weight: 700; color: var(--ink); }
.dish .name-zh { font-size: 13px; color: var(--muted); margin-top: 2px; }
.dish .price { font-size: 15px; font-weight: 700; color: var(--ink); margin-top: 6px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button {
  width: 32px; height: 32px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 18px;
  cursor: pointer;
  color: var(--ink);
}
.stepper button.plus { background: var(--accent); border-color: var(--accent); color: #fff; }
.stepper .qty { min-width: 20px; text-align: center; font-weight: 700; }

.cartbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(255,246,236,0), var(--bg-2) 40%);
  pointer-events: none;
}
.cartbar .inner {
  pointer-events: auto;
  max-width: 640px;
  margin: 0 auto;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 10px 24px rgba(0,0,0,.2);
}
.cartbar .btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.form-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  margin-top: 8px;
}
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fffdfa;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 16px;
  color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent-2); border-color: var(--accent-2); }

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 14px;
  width: 100%;
  border-radius: 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.btn.ghost { background: var(--accent-soft); color: var(--accent); }
.btn.big { font-size: 17px; padding: 16px; }

.locbtn {
  background: var(--accent-soft);
  color: var(--accent);
  border: none;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  margin-top: 6px;
}

.order-summary {
  background: var(--accent-soft);
  border-radius: 16px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 14px;
}
.order-summary .row { display: flex; justify-content: space-between; gap: 8px; margin: 4px 0; }

.tabbar { position: sticky; top: 0; background: var(--bg); z-index: 5; }
.tabbar .tabs { display: flex; gap: 8px; padding: 10px 0; }
.tabbar .tabs button { flex: 1; }

.list-item {
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 10px;
}
.list-item .head { display: flex; justify-content: space-between; align-items: center; }
.list-item .muted { color: var(--muted); font-size: 12px; }
.pill { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }

table { width: 100%; border-collapse: collapse; }
#adminBody .dish-row { display: flex; align-items: center; gap: 12px; }
#adminBody .dish-row .thumb {
  width: 54px; height: 54px; border-radius: 14px; overflow: hidden;
  background: var(--accent-soft); display: flex; align-items: center; justify-content: center;
  font-size: 26px; flex: 0 0 auto;
}
#adminBody .dish-row .thumb img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
#adminBody .dish-row .thumb a { display: block; width: 100%; height: 100%; }
#adminBody .dish-row .meta { flex: 1; min-width: 0; }
#adminBody .dish-row .ops { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
#adminBody .dish-row .ops .btn { width: auto; padding: 6px 10px; font-size: 12px; border-radius: 12px; }
.imglist { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.imgi { position: relative; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; background: var(--accent-soft); }
.imgi img { width: 100%; height: 100%; object-fit: cover; }
.imgi button { position: absolute; top: 0; right: 0; background: rgba(0,0,0,.6); color: #fff; border: none; width: 18px; height: 18px; font-size: 11px; line-height: 1; border-radius: 0 0 0 8px; cursor: pointer; }
img[loading="lazy"] { background: var(--accent-soft); }
.stat-head { display: flex; gap: 10px; margin-bottom: 10px; }
.stat { flex: 1; background: var(--card); border-radius: 14px; padding: 12px; text-align: center; box-shadow: var(--shadow); }
.stat-num { font-size: 20px; font-weight: 700; color: var(--accent); word-break: break-word; }
.stat-lbl { font-size: 12px; color: var(--muted); margin-top: 4px; }
.qbar { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.qbar button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 12px; font-size: 12px; cursor: pointer; color: var(--ink); }
.qbar button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.range { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.range input { flex: 1; border: 1px solid var(--line); background: #fffdfa; border-radius: 12px; padding: 10px 12px; font-size: 14px; color: var(--ink); }
.chart-title { font-size: 14px; font-weight: 700; margin: 12px 0 6px; }
.chart { width: 100%; height: auto; }
.filterbox { display: flex; gap: 8px; margin-bottom: 12px; }
.filterbox input {
  flex: 1; border: 1px solid var(--line); background: #fffdfa;
  border-radius: 14px; padding: 12px 14px; font-size: 16px; color: var(--ink);
}
.filterbox input:focus { outline: 2px solid var(--accent-2); border-color: var(--accent-2); }
.sticky-form {
  position: sticky; top: 54px; z-index: 6;
  background: var(--bg); padding: 4px 0 8px;
}
.compact-form { padding: 12px; }
.compact-form .field { margin-bottom: 8px; }
.compact-form input, .compact-form select {
  padding: 9px 12px; font-size: 14px; border-radius: 12px;
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.imgrow { display: flex; gap: 8px; align-items: center; }
.imgrow input { flex: 1; }
.btnrow { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.btnrow .btn { width: auto; padding: 11px 16px; }
.lb {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, .8);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.lb img { max-width: 94vw; max-height: 88vh; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }

/* 多终端 / 多分辨率适配 */
.tabbar .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabbar .tabs button { flex: 1 0 auto; white-space: nowrap; }
@media (max-width: 480px) {
  .tabbar .tabs button { font-size: 12px; padding: 8px 6px; }
  .brand .vi { font-size: 26px; }
  .brand .zh { font-size: 14px; }
}
@media (max-width: 380px) {
  .grid2 { grid-template-columns: 1fr; }
  .switcher { flex-wrap: wrap; }
  .soc { width: 46px; height: 46px; font-size: 12px; }
}
@media (min-width: 900px) {
  .wrap { max-width: 720px; }
}
.dish .info, .order-summary { word-break: break-word; }
.dish .thumb { position: relative; }
.statsrow { display: flex; justify-content: center; gap: 16px; font-size: 14px; margin-top: 12px; color: var(--ink); }
.statsrow .stars { color: #f6b93b; }
.statsrow .stars b { color: var(--ink); }
.statsrow .month { color: var(--muted); }
.imgct { position: absolute; right: 4px; bottom: 4px; background: rgba(0,0,0,.55); color: #fff; border: none; border-radius: 8px; font-size: 10px; padding: 2px 6px; cursor: pointer; }
.reviewbtn {
  margin-top: 8px; background: var(--accent-soft); color: var(--accent); border: none;
  border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer;
  white-space: nowrap; display: inline-block; flex: 0 0 auto; line-height: 1.4;
}
.dmeta { display: flex; align-items: center; gap: 10px; font-size: 12px; margin-top: 6px; }
.dstars { color: #f6b93b; }
.dmq { color: var(--muted); }
.rcarousel { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.rcard { flex: 0 0 210px; background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 12px; cursor: pointer; }
.rstars { color: #f6b93b; font-size: 13px; }
.rname { font-size: 13px; font-weight: 700; margin-top: 4px; }
.rtext { font-size: 12px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rmore { font-size: 12px; color: var(--accent); margin-top: 6px; }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; z-index: 120; }
.modal { background: var(--card); width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; padding: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.m-title { font-size: 18px; font-weight: 700; }
.m-dish { color: var(--muted); font-size: 13px; margin: 4px 0 8px; }
.stars.pick { font-size: 30px; display: flex; gap: 4px; margin: 8px 0; }
.stars.pick span { color: #e4d9cc; cursor: pointer; }
.stars.pick span.on { color: #f6b93b; }
.anonrow { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); cursor: pointer; }
textarea { width: 100%; border: 1px solid var(--line); background: #fffdfa; border-radius: 14px; padding: 12px 14px; font-size: 16px; color: var(--ink); }
.modal .btnrow { display: flex; gap: 10px; margin-top: 12px; }
.modal .btnrow .btn { flex: 1; }
td, th { text-align: left; padding: 8px 6px; font-size: 14px; border-bottom: 1px solid var(--line); }

a.link { color: var(--accent); }
.admin-link { text-align: center; margin-top: 26px; }
.admin-link a { color: var(--muted); font-size: 12px; text-decoration: none; }
.admin-top {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  box-shadow: var(--shadow);
}

.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.toast {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 14px; z-index: 20; opacity: 0; transition: opacity .2s;
}
.toast.show { opacity: 1; }
