/* ============================================================
   map.css · 地图 App
   ============================================================ */

#page-map {
    padding: 0;
    position: relative;
    background: transparent;
}

/* ===== 顶部导航 ===== */
.map-app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 46px 20px 16px;   /* 顶部多留，避开状态栏 */
    z-index: 10;
    pointer-events: none;
}
.map-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
}
.map-back-btn {
    width: auto;
    height: auto;
    border: none;
    background: none;
    padding: 0;
    color: #fff;
    cursor: pointer;
    font-family: 'WenJinMincho', 'Noto Serif SC', serif;
    font-size: 42px;
    font-weight: 400;
    line-height: 1;
    /* 让 ‹ 的尖端和文字中线对齐：以实际效果微调 -2 ~ -6 */
    transform: translateY(-4px);
    text-shadow:
        0 0 12px rgba(255, 255, 255, 0.55),
        0 0 28px rgba(192, 132, 252, 0.35);
    transition: text-shadow .25s;
    user-select: none;
    -webkit-user-select: none;
}
.map-back-btn:hover {
    text-shadow:
        0 0 16px rgba(255, 255, 255, 0.75),
        0 0 36px rgba(192, 132, 252, 0.55);
}
.map-breadcrumb {
    pointer-events: auto;
    font-family: 'WenJinMincho', 'Noto Serif SC', serif;
    font-size: 28px;
    font-weight: 500;
    color: #fff;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    letter-spacing: 2px;
    text-shadow:
        0 0 12px rgba(255, 255, 255, 0.55),
        0 0 28px rgba(192, 132, 252, 0.35);
    transition: text-shadow .25s;
}
.map-breadcrumb:hover {
    text-shadow:
        0 0 16px rgba(255, 255, 255, 0.75),
        0 0 36px rgba(192, 132, 252, 0.55);
}
.map-breadcrumb::before {
    content: '';
    display: inline-block;
    vertical-align: middle;
    width: 1px;
    height: 32px;
    margin-right: 16px;
    background: linear-gradient(to bottom,
        transparent 0%,
        rgba(255, 255, 255, 0.9) 50%,
        transparent 100%);
    filter:
        drop-shadow(0 0 8px rgba(255, 255, 255, 0.7))
        drop-shadow(0 0 16px rgba(192, 132, 252, 0.4));
    transform: translateY(-1px);
}
.map-zoom {
    pointer-events: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    color: #fff;
    background: none;
    border: none;
    padding: 0;
    letter-spacing: 1px;
    opacity: 0.9;
    text-shadow:
        0 0 10px rgba(255, 255, 255, 0.5),
        0 0 22px rgba(192, 132, 252, 0.3);
}

/* ===== 视口：完全透明，无黑壳 ===== */
.map-viewport {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background-color: #1a1a22;
    background-image:
        repeating-linear-gradient(0deg,  rgba(200, 200, 220, 0.06) 0 1px, transparent 1px 64px),
        repeating-linear-gradient(90deg, rgba(200, 200, 220, 0.06) 0 1px, transparent 1px 64px);
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    z-index: 5;
}
.map-viewport.dragging {
    cursor: grabbing;
}
.map-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-origin: center center;
    will-change: transform;
    z-index: 2;
}

/* ===== 地块线条：大锯齿 ===== */
.map-cell {
    fill: rgba(255, 255, 255, 0.08);
    stroke: rgba(255, 255, 255, 0.55);
    stroke-width: 1.2;
    stroke-linejoin: miter;
    cursor: pointer;
    transition: fill .3s, stroke .3s, filter .3s;
}
.map-cell:hover {
    fill: rgba(255, 255, 255, 0.14);
    stroke: rgba(255, 255, 255, 0.8);
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.7));
}

/* ★ 选中：线条白色发光 + 填充更白 + 悬浮阴影 */
.map-cell.selected {
    fill: rgba(255, 255, 255, 0.22);
    stroke: #ffffff;
    stroke-width: 1.8;
    filter:
        drop-shadow(0 0 5px rgba(255, 255, 255, 0.85))
        drop-shadow(0 0 12px rgba(255, 255, 255, 0.45))
        drop-shadow(0 6px 14px rgba(0, 0, 0, 0.6));
}

