/* ============================================
   枫桥镇手绘地图 · 游客端响应式样式
   方案C：PC(>=1024) 左栏+右图 / H5(<1024) 全屏图+底部抽屉
   设计语言：青绿山水 + 现代工具 UI（参考"好吃熊猫"成都地图）
   圆角体系：容器 16 / 卡片 12 / 输入 12 / 按钮&chip pill
   所有样式挂 .map-app 根类，防止污染其它页面
   ============================================ */

.map-app * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.map-app {
    --panel-w: 400px;
    --brand: #2f8f7a;          /* 主色：黛青（青绿山水） */
    --brand-deep: #1f6f5e;     /* 主色深档（hover/active） */
    --brand-soft: #e6f2ed;     /* 主色浅底 */
    --paper: #fbf8f1;          /* 面板纸感 */
    --ink: #33302f;           /* 主文字：墨色 */
    --ink-soft: #8a7f6a;       /* 次要文字 */
    --line: rgba(120, 100, 60, .14);
    --eat: #d9823f;            /* 吃：柿子橙(低饱和) */
    --hotel: #7a6db0;          /* 住：黛紫 */
    --hospital: #c85a66;       /* 医：朱红 */
    --scenic: #4c9a72;         /* 游：松绿 */
    --shadow: 0 8px 24px rgba(47, 90, 74, .10);
    --shadow-sm: 0 2px 8px rgba(47, 90, 74, .08);
    --radius: 12px;
    --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    position: fixed; inset: 0; overflow: hidden;
    font-family: var(--font);
    background: #f4efe4;
    color: #3a3226;
}

/* ---------- 顶部品牌条（H5 显示） ---------- */
.map-app .map-topbar {
    display: none;
    position: absolute; top: 0; left: 0; right: 0; z-index: 900;
    height: 52px; padding: 0 14px;
    align-items: center; justify-content: center;
    background: rgba(251, 248, 241, .94);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 12px rgba(60, 40, 10, .05);
}
.map-app .topbar-logo {
    flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px;
    background: linear-gradient(135deg, var(--brand), var(--brand-deep));
    color: #fff; font-size: 15px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
    margin-right: 8px; box-shadow: var(--shadow-sm);
}
.map-app .map-topbar #topbarTitle { font-weight: 800; font-size: 16px; letter-spacing: 2px; color: var(--ink); }
.map-app .map-topbar .map-total { margin-left: 8px; font-size: 12px; font-weight: 500; color: var(--brand); }

/* ---------- 全局地图容器 ---------- */
.map-app #map { position: absolute; inset: 0; z-index: 100; background: #f0ead9; }
.map-app .ol-viewport { font-family: var(--font); }

