.map-shell { display: flex; height: calc(100vh - 154px); min-height: 520px; position: relative; }

.panel {
  width: 286px; flex: 0 0 286px; background: #fbf8f1; border-right: 1px solid var(--line);
  overflow-y: auto; padding: 18px 16px 28px; z-index: 500;
}
.panel-toggle { display: none; }
.panel h2 { font-family: var(--serif); font-size: 20px; margin: 0 0 4px; letter-spacing: 1px; }
.panel .sub { color: var(--ink-soft); font-size: 12.5px; margin: 0 0 16px; }
.panel h3 { font-size: 13px; letter-spacing: 1px; color: var(--red); margin: 20px 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.search-box { display: flex; gap: 6px; }
.search-box input { flex: 1; min-width: 0; border: 1px solid var(--line); background: #fff; padding: 9px 10px; border-radius: 6px; font-size: 13px; }
.search-box button { border: 0; background: var(--ink); color: #fff; border-radius: 6px; padding: 0 12px; cursor: pointer; }
#searchResults { margin-top: 6px; border: 1px solid var(--line); background: #fff; border-radius: 6px; max-height: 260px; overflow-y: auto; display: none; }
#searchResults .item { padding: 8px 10px; border-bottom: 1px solid #eee8dc; cursor: pointer; font-size: 13px; }
#searchResults .item:last-child { border-bottom: 0; }
#searchResults .item:hover, #searchResults .item.active { background: #f3ead8; }
#searchResults em { color: var(--red); font-style: normal; font-weight: 700; }

.filter-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 16px; padding: 5px 11px; font-size: 12.5px; cursor: pointer; }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.season-chip.active { background: var(--red); border-color: var(--red); }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin: 6px 0; cursor: pointer; }
.legend-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #c9bda6, 0 1px 3px rgba(0,0,0,.2); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-family: var(--serif); font-weight: 900; font-size: 12px; line-height: 1; flex: 0 0 20px; }
.legend-item .count { margin-left: auto; color: var(--ink-soft); }
.base-list { display: flex; gap: 6px; }
.base-list button { flex: 1; font-size: 12px; padding: 6px 4px; border: 1px solid var(--line); background: #fff; border-radius: 5px; cursor: pointer; }
.base-list button.active { border-color: var(--teal); color: var(--teal); font-weight: 700; }
.count-line { font-size: 12px; color: var(--ink-soft); margin-top: 12px; }
.panel-note { font-size: 11.5px; color: #8a7f70; margin-top: 16px; line-height: 1.7; }
.grid-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; cursor: pointer; padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.grid-toggle input { accent-color: var(--red); margin: 0; }
#gridAll { font-weight: 700; }
.grid-sub { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.grid-note { font-size: 11px; color: #8a7f70; line-height: 1.6; margin-top: 8px; }
.g-line { display: inline-block; width: 20px; height: 0; border-top-width: 2px; border-top-style: solid; }
.g-meridian { border-color: #4c4c4c; border-top-width: 1px; }
.g-ring { border-color: #d7a326; }
.g-key { border-color: #c8102e; border-top-width: 3px; }
.g-triangle { border-color: #c99a3e; border-top-style: dashed; }

.map-wrap { flex: 1; min-width: 0; position: relative; background: #e9e3d6; }
#map { width: 100%; height: 100%; }
.map-title { position: absolute; left: 56px; top: 14px; z-index: 600; background: rgba(255,253,248,.94); border: 1px solid var(--line); border-radius: 8px; padding: 9px 14px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.map-title b { font-family: var(--serif); font-size: 17px; }
.map-title span { display: block; font-size: 11.5px; color: var(--ink-soft); }
.tile-warn { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 650; background: #fff4e2; border: 1px solid #e0bd80; color: #7a4a13; font-size: 12.5px; padding: 8px 14px; border-radius: 6px; display: none; }

.leaflet-popup-content-wrapper { border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.16); }
.leaflet-popup-content { margin: 12px 14px; width: 268px !important; }
.pop-img { width: 100%; height: 112px; object-fit: cover; border-radius: 6px; display: block; }
.pop-ph { width: 100%; height: 112px; border-radius: 6px; background: #efe6d5; color: #8c6b3d; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 30px; }
.pop-title { font-family: var(--serif); font-size: 18px; font-weight: 900; margin: 8px 0 2px; }
.pop-meta { font-size: 12px; color: var(--ink-soft); }
.pop-desc { font-size: 12.5px; color: #4c443b; margin: 6px 0; line-height: 1.6; }
.pop-tag { display: inline-block; font-size: 11px; background: #f0e6d3; color: #7a5b2c; padding: 2px 7px; border-radius: 10px; margin-right: 6px; }
.pop-btn { display: inline-block; margin-top: 8px; background: var(--red); color: #fff !important; text-decoration: none; font-size: 12.5px; padding: 6px 14px; border-radius: 5px; cursor: pointer; }
.sj-div-icon { background: none; border: 0; }
.sj-marker { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 6px rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; color: #fff; font-family: var(--serif); font-weight: 900; font-size: 13px; line-height: 1; }
.sj-label { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; color: #26211c; font-family: var(--serif); font-weight: 900; font-size: 12.5px; white-space: nowrap; -webkit-text-stroke: 2px #fff; paint-order: stroke fill; text-shadow: 0 1px 2px rgba(0,0,0,.2); }
.leaflet-tooltip.sj-label::before { display: none; }

.drawer-scrim { position: fixed; inset: 0; background: rgba(20,18,15,.35); z-index: 1500; display: none; }
.drawer-scrim.open { display: block; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 398px; max-width: 100vw; background: #fbf8f1; z-index: 1600; transform: translateX(102%); transition: transform .25s ease; box-shadow: -8px 0 28px rgba(0,0,0,.18); overflow-y: auto; }
.drawer.open { transform: translateX(0); }
.drawer-head { background: var(--ink); color: #f4ead6; padding: 18px 20px; position: sticky; top: 0; z-index: 2; }
.drawer-head h3 { font-family: var(--serif); font-size: 20px; margin: 0 0 2px; font-weight: 900; }
.drawer-head p { font-size: 12px; color: #c8bda9; margin: 0; }
.drawer-close { position: absolute; right: 14px; top: 14px; background: none; border: 1px solid #7a7165; color: #fff; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; }
.drawer-body { padding: 18px 20px 40px; }
.drawer-body h4 { font-size: 13px; color: var(--red); border-bottom: 1px solid var(--line); padding-bottom: 6px; margin: 22px 0 10px; letter-spacing: 1px; }
.drawer-body h4:first-child { margin-top: 0; }
.drawer-body p { font-size: 13px; color: #443d34; margin: 6px 0; }
.meta-grid { display: grid; grid-template-columns: 70px 1fr; gap: 4px 8px; font-size: 12.5px; }
.meta-grid dt { color: var(--ink-soft); }
.meta-grid dd { margin: 0; }
.player-box { position: relative; width: 100%; padding-top: 56.25%; background: #1b1b1b; border-radius: 6px; overflow: hidden; }
.player-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-tools { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.player-tools a, .player-tools button { font-size: 12px; padding: 5px 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 5px; text-decoration: none; cursor: pointer; }
.player-tools a, .player-tools-a { font-size: 12px; padding: 5px 0; }
.float-player { position: fixed; z-index: 1800; display: flex; flex-direction: column; background: #1b1b1b; border: 1px solid #3a3a3a; border-radius: 8px; box-shadow: 0 16px 48px rgba(0,0,0,.55); overflow: hidden; }
.fp-bar { display: flex; align-items: center; justify-content: space-between; height: 40px; flex: 0 0 40px; padding: 0 12px; background: #2b2b2b; color: #f3ead8; cursor: move; user-select: none; font-family: var(--serif); font-size: 14px; font-weight: 700; }
.fp-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fp-close { background: none; border: 0; color: #f3ead8; font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }
.fp-close:hover { color: #e57368; }
.fp-stage { flex: 1 1 auto; min-height: 0; }
.fp-stage iframe { width: 100%; height: 100%; border: 0; display: block; }
.fp-resize { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; background: linear-gradient(135deg, transparent 50%, #b08a3e 50%, #b08a3e 65%, transparent 65%, transparent 78%, #b08a3e 78%); }
@media (max-width: 700px) { .float-player { left: 8px !important; top: 56px !important; width: calc(100vw - 16px) !important; height: calc(100vh - 72px) !important; } }
.player-fallback { padding: 16px; background: #f0e8d9; border: 1px dashed var(--gold); border-radius: 6px; font-size: 12.5px; }
.alt-list { font-size: 12px; margin-top: 8px; line-height: 2; color: #6d6358; }
.alt-list a { display: inline-block; margin: 0 8px 4px 0; padding: 4px 9px; border: 1px solid var(--gold); border-radius: 5px; color: #7a5b2c; text-decoration: none; background: #fffdf7; }
.alt-list a:hover { background: var(--gold); color: #fff; }
.rights-note { margin-top: 24px; padding: 12px 14px; border-top: 1px solid var(--line); background: #f2ecdf; color: #6d6358; font-size: 11.5px; line-height: 1.8; border-radius: 6px; }
.leaflet-control-attribution { background: rgba(255,255,255,.86) !important; padding: 2px 8px !important; border-radius: 4px 0 0 0; font-size: 11px; }
.leaflet-control-attribution a { color: var(--red) !important; font-weight: 700; text-decoration: none; }

/* 地图站页脚：仅 LOGO 与一句话 */
.site-foot.map-foot { background: var(--foot-widget); min-height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px clamp(18px, 4vw, 54px); }
.map-foot-brand { display: block; flex: 0 0 auto; }
.map-foot-brand img { display: block; height: 36px; width: auto; max-width: 240px; }
.map-foot-line { margin: 0; color: #9b9b9b; font-size: 12.5px; text-align: right; max-width: 520px; line-height: 1.6; }
@media (max-width: 900px) {
  .site-foot.map-foot { min-height: 64px; gap: 12px; padding: 10px 18px; }
  .map-foot-brand img { height: 28px; max-width: 170px; }
  .map-foot-line { font-size: 11px; }
}
@media (max-width: 900px) {
  .map-shell { height: calc(100vh - 128px); flex-direction: column; }
  .panel { width: 100%; flex: 0 0 auto; max-height: 35vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .map-wrap { min-height: 50vh; }
  .map-title { left: 52px; top: 8px; padding: 6px 10px; }
  .leaflet-top.leaflet-left { top: 52px; }
  .map-title b { font-size: 14px; }
  .tile-warn { top: 62px; width: calc(100% - 32px); }
  .drawer { width: 100%; top: auto; height: 84vh; border-radius: 14px 14px 0 0; transform: translateY(102%); }
  .drawer.open { transform: translateY(0); }
}
/* 手机端：筛选面板默认收起为一条工具条，地图优先占满屏幕 */
@media (max-width: 700px) {
  .map-shell {
    height: calc(100vh - 110px);
    height: calc(100dvh - 110px);
    min-height: 0;
  }
  .panel {
    position: absolute; inset: 0 0 auto; width: 100%;
    max-height: 42px; padding: 0; overflow: hidden;
    border-right: 0; border-bottom: 1px solid var(--line);
    z-index: 1100; transition: max-height .22s ease;
  }
  .panel.open {
    max-height: 70vh;
    max-height: min(70dvh, 560px);
    overflow-y: auto;
    box-shadow: 0 10px 28px rgba(0,0,0,.2);
  }
  .panel-toggle {
    display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 2;
    width: 100%; height: 42px; padding: 0 14px;
    border: 0; background: var(--ink); color: #f4ead6;
    font-family: var(--serif); font-size: 15px; font-weight: 900;
    letter-spacing: 1px; cursor: pointer;
  }
  .panel.open .panel-toggle { background: var(--red); }
  .panel-toggle .pt-title small {
    font-family: var(--sans); font-size: 11px; font-weight: 400;
    color: #c8bda9; letter-spacing: 0; margin-left: 6px;
  }
  .panel-toggle .pt-action {
    font-family: var(--sans); font-size: 12px; font-weight: 400;
    letter-spacing: 0; color: var(--gold);
  }
  .panel-content { padding: 12px 14px 26px; }
  .panel-content h2 { display: none; }
  .panel-content .sub { margin-top: 0; }
  .map-wrap { min-height: 0; }
  .map-title { display: none; }
  .leaflet-top.leaflet-left { top: 50px; }
  .tile-warn { top: 50px; }
  .site-foot.map-foot { min-height: 46px; padding: 6px 14px; }
  .map-foot-brand img { height: 22px; max-width: 140px; }
  .map-foot-line { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .drawer { transition: none; }
}
