/* 仅作用于日行程手绘地图，不改变日历、时间表和便签布局。 */
#wechat-char-schedule-host .cs-map-area--illustrated {
    display: flex; flex-direction: column; gap: 8px;
    height: auto; min-height: 0; max-height: none; flex: 0 0 auto;
    padding: 10px; background: #f9fbfe; border-radius: 18px;
    box-sizing: border-box; box-shadow: inset 0 0 0 1px #d3dfed;
}
#wechat-char-schedule-host .cs-map-area--illustrated::before { content: none; }
.cs-map-mini-heading { display: flex; flex: 0 0 auto; gap: 6px; align-items: center; justify-content: space-between; color: #293e62; }
.cs-map-mini-title { font-size: 13px; font-weight: 650; }
.cs-map-mini-theme { font-size: 10px; color: #506580; }
#wechat-char-schedule-host .cs-map-mini-illustrated {
    appearance: none; border: 0; padding: 0; margin: 0; width: 100%; height: auto;
    aspect-ratio: 1; flex: 0 0 auto; background: #e3ecf7; box-shadow: none; border-radius: 12px;
}
.cs-map-expand { position: absolute; right: 6px; bottom: 6px; border-radius: 8px; background: #fffdf9; color: #293e62; padding: 4px 6px; font-size: 10px; }
.cs-map-mini-status { flex: 0 0 auto; font-size: 11px; line-height: 1.5; color: #506580; overflow-wrap: anywhere; }
#wechat-char-schedule-host .cs-large-map-illustrated { background: #e3ecf7; backdrop-filter: none; }
#wechat-char-schedule-host .cs-large-map-illustrated .cs-large-map-inner {
    display: flex; flex-direction: column; gap: 0; background: #f7fafd; color: #293e62;
    padding: calc(12px + var(--safe-area-inset-top, env(safe-area-inset-top, 0px))) 16px calc(12px + var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px)));
    box-sizing: border-box; font-family: inherit;
}
.cs-map-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; }
.cs-map-dialog-heading { min-width: 0; }
.cs-map-dialog-heading h2 { margin: 0; font-size: 20px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.cs-map-dialog-heading p { margin: 4px 0 0; font-size: 11px; color: #506580; }
#wechat-char-schedule-host .cs-large-map-illustrated .cs-large-map-close {
    position: static; flex: 0 0 44px; width: 44px; height: 44px; font-size: 26px;
    border: 1px solid #d3dfed; border-radius: 50%; background: white; color: #293e62; box-shadow: none;
}
.cs-map-dialog-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; padding: 12px 0; flex-shrink: 0; }
.cs-map-select-label { display: flex; flex: 1 1 130px; flex-direction: column; gap: 4px; min-width: 0; color: #506580; font-size: 11px; }
#wechat-char-schedule-host .cs-map-select {
    appearance: auto; max-width: 100%; width: 100%; min-height: 44px; padding: 6px 8px;
    border: 1px solid #c6d6e9; border-radius: 10px; background: #fff; color: #293e62; font: inherit; font-size: 13px;
}
.cs-map-control { appearance: none; min-height: 44px; padding: 8px 12px; border: 1px solid #c6d6e9; border-radius: 10px; background: #e3ecf7; color: #293e62; font: inherit; font-size: 12px; cursor: pointer; }
.cs-map-control:disabled { opacity: .6; cursor: wait; }
.cs-map-mini-illustrated:focus-visible, .cs-map-control:focus-visible, .cs-map-select:focus-visible, .cs-large-map-close:focus-visible { outline: 2px solid #5c78a9; outline-offset: 2px; }
.cs-map-dialog-body { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; gap: 12px; overflow: hidden; }
.cs-map-dialog-art { flex: 0 0 auto; width: 100%; height: min(calc(100vw - 32px), 44vh); max-height: 420px; min-height: 140px; position: relative; padding-bottom: 20px; box-sizing: content-box; }
.cs-map-dialog-art .cs-illustrated-map { max-width: 100%; max-height: 100%; }
.cs-map-art-caption { position: absolute; bottom: 0; margin: 0; width: 100%; text-align: center; font-size: 10px; line-height: 16px; color: #506580; }
.cs-map-dialog-body .cs-illustrated-map-panel { flex: 1 1 auto; border-radius: 12px; padding: 12px; }
.cs-map-context-note { font-size: 12px; line-height: 1.6; color: #506580; margin: 0 0 8px; overflow-wrap: anywhere; }
.cs-map-unverified-list { padding-left: 22px; font-size: 12px; line-height: 1.6; color: #506580; overflow-wrap: anywhere; }
.cs-map-attribution { display: block; color: #506580; font-size: 10px; margin-top: 12px; }
@media (orientation: portrait) {
    .cs-map-dialog-body {
        overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
        overflow-anchor: none; -webkit-overflow-scrolling: touch;
    }
    .cs-map-dialog-art {
        height: auto; aspect-ratio: 1; min-height: 0; max-height: none;
    }
    .cs-map-dialog-body .cs-illustrated-map-panel {
        flex: 0 0 auto; overflow: visible;
    }
}
@media (max-width: 380px) {
    #wechat-char-schedule-host .cs-map-area--illustrated { max-height: none; }
}
@media (max-height: 620px) and (orientation: portrait) {
    .cs-map-dialog-heading h2 { font-size: 18px; }
}
@media (orientation: landscape) {
    .cs-map-dialog-body { flex-direction: row; }
    .cs-map-dialog-art { width: min(45%, 400px); height: calc(100% - 20px); min-height: 0; flex: 0 0 min(45%, 400px); }
    .cs-map-dialog-body .cs-illustrated-map-panel { width: 50%; }
    .cs-map-dialog-controls { padding: 8px 0; flex-wrap: nowrap; }
}

.cs-illustrated-map {
    display: block;
    width: 100%;
    height: 100%;
    background: #edf3fa;
    overflow: hidden;
    border-radius: inherit;
}

.cs-illustrated-map--full {
    border-radius: 14px;
}

.cs-illustrated-map-panel {
    --cs-map-panel-ink: #293e62;
    --cs-map-panel-secondary: #506580;
    --cs-map-panel-line: #d3dfed;
    color: var(--cs-map-panel-ink);
    background: #f9fbfe;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
    width: 100%;
    min-height: 0;
    padding: 16px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #a6bcd8 transparent;
}

.cs-illustrated-map-panel:focus-visible {
    outline: 2px solid #5c78a9;
    outline-offset: -3px;
}

/* 放大地图保留滚动，仅隐藏竖屏主体与横屏地点清单的滚动条。 */
.cs-large-map-illustrated .cs-map-dialog-body,
.cs-large-map-illustrated .cs-illustrated-map-panel {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.cs-large-map-illustrated .cs-map-dialog-body::-webkit-scrollbar,
.cs-large-map-illustrated .cs-illustrated-map-panel::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.cs-illustrated-map-panel-title {
    margin: 0 0 12px;
    color: var(--cs-map-panel-ink);
    font-size: 15px;
    line-height: 1.4;
    font-weight: 700;
}

.cs-illustrated-map-stops {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cs-illustrated-map-stop {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-height: 32px;
    padding: 7px 0;
    box-sizing: border-box;
}

.cs-illustrated-map-stop + .cs-illustrated-map-stop {
    border-top: 1px solid var(--cs-map-panel-line);
}

.cs-illustrated-map-stop-number {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e3ecf7;
    color: #293e62;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.cs-illustrated-map-stop-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    column-gap: 12px;
    row-gap: 2px;
}

.cs-illustrated-map-stop-name {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
    font-weight: 600;
}

.cs-illustrated-map-stop-time {
    flex: 0 0 auto;
    color: var(--cs-map-panel-secondary);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.cs-illustrated-map-empty,
.cs-illustrated-map-match-note {
    margin: 8px 0 0;
    color: var(--cs-map-panel-secondary);
    font-size: 12px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.cs-illustrated-map-catalog {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--cs-map-panel-line);
}

.cs-illustrated-map-catalog-title {
    min-height: 32px;
    box-sizing: border-box;
    padding: 4px 0;
    color: var(--cs-map-panel-ink);
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    touch-action: manipulation;
    overflow-wrap: anywhere;
}

.cs-illustrated-map-catalog-title:focus-visible {
    outline: 2px solid #5c78a9;
    outline-offset: 3px;
    border-radius: 4px;
}

.cs-illustrated-map-place-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}

.cs-illustrated-map-place {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    column-gap: 10px;
    row-gap: 2px;
    min-width: 0;
}

.cs-illustrated-map-place-name {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
    font-size: 13px;
}

.cs-illustrated-map-place-kind {
    flex: 0 0 auto;
    max-width: 100%;
    color: var(--cs-map-panel-secondary);
    font-size: 11px;
    overflow-wrap: anywhere;
}

@media (max-width: 340px) {
    .cs-illustrated-map-panel {
        padding: 12px;
    }

    .cs-illustrated-map-stop {
        gap: 8px;
    }
}

@media (forced-colors: active) {
    .cs-illustrated-map-panel {
        background: Canvas;
        color: CanvasText;
    }

    .cs-illustrated-map-panel-title,
    .cs-illustrated-map-catalog-title,
    .cs-illustrated-map-stop-number {
        color: CanvasText;
    }

    .cs-illustrated-map-stop-number {
        border: 1px solid CanvasText;
        background: Canvas;
    }
}
