/* 航线地图（/tools/route-map）：等经纬示意底图 + 可切换的干线高亮 */
.rm-section { padding-top: 8px; }

.rm-shell { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

.rm-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 22px;
    align-items: start;
}

.rm-map-col { min-width: 0; }

.rm-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.rm-canvas {
    position: relative;
    background: linear-gradient(160deg, #f2f7fc 0%, #e8f0f9 60%, #e2ecf7 100%);
    border: 1px solid var(--border, #e3e9f0);
    border-radius: 18px;
    box-shadow: var(--shadow, 0 12px 30px rgba(20, 42, 67, .07));
    overflow: hidden;
}

.rm-svg {
    display: block;
    width: 100%;
    height: auto;
}

.rm-sea { fill: transparent; }
.rm-grat line { stroke: rgba(20, 42, 67, .07); stroke-width: 1; }
.rm-land { fill: #dbe6f1; stroke: rgba(20, 42, 67, .16); stroke-width: 1.1; stroke-linejoin: round; }

/* 干线 */
.rm-lane .rm-line {
    fill: none;
    stroke: var(--rm-c, #2563eb);
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .5;
    transition: opacity .18s ease, stroke-width .18s ease;
}
.rm-lane .rm-hit {
    fill: none;
    stroke: transparent;
    stroke-width: 18;
    cursor: pointer;
}
.rm-lane .rm-hub {
    fill: #fff;
    stroke: var(--rm-c, #2563eb);
    stroke-width: 2.4;
    opacity: .85;
    transition: opacity .18s ease, transform .18s ease;
}

.rm-lane.is-active .rm-line { opacity: 1; stroke-width: 4; }
.rm-lane.is-active .rm-hub { opacity: 1; stroke-width: 3; }

.rm-board.has-focus .rm-lane:not(.is-active) .rm-line { opacity: .12; }
.rm-board.has-focus .rm-lane:not(.is-active) .rm-hub { opacity: .2; }

/* 中国基本港 */
.rm-origin circle { fill: #fff; stroke: #142a43; stroke-width: 2.4; }
.rm-origin .rm-origin-ring { fill: none; stroke: rgba(20, 42, 67, .25); stroke-width: 1.6; }
.rm-origin text {
    font-family: inherit;
    font-size: 24px;
    font-weight: 700;
    fill: #142a43;
    letter-spacing: .02em;
    paint-order: stroke;
    stroke: rgba(255, 255, 255, .85);
    stroke-width: 4px;
}

/* 悬浮提示 */
.rm-tip {
    position: absolute;
    z-index: 5;
    max-width: 260px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(11, 26, 43, .94);
    color: #fff;
    font-size: 12px;
    line-height: 1.5;
    pointer-events: none;
    transform: translate(-50%, calc(-100% - 14px));
    box-shadow: 0 10px 24px rgba(11, 26, 43, .28);
}
.rm-tip strong { display: block; font-size: 13px; margin-bottom: 2px; }
.rm-tip span { display: block; color: rgba(255, 255, 255, .78); }
.rm-tip em { font-style: normal; color: #fff; font-weight: 700; }

.rm-scroll-hint { display: none; margin: 8px 0 0; font-size: .75rem; color: var(--text-muted, #667085); }
.rm-caption { margin: 12px 0 0; font-size: .75rem; line-height: 1.6; color: var(--text-muted, #667085); }

/* 图例 / 列表 */
.rm-legend {
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e3e9f0);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow, 0 12px 30px rgba(20, 42, 67, .06));
    max-height: 560px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.rm-legend-head h3 { margin: 0 0 6px; font-size: 1rem; font-weight: 700; color: var(--text, #142a43); }
.rm-legend-head p { margin: 0 0 16px; font-size: .75rem; line-height: 1.55; color: var(--text-muted, #667085); }

.rm-group { margin-bottom: 14px; }
.rm-group:last-of-type { margin-bottom: 0; }
.rm-group-t {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted, #667085);
}
.rm-group-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rm-c, #2563eb); flex: 0 0 auto; }

.rm-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "name days" "meta days";
    gap: 2px 10px;
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 4px;
    border: 1px solid transparent;
    border-left: 3px solid transparent;
    border-radius: 8px;
    background: transparent;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.rm-item:hover { background: rgba(20, 42, 67, .04); border-left-color: var(--rm-c, #2563eb); }
.rm-item:focus-visible { outline: 2px solid var(--rm-c, #2563eb); outline-offset: 2px; }
.rm-item[aria-pressed="true"] {
    background: rgba(20, 42, 67, .06);
    border-left-color: var(--rm-c, #2563eb);
}
.rm-item-name { grid-area: name; font-size: .82rem; font-weight: 600; color: var(--text, #142a43); line-height: 1.35; }
.rm-item-meta { grid-area: meta; font-size: .7rem; color: var(--text-muted, #667085); line-height: 1.4; }
.rm-item-days {
    grid-area: days;
    align-self: center;
    white-space: nowrap;
    font-size: .78rem;
    font-weight: 700;
    color: var(--text, #142a43);
}
.rm-item-days em { font-style: normal; font-weight: 500; color: var(--text-muted, #667085); font-size: .68rem; }

.rm-reset {
    width: 100%;
    margin-top: 14px;
    padding: 9px 12px;
    border: 1px solid var(--border, #e3e9f0);
    border-radius: 8px;
    background: var(--bg-alt, #f5f7f9);
    font-family: inherit;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text, #142a43);
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease;
}
.rm-reset:hover { border-color: var(--orange, #2563eb); color: var(--orange, #2563eb); }

/* 说明与后续入口 */
.rm-note {
    margin-top: 26px;
    padding: 14px 18px;
    border-left: 3px solid var(--orange, #2563eb);
    background: var(--bg-alt, #f5f7f9);
    border-radius: 8px;
    font-size: .78rem;
    line-height: 1.65;
    color: var(--text-muted, #667085);
}
.rm-note strong { display: block; color: var(--text, #142a43); margin-bottom: 2px; font-size: .8rem; }

.rm-next { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rm-next-card {
    display: block;
    padding: 20px;
    border: 1px solid var(--border, #e3e9f0);
    border-radius: 14px;
    background: var(--bg-card, #fff);
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.rm-next-card:hover { transform: translateY(-2px); border-color: var(--orange, #2563eb); box-shadow: var(--shadow, 0 12px 30px rgba(20, 42, 67, .08)); }
.rm-next-card i { display: block; font-size: 1.4rem; color: var(--orange, #2563eb); margin-bottom: 10px; }
.rm-next-card strong { display: block; font-size: .92rem; color: var(--text, #142a43); margin-bottom: 4px; }
.rm-next-card span { font-size: .78rem; line-height: 1.55; color: var(--text-muted, #667085); }

/* 响应式 */
@media (max-width: 1080px) {
    .rm-board { grid-template-columns: minmax(0, 1fr); }
    .rm-legend { max-height: none; }
    .rm-next { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .rm-shell { padding: 0 16px; }
    .rm-svg { width: 620px; max-width: none; }
    .rm-scroll-hint { display: block; }
    .rm-canvas { border-radius: 14px; }
    .rm-next { grid-template-columns: minmax(0, 1fr); }
    .rm-legend { padding: 16px; }
    .rm-origin text { font-size: 30px; }
}

@media (prefers-reduced-motion: reduce) {
    .rm-lane .rm-line, .rm-item, .rm-next-card { transition: none; }
}