/* ===== 图标 ===== */
.map-icon {
    pointer-events: auto;
    cursor: pointer;
}
.map-icon-inner {
    transition: transform .2s ease;
}
.map-icon.selected .map-icon-inner {
    transform: scale(1.1);
}
.map-icon-pin {
    fill: #ffffff;
    fill-rule: evenodd;
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.7)) drop-shadow(0 0 10px rgba(192, 132, 252, 0.35));
    transition: fill .25s, filter .25s;
}
.map-icon.selected .map-icon-pin {
    fill: #ec4899;
    filter: drop-shadow(0 0 6px rgba(236, 72, 153, 0.9)) drop-shadow(0 0 14px rgba(236, 72, 153, 0.55));
}
.map-icon-pulse {
    fill: #ec4899;
    fill-rule: evenodd;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    pointer-events: none;
}
.map-icon.selected .map-icon-pulse {
    animation: mapIconPulse 1.8s ease-out infinite;
}
@keyframes mapIconPulse {
    0%   { transform: scale(0.8); opacity: 0.85; }
    100% { transform: scale(2.4); opacity: 0; }
}

/* ===== 连接线 SVG ===== */
.map-link-svg {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 15;
}
#mapLinkLine {
    stroke: #ffffff;
    stroke-width: 1.2;
    stroke-linecap: round;
    filter: drop-shadow(0 0 3px rgba(255,255,255,0.9)) drop-shadow(0 0 8px rgba(255,255,255,0.45));
    opacity: 0;
    transition: opacity .2s;
}
.map-link-svg.show #mapLinkLine {
    opacity: 1;
}

