feat(map): streamline search and detail panels

This commit is contained in:
lingniu
2026-08-11 17:41:45 +08:00
parent c42570c0ee
commit f535b1570b
4 changed files with 1415 additions and 32 deletions
+559
View File
@@ -334,6 +334,335 @@ body {
.map-top-bar * { pointer-events: auto; }
.map-explore-toolbar {
position: absolute;
top: 48px;
left: 12px;
max-width: calc(100% - 24px);
z-index: 12;
display: flex;
align-items: center;
gap: 7px;
min-width: 0;
padding: 5px;
border: 1px solid var(--glass-border);
border-radius: 13px;
background: var(--glass-bg);
box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
backdrop-filter: blur(22px);
-webkit-backdrop-filter: blur(22px);
}
.locate-btn,
.filter-clear-btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 5px;
width: 32px;
min-height: 32px;
padding: 0;
border: 1px solid var(--glass-border);
border-radius: 9px;
background: var(--pill-bg);
color: var(--text-main);
font-size: 10px;
font-weight: 600;
white-space: nowrap;
cursor: pointer;
transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.locate-btn:hover,
.filter-clear-btn:hover {
border-color: var(--glass-hover-border);
transform: translateY(-1px);
}
.locate-btn svg {
width: 14px;
height: 14px;
fill: none;
stroke: currentColor;
stroke-width: 1.8;
}
.locate-btn span { display: none; }
.locate-btn.is-loading svg { animation: locate-pulse 1s ease-in-out infinite; }
.locate-btn.is-active {
border-color: rgba(0, 113, 67, 0.28);
background: rgba(0, 113, 67, 0.1);
color: var(--accent-primary);
}
.locate-btn.is-error {
border-color: rgba(220, 38, 38, 0.25);
color: #dc2626;
}
@keyframes locate-pulse {
50% { opacity: 0.45; transform: scale(0.86); }
}
.explore-search-shell {
position: relative;
min-width: 0;
}
.entity-search-field {
display: flex;
align-items: center;
width: min(320px, calc(100vw - 112px));
min-width: 180px;
height: 32px;
gap: 6px;
padding: 0 8px;
border: 1px solid var(--glass-border);
border-radius: 9px;
background: var(--pill-bg);
transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.entity-search-field:focus-within {
border-color: rgba(2, 132, 199, 0.45);
box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.08);
}
.entity-search-field > svg {
width: 14px;
height: 14px;
flex: 0 0 14px;
fill: none;
stroke: var(--text-muted);
stroke-width: 1.8;
}
.entity-search-field input {
width: 100%;
min-width: 0;
border: 0;
outline: 0;
background: transparent;
color: var(--text-main);
font: 11px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
user-select: text;
}
.entity-search-field input::placeholder { color: var(--text-sub); }
.search-clear-btn {
width: 20px;
height: 20px;
flex: 0 0 20px;
border: 0;
border-radius: 50%;
background: var(--segmented-bg);
color: var(--text-muted);
cursor: pointer;
}
.entity-search-field input::-webkit-search-cancel-button { display: none; }
.filter-clear-btn[hidden],
.search-clear-btn[hidden],
.location-feedback[hidden] { display: none; }
.explore-suggestions {
position: absolute;
top: calc(100% + 7px);
left: 0;
width: min(390px, calc(100vw - 32px));
max-height: min(360px, calc(100dvh - 180px));
overflow-y: auto;
padding: 6px;
border: 1px solid var(--glass-border);
border-radius: 13px;
background: color-mix(in srgb, var(--glass-bg) 96%, transparent);
box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
backdrop-filter: blur(26px);
-webkit-backdrop-filter: blur(26px);
}
.explore-suggestions[hidden],
.filter-chip-rail[hidden] { display: none; }
.suggestion-section-label {
display: block;
padding: 5px 8px 4px;
color: var(--text-muted);
font-size: 9px;
font-weight: 700;
letter-spacing: 0.04em;
}
.explore-suggestion {
display: grid;
grid-template-columns: 22px minmax(0, 1fr) auto;
align-items: center;
width: 100%;
min-height: 42px;
gap: 8px;
padding: 6px 8px;
border: 0;
border-radius: 9px;
background: transparent;
color: var(--text-main);
text-align: left;
cursor: pointer;
}
.explore-suggestion:hover,
.explore-suggestion.is-active { background: var(--pill-bg); }
.suggestion-symbol {
display: grid;
width: 22px;
height: 22px;
place-items: center;
border-radius: 7px;
background: rgba(2, 132, 199, 0.1);
color: var(--accent-blue);
font-size: 12px;
font-weight: 700;
}
.suggestion-symbol.is-location { background: rgba(0, 113, 67, 0.1); color: var(--accent-primary); }
.suggestion-copy { min-width: 0; }
.suggestion-copy strong { display: block; overflow: hidden; font-size: 11px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-copy small { display: block; overflow: hidden; margin-top: 2px; color: var(--text-muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.suggestion-kind { color: var(--text-sub); font-size: 9px; white-space: nowrap; }
.suggestion-empty {
display: block;
padding: 16px 10px;
color: var(--text-muted);
font-size: 10px;
text-align: center;
}
.filter-chip-rail {
display: flex;
align-items: center;
gap: 5px;
min-width: 0;
max-width: 300px;
overflow-x: auto;
scrollbar-width: none;
}
.filter-chip-rail::-webkit-scrollbar { display: none; }
.filter-chip {
display: inline-flex;
align-items: center;
gap: 5px;
min-height: 26px;
padding: 0 7px;
border: 1px solid rgba(0, 113, 67, 0.15);
border-radius: 999px;
background: rgba(0, 113, 67, 0.08);
color: var(--accent-primary);
font-size: 10px;
font-weight: 600;
white-space: nowrap;
}
.filter-chip button {
display: grid;
width: 15px;
height: 15px;
place-items: center;
border: 0;
border-radius: 50%;
background: transparent;
color: currentColor;
font-size: 14px;
line-height: 1;
cursor: pointer;
}
.filter-chip button:hover { background: rgba(0, 113, 67, 0.13); }
.filter-select-wrap {
position: relative;
display: block;
}
.filter-select-wrap::after {
content: '';
position: absolute;
top: 50%;
right: 9px;
width: 5px;
height: 5px;
border-right: 1.5px solid var(--text-muted);
border-bottom: 1.5px solid var(--text-muted);
pointer-events: none;
transform: translateY(-70%) rotate(45deg);
}
.filter-select-wrap select {
width: 104px;
height: 32px;
padding: 0 25px 0 9px;
border: 1px solid var(--glass-border);
border-radius: 9px;
outline: 0;
appearance: none;
background: var(--pill-bg);
color: var(--text-main);
font-size: 10px;
cursor: pointer;
}
.filter-select-wrap select:focus {
border-color: rgba(2, 132, 199, 0.45);
}
.filter-select-wrap select:disabled {
opacity: 0.46;
cursor: not-allowed;
}
.filter-result-meta {
flex: 0 0 auto;
padding: 0 3px;
color: var(--text-muted);
font: 9px/1.2 'JetBrains Mono', monospace;
white-space: nowrap;
}
.location-feedback {
position: absolute;
top: calc(100% + 6px);
left: 0;
max-width: min(360px, 90vw);
padding: 7px 10px;
border: 1px solid rgba(220, 38, 38, 0.18);
border-radius: 9px;
background: var(--glass-bg);
color: #b91c1c;
box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
font-size: 10px;
line-height: 1.4;
backdrop-filter: blur(18px);
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border: 0;
}
.status-glass-pill {
display: flex;
align-items: center;
@@ -392,6 +721,144 @@ body {
height: 100%;
}
.map-detail-card {
position: absolute;
left: 14px;
bottom: 18px;
z-index: 15;
width: min(292px, calc(100% - 148px));
max-height: min(236px, calc(100% - 120px));
overflow: auto;
padding: 11px 12px;
border: 1px solid var(--glass-border);
border-radius: 15px;
background: var(--glass-bg);
box-shadow: 0 18px 45px rgba(15, 23, 42, 0.2);
backdrop-filter: blur(24px);
-webkit-backdrop-filter: blur(24px);
animation: detail-card-enter 0.2s ease-out;
}
.map-detail-card[hidden] { display: none; }
@keyframes detail-card-enter {
from { opacity: 0; transform: translateY(7px) scale(0.985); }
to { opacity: 1; transform: translateY(0) scale(1); }
}
.detail-card-accent {
position: absolute;
inset: 0 auto 0 0;
width: 3px;
border-radius: 15px 0 0 15px;
background: var(--accent-blue);
}
.detail-card-accent.is-station { background: var(--accent-primary); }
.detail-card-header {
display: flex;
align-items: flex-start;
justify-content: space-between;
gap: 8px;
padding-bottom: 8px;
border-bottom: 1px solid var(--glass-border);
}
.detail-title-wrap { min-width: 0; }
.detail-type-pill {
display: inline-flex;
margin-bottom: 4px;
padding: 2px 7px;
border-radius: 999px;
background: rgba(37, 99, 235, 0.1);
color: var(--accent-blue);
font-size: 9px;
font-weight: 700;
}
.detail-type-pill.is-station {
background: rgba(0, 113, 67, 0.1);
color: var(--accent-primary);
}
.detail-title-wrap h2 {
overflow: hidden;
color: var(--text-main);
font-size: 13px;
font-weight: 700;
line-height: 1.25;
text-overflow: ellipsis;
white-space: nowrap;
}
.detail-title-wrap p {
overflow: hidden;
margin-top: 2px;
color: var(--text-muted);
font-size: 9px;
line-height: 1.35;
text-overflow: ellipsis;
white-space: nowrap;
}
.detail-close-btn {
display: grid;
width: 22px;
height: 22px;
flex: 0 0 22px;
place-items: center;
border: 0;
border-radius: 50%;
background: var(--pill-bg);
color: var(--text-muted);
font-size: 15px;
line-height: 1;
cursor: pointer;
}
.detail-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 7px 10px;
padding-top: 8px;
}
.detail-field { min-width: 0; }
.detail-field.is-wide { grid-column: 1 / -1; }
.detail-field dt {
margin-bottom: 3px;
color: var(--text-muted);
font-size: 9px;
}
.detail-field dd {
overflow-wrap: anywhere;
color: var(--text-main);
font: 600 10px/1.35 'JetBrains Mono', -apple-system, sans-serif;
}
.detail-field.is-extra { display: none; }
.map-detail-card.is-expanded .detail-field.is-extra { display: block; }
.detail-expand-btn {
display: inline-flex;
align-items: center;
gap: 4px;
margin-top: 8px;
padding: 0;
border: 0;
background: transparent;
color: var(--accent-blue);
font-size: 10px;
font-weight: 600;
cursor: pointer;
}
.detail-expand-btn[hidden] { display: none; }
.map-action-controls {
position: absolute;
bottom: 24px;
@@ -627,6 +1094,11 @@ body {
border-color: var(--glass-hover-border);
}
.rank-glass-row.is-selected {
border-color: rgba(2, 132, 199, 0.42);
background: rgba(2, 132, 199, 0.08);
}
.r-badge {
width: 18px;
height: 18px;
@@ -728,6 +1200,35 @@ body {
.province-info-card.is-vehicle-point.is-online .p-dot { background: #00a86b; }
.province-info-card.is-vehicle-point.is-offline .p-dot { background: #8e8e93; }
.province-info-card.is-selected {
border-color: var(--accent-cyan);
box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12), 0 9px 24px rgba(2, 132, 199, 0.2);
}
.user-location-marker {
position: relative;
width: 18px;
height: 18px;
border: 3px solid #fff;
border-radius: 50%;
background: #1677ff;
box-shadow: 0 3px 10px rgba(22, 119, 255, 0.38);
}
.user-location-marker::before {
content: '';
position: absolute;
inset: -8px;
border: 1px solid rgba(22, 119, 255, 0.35);
border-radius: 50%;
animation: user-location-wave 1.8s ease-out infinite;
}
@keyframes user-location-wave {
from { opacity: 0.9; transform: scale(0.55); }
to { opacity: 0; transform: scale(1.35); }
}
.province-info-badge-wrap:hover .province-info-card {
transform: scale(1.15);
border-color: var(--accent-cyan) !important;
@@ -769,6 +1270,10 @@ body {
/* --------------------------------------------------------------------------
MOBILE / NARROW VIEWPORT
-------------------------------------------------------------------------- */
@media (min-width: 769px) and (max-width: 1180px) {
.filter-chip-rail { max-width: 190px; }
}
@media (max-width: 768px) {
body {
height: auto;
@@ -891,6 +1396,49 @@ body {
right: 8px;
}
.map-explore-toolbar {
top: 44px;
left: 8px;
right: 8px;
max-width: none;
display: flex;
flex-wrap: wrap;
gap: 6px;
padding: 6px;
}
.locate-btn {
flex: 0 0 32px;
}
.explore-search-shell { flex: 1 1 170px; }
.entity-search-field {
width: 100%;
min-width: 0;
}
.filter-chip-rail {
order: 3;
flex: 1 1 calc(100% - 78px);
max-width: none;
overflow-x: auto;
overscroll-behavior-x: contain;
}
.filter-result-meta {
order: 4;
flex: 0 0 auto;
max-width: 76px;
overflow: hidden;
text-overflow: ellipsis;
}
.explore-suggestions {
width: min(420px, calc(100vw - 32px));
max-height: 300px;
}
.status-glass-pill {
min-width: 0;
max-width: 100%;
@@ -914,6 +1462,17 @@ body {
gap: 4px;
}
.map-detail-card {
left: 8px;
right: 8px;
bottom: 54px;
width: auto;
max-height: min(220px, calc(100% - 140px));
padding: 10px 12px;
}
.detail-grid { gap: 8px 12px; }
.glass-btn {
padding: 5px 7px;
font-size: 9px;