:root {
  --green: #4e8f2f;
  --green-dark: #356d20;
  --green-deep: #2c5b1a;
  --green-soft: #eaf3e2;
  --green-pale: #f4f8ef;
  --gold: #e0b04a;
  --ink: #1f2a1c;
  --muted: #6d7c65;
  --line: #e2e9dc;
  --bg: #f5f7f2;
  --card: #ffffff;
  --radius-lg: 18px;
  --radius-md: 14px;
  --shadow: 0 8px 24px rgba(47, 82, 30, .08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #e9eee4;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }

.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.phone-shell {
  width: min(480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 40px rgba(35, 60, 25, .12);
  position: relative;
  overflow: hidden;
  padding-bottom: 84px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 52px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
  background: linear-gradient(135deg, #5a9a37, #3f7a27);
  box-shadow: 0 2px 12px rgba(45, 85, 25, .18);
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: .5px;
  font-weight: 600;
}

.brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .2);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .12);
  color: #fff;
  display: grid;
  place-items: center;
}

.icon-btn .icon { width: 18px; height: 18px; }

.hero {
  position: relative;
  background: linear-gradient(160deg, #629f3d 0%, #477f2c 55%, #3a6d24 100%);
  color: #fff;
  padding: 22px 18px 24px;
  border-radius: 0 0 28px 28px;
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14);
  pointer-events: none;
}

.hero::before { width: 180px; height: 180px; right: -55px; top: -68px; }
.hero::after { width: 120px; height: 120px; right: 28px; bottom: -62px; }

.hero-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-logo {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: #fff;
  padding: 4px;
  object-fit: contain;
  box-shadow: 0 6px 18px rgba(20, 50, 10, .22);
  flex: none;
}

.hero-copy { min-width: 0; }

.hero-kicker {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  margin-bottom: 6px;
}

.hero h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
  font-weight: 700;
}

.hero h1 span { font-size: 15px; font-weight: 500; opacity: .92; }

.hero-copy p {
  margin: 6px 0 0;
  font-size: 12px;
  opacity: .88;
}

.status-row {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.status-left { display: flex; align-items: center; gap: 7px; min-width: 0; }
.status-left strong { font-size: 13px; }
.status-hint { font-size: 11px; opacity: .82; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b7f27c;
  box-shadow: 0 0 0 4px rgba(183, 242, 124, .22);
  flex: none;
}

.status-dot.off { background: #ffc98a; box-shadow: 0 0 0 4px rgba(255, 201, 138, .2); }

.status-badge {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  color: var(--green-dark);
  font-weight: 600;
  white-space: nowrap;
}

.hero-tags {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.hero-tags span {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .1);
  color: rgba(255, 255, 255, .9);
}

.section {
  padding: 18px 16px 0;
  scroll-margin-top: 64px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.3;
  font-weight: 700;
  position: relative;
  padding-left: 10px;
}

.section-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 3px;
  background: var(--green);
}

.section-head > span { font-size: 11px; color: var(--muted); }

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid rgba(226, 233, 220, .8);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.quick-item {
  border: 1px solid rgba(226, 233, 220, .9);
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 13px 5px 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 14px rgba(47, 82, 30, .05);
  transition: transform .18s ease, box-shadow .18s ease;
}

.quick-item:active { transform: scale(.97); }

.quick-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--green-dark);
  background: var(--green-soft);
  margin-bottom: 2px;
}

.quick-name { font-size: 13px; font-weight: 600; }
.quick-item small { font-size: 10px; color: var(--muted); }

.service-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.service-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 13px;
  box-shadow: 0 4px 14px rgba(47, 82, 30, .04);
}

.service-card-wide {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.service-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--green-pale);
  color: var(--green);
  display: grid;
  place-items: center;
  flex: none;
}

.service-card strong { font-size: 13px; }
.service-card p { margin: 4px 0 0; font-size: 11px; color: var(--muted); line-height: 1.5; }
.service-card-wide .service-icon { width: 40px; height: 40px; }
.service-card-wide > div { flex: 1; }

.mini-btn {
  border: 1px solid var(--green);
  color: var(--green-dark);
  background: #fff;
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11px;
  flex: none;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #e9efe2;
  border-radius: 12px;
  margin-bottom: 10px;
}

.tab {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 6px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
}

.tab.active {
  background: #fff;
  color: var(--green-dark);
  box-shadow: 0 2px 8px rgba(47, 82, 30, .1);
}

.form-card { padding: 16px; }

.form-row { margin-bottom: 12px; }

