:root {
    --mdc-theme-primary: #9760b3;
}



/**  --- 圖例對話框 css start --- **/
/*  --- 路線圖例 css start --- */
th {
    font-size: medium;
}

td {
    background-color: transparent;
    vertical-align: middle;
    font-size: medium;
    font-weight: 500;
    color: black;
}

.extended-express {
    background-color: transparent; 
    border-bottom-width: 0px; 
    font-size: small;
}

.legend-container {
    display: flex;
    flex-direction: row;
    padding: 8px 0px;
}

.legend-text-container {
    padding-left: 8px;
}

.legend-text {
    margin: 0 0;
}

.legend-text-zh {
    font-size: medium;
}

.legend-text-en {
    font-size: small;
}

@media (min-width:600px) {
    td {
        font-size: large;
    }

    .extended-express {
        font-size: medium;
    }
}
/*  --- 路線圖例 css end --- */

/*  --- 圖例 css start --- */
.legend-row {
    display: flex;
    flex-wrap: wrap;
}

.legend-block {
    flex: 0 0 auto; 
    width: 100%;
}

.legend-divider {
    margin: 8px 0;
}

.legend-col {
    flex: 0 0 auto;
    width: 100%;
}

@media (min-width: 480px) {
    .legend-col {
        flex: 0 0 auto;
        width: 50%;
    }
}

@media (min-width: 600px) {
    .legend-col {
        flex: 0 0 auto;
        width: 50%;
    }
}

@media (min-width: 905px) {
    .legend-col {
        flex: 0 0 auto;
        width: 50%;
    }
}

@media (min-width: 1176px) {
    .legend-col {
        flex: 0 0 auto;
        width: 33.33333333%;
    }
}
/*  --- 圖例 css end --- */
/** --- 圖例對話框 css end --- **/



/* --- 模式切換按鈕 css start  --- */
.segmented-selector-group {
    display: inline-flex;
    font-size: medium;
    margin-left: 0px;
}

.segmented-radio {
    display: none;
}

.segmented-btn {
    padding: 8px 12px;
    border: 1px solid black;
    background-color: transparent;  /* 未選取預設背景色 */
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    transition: background-color 0.2s ease-in-out;
    font-size: medium;
    font-weight: normal;
    color: black;

    -webkit-tap-highlight-color: transparent;
}

.segmented-btn:active {
    background-color: #E0E0E0; /* 按下時的顏色，可以和 hover 相同或稍深 */
}

/* 將所有 :hover 規則都放進這個 media query 中 */
/* 這段 CSS 只會在有精確指標 (如滑鼠) 且支援 hover 的裝置上生效 */
@media (hover: hover) and (pointer: fine) {
    .segmented-btn:hover {  /* 未選取時 hover 的背景色 */
        background-color: #E0E0E0;
    }

    .segmented-radio:checked+.segmented-btn:hover {
        background-color: #c19ed4; /* 選取時 hover 的背景色 */
    }
}

.segmented-btn:not(:first-of-type) {
    margin-left: -1px;
}

#mode_price_radio+.segmented-btn {
    border-top-left-radius: 1.3125em;
    border-bottom-left-radius: 1.3125em;
}

#mode_time_radio+.segmented-btn {
    border-top-right-radius: 1.3125em;
    border-bottom-right-radius: 1.3125em;
}

.segmented-radio:checked+.segmented-btn {
    background-color: #d9c4e4;  /* 選取時的背景色 */
}

.segmented-btn .selection-icon {
    display: none;  /* 預設隱藏圖示 */
    margin-right: 8px;  /* 圖示和文字之間的間距 */
}

.segmented-radio:checked+.segmented-btn .selection-icon {
    display: inline-block;  /* 當 radio input 被選中時，顯示其對應 label 內的 SVG 圖示 */
}
/* --- 模式切換按鈕 css start  --- */



/* --- 下拉式選單 css start  --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-button {
    padding: 8px 12px; 
    border: #787878 solid 2px;
    border-radius: 4px; 
    font-size: medium; 
    background-color: transparent; 
    /* width: 180px;  */
    width: 12em;
    text-align: left;
}

.dropdown-button:hover {
    border: #9760b3 solid 2px;
}

.dropdown-button:focus {
    border: #9760b3 solid 2px;

    outline-width: 0px !important;
    outline-style: solid !important;
    outline-color: #ffa900 !important;
    background-color: transparent !important;
    color: #9760b3 !important;
}

.dropdown-button:focus * {
    background-color: white!important;
    color: #000!important; 
}

.dropdown-button:focus #benchmark_station_title {
    color: #9760b3!important;  
}

