
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
}
/* header and city switch*/

header {
    background: #333;
    color: white;
    text-align: center;
    padding: 1rem 0;
}
.city-toggle {
    position: absolute;
    top: 15px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 8px;
    z-index: 1000;
}

.city-toggle label {
    font-weight: 500;
    color: #ffffff;
}

#city-select {
    padding: 5px 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="gray" height="16" viewBox="0 0 24 24" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 12px;
    padding-right: 30px;
}







/* main area */

main {
    display: flex;
    height: calc(100vh - 80px); 
}

.mainview-panel {
    flex: 0 0 78%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #ccc;
    transition: all 0.3s ease;
}
/* map part */
.map-section {
    flex: 6;
    background-color: #f9f9f9;
    border-bottom: 1px solid #ccc;
    overflow: hidden;
    height: 100%;
    z-index: 10;
    position: relative

}
.map-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden; 
}

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

.legend-box {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: white;
    padding: 6px 10px;
    font-size: 10px;
    border: 1px solid #999;
    border-radius: 5px;
    box-shadow: 0 0 3px rgba(0,0,0,0.2);
    z-index: 10;
}
.station {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: #585454;
    border-radius: 50%;
}

.line {
    position: absolute;
    height: 2px;
    background-color: black;
}


.zoom-controls {
    position: absolute; 
    right: - 75%;  
    display: flex;
    flex-direction: column;
    
}

.zoom-controls button {
    margin: 5px;
    font-size: 20px;
    padding: 0;
    width: 30px; 
    height: 30px; 
    cursor: pointer;
    background-color: #797c7f;
    color: white;
    border: none;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
}


.loading-indicator {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 14px;
    z-index: 999;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.1);
  }
  
  .dots::after {
    content: '';
    animation: dot-flash 1.5s infinite steps(4, end);
  }
  
  @keyframes dot-flash {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
  }


/* timeline part */
.timeline-section {
    flex: 1;
    padding: 1rem;
    background-color: #eee;
    position:relative;
    overflow:visible;
    flex-direction: column; 
    justify-content: center;
    align-items: center;
    height: 100%;  /* 让 .routes-line 在整个区域内居中 */
}
.timeline {
    position: relative;
    width: 90%; 
    background-color: #585454; 
    height: 2px; 
    top: 50%; 
    left: 50px; 
    right: 0; 
    transform: translateY(-50%);
    border-radius: 2.5px;
}

.start-marker,
.end-marker {
    position: absolute;
    width: 2px; 
    height: 30px; 
    background-color: #585454; 
    top: -15px; 
    border-radius: 2.5px;
}
.start-marker {
    left: 0; 
}
.end-marker {
    right: 0; 
}

.timeline-ticks {
    position: relative;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
    height: 10px;
  }
  
  .tick {
    position: absolute;
    width: 1.5px;
    height: 10px;
    background-color: #585454;
  }
  
  .time-labels {
    position: relative;
    width: 100%;
    top: 600%; 
    font-size: 8px;
    color: #585454;
    text-align: center;
  }
  
  .time-label {
    position: absolute;
    white-space: nowrap;
  }

.route-lines{
    position: relative;
    flex-direction: column; 
    width:95%;
    align-items: center;
}
.routes-line{
    justify-content: center;  /* 让子元素垂直方向居中 */
    align-items: center; 
}
  .route-timeline {
    position: relative;
    display: flex;
    height:2px;
    width:95%;
    left: 30px;
}



  
/* marker for the start station*/
  .marker {
    position: absolute;
    width: 5px; 
    height: 30px; 
    stroke: 0.5px;
    top: -15px; 
    z-index: 10;
    border-radius: 2px; 
}
.time-bar{
    position:absolute;
    height:25px;
    top:-12.5px;
    border-radius: 2px
}


  
/* text input area */ 

    /* show or hide the area button */
.text-button {
    flex: 0 0 2%;
    min-width: 10px;
    background-color: #f5f5f5;
}
.hide-text {
    margin-top: 3px;
    margin-left:2px;
    width: 17px;
    height: 17px;
    border-radius: 4px;
    background-color: #797c7f;
    color: white;
    border: none;  
}
.show-text {
    margin-top: 3px;
    margin-left:2px;
    width: 17px;
    height: 17px;
    border-radius: 4px;
    background-color: #797c7f;
    color: white;
    border: none;  
    display: none;
}

   /* input part */ 

.textinput-panel {
    flex: 0 0 20%;
    padding: 1rem;
    background-color: #f5f5f5;
    transition: all 0.3s ease;
    overflow:auto
}

textarea {
    width: 100%;
    height: 2rem;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    resize: none;
    margin-right: 10px;
}

.textinput-panel button { 
    display: block;
    margin-top: 10px;
    padding: 5px 8px;
    background-color: #797c7f;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.input_destination{
    position: relative;
    display: flex;
    align-items: center;
}

.section {
    margin-bottom: 40px; 
}

.input-group {
    margin-bottom: 20px; 
}

  /* for automatch */ 
.match-container {
    position: absolute; 
    top: 100%; 
    left: 0;
    width: 100%; 
    background: white; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
    max-height: 150px; 
    overflow-y: auto; 
    z-index: 1000; 
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none; 
}

.match-item {
    padding: 8px;
    cursor: pointer;
    color: #333; 
}

.match-item:hover {
    background-color: #f0f0f0;
}

.input_destination,
#start_station,
#end_station {
    position: relative; 
}




.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
  }
  .switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
  }
  .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
  }
  input:checked + .slider {
    background-color: #98afdf;
  }
  input:checked + .slider:before {
    transform: translateX(20px);
  }
  .label-text {
    margin-left: 10px;
    font-size: 14px;
  }

