/* ============================================================
   碧江美食地图 - 手机版样式 v2（首页列表 + 详情页内嵌地图）
   主题色：朱砂红 #c8102e  / 暖橙 #f59e0b
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: #f5f1ea;
  color: #2b2622;
  overflow: hidden;
}

/* ---------- 顶部品牌栏 ---------- */
#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px 10px;
  background: linear-gradient(135deg, #a80d26 0%, #c8102e 60%, #e0552a 100%);
  box-shadow: 0 2px 10px rgba(160,20,30,.3);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { font-size: 26px; }
.brand-text h1 { font-size: 18px; font-weight: 700; letter-spacing: 2px; }
.brand-text p { font-size: 11px; opacity: .92; margin-top: 2px; letter-spacing: 1px; }
.top-btn {
  background: rgba(255,255,255,.2);
  border: 1px solid rgba(255,255,255,.4);
  color: #fff;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
}

/* ============ 首页列表 ============ */
#home {
  position: fixed;
  inset: 0;
  padding-top: calc(env(safe-area-inset-top, 0px) + 64px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #f5f1ea;
}
.home-hero {
  padding: 16px 16px 6px;
}
.hero-title {
  font-size: 19px;
  font-weight: 800;
  color: #2b2622;
  letter-spacing: 1px;
}
.hero-sub {
  font-size: 12px;
  color: #9a8c82;
  margin-top: 4px;
}
.home-footer {
  text-align: center;
  font-size: 11px;
  color: #b5a89c;
  padding: 18px 0 10px;
  letter-spacing: 1px;
}

/* 商家卡片（单列大卡片） */
.place-grid {
  padding: 8px 16px 0;
}
.place-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 14px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(60,30,15,.08);
  transition: transform .15s;
}
.place-card:active { transform: scale(.985); }
.place-card .thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #3a2a22;
}
.place-card .thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.place-card .thumb .num-badge {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 2;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.place-card .thumb .play-btn {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: rgba(200,16,46,.88);
  border: 2.5px solid rgba(255,255,255,.9);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}
.place-card .thumb .dur {
  position: absolute;
  right: 10px; bottom: 8px;
  z-index: 2;
  background: rgba(0,0,0,.6);
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 8px;
}
.place-card .info { padding: 12px 14px 14px; }
.place-card .info h3 {
  font-size: 17px;
  font-weight: 700;
  color: #2b2622;
  display: flex; align-items: center; justify-content: space-between;
}
.place-card .info h3 .go {
  font-size: 12px;
  color: #c8102e;
  font-weight: 500;
}
.place-card .area {
  font-size: 11px;
  color: #a08d80;
  margin-top: 3px;
}
.place-card .tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 9px;
}
.place-card .tags span {
  background: #fdeeea;
  color: #c8102e;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 12px;
  border: 1px solid #f6cdc2;
}

/* ============ 面板（详情 / 全屏地图） ============ */
.panel {
  position: fixed;
  inset: 0;
  z-index: 700;
  background: #fdfbf7;
  display: flex;
  flex-direction: column;
  animation: slideUp .28s cubic-bezier(.22,.9,.3,1);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.panel.hidden { display: none; }
.close-btn {
  width: 32px; height: 32px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,.22);
  color: #fff; font-size: 15px;
  cursor: pointer;
  flex: 0 0 auto;
}

/* 详情面板 */
.detail-topbar {
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 8px;
  background: #c8102e;
  color: #fff;
}
.detail-tag { font-size: 13px; opacity: .95; letter-spacing: 1px; }
.detail-scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}
#placeVideo {
  width: 100%; height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