.dropdown-content { /* 預設隱藏選單 */
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    /* min-width: 160px; */
    min-width: 10em;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 2;
    max-height: 300px; /* 選單最大高度 */
    overflow-y: auto;  /* 當內容超出 max-height 時，顯示垂直捲軸 */
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: medium;
    text-align: left;
}

.dropdown-content a:hover {
    background-color: #E0E0E0
}

.dropdown.dropdown-is-active .dropdown-content {    /* 按下按鈕 -> 顯示選單 */ 
    display: block;
}

#benchmark_station_title {
    font-size: small; 
    color: #484848;  
    position: absolute; 
    background-color: white; 
    z-index: 1; 
    top: -12px; 
    left: 8px;
    padding: 0px 4px;
}

.dropdown-button:hover #benchmark_station_title {
    color: #9760b3;  
}
/* --- 下拉式選單 css end  --- */



/* -- Outlined button css start -- */
.outlined-button {
    padding: 8px 12px;
    border: rgba(0, 0, 0, 1) solid 1px;
    font-size: medium;
    background-color: transparent;
    color: #9760b3;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.outlined-button:focus {
    outline-width: 3px !important;
    outline-style: solid !important;
    outline-color: #9760b3 !important;
    background-color: #c19ed4 !important;
    color: #000 !important;
}

.outlined-button:focus svg {
    fill: black;
    background-color: #c19ed4 !important;
}

@media (hover: hover) and (pointer: fine) {
    .outlined-button:hover {
        background-color: #f0e7f4 !important;
    }
    

    .outlined-button:hover svg {
        background-color: #f0e7f4 !important;
    }
}
/* -- Outlined button css end -- */


/* -- Contained button css start -- */
.contained-button {
    padding: 8px 12px;
    border: black solid 0px;
    font-size: medium;
    background-color: #9760b3;
    color: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
}

.contained-button:focus {
    outline-width: 3px !important;
    outline-style: solid !important;
    outline-color: #9760b3 !important;
    background-color: #c19ed4 !important;
    color: #000 !important;
}

.contained-button:focus svg {
    fill: black;
    background-color: #c19ed4 !important;
}

@media (hover: hover) and (pointer: fine) {
    .contained-button:hover {
        background-color: #a97ac1 !important;
    } 

    .contained-button:focus:hover {
        color: white !important;
    }

    .contained-button:hover svg {
        background-color: #a97ac1 !important;
    }

    .contained-button:focus:hover svg {
        fill: white;
    }
}        
/* -- Contained button css end -- */


.lang-button {
    background-color: white;
    color: #9760b3;
    font-size: medium;
    padding-top: 8px;
    padding-bottom: 8px;
    padding-left: 12px;
    padding-right: 12px;
    border-width: 1px;
    border-radius: 4px;
    border-color: #ddd;
}

#btn_lang:focus {
    outline-width: 3px!important;
    outline-style: solid!important;
    outline-color: #ffa900!important;
    background-color: white!important;
    color: #000!important;
}

#btn_lang:focus * {
    background-color: white!important;
    color: #000!important;
}

.quicklinkbox, .box_head, .maintitle {
    display: none;  /* 當螢幕寬不足600px，隱藏快速連結、標題欄等資訊 */
}

#mobile_title {
    display: block;
}

.container-road-map {
    background-color: white;
    padding: 8px 16px;
}

.container-road-map-svg {
    display: flex; 
    justify-content: center; 
    background-color: white; 
    border: 1px solid #808080; 
    border-radius: 4px;
    padding: 8px;
    margin-top: 8px;
}

@media (min-width: 600px) {
    .quicklinkbox, .box_head, .maintitle {
        display: block; /* 顯示快速連結、標題欄等資訊 */
    }

    #mobile_title {
        display: none;
    }

    .container-road-map {
        padding: 16px;
    }

    .container-road-map-svg {
        border: none;
        padding: 16px;
    }
}

/* 在 mobile，將內容區塊內距設定為 0 */
@media (max-width: 599px) {
    .container-mrt-map {
        padding-right: 0px;
        padding-left: 0px;
        margin-right: auto;
        margin-left: auto;
    }
}


/* 讓SVG Text 在觸控螢幕無法被選擇反白 */
svg text.station-value-text {
    -webkit-user-select: none; /* Safari, Chrome, Opera (舊版) */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* Internet Explorer/Edge */
    user-select: none;         /* 標準語法 */

    /* 針對 iOS Safari，防止長按時出現複製/貼上等選單 (可選) */
    -webkit-touch-callout: none;
}



.mdc-tooltip__surface {
    font-size: x-small;
}

.mdc-dialog.mdc-dialog--fullscreen .mdc-dialog__surface {
    max-width: 1040px;
}