.form-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-row label,
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(78, 143, 47, .12);
}

textarea { resize: vertical; min-height: 62px; }

.primary-btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #579738, #3d7826);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 6px 16px rgba(61, 120, 38, .22);
}

.primary-btn:active { transform: translateY(1px); }

.form-note,
.data-note {
  margin: 10px 0 0;
  font-size: 10px;
  color: #97a290;
  line-height: 1.5;
}

/* 常用信息 */
.profile-tip {
  margin: 0 0 14px;
  padding: 10px 12px;
  background: var(--green-pale);
  border-radius: 10px;
  font-size: 12px;
  color: var(--green-deep);
  line-height: 1.6;
}
.label-hint { font-weight: 400; color: #97a290; }
.address-list { margin-top: 6px; }
.address-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.address-index {
  flex: none;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 700;
}
.address-input { flex: 1; margin-top: 0; }
.address-del {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #b13a2b;
}
.address-del .icon { width: 16px; height: 16px; }
.address-empty {
  padding: 12px;
  text-align: center;
  font-size: 12px;
  color: #97a290;
  background: var(--green-pale);
  border-radius: 10px;
}
.add-address-btn {
  width: 100%;
  margin-top: 2px;
  padding: 9px;
  border: 1px dashed #a8c991;
  border-radius: 10px;
  background: var(--green-pale);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 600;
}
#addressRow > label { margin-bottom: 0; }
#bookingAddress { margin-top: 8px; }

/* 预约时间窗提示 */
.slot-hint {
  margin: -2px 0 12px;
  padding: 8px 11px;
  border-radius: 9px;
  background: var(--green-pale);
  color: var(--green-deep);
  font-size: 11px;
  line-height: 1.6;
}
.slot-hint strong { color: var(--green-dark); }
.slot-hint.warn { background: #fff3e0; color: #a35c00; }
.slot-hint.warn strong { color: #a35c00; }
.slot-hint.danger { background: #fdecea; color: #b13a2b; }
.slot-hint.danger strong { color: #b13a2b; }

/* 自定义日期选择器（替代浏览器原生弹窗，按钮更大） */
.date-trigger { cursor: pointer; color: var(--ink); font-weight: 600; }
.date-trigger::placeholder { color: #97a290; font-weight: 400; }
.dp-mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(20, 30, 15, .5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: dp-fade .18s ease;
}
@keyframes dp-fade { from { opacity: 0; } to { opacity: 1; } }
.dp-panel {
  width: min(480px, 100%);
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 30px rgba(20, 50, 10, .18);
  animation: dp-up .22s ease;
}
@keyframes dp-up { from { transform: translateY(30px); } to { transform: translateY(0); } }
.dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.dp-title { font-size: 19px; font-weight: 700; color: var(--ink); }
.dp-arrow {
  width: 42px; height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--green-pale);
  color: var(--green-dark);
  font-size: 28px;
  line-height: 1;
  display: grid; place-items: center;
}
.dp-week, .dp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dp-week { margin-bottom: 6px; }
.dp-week span {
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  padding: 6px 0;
}
.dp-days { min-height: 240px; align-content: start; }
.dp-day {
  height: 46px;
  display: grid; place-items: center;
  font-size: 17px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}
.dp-day.empty { background: transparent; }
.dp-day.disabled { color: #c3ccbc; cursor: not-allowed; }
.dp-day:not(.disabled):not(.selected):active { background: var(--green-pale); }
.dp-day.today { border-color: var(--green); }
.dp-day.selected { background: var(--green); color: #fff; }
.dp-foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.dp-today-btn {
  width: 100%;
  border: 0;
  background: none;
  color: var(--green-dark);
  font-size: 16px;
  font-weight: 600;
  padding: 8px;
  margin-bottom: 8px;
}
.dp-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.dp-btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  font-size: 17px;
  font-weight: 700;
}
.dp-btn.cancel { background: #fff; color: var(--muted); }
.dp-btn.ok {
  border-color: var(--green);
  background: linear-gradient(135deg, #579738, #3d7826);
  color: #fff;
  box-shadow: 0 5px 14px rgba(61, 120, 38, .22);
}

.result-card {
  margin-top: 12px;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  background: var(--green-soft);
  border: 1px dashed #a8c991;
  color: var(--green-deep);
  font-size: 12px;
}

.result-card strong { font-size: 13px; }
.result-card p { margin: 3px 0 0; }

.chip-row {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 0 10px;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar { display: none; }

.chip {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  white-space: nowrap;
  flex: none;
}

.chip.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.dish-list { padding: 4px 14px; }

.dish {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eef2ea;
}

.dish:last-child { border-bottom: 0; }

.dish-title {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dish-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--green-dark);
  background: var(--green-soft);
  padding: 1px 7px;
  border-radius: 999px;
}

.dish-desc { font-size: 11px; color: var(--muted); margin-top: 3px; }
.dish-price { font-size: 16px; font-weight: 700; color: var(--green-dark); white-space: nowrap; }
.dish-price small { font-size: 11px; font-weight: 500; }

.chat-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.chat-log {
  height: 252px;
  overflow-y: auto;
  padding: 14px;
  background: #fbfcf9;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg { display: flex; }
.msg.user { justify-content: flex-end; }

.bubble {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.bot .bubble {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  border-top-left-radius: 4px;
}

.msg.user .bubble {
  background: var(--green);
  color: #fff;
  border-top-right-radius: 4px;
}

.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px 4px;
  border-top: 1px solid var(--line);
}

.chat-chips .chip {
  font-size: 11px;
  padding: 5px 9px;
  background: var(--green-pale);
  border-color: #dce9d2;
  color: var(--green-dark);
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 8px 12px 12px;
}

.chat-input-row input {
  margin: 0;
  border-radius: 999px;
  padding: 9px 13px;
}

.send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}

.booking-list { display: flex; flex-direction: column; gap: 10px; }

.booking-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 13px;
  box-shadow: 0 4px 14px rgba(47, 82, 30, .04);
}

.booking-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.booking-top strong { font-size: 14px; }

.booking-type {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-dark);
}

.booking-meta { font-size: 12px; color: var(--muted); }
.booking-meta span { margin-right: 10px; }
.booking-id { font-size: 10px; color: #9aa594; margin-top: 6px; }

.booking-actions { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin-top: 8px; }

.booking-status {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  margin-left: auto;
}
.st-pending { background: #fff3e0; color: #b76e00; }
.st-confirmed { background: #e6f4ea; color: #217a3c; }
.st-done { background: #eef1f5; color: #5a6675; }
.st-cancelled { background: #fdecea; color: #b13a2b; }

.sync-status-btn {
  border: 0;
  background: transparent;
  color: var(--green-dark);
  font-size: 11px;
  padding: 4px 0;
}

.cancel-btn {
  border: 0;
  background: transparent;
  color: #b4634e;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}

.cancel-btn .icon { width: 14px; height: 14px; }

.empty-state {
  text-align: center;
  padding: 28px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 12px;
  background: rgba(255, 255, 255, .6);
}

.info-card { padding: 4px 14px; }

.info-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid #eef2ea;
}

.info-row:last-child { border-bottom: 0; }

.info-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green-dark);
  display: grid;
  place-items: center;
  flex: none;
}

.info-body { flex: 1; min-width: 0; }
.info-body strong { font-size: 13px; }
.info-body p { margin: 3px 0 0; font-size: 12px; color: var(--muted); line-height: 1.55; }
.info-body a { color: var(--green-dark); font-weight: 600; }

.nav-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }

.nav-btn {
  display: block;
  text-align: center;
  padding: 11px;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.nav-btn.ghost { background: #fff; color: var(--green-dark); border: 1px solid var(--green); }

.footer {
  padding: 26px 18px 8px;
  text-align: center;
  color: #9aa594;
  font-size: 10px;
  line-height: 1.6;
}

.footer p { margin: 3px 0; }

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 100%);
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 7px 6px calc(7px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}

.nav-item {
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  padding: 4px 0;
}

.nav-item .icon { width: 21px; height: 21px; }
.nav-item.active { color: var(--green); font-weight: 600; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 94px;
  transform: translate(-50%, 10px);
  z-index: 50;
  background: rgba(31, 42, 28, .93);
  color: #fff;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  white-space: nowrap;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

.hidden { display: none !important; }

@media (max-width: 360px) {
  .hero h1 { font-size: 19px; }
  .hero h1 span { font-size: 13px; }
  .quick-item { padding: 11px 3px 9px; }
  .quick-name { font-size: 12px; }
  .form-row.two-col { grid-template-columns: 1fr; }
  .status-badge { display: none; }
}

@media (min-width: 520px) {
  .phone-shell { margin: 18px auto; border-radius: 24px; min-height: calc(100vh - 36px); }
  .hero { border-radius: 0 0 24px 24px; }
  .bottom-nav { bottom: 18px; border-radius: 0 0 24px 24px; }
}