.detail-body { padding: 18px 18px calc(env(safe-area-inset-bottom, 0px) + 30px); }
.detail-body h2 { font-size: 22px; color: #2b2622; letter-spacing: 1px; }
.detail-loc { font-size: 12px; color: #a08d80; margin-top: 4px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 14px; }
.tag-row span {
  background: #fdeeea;
  color: #c8102e;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 16px;
  border: 1px solid #f6cdc2;
}
.detail-desc {
  font-size: 14px;
  line-height: 1.85;
  color: #4a423c;
  text-align: justify;
}

/* 内嵌地图卡片 */
.map-card {
  margin-top: 18px;
  border: 1px solid #eadfd2;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.map-card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #4a423c;
  background: #faf6f0;
}
.map-card-head .map-tip {
  font-size: 11px;
  font-weight: 400;
  color: #b0a094;
}
.detail-map {
  height: 220px;
  background: #e8e2d6;
  cursor: pointer;
}
.leaflet-container { font-family: inherit; }

/* 地图标记 */
.food-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.food-marker .dot {
  width: 32px; height: 32px;
  background: radial-gradient(circle at 35% 30%, #ff6b4a, #c8102e 60%, #8f0a20);
  border: 2.5px solid #fff;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(160,20,30,.5);
}
.food-marker .dot span {
  transform: rotate(45deg);
  color: #fff; font-size: 12px; font-weight: 700;
}
.food-marker .label {
  margin-top: 4px;
  background: rgba(43,20,16,.85);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}

.detail-actions { margin-top: 16px; }
.action-btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #c8102e, #e0552a);
  color: #fff;
  font-size: 15px;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(200,16,46,.35);
}
.action-btn:active { transform: scale(.98); }

/* ============ 评论区 ============ */
.comment-section {
  margin-top: 22px;
  border-top: 1px solid #f0e6da;
  padding-top: 14px;
}
.comment-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 700; color: #2b2622;
  margin-bottom: 12px;
}
.comment-head b { color: #c8102e; font-size: 13px; }
.login-state {
  font-size: 11px; font-weight: 400;
  color: #b0a094;
  background: #f6efe6;
  padding: 3px 10px;
  border-radius: 12px;
  cursor: pointer;
}
.login-state.logged-in { color: #c8102e; background: #fdeeea; }

.comment-list { min-height: 40px; }
.comment-item {
  display: flex; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f6f0e7;
}
.comment-item .c-avatar {
  flex: 0 0 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c8102e, #f59e0b);
  color: #fff;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.comment-item .c-body { flex: 1; min-width: 0; }
.comment-item .c-head {
  display: flex; align-items: center; gap: 8px;
}
.comment-item .c-nick { font-size: 13px; font-weight: 600; color: #3d3530; }
.comment-item .c-time { font-size: 10px; color: #b5a89c; }
.comment-item .c-content {
  font-size: 13px;
  line-height: 1.6;
  color: #4a423c;
  margin-top: 4px;
  word-break: break-all;
}
.comment-empty {
  text-align: center;
  color: #b5a89c;
  font-size: 12px;
  padding: 18px 0;
}

.comment-input-bar {
  display: flex; gap: 10px;
  margin-top: 14px;
}
.comment-input-bar input {
  flex: 1;
  border: 1px solid #e5d9ca;
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 13px;
  background: #fff;
  outline: none;
  color: #2b2622;
}
.comment-input-bar input:focus { border-color: #c8102e; }
.comment-input-bar button {
  flex: 0 0 auto;
  border: none;
  border-radius: 20px;
  padding: 0 20px;
  background: linear-gradient(135deg, #c8102e, #e0552a);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}
.comment-input-bar button:active { transform: scale(.96); }

/* ============ 登录/注册面板 ============ */
.panel-login { z-index: 900; }
.login-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 12px;
  background: #c8102e;
  color: #fff;
}
.login-title { font-size: 16px; font-weight: 700; letter-spacing: 2px; }
.login-body {
  flex: 1;
  padding: 24px 24px calc(env(safe-area-inset-bottom, 0px) + 30px);
  overflow-y: auto;
}
.login-logo {
  text-align: center;
  font-size: 44px;
  margin-bottom: 18px;
}
.login-tabs {
  display: flex;
  background: #f6efe6;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 20px;
}
.login-tabs .tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  font-size: 14px;
  border-radius: 9px;
  color: #8a7a6e;
  cursor: pointer;
}
.login-tabs .tab.active {
  background: #fff;
  color: #c8102e;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.login-form input {
  width: 100%;
  border: 1px solid #e5d9ca;
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 14px;
  margin-bottom: 12px;
  background: #fff;
  outline: none;
  color: #2b2622;
}
.login-form input:focus { border-color: #c8102e; }
.login-form .nick-wrap { margin-bottom: 0; }
.login-msg {
  font-size: 12px;
  color: #c8102e;
  min-height: 16px;
  margin-bottom: 8px;
}
.login-hint {
  text-align: center;
  font-size: 11px;
  color: #b5a89c;
  margin-top: 14px;
}
.hidden { display: none !important; }

/* 全屏地图面板 */
.panel-map { z-index: 800; }
.map-topbar {
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 14px 10px;
  background: #c8102e;
  color: #fff;
}
.map-title { font-size: 15px; font-weight: 600; letter-spacing: 1px; }
.full-map {
  flex: 1;
  background: #e8e2d6;
  min-height: 0;
}
.map-footer {
  padding: 12px 16px calc(env(safe-area-inset-bottom, 0px) + 14px);
  font-size: 12px;
  color: #8a7a6e;
  background: #fdfbf7;
  border-top: 1px solid #f0e6da;
  text-align: center;
}

/* ============ 桌面端适配 ============ */
@media (min-width: 768px) {
  #topbar { max-width: 560px; left: 50%; transform: translateX(-50%); right: auto; width: 100%; }
  #home { max-width: 560px; left: 50%; transform: translateX(-50%); right: auto; }
  .panel { left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px; animation: slideUpM .28s cubic-bezier(.22,.9,.3,1); }
  @keyframes slideUpM {
    from { transform: translate(-50%, 100%); }
    to { transform: translate(-50%, 0); }
  }
}
