*,
*::before,
*::after {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

.inline-flex {
    display: inline-flex;
}

body {
    background: url(https://hexschool.github.io/js-filter/assets/bg.jpg);
    background-size: cover;
    min-height: 100vh;
    font-family: "NotoSansCJKtc-Bold";
    color: #2a2a2a;
    letter-spacing: 1px;
}

.wrap {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 1rem;
}

.logo a {
    display: block;
    background: url(https://firebasestorage.googleapis.com/v0/b/hexschool-courses.appspot.com/o/course%2FJS%20%E5%89%8D%E7%AB%AF%E4%BF%AE%E7%B7%B4%E5%85%A8%E6%94%BB%E7%95%A5%2F1628942714013-logo%20%E6%94%B9.png?alt=media&token=583e78ed-6a6c-4660-9f0e-2f59f8eb78e2) no-repeat;
    width: 450px;
    height: 105px;
    text-indent: 101%;
    overflow: hidden;
    cursor: pointer;
}

@media (max-width: 767px) {
    body {
        background-position: center top;
        padding-bottom: 4.5rem;
    }

    .wrap {
        padding: 0 0.75rem;
    }

    .logo a {
        background: url(https://firebasestorage.googleapis.com/v0/b/hexschool-courses.appspot.com/o/course%2FJS%20%E5%89%8D%E7%AB%AF%E4%BF%AE%E7%B7%B4%E5%85%A8%E6%94%BB%E7%95%A5%2F1629001163643-logo-sm.png?alt=media&token=914f40fc-c143-4aaa-a1c3-fb0bdd17fa9c) no-repeat;
        width: 178px;
        height: 50px;
        margin: 1.25rem auto;
    }
}

.main {
    background: #fff;
    border: 5px solid #fff8d45a;
    padding: 2.5rem;
}

@media (max-width: 767px) {
    .main {
        padding: 0.75rem;
        border-width: 3px;
    }
}

.btn-type {
    padding: 0.5rem 2.5rem;
    color: #2a2a2a;
    letter-spacing: 1px;
    margin: 0 0.625rem 1.25rem 0;
}

.btn-type:hover,
.btn-type:active {
    background: #757473;
}

@media (max-width: 767px) {
    .button-group {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .btn-type {
        flex: 1 1 calc(33.333% - 0.5rem);
        min-width: 5rem;
        margin: 0 0 1rem;
        padding: 0.625rem 0.75rem;
    }
}

.seach-group {
    white-space: nowrap;
    margin-bottom: 2.5rem;
    width: 100%;
}

.date-input,
.crop-input {
    width: 40.625%;
}

.date-input label,
.crop-input label {
    background: #899e39;
    padding: 0.5rem 1rem;
    width: 27.5%;
}

.date-input input,
.crop-input input {
    width: 80%;
    border: 2px #899e39 solid;
    padding: 0.375rem;
    margin-left: -0.3125rem;
}

.search {
    width: 16.39%;
    background: #899e39;
    padding: 0.5rem 3.375rem;
}

@media (max-width: 767px) {
    .seach-group {
        margin-bottom: 1.5rem;
    }

    .date-input,
    .crop-input {
        width: 100%;
    }

    .date-input label,
    .crop-input label {
        flex: 0 0 auto;
        width: auto;
        min-width: 5.75rem;
        text-align: center;
    }

    .date-input input,
    .crop-input input {
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
    }

    .search {
        width: 100%;
        margin-left: 0 !important;
        padding: 0.625rem 1rem;
    }
}

.sort-select {
    appearance: none;
    -moz-appearance: none;
    -webkit-appearance: none;
    background: url('data:image/svg+xml;utf8,<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="sort-down" class="svg-inline--fa fa-sort-down fa-w-2" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="10 0 320 900"><path fill="currentColor" d="M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9 0L24 329c-15.1-15.1-4.4-41 17-41z"></path></svg>') no-repeat;
    background-position: 105px 5px;
}

.show-result {
    font-size: 18px;
    letter-spacing: 1.12px;
}

.sort-content {
    margin-bottom: 1.25rem;
}

.market thead {
    background: #f4f1ea;
    border-top: 2px solid #2a2a2a;
    border-bottom: 2px solid #2a2a2a;
}

.market tbody {
    border-bottom: 2px solid #d9d9d9;
}

@media (max-width: 767px) {
    .sort-content {
        min-height: 1.75rem;
        margin-bottom: 0.75rem;
    }

    .show-result {
        font-size: 1rem;
        line-height: 1.5;
        white-space: normal;
        text-align: center;
    }

    .market {
        display: block;
        width: 100%;
        margin-right: 0 !important;
        white-space: normal;
    }

    .market thead {
        display: none;
    }

    .market tbody,
    .market tr,
    .market td {
        display: block;
        width: 100%;
    }

    .market tr {
        border: 1px solid #d9d9d9;
        border-radius: 0.5rem;
        margin-bottom: 0.75rem;
        overflow: hidden;
    }

    .market td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        border-bottom: 1px solid #ececec;
        padding: 0.75rem;
        text-align: right;
        white-space: normal;
    }

    .market td:last-child {
        border-bottom: 0;
    }

    .market td::before {
        flex: 0 0 auto;
        color: #757473;
        font-weight: bold;
        text-align: left;
    }

    .market td:nth-child(1)::before {
        content: "作物名稱";
    }

    .market td:nth-child(2)::before {
        content: "市場名稱";
    }

    .market td:nth-child(3)::before {
        content: "上價";
    }

    .market td:nth-child(4)::before {
        content: "中價";
    }

    .market td:nth-child(5)::before {
        content: "下價";
    }

    .market td:nth-child(6)::before {
        content: "平均價";
    }

    .market td:nth-child(7)::before {
        content: "交易量";
    }

    .market td[colspan] {
        display: block;
        text-align: center;
    }

    .market td[colspan]::before {
        content: none;
    }
}

@media (max-width: 767px) {
    .mobile-select {
        appearance: none;
        -moz-appearance: none;
        -webkit-appearance: none;
        background: url('data:image/svg+xml;utf8,<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="sort-down" class="svg-inline--fa fa-sort-down fa-w-2" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="10 0 320 800"><path fill="currentColor" d="M41 288h238c21.4 0 32.1 25.9 17 41L177 448c-9.4 9.4-24.6 9.4-33.9 0L24 329c-15.1-15.1-4.4-41 17-41z"></path></svg>') no-repeat;
        background-color: #fff;
        background-position: right 0.5rem center;
        box-shadow: 0 0.25rem 1rem rgba(42, 42, 42, 0.18);
        min-width: 6.5rem;
        min-height: 2.75rem;
        margin: 0 0.75rem 0.75rem 0;
    }
}

.sort-advanced {
    position: relative;
}

.fa-caret-up,
.fa-caret-down {
    position: absolute;
}

.fa-caret-up {
    top: -2px;
    right: -15px;
}

.fa-caret-down {
    top: 9px;
    right: -15px;
}

.seach-group{
    display: flex;
    justify-content: center;
}

.btn-type.active {
    background: #f8d45a !important;
    color: #2a2a2a !important;
}
