/* ========== 基础变量 ========== */
:root {
  --bg: #f5ecda;
  --bg-2: #f9f1e0;
  --card: #ffffff;
  --ink: #3a2a18;
  --ink-2: #7a6a55;
  --ink-3: #a89881;
  --brand: #6b4a2b;
  --brand-2: #8a6644;
  --accent: #b58a55;
  --line: #ece2cf;
  --shadow: 0 4px 18px rgba(120, 90, 50, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; }
img { max-width: 100%; display: block; }
.page { max-width: 720px; margin: 0 auto; padding: 0 18px 80px; }

/* ========== 顶部通栏 ========== */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--bg-2);
  border-bottom: 1px solid rgba(120, 90, 50, 0.06);
  padding: 14px 0 12px;
}
.topbar-inner {
  max-width: 720px; margin: 0 auto; padding: 0 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: baseline; gap: 6px; }
.brand-icon { font-size: 20px; }
.brand-text { font-size: 20px; font-weight: 700; letter-spacing: 0.5px; color: var(--ink); }
.brand-sub { font-size: 13px; color: var(--ink-2); margin-left: 2px; }

/* 右上角微信号按钮 */
.btn-book {
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(107, 74, 43, 0.25);
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn-book:hover { background: var(--brand-2); transform: translateY(-1px); }
.btn-book:active { transform: scale(0.96); }

/* ========== Hero ========== */
.hero { text-align: center; padding: 36px 8px 12px; }
.hero-logo {
  width: 96px; height: 96px; margin: 0 auto 18px;
  background: linear-gradient(135deg, #c79a6a 0%, #a8784d 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px rgba(168, 120, 77, 0.25);
}
.hero-icon { width: 56px; height: 56px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.hero-title { font-size: 30px; font-weight: 700; margin: 0 0 6px; letter-spacing: 1px; }
.hero-sub { font-size: 14px; color: var(--ink-2); margin: 0; }
.hero-sub .dot { margin: 0 6px; opacity: 0.6; }

/* ========== Section ========== */
.section { margin-top: 22px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 4px 10px;
}
.section-title { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: 0.5px; }
.section-more { font-size: 13px; color: var(--ink-2); }

/* ========== 置顶卡片 ========== */
.pinned { margin-bottom: 16px; animation: pinnedIn 0.35s cubic-bezier(0.22,1,0.36,1); }
@keyframes pinnedIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pinned-card {
  width: 100%; background: #fff; border-radius: var(--radius);
  padding: 28px 16px 22px; display: flex; flex-direction: column;
  align-items: center; gap: 10px; box-shadow: var(--shadow);
  border: 1px solid var(--line); text-align: center;
  transition: transform 0.2s ease;
}
.pinned-card:active { transform: scale(0.98); }
.pinned-emoji { font-size: 70px; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.08)); }
.pinned-name { font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: 1px; }

/* 二级菜单 */
.submenu {
  margin-top: 14px; display: flex; gap: 10px; padding: 4px;
  background: rgba(255,255,255,0.6); border-radius: 14px;
  border: 1px solid var(--line);
}
.tab {
  flex: 1; padding: 10px 14px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: all 0.2s ease;
}
.tab .tab-icon { font-size: 16px; }
.tab.tab-active {
  background: var(--brand); color: #fff;
  box-shadow: 0 3px 10px rgba(107,74,43,0.25);
}
.subpane { margin-top: 14px; animation: fadeUp 0.3s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.route-summary {
  background: #fff; border-radius: 14px; padding: 14px 16px;
  border: 1px solid var(--line); margin-bottom: 12px;
  font-size: 14px; color: var(--ink); line-height: 1.7;
  box-shadow: var(--shadow);
}
.route-summary .label {
  font-size: 12px; color: var(--brand); font-weight: 700;
  margin-bottom: 6px; letter-spacing: 1px;
}

.point {
  background: #fff; border-radius: 14px; padding: 12px;
  margin-bottom: 12px; border: 1px solid var(--line);
  display: flex; gap: 12px; box-shadow: var(--shadow);
}
.point:has(.carousel) {
  flex-direction: column;
}
.point-img {
  flex: 0 0 88px; height: 88px; border-radius: 10px;
  background: var(--bg-2) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; border: 1px solid var(--line); overflow: hidden;
}
.point:has(.carousel) .point-img {
  flex: none; width: 100%; height: auto;
  border: 0; background: none;
}
.point-name { font-size: 15px; font-weight: 700; margin: 2px 0 6px; color: var(--ink); }
.point-desc { font-size: 13px; color: var(--ink-2); line-height: 1.65; word-break: break-word; }
.empty-tip {
  background: #fff; border: 1px dashed var(--line); border-radius: 14px;
  padding: 20px 14px; text-align: center; font-size: 13px; color: var(--ink-3);
}

/* ========== 宫格 ========== */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.s-card {
  position: relative; background: #fff; border-radius: var(--radius);
  padding: 28px 12px 20px; text-align: center;
  border: 1px solid var(--line); box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), box-shadow 0.25s ease, opacity 0.35s ease;
  animation: cardIn 0.4s ease both;
  overflow: hidden;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.s-card:active { transform: scale(0.97); }
.s-card .s-emoji {
  font-size: 50px; line-height: 1; display: block; margin: 6px 0 14px;
  filter: drop-shadow(0 3px 5px rgba(0,0,0,0.06));
  transition: transform 0.3s ease;
}
.s-card .s-name { font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: 0.5px; }
.s-card.is-hidden { opacity: 0; transform: scale(0.85); pointer-events: none; }

/* ========== 推荐路线 ========== */
.route-list { display: flex; flex-direction: column; gap: 12px; }
.route-card {
  display: flex; background: #fff; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.route-thumb {
  flex: 0 0 110px; height: 110px;
  background: var(--bg-2) center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; font-size: 40px;
}
.route-thumb img { width: 100%; height: 100%; object-fit: cover; }
.route-body { flex: 1; min-width: 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.route-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.route-summary-text {
  font-size: 13px; color: var(--ink-2); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.route-tags { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 11px; background: var(--bg-2); color: var(--brand);
  padding: 3px 8px; border-radius: 999px; font-weight: 600;
  border: 1px solid var(--line);
}

/* ========== 路线展开面板 ========== */
.route-card.has-detail {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.route-card.has-detail:hover { box-shadow: 0 6px 22px rgba(120,90,50,0.14); }
.route-card.has-detail:active { transform: scale(0.98); }
.route-card.is-expanded {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(107,74,43,0.15);
}
.route-arrow {
  font-size: 18px; color: var(--ink-3); margin-left: 6px;
  transition: transform 0.3s ease;
}
.route-card.is-expanded .route-arrow { transform: rotate(90deg); }

.route-detail,
.route-detail-inline {
  margin-top: 12px; animation: fadeUp 0.3s ease;
}
.route-detail[hidden] { display: none; }
.route-day {
  background: #fff; border-radius: 14px; padding: 14px 16px;
  margin-bottom: 10px; border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.route-day-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.route-day-num {
  background: var(--brand); color: #fff;
  font-size: 12px; font-weight: 700; padding: 3px 10px;
  border-radius: 999px; white-space: nowrap;
}
.route-day-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.route-day-items {
  margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2);
  line-height: 1.8;
}
.route-day-items li { margin-bottom: 2px; }
.route-day-items li::marker { color: var(--accent); }

/* ========== 宫格引导提示 ========== */
.grid-hint {
  text-align: center; font-size: 13px; color: var(--ink-3);
  padding: 0 0 12px; letter-spacing: 1px;
}

/* ========== 底部 ========== */
.footer { margin-top: 32px; text-align: center; color: var(--ink-3); font-size: 12px; }
.footer p { margin: 4px 0; }

/* ========== 管理入口 ========== */
.fab-admin {
  position: fixed; right: 16px;
  bottom: max(20px, env(safe-area-inset-bottom));
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, #c79a6a, #a8784d);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 24px; box-shadow: 0 6px 16px rgba(168,120,77,0.35);
  z-index: 50; transition: transform 0.2s ease;
}
.fab-admin:active { transform: scale(0.95); }

/* ========== Toast ========== */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(58,42,24,0.92); color: #fff;
  padding: 10px 18px; border-radius: 999px;
  font-size: 13px; z-index: 200; pointer-events: none;
  opacity: 0; transition: opacity 0.2s ease;
}
.toast.show { opacity: 1; }

/* ========== 横向滑动图集 ========== */
.img-gallery {
  display: flex; gap: 8px; overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.img-gallery::-webkit-scrollbar { display: none; }
.gallery-slide {
  flex: 0 0 auto; width: 160px; height: 110px;
  border-radius: 8px; overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.2s ease;
}
.gallery-slide:active { transform: scale(0.96); }
.gallery-slide img {
  width: 100%; height: 100%; object-fit: cover;
}

/* 有多图时 point-img 改为全宽 */
.point:has(.img-gallery) .point-img {
  flex: 0 0 100%; height: auto;
  border: 0; background: none;
}

/* ========== 轮播图 ========== */
.carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  cursor: pointer;
}
.carousel-track {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.carousel-slide {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  transition: transform 0.35s ease;
}
.carousel-slide img {
  width: 100%; height: 100%; object-fit: cover;
  -webkit-user-drag: none;
  opacity: 0; transition: opacity 0.4s ease;
}
.carousel-slide img.loaded { opacity: 1; }
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.85); color: var(--ink);
  font-size: 22px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: none; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer; z-index: 2;
  transition: background 0.2s, transform 0.15s;
}
.carousel-arrow:hover { background: #fff; }
.carousel-arrow:active { transform: translateY(-50%) scale(0.93); }
.carousel-arrow.prev { left: 8px; padding-right: 2px; }
.carousel-arrow.next { right: 8px; padding-left: 2px; }
.carousel-dots {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 2;
}
.carousel-dots .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.6); cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.carousel-dots .dot.active {
  background: #fff; transform: scale(1.3);
}

/* ========== 外部链接按钮 ========== */
.food-link {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 14px; padding: 14px 16px;
  margin-bottom: 12px; border: 1px solid var(--brand);
  box-shadow: var(--shadow); text-decoration: none;
  color: var(--brand); font-size: 15px; font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.food-link:active { transform: scale(0.98); }
.food-link-icon { font-size: 18px; }
.food-link-arrow { margin-left: auto; font-size: 20px; opacity: 0.5; }

/* ========== 图片点击放大 ========== */
.point-img { cursor: pointer; }
.food-banner {
  border-radius: 14px; overflow: hidden; margin-bottom: 12px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.food-banner img {
  width: 100%; display: block; border-radius: 14px;
}
.point-img:active img { transform: scale(0.97); }

.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.88);
  backdrop-filter: blur(4px);
}
.lightbox img {
  position: relative; z-index: 1;
  max-width: 94vw; max-height: 86vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  animation: lightboxIn 0.25s ease;
}
@keyframes lightboxIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
.lightbox-close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: #fff;
  font-size: 20px; border: 1px solid rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background 0.2s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }

/* lightbox 左右箭头 */
.lightbox-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.25); color: #fff;
  font-size: 28px; font-weight: 300;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.35);
  cursor: pointer; z-index: 3;
  transition: background 0.2s, transform 0.15s;
  user-select: none;
}
.lightbox-arrow:hover { background: rgba(255,255,255,0.4); }
.lightbox-arrow:active { transform: translateY(-50%) scale(0.93); }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }

/* lightbox 计数器 */
.lightbox-counter {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,0.75); font-size: 13px; z-index: 3;
  background: rgba(0,0,0,0.35); padding: 4px 12px; border-radius: 999px;
  letter-spacing: 1px;
}

/* ========== 响应式 ========== */
@media (min-width: 720px) {
  .page { padding: 0 32px 100px; }
  .grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .s-card { padding: 36px 12px 24px; }
  .s-card .s-emoji { font-size: 56px; }
  .route-list { display: grid; grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .page { max-width: 960px; }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .route-list { grid-template-columns: repeat(3, 1fr); }
}
