:root {
    color-scheme: light;
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    color: #000;
    background: #fff;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #fff;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
}

.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;
}

.tracking-page {
    width: min(1150px, calc(100% - 40px));
    margin: 0 auto;
    padding: 32px 0 56px;
}

.tracking-query {
    position: relative;
    min-height: 181px;
    padding: 19px 20px 68px;
    border-radius: 8px;
    background: #f3f3f3;
}

.waybill-editor {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px 10px;
    min-height: 84px;
    cursor: text;
}

.waybill-chips {
    display: contents;
}

.waybill-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    max-width: 100%;
    padding: 0 12px 0 13px;
    border-radius: 18px;
    color: #fff;
    background: #01083f;
    font-size: 13px;
    line-height: 1;
}

.waybill-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chip-remove {
    display: grid;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    padding: 0;
    place-items: center;
    border-radius: 50%;
    cursor: pointer;
    background: transparent;
}

.chip-remove img {
    display: block;
    width: 18px;
    height: 18px;
}

.waybill-input {
    flex: 1 1 360px;
    min-width: 180px;
    height: 36px;
    padding: 0;
    border: 0;
    outline: 0;
    color: #111;
    background: transparent;
    font-size: 14px;
}

.waybill-input::placeholder {
    color: #6d6d6d;
    opacity: 1;
}

.query-button {
    position: absolute;
    right: 15px;
    bottom: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 137px;
    height: 36px;
    border-radius: 4px;
    color: #000;
    background: #fedf4d;
    cursor: pointer;
    font-size: 16px;
}

.query-button:hover {
    background: #f6d537;
}

.query-button:disabled {
    cursor: wait;
    opacity: .65;
}

.query-button img {
    width: 16px;
    height: 16px;
    transform: rotate(-90deg);
}

.tracking-records {
    padding-top: 18px;
}

.tracking-records h2 {
    margin: 0 0 28px;
    color: #787f87;
    font-size: 14px;
    font-weight: 400;
}

.records-status {
    display: none;
    padding: 48px 20px;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    color: #787f87;
    text-align: center;
    font-size: 14px;
}

.records-status.is-visible {
    display: block;
}

.records-list {
    display: grid;
    gap: 24px;
}

.tracking-card {
    overflow: hidden;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
}

.tracking-card__header {
    display: flex;
    align-items: center;
    min-height: 70px;
    padding: 18px 28px;
    border-bottom: 1px solid #d9d9d9;
    background: #f0f0f0;
}

.tracking-card__header h3 {
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 20px;
    font-weight: 700;
}

.tracking-card__body {
    display: grid;
    grid-template-columns: 122px minmax(0, 1fr);
    gap: 24px;
    padding: 32px 28px 20px;
}

.route-summary {
    display: grid;
    align-content: start;
    gap: 24px;
}

.route-field {
    display: grid;
    gap: 5px;
}

.route-field__label {
    color: #787f87;
    font-size: 14px;
}

.route-field__value {
    min-height: 21px;
    overflow-wrap: anywhere;
    font-size: 16px;
}

.timeline {
    position: relative;
    min-width: 0;
    padding-left: 52px;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 18px;
    bottom: 18px;
    left: 18px;
    width: 1px;
    background: #d9d9d9;
}

.timeline-item {
    position: relative;
    min-height: 86px;
    padding: 4px 0 18px;
}
 
.timeline-item .attachments{
    display: none;
}

.timeline-item:nth-child(1) .attachments{
    display: flex;
}

.timeline-item:last-child {
    min-height: 60px;
}

.timeline-marker {
    position: absolute;
    top: 5px;
    left: -45px;
    z-index: 1;
    display: grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 50%;
    background: #fff;
}

.timeline-item:first-child .timeline-marker {
    width: 36px;
    height: 36px;
    top: -2px;
    left: -52px;
}

.timeline-marker img {
    display: block;
    width: 14px;
    height: 14px;
}

.timeline-item:first-child .timeline-marker img {
    width: 36px;
    height: 36px;
}

.timeline-heading {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px 16px;
    min-height: 24px;
    font-size: 16px;
    font-weight: 700;
}

.timeline-info {
    margin: 7px 0 0;
    overflow-wrap: anywhere;
    color: #000;
    font-size: 16px;
    line-height: 1.55;
}

.timeline-info.is-empty {
    display: none;
}

.attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
}

.attachment {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    padding: 0;
    overflow: hidden;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    cursor: pointer;
    background: #f6f6f6;
    text-decoration: none;
}

.attachment img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment--pdf img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.card-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 132px;
    min-height: 32px;
    margin: 0 auto 12px;
    padding: 0 8px;
    color: #787f87;
    cursor: pointer;
    background: transparent;
    font-size: 14px;
}

.card-toggle img {
    width: 14px;
    height: 14px;
    transition: transform .2s ease;
}

.tracking-card.is-expanded .card-toggle img {
    transform: rotate(180deg);
}

.feedback {
    position: fixed;
    z-index: 30;
    top: 50%;
    left: 50%;
    display: none;
    min-width: 181px;
    max-width: min(420px, calc(100% - 32px));
    min-height: 50px;
    padding: 15px 20px;
    transform: translate(-50%, -50%);
    border-radius: 8px;
    color: #f00;
    background: rgba(0, 0, 0, .35);
    text-align: center;
    font-size: 14px;
}

.feedback.is-visible {
    display: block;
}

.preview-modal {
    position: fixed;
    z-index: 50;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.preview-modal.is-open {
    display: flex;
}

.preview-backdrop {
    position: absolute;
    inset: 0;
    cursor: default;
    background: rgba(0, 0, 0, .5);
    backdrop-filter: blur(11px);
}

.preview-dialog {
    position: relative;
    z-index: 1;
    width: min(1000px, 100%);
    height: min(1021px, calc(100vh - 80px));
    padding: 62px 50px 59px;
    border-radius: 20px;
    background: #fff;
}

.preview-close {
    position: absolute;
    top: 15px;
    right: 15px;
    display: grid;
    width: 30px;
    height: 30px;
    padding: 0;
    place-items: center;
    cursor: pointer;
    background: transparent;
}

.preview-close img {
    width: 30px;
    height: 30px;
}

.preview-content {
    width: 100%;
    height: 100%;
}

.preview-content img,
.preview-content iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 8px;
    object-fit: contain;
    background: #f6f6f6;
}

@media (max-width: 760px) {
    .tracking-page {
        width: min(100% - 24px, 1150px);
        padding-top: 16px;
    }

    .tracking-query {
        padding: 16px 14px 66px;
    }

    .waybill-input {
        flex-basis: 100%;
    }

    .query-button {
        right: 14px;
        bottom: 15px;
    }

    .tracking-card__header {
        min-height: 58px;
        padding: 14px 16px;
    }

    .tracking-card__header h3 {
        font-size: 17px;
    }

    .tracking-card__body {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 22px 16px 14px;
    }

    .route-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .timeline {
        padding-left: 44px;
    }

    .timeline-heading,
    .timeline-info {
        font-size: 14px;
    }

    .preview-modal {
        padding: 16px;
    }

    .preview-dialog {
        height: min(760px, calc(100vh - 32px));
        padding: 54px 16px 16px;
        border-radius: 12px;
    }
}