/* 地图右下角缩放控件（OpenLayers ol-zoom） */
.map-app .ol-zoom {
    position: absolute; top: auto; bottom: 18px; right: 12px; left: auto;
    background: none; padding: 0; border-radius: 10px; overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.map-app .ol-zoom button {
    display: block; width: 40px; height: 40px; line-height: 40px; margin: 0;
    border: 0; border-radius: 0; background: #fffdf7; color: #3a3226;
    font-family: var(--font); font-size: 20px; font-weight: 600;
    caret-color: transparent; cursor: pointer;
    transition: background .15s, color .15s;
}
.map-app .ol-zoom button + button { border-top: 1px solid var(--line); }
.map-app .ol-zoom button:hover { background: var(--brand-soft); color: var(--brand) !important; }

/* 三角形折叠按钮（地图左下角，H5 收起/展开列表；抽屉出现时隐藏） */
.map-app .map-toggle {
    position: absolute; left: 12px; bottom: 12px; z-index: 800;
    width: 44px; height: 44px; border-radius: 50%;
    border: 0; background: #fffdf7; color: var(--brand); font-size: 18px; font-weight: 800;
    box-shadow: var(--shadow); cursor: pointer;
    display: none;
    transition: transform .24s cubic-bezier(.16, 1, .3, 1), opacity .18s ease, background .15s;
}
.map-app .map-toggle:active { transform: scale(.94); }
.map-app .map-toggle.active { background: var(--brand); color: #fff; transform: rotate(180deg); }
.map-app .map-toggle.menu-open { transform: rotate(180deg) scale(0); opacity: 0; pointer-events: none; }

/* ---------- 点位 divIcon ---------- */
.map-app .spot-icon {
    position: relative;
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 15px; font-weight: 700;
    border: 2px solid #fff; box-shadow: 0 3px 10px rgba(47, 90, 74, .25);
    cursor: pointer; transform: translate(-50%, -50%);
    transition: transform .18s cubic-bezier(.16, 1, .3, 1);
}
.map-app .spot-icon:hover { transform: translate(-50%, -50%) scale(1.1); }
.map-app .spot-icon.eat      { background: var(--eat); }
.map-app .spot-icon.hotel    { background: var(--hotel); }
.map-app .spot-icon.hospital { background: var(--hospital); }
.map-app .spot-icon.scenic   { background: var(--scenic); }
.map-app .spot-icon .sicon { font-size: 17px; line-height: 1; }
.map-app .spot-icon.active { transform: translate(-50%, -50%) scale(1.35); box-shadow: 0 0 0 4px rgba(255, 255, 255, .65), 0 6px 16px rgba(0, 0, 0, .22); }

/* 点位名称标签（图标下方） */
.map-app .spot-icon::after {
    content: attr(data-name);
    position: absolute; top: calc(100% + 3px); left: 50%;
    transform: translateX(-50%);
    padding: 2px 8px; border-radius: 99px;
    background: rgba(255, 255, 255, .92);
    color: #3a3226; font-size: 11px; font-weight: 600;
    white-space: nowrap; line-height: 1.35;
    box-shadow: 0 1px 4px rgba(47, 90, 74, .18);
    pointer-events: none;
}
.map-app .spot-icon.active::after { font-weight: 700; background: #fff; }

/* 聚合/编号点 */
.map-app .spot-icon.cluster { background: #7d6b4f; font-size: 14px; transform: translate(-50%, -50%); }

/* ---------- popup 详情（OpenLayers Overlay） ---------- */
.map-app .ol-popup {
    position: absolute; min-width: 220px;
    border-radius: 14px; background: #fff; box-shadow: var(--shadow);
    transform: translate(-50%, calc(-100% - 18px));
    will-change: transform;
}
.map-app .ol-popup::after {
    content: ""; position: absolute; left: 50%; bottom: -8px;
    transform: translateX(-50%);
    border: 8px solid transparent; border-top-color: #fff; border-bottom: 0;
}
.map-app .ol-popup .popup-box { padding: 14px 16px; }
.map-app .popup-box { min-width: 220px; }
.map-app .popup-box .p-name { font-size: 16px; font-weight: 700; color: #3a3226; display: flex; align-items: center; gap: 6px; }
.map-app .popup-box .p-type { font-size: 11px; padding: 2px 9px; border-radius: 99px; color: #fff; }
.map-app .popup-box .p-type.eat { background: var(--eat); }
.map-app .popup-box .p-type.hotel { background: var(--hotel); }
.map-app .popup-box .p-type.hospital { background: var(--hospital); }
.map-app .popup-box .p-type.scenic { background: var(--scenic); }
.map-app .popup-box .p-addr { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.map-app .popup-box .p-go {
    margin-top: 10px; display: inline-flex; align-items: center; gap: 5px;
    padding: 7px 18px; border-radius: 99px;
    background: var(--brand); color: #fff; font-size: 13px; font-weight: 600;
    text-decoration: none; border: 0; cursor: pointer;
    transition: background .15s, transform .1s;
}
.map-app .popup-box .p-go:active { transform: scale(.96); }
.map-app .popup-box .p-go:hover { background: var(--brand-deep); }

/* ---------- PC 左侧信息栏 ---------- */
.map-app .map-panel {
    position: absolute; top: 0; left: 0; bottom: 0; z-index: 500;
    width: var(--panel-w);
    background: linear-gradient(180deg, #fdfaf3, var(--paper) 90px);
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column;
    box-shadow: 2px 0 20px rgba(47, 90, 74, .07);
    transform: translateX(0); transition: transform .32s cubic-bezier(.16, 1, .3, 1);
}
.map-app .map-panel.collapsed { transform: translateX(calc(-100% - 1px)); }

/* 面板头部：标题 + 青绿晕染 */
.map-app .panel-head {
    padding: 20px 20px 12px;
    display: flex; align-items: flex-start; justify-content: space-between;
    background:
        radial-gradient(120% 120% at 100% 0%, rgba(47, 143, 122, .10), transparent 55%),
        radial-gradient(90% 130% at 0% 110%, rgba(74, 154, 114, .08), transparent 60%);
}
.map-app .panel-head > div { position: relative; }
.map-app .panel-head h1 { font-size: 21px; margin: 0; font-weight: 800; letter-spacing: 2px; color: var(--ink); }
.map-app .panel-head .panel-sub { font-size: 12px; color: var(--ink-soft); margin-top: 4px; line-height: 1.5; max-width: 300px; }
.map-app .panel-close {
    flex: 0 0 auto; width: 30px; height: 30px; border: 0; border-radius: 50%; cursor: pointer;
    background: var(--brand-soft); color: var(--brand); font-size: 15px; line-height: 1;
    transition: background .15s;
}
.map-app .panel-close:hover { background: #d7e9e1; }

/* 分类 tabs（图标+文字 双编码） */
.map-app .panel-tabs { padding: 10px 20px 6px; display: flex; gap: 8px; flex-wrap: wrap; }
.map-app .tab {
    padding: 6px 15px; border-radius: 99px; font-size: 13px; cursor: pointer;
    background: rgba(255, 253, 247, .9); color: var(--ink-soft); border: 1px solid var(--line);
    user-select: none; display: flex; align-items: center; gap: 5px;
    transition: background .15s, color .15s, border-color .15s;
}
.map-app .tab:hover { border-color: rgba(47, 143, 122, .4); color: var(--brand); }
.map-app .tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.map-app .tab .t-ico { font-size: 14px; line-height: 1; }
.map-app .tab .t-num { font-size: 11px; opacity: .8; font-weight: 600; }

/* 排序栏 */
.map-app .panel-sort { padding: 8px 20px 4px; display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--ink-soft); }
.map-app .sort-btn { border: 0; background: none; color: var(--ink-soft); cursor: pointer; font-size: 12px; display: flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 8px; transition: color .15s, background .15s; }
.map-app .sort-btn:hover { background: var(--brand-soft); }
.map-app .sort-btn.active { color: var(--brand); font-weight: 600; }

/* 点位卡片列表 */
.map-app .panel-list { flex: 1; overflow-y: auto; padding: 8px 14px 14px; margin-top: 2px; }
.map-app .panel-list::-webkit-scrollbar { width: 5px; }
.map-app .panel-list::-webkit-scrollbar-thumb { background: #d8cbbb; border-radius: 99px; }
.map-app .map-card {
    position: relative; display: flex; gap: 12px; align-items: center;
    padding: 11px 12px; margin-bottom: 9px; border-radius: var(--radius);
    background: #fff; border: 1px solid var(--line);
    cursor: pointer;
    transition: box-shadow .16s, transform .14s, border-color .16s;
}
.map-app .map-card:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); border-color: rgba(47, 143, 122, .35); }
.map-app .map-card.active { border-color: var(--brand); background: #f4faf7; }
.map-app .map-card.active::before {
    content: ""; position: absolute; left: 0; top: 12px; bottom: 12px;
    width: 3px; border-radius: 0 99px 99px 0; background: var(--brand);
}
.map-app .card-ico {
    flex: 0 0 46px; width: 46px; height: 46px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff;
    box-shadow: var(--shadow-sm);
}
.map-app .card-ico.eat      { background: linear-gradient(135deg, #e09a5f, var(--eat)); }
.map-app .card-ico.hotel    { background: linear-gradient(135deg, #9386c4, var(--hotel)); }
.map-app .card-ico.hospital { background: linear-gradient(135deg, #d2747e, var(--hospital)); }
.map-app .card-ico.scenic   { background: linear-gradient(135deg, #6dab85, var(--scenic)); }
.map-app .card-body { flex: 1; min-width: 0; }
.map-app .card-name { font-size: 15px; font-weight: 700; color: #3a3226; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-app .card-addr { font-size: 12px; color: var(--ink-soft); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-app .card-tags { display: flex; gap: 5px; margin-top: 5px; flex-wrap: wrap; }
.map-app .tag-chip { font-size: 11px; padding: 2px 9px; border-radius: 99px; color: #fff; font-weight: 500; }
.map-app .tag-chip.eat { background: var(--eat); }
.map-app .tag-chip.hotel { background: var(--hotel); }
.map-app .tag-chip.hospital { background: var(--hospital); }
.map-app .tag-chip.scenic { background: var(--scenic); }
.map-app .card-go {
    flex: 0 0 auto; padding: 8px 15px; border-radius: 99px; border: 0;
    background: var(--brand); color: #fff; font-size: 12px; font-weight: 600; cursor: pointer;
    transition: background .15s, transform .1s;
}
.map-app .card-go:hover { background: var(--brand-deep); }
.map-app .card-go:active { transform: scale(.94); }

/* ---------- H5 底部抽屉 ---------- */
.map-app .map-drawer {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 700;
    max-height: 48vh; background: #fdfbf6;
    border-radius: 20px 20px 0 0; box-shadow: 0 -6px 30px rgba(47, 90, 74, .16);
    transform: translateY(110%); transition: transform .34s cubic-bezier(.16, 1, .3, 1);
    display: flex; flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.map-app .map-drawer::before {
    content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    border-radius: 20px 20px 0 0;
    background: linear-gradient(90deg, transparent, rgba(47, 143, 122, .25), transparent);
}
.map-app .map-drawer.open { transform: translateY(0); }
.map-app .drawer-grip { width: 40px; height: 4px; border-radius: 99px; background: #d8cbbb; margin: 11px auto 5px; flex: 0 0 auto; }
.map-app .drawer-title { padding: 4px 18px 6px; font-size: 14px; font-weight: 700; color: #3a3226; display: flex; align-items: center; justify-content: space-between; }
.map-app .drawer-title #drawerName { display: flex; align-items: center; gap: 6px; }
.map-app .drawer-close {
    border: 0; background: var(--brand-soft); color: var(--brand);
    font-size: 15px; line-height: 1; cursor: pointer; padding: 0;
    width: 26px; height: 26px; border-radius: 50%;
}
.map-app .drawer-list { flex: 1; overflow-y: auto; padding: 6px 14px 16px; }
.map-app .drawer-list .map-card { margin-bottom: 7px; }
.map-app .drawer-intro { margin: 8px 0 0; font-size: 13px; line-height: 1.75; color: #5c5444; }
.map-app .drawer-view { display: flex; flex-direction: column; overflow: hidden; flex: 1; min-height: 0; }
.map-app .drawer-meta { padding: 2px 0 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ---------- 动效降级（尊重系统设置） ---------- */
@media (prefers-reduced-motion: reduce) {
    .map-app * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
    .map-app .map-panel, .map-app .map-drawer { transition: none; }
}

/* ---------- 移动端布局（< 1024px） ---------- */
@media (max-width: 1023px) {
    .map-app .map-panel { display: none !important; }
    .map-app .map-topbar { display: flex; }
    .map-app #map { top: 52px; }
    .map-app .map-toggle { display: block; }
    .map-app .ol-zoom { display: none; }
    .map-app .map-pop-nav { display: none; }
}

/* ---------- 桌面端（>= 1024px） ---------- */
@media (min-width: 1024px) {
    .map-app .map-drawer, .map-app .map-toggle { display: none; }
    .map-app .map-panel { transform: none !important; }      /* PC 左侧列表常驻，不可收起 */
    .map-app .panel-close { display: none !important; }
    .map-app #map { left: var(--panel-w); }                  /* 右区地图，不被左栏遮挡 */
    .map-app .panel-list .map-card .card-go { display: none; }  /* PC 用 popup 内导航 */
}