:root {
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #172033;
  background: #edf2f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .46; }
.app-shell { height: 100%; display: grid; grid-template-rows: 72px 1fr; overflow: hidden; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 22px; background: rgba(255,255,255,.97); border-bottom: 1px solid #dce4ef; box-shadow: 0 4px 20px rgba(31,53,82,.07); z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand__mark { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(145deg,#1769ff,#6b48ff); color: #fff; font-size: 22px; font-weight: 800; box-shadow: 0 8px 20px rgba(44,99,255,.27); }
.brand h1 { margin: 0; font-size: 19px; }
.brand p { margin: 4px 0 0; color: #748198; font-size: 12px; }
.topbar__status { display: flex; align-items: center; gap: 8px; }
.status-pill { padding: 7px 10px; background: #f2f6fb; color: #526079; border: 1px solid #dce5f0; border-radius: 999px; font-size: 12px; }
.workspace { min-height: 0; display: grid; grid-template-columns: 390px minmax(430px,1fr) 360px; gap: 1px; background: #d9e2ee; }
.panel { min-height: 0; overflow-y: auto; background: #f8fafc; }
.panel--left { border-right: 1px solid #dce4ef; }
.panel--right { border-left: 1px solid #dce4ef; padding: 16px; }
.panel-section { padding: 16px; border-bottom: 1px solid #e3eaf3; background: #fff; }
.panel-section--compact { padding-top: 14px; padding-bottom: 14px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.section-heading > div { display: flex; align-items: center; gap: 8px; }
.section-heading h2 { margin: 0; font-size: 15px; }
.section-heading small { color: #8290a5; text-align: right; }
.section-heading--sticky { position: sticky; top: -16px; padding: 15px 0 12px; background: #f8fafc; z-index: 4; }
.step-badge { width: 23px; height: 23px; display: inline-grid; place-items: center; background: #eaf1ff; color: #246bfd; border-radius: 7px; font-size: 12px; font-weight: 800; }
.input, .select { width: 100%; height: 40px; border: 1px solid #cfd9e7; border-radius: 9px; background: #fff; color: #1d2940; padding: 0 11px; outline: none; transition: .2s; }
.input:focus, .select:focus { border-color: #3b75ee; box-shadow: 0 0 0 3px rgba(59,117,238,.12); }
.input--compact { height: 36px; }
.select--small { height: 34px; margin-top: 5px; font-size: 11px; }
.field-label { display: block; margin: 10px 0 5px; color: #66748b; font-size: 12px; }
.search-row { display: grid; grid-template-columns: 1fr 66px; gap: 7px; }
.search-row .button { padding: 0 8px; }
.search-results { max-height: 270px; margin-top: 8px; overflow-y: auto; border: 1px solid #dbe5f1; border-radius: 11px; background: #fff; box-shadow: 0 10px 25px rgba(39,61,91,.11); }
.search-result { width: 100%; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; padding: 10px; border: 0; border-bottom: 1px solid #edf1f6; background: #fff; color: #26354b; text-align: left; }
.search-result:last-child { border-bottom: 0; }
.search-result:hover { background: #f2f7ff; }
.search-result__icon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: #eaf1ff; color: #246bfd; font-size: 17px; }
.search-result > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.search-result strong, .search-result small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result strong { font-size: 12px; }
.search-result small { color: #7d899b; font-size: 10px; }
.search-result em { color: #246bfd; font-size: 10px; font-style: normal; font-weight: 700; }
.search-loading { padding: 16px; color: #6f7d92; text-align: center; font-size: 12px; }
.tool-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; margin-top: 10px; }
.tool-button { min-height: 38px; border: 1px solid #d4dfed; border-radius: 9px; background: #f7f9fc; color: #526079; font-size: 11px; }
.tool-button.active { border-color: #276df1; background: #eaf1ff; color: #1658d6; font-weight: 700; }
.node-help, .mode-hint { color: #78879d; font-size: 10px; line-height: 1.55; }
.node-help { margin-top: 8px; }
.mode-hint { margin-top: 7px; padding: 7px 9px; border-radius: 8px; background: #f0f5fb; }
.empty-hint { color: #8895a8; font-size: 12px; line-height: 1.65; margin: 12px 0 0; }
.node-list { margin-top: 11px; display: grid; gap: 6px; }
.node-row { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid #e0e8f2; border-radius: 10px; background: #fbfcfe; }
.node-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.node-dot--start { background: #16a66a; }
.node-dot--waypoint { background: #4778ed; }
.node-dot--end { background: #e14e58; }
.node-row__body { min-width: 0; display: grid; flex: 1; }
.node-row__body strong { font-size: 12px; }
.node-row__body span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #506078; font-size: 12px; }
.node-row__body small { color: #9aa5b5; font-size: 10px; }
.node-order { display: grid; grid-template-columns: 24px 24px; gap: 3px; }
.node-order button { width: 24px; height: 24px; padding: 0; border: 1px solid #d8e2ee; border-radius: 6px; background: #fff; color: #50647f; }
.icon-button { border: 0; background: transparent; color: #8190a5; font-size: 20px; }
.icon-button--square { width: 36px; height: 36px; padding: 0; border: 1px solid #d7e0eb; border-radius: 8px; font-size: 12px; background: #fff; }
.segment-editor-list { display: grid; gap: 10px; }
.segment-editor { padding: 12px; border: 1px solid #dfe7f1; border-radius: 12px; background: #fbfcfe; }
.segment-editor__title { display: grid; gap: 4px; }
.segment-editor__title > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.segment-editor__title strong { font-size: 13px; }
.segment-editor__title > span { color: #748198; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mode-chip { padding: 4px 7px; border-radius: 999px; background: #eef3fa; color: #53637a; font-size: 10px; font-weight: 700; }
.mode-chip--driving { background: #e9f0ff; color: #245fcf; }
.mode-chip--walking { background: #e7f8f0; color: #0f8252; }
.mode-chip--bicycling { background: #fff2df; color: #b56211; }
.mode-chip--train { background: #f0eaff; color: #6842cc; }
.mode-chip--flight { background: #e3f8fc; color: #0085a2; }
.segment-fields { margin-top: 9px; margin-bottom: 0 !important; }
.segment-fields label { color: #65738a; font-size: 11px; }
.segment-fields .select, .segment-fields .input { margin-top: 5px; }
.guide-actions, .button-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.guide-actions span { margin-left: auto; color: #7b899c; font-size: 11px; }
.checkbox-row { display: flex; align-items: center; gap: 7px; margin-top: 8px; color: #627088; font-size: 12px; }
.two-column-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 10px; }
.two-column-fields label, .three-column-fields label { color: #65738a; font-size: 12px; }
.two-column-fields .select { margin-top: 5px; }
.three-column-fields { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.button { min-height: 36px; border: 1px solid #cdd8e6; border-radius: 9px; background: #fff; color: #33425a; padding: 0 13px; font-weight: 650; }
.button:hover:not(:disabled) { border-color: #8ba9d7; }
.button--primary { border-color: #246bfd; background: linear-gradient(135deg,#246bfd,#5d50eb); color: #fff; box-shadow: 0 8px 18px rgba(44,99,235,.2); }
.button--accent { border-color: #7354e9; background: linear-gradient(135deg,#6248e7,#b146d7); color: #fff; box-shadow: 0 8px 18px rgba(113,73,221,.18); }
.button--ghost { background: #f7f9fc; }
.button--small { min-height: 32px; padding: 0 9px; font-size: 11px; }
.button--wide { width: 100%; min-height: 43px; }
.export-video-box { margin-top: 10px; padding: 10px; border: 1px solid #dfd9f6; border-radius: 11px; background: linear-gradient(145deg,#fbfaff,#f5f2ff); }
.export-video-box .button { margin-top: 9px; }
.export-video-box small { display: block; margin-top: 7px; color: #81789c; font-size: 9px; line-height: 1.5; }
.saved-project-row { display: grid; grid-template-columns: 1fr 36px 36px; gap: 6px; margin-top: 9px; }
.map-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #d9e4ef; }
#map { position: absolute; inset: 0; }
.map-instruction { position: absolute; top: 16px; left: 16px; right: 16px; max-width: 580px; display: grid; gap: 3px; padding: 11px 14px; border: 1px solid rgba(210,222,237,.9); border-radius: 11px; background: rgba(255,255,255,.92); box-shadow: 0 10px 26px rgba(33,52,78,.14); backdrop-filter: blur(10px); z-index: 5; }
.map-instruction strong { font-size: 13px; }
.map-instruction span { color: #718097; font-size: 11px; }
.toast { position: absolute; top: 88px; left: 50%; transform: translateX(-50%); max-width: min(720px,82%); padding: 9px 14px; border-radius: 999px; background: rgba(27,43,67,.9); color: #fff; font-size: 12px; text-align: center; z-index: 10; box-shadow: 0 8px 20px rgba(19,35,59,.2); }
.toast--error { background: rgba(181,44,52,.94); }
.playback-card { position: absolute; left: 18px; right: 18px; bottom: 18px; padding: 12px 14px; border: 1px solid rgba(210,222,237,.92); border-radius: 14px; background: rgba(255,255,255,.94); box-shadow: 0 14px 34px rgba(30,48,75,.18); backdrop-filter: blur(12px); z-index: 7; }
.playback-summary { display: flex; gap: 22px; margin-bottom: 10px; }
.playback-summary div { display: flex; align-items: baseline; gap: 6px; }
.playback-summary strong { font-size: 15px; }
.playback-summary span { color: #7f8ca0; font-size: 10px; }
.playback-controls { display: grid; grid-template-columns: 58px 1fr 125px 68px 50px; align-items: center; gap: 9px; }
.play-button { height: 34px; border: 0; border-radius: 9px; background: #236df3; color: #fff; font-weight: 750; }
.playback-controls input[type=range] { width: 100%; }
.time-label { color: #65738a; font-size: 10px; text-align: center; }
.rate-select { height: 32px; border: 1px solid #d4deea; border-radius: 8px; background: #fff; }
.route-results { display: grid; gap: 14px; }
.route-segment { display: grid; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid #dfe7f1; }
.route-segment header { display: grid; gap: 2px; }
.route-segment header span { color: #246bfd; font-size: 11px; font-weight: 800; }
.route-segment header strong { font-size: 12px; }
.warning-box { padding: 8px 10px; border: 1px solid #f1d394; border-radius: 9px; background: #fff8e7; color: #8a5f00; font-size: 11px; line-height: 1.5; }
.route-card { width: 100%; display: grid; gap: 9px; padding: 11px; text-align: left; border: 1px solid #dae4ef; border-radius: 12px; background: #fff; color: #28364c; transition: .18s; }
.route-card:hover { transform: translateY(-1px); border-color: #9bb9e9; box-shadow: 0 8px 18px rgba(52,78,112,.08); }
.route-card.selected { border-color: #3474ef; box-shadow: 0 0 0 3px rgba(52,116,239,.1); }
.route-card__top { display: flex; justify-content: space-between; align-items: center; }
.route-card__top > div { display: grid; }
.route-card__top strong { font-size: 13px; }
.route-card__top span { color: #8b97a8; font-size: 10px; }
.selection-mark { padding: 4px 7px; border-radius: 999px; background: #eef3fa; }
.route-card.selected .selection-mark { background: #e8f0ff; color: #246bfd; font-weight: 800; }
.route-card__metrics { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; }
.route-card__metrics span { display: grid; color: #8b97a8; font-size: 9px; }
.route-card__metrics b { color: #2a3950; font-size: 12px; }
.route-card__roads { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #6b788c; font-size: 10px; }
.constraint-state { padding: 5px 7px; border-radius: 7px; font-size: 10px; }
.constraint-state.ok { background: #e9f8f1; color: #087749; }
.constraint-state.bad { background: #fff0f0; color: #b4333d; }
.empty-result { height: calc(100% - 46px); display: grid; align-content: center; justify-items: center; padding: 30px; color: #7a8799; text-align: center; }
.empty-result__icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 20px; background: #eaf1fb; color: #4379d9; font-size: 30px; }
.empty-result h3 { margin: 15px 0 6px; color: #3c4c63; }
.empty-result p { margin: 4px 0; font-size: 12px; line-height: 1.6; }
.node-marker { width: 34px; height: 34px; display: grid; place-items: center; border: 3px solid #fff; border-radius: 50% 50% 50% 7px; color: #fff; font-size: 11px; font-weight: 900; transform: rotate(-45deg); box-shadow: 0 5px 12px rgba(25,43,70,.25); }
.node-marker span { transform: rotate(45deg); }
.node-marker--start { background: #15a66a; }
.node-marker--waypoint { background: #4778ed; }
.node-marker--end { background: #e14e58; }
.guide-marker { width: 28px; height: 28px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 50%; background: #f19322; color: #fff; font-size: 9px; font-weight: 900; box-shadow: 0 4px 10px rgba(72,48,10,.25); }
.moving-icon { position: relative; width: 50px; height: 50px; display: grid; place-items: center; }
.moving-icon__halo { position: absolute; inset: 7px; border-radius: 50%; background: rgba(255,255,255,.95); box-shadow: 0 7px 18px rgba(17,35,68,.28); animation: haloPulse 1.4s ease-in-out infinite; }
.moving-icon__glyph { position: relative; z-index: 2; font-size: 27px; line-height: 1; filter: drop-shadow(0 2px 1px rgba(27,42,67,.13)); animation: travelBob .7s ease-in-out infinite alternate; }
.moving-icon--flight .moving-icon__glyph { animation: planeFloat .8s ease-in-out infinite alternate; }
.moving-icon--train .moving-icon__glyph { animation: trainRumble .28s linear infinite alternate; }
.moving-icon--walking .moving-icon__glyph { animation: walkStep .42s ease-in-out infinite alternate; transform-origin: 50% 85%; }
.moving-icon--bicycling .moving-icon__glyph { animation: cycleBounce .34s ease-in-out infinite alternate; }
@keyframes haloPulse { from { transform: scale(.92); opacity: .9; } to { transform: scale(1.12); opacity: .55; } }
@keyframes travelBob { from { transform: translateY(2px) rotate(-2deg); } to { transform: translateY(-3px) rotate(2deg); } }
@keyframes planeFloat { from { transform: translate(-2px,3px) rotate(-4deg); } to { transform: translate(3px,-4px) rotate(4deg); } }
@keyframes trainRumble { from { transform: translate(-1px,1px); } to { transform: translate(1px,-1px); } }
@keyframes walkStep { from { transform: translateY(1px) rotate(-5deg); } to { transform: translateY(-2px) rotate(5deg); } }
@keyframes cycleBounce { from { transform: translateY(1px) rotate(-2deg); } to { transform: translateY(-2px) rotate(2deg); } }

@media (max-width: 1260px) {
  .workspace { grid-template-columns: 360px minmax(390px,1fr); }
  .panel--right { position: absolute; right: 0; top: 72px; bottom: 0; width: 340px; z-index: 12; box-shadow: -10px 0 30px rgba(28,48,74,.14); }
  .map-stage { margin-right: 340px; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-rows: 62px 1fr; }
  .brand p, .topbar__status .status-pill { display: none; }
  .workspace { display: block; overflow: auto; }
  .panel--left, .panel--right { position: static; width: auto; max-height: none; }
  .map-stage { height: 65vh; margin: 0; }
  .playback-controls { grid-template-columns: 55px 1fr 70px; }
  .time-label, .playback-controls .button { display: none; }
  .three-column-fields { grid-template-columns: 1fr; }
}
.search-result em.search-result__approx { color: #b66a00; background: #fff2d8; border: 1px solid #f3d49b; border-radius: 999px; padding: 3px 6px; }