/* ===== 地点卡片 ===== */
.map-card {
    position: fixed;
    width: 300px;
    height: 175px;
    border-radius: 14px;
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 20;
    box-sizing: border-box;
    background:
        radial-gradient(ellipse at center,
            rgba(0, 0, 0, 0.62) 0%,
            rgba(0, 0, 0, 0.38) 55%,
            rgba(0, 0, 0, 0.12) 100%);
    backdrop-filter: blur(6px) saturate(140%);
    -webkit-backdrop-filter: blur(6px) saturate(140%);
    overflow: hidden;
    animation: mapCardIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes mapCardIn {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
}

/* 四角 L 线 */
.map-card-corner {
    position: absolute;
    width: 14px;
    height: 14px;
    pointer-events: none;
    filter: drop-shadow(0 0 4px rgba(255,255,255,0.85)) drop-shadow(0 0 8px rgba(255,255,255,0.4));
}
.map-card-corner.tl { top: 6px; left: 6px; border-top: 1.5px solid #fff; border-left: 1.5px solid #fff; border-top-left-radius: 6px; }
.map-card-corner.tr { top: 6px; right: 6px; border-top: 1.5px solid #fff; border-right: 1.5px solid #fff; border-top-right-radius: 6px; }
.map-card-corner.bl { bottom: 6px; left: 6px; border-bottom: 1.5px solid #fff; border-left: 1.5px solid #fff; border-bottom-left-radius: 6px; }
.map-card-corner.br { bottom: 6px; right: 6px; border-bottom: 1.5px solid #fff; border-right: 1.5px solid #fff; border-bottom-right-radius: 6px; }

/* 扫描光带 */
.map-card-scan {
    position: absolute;
    left: 0; right: 0;
    top: -40%;
    height: 40%;
    pointer-events: none;
    background: linear-gradient(to bottom,
        transparent 0%,
        rgba(236, 72, 153, 0.06) 35%,
        rgba(236, 72, 153, 0.20) 50%,
        rgba(236, 72, 153, 0.06) 65%,
        transparent 100%);
    filter: blur(3px);
    animation: mapCardScan 5s ease-in-out infinite;
}
@keyframes mapCardScan {
    0%   { transform: translateY(0);     opacity: 0; }
    12%  { opacity: 1; }
    88%  { opacity: 1; }
    100% { transform: translateY(360%);  opacity: 0; }
}

/* 卡片主体 */
.map-card-body {
    display: flex;
    align-items: stretch;
    gap: 10px;
    flex: 1;
    min-height: 0;
    position: relative;
    z-index: 2;
}
.map-card-left {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 5px;
    flex-shrink: 0;
    min-width: 70px;
    max-width: 105px;
}
.map-card-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.map-card-en {
    font-size: 9px;
    color: rgba(255,255,255,0.55);
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    align-self: flex-start;
}
.map-card-divider {
    width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.5), transparent);
    flex-shrink: 0;
    margin: 2px 0;
}
.map-card-right {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: flex-start;
}
.map-card-desc {
    font-size: 12px;
    color: rgba(255,255,255,0.85);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 按钮 */
.map-card-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    position: relative;
    z-index: 2;
}
.map-card-btn {
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.06);
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
    white-space: nowrap;
}
.map-card-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.16);
    border-color: rgba(255,255,255,0.5);
}
.map-card-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.map-card-btn.primary {
    background: linear-gradient(135deg, #c084fc, #ec4899);
    border-color: transparent;
    box-shadow: 0 3px 12px rgba(192,132,252,0.35);
}
.map-card-btn.primary:hover:not(:disabled) {
    box-shadow: 0 3px 18px rgba(236,72,153,0.55);
    transform: translateY(-1px);
}

/* ===== 选中地块的发光粒子 ===== */
.map-particle {
    fill: #ffffff;
    pointer-events: none;
    filter:
        drop-shadow(0 0 3px rgba(255, 255, 255, 0.95))
        drop-shadow(0 0 8px rgba(255, 255, 255, 0.7));
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    animation: mapParticleFloat 3s ease-in-out infinite;
}

@keyframes mapParticleFloat {
    0%   { opacity: 0;    transform: translateY(0)    scale(0.6); }
    20%  { opacity: 1;    transform: translateY(-3px) scale(1.0); }
    50%  { opacity: 0.9;  transform: translateY(-9px) scale(1.15); }
    80%  { opacity: 0.4;  transform: translateY(-5px) scale(0.95); }
    100% { opacity: 0;    transform: translateY(-12px) scale(0.6); }
}

/* ===== 地块名称标签 ===== */
.map-cell-label {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    fill: rgba(255, 255, 255, 0.95);
    pointer-events: none;
    letter-spacing: 2px;
    text-transform: uppercase;
    paint-order: stroke fill;
    stroke: rgba(0, 0, 0, 0.9);
    stroke-linejoin: round;
    user-select: none;
    -webkit-user-select: none;
}

/* ===== 多地点：内部线条调暗，相邻叠加后 = 单地点亮度 ===== */
.map-cell-inner {
    stroke: rgba(255, 255, 255, 0.42);
}
.map-outline {
    fill: none;
    stroke: rgba(255, 255, 255, 0.33);
    stroke-width: 1.2;
    stroke-linejoin: miter;
    pointer-events: none;
}

/* ===== 整张地图的地面投影 ===== */
.map-ground-shadow {
    fill: rgba(28, 10, 48, 0.55);   /* 深紫黑，带一点紫 */
    filter: blur(6px);
    pointer-events: none;
}

.map-zoom-corner {
    position: fixed;
    left: 24px;
    bottom: 28px;
    z-index: 20;
}

/* ===== 顶栏右侧：100% + 加号 ===== */
.map-header-right {
    display: flex;
    align-items: center;
    gap: 18px;
    pointer-events: auto;
}
.map-add-btn {
    width: auto;
    height: auto;
    border: none;
    background: none;
    padding: 0 4px;
    color: #fff;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    font-size: 34px;
    font-weight: 300;
    line-height: 1;
    /* 加号圆润一点：微调让横竖交点更居中 */
    transform: translateY(-2px);
    text-shadow:
        0 0 12px rgba(255, 255, 255, 0.55),
        0 0 28px rgba(192, 132, 252, 0.35);
    transition: text-shadow .25s;
    user-select: none;
    -webkit-user-select: none;
}
.map-add-btn:hover {
    text-shadow:
        0 0 16px rgba(255, 255, 255, 0.75),
        0 0 36px rgba(192, 132, 252, 0.55);
}
/* ===== 不可见地点：灰显，可看不可去 ===== */
.map-cell.map-cell-invisible {
    fill: rgba(255, 255, 255, 0.03);
    stroke: rgba(255, 255, 255, 0.25);
    stroke-dasharray: 4 3;
}
.map-cell.map-cell-invisible:hover {
    fill: rgba(255, 255, 255, 0.06);
    stroke: rgba(255, 255, 255, 0.4);
}
.map-cell.map-cell-invisible.selected {
    fill: rgba(255, 255, 255, 0.1);
    stroke: rgba(255, 255, 255, 0.5);
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.3));
}

.map-icon.map-icon-invisible .map-icon-pin {
    fill: rgba(255, 255, 255, 0.45);
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.3));
}
.map-icon.map-icon-invisible.selected .map-icon-pin {
    fill: rgba(236, 72, 153, 0.5);
    filter: drop-shadow(0 0 5px rgba(236, 72, 153, 0.4));
}