﻿html > body {
    margin: 0 auto;
}

body {
    background: #f3f3f3;
    height: 100vh;
    width: min(430px, 100%);
}

:root, body {
    background-color: #f3f3f3 !important;
}


.simple-button {
    display: inline-block;
    border: none;
    color: #333;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

    .simple-button.disabled {
        background: #f3f3f3;
        cursor: not-allowed;
    }

    .simple-button:not(.disabled):active {
        box-shadow: inset 0 -3px #999; /*add a darker shade on the bottom edge */
        background: #108dda;
    }

fluent-card {
    background: #fdfdfd;
}


/******/

.overview-table-container {
    margin: 0 2px;
    overflow: scroll;
}

table.overview {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

    table.overview th, table.overview td {
        padding: 4px;
        text-align: left;
        border-bottom: 1px solid #e1dfdd;
    }

    table.overview th {
        background-color: #f3f2f1;
        font-weight: 600;
        color: #605e5c;
        position: sticky;
        top: 0;
        z-index: 1;
        box-shadow: inset 0 -1px 0 0 #efe8e0;
        white-space: nowrap;
    }

    table.overview > tbody > tr > td:first-child {
        width: 33%;
        word-wrap: break-word;
        word-break: break-all;
    }

    table.overview > tbody > tr > td:nth-child(2) {
        width: 10%;
        word-wrap: break-word;
        word-break: break-all;
    }

    table.overview tr:nth-child(even) {
        background-color: #efe8e0;
    }

    table.overview td > .note {
        margin-left: 23px;
        border-bottom: 1px dotted #b2a8ad;
        color: dimgray;
    }

.simple-badge {
    font-size: 12px;
    background: floralwhite;
    color: grey;
    border-radius: 4px;
    padding: 2px 4px;
    line-height: 24px;
}

.timetable-overview {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 8px 12px 12px;
    gap: 10px;
    overflow: hidden;
}

.timetable-overview-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: .5rem .75rem;
}

.timetable-overview-toolbar-content {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: .5rem .75rem;
    min-width: 0;
}

.timetable-overview-title {
    margin: 0;
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    flex-wrap: wrap;
    gap: .35rem;
    min-width: 0;
    min-height: 24px;
    font-size: 1.15rem;
    line-height: 1.2;
}

    .timetable-overview-title .simple-badge {
        display: inline-flex;
        align-items: center;
        height: 24px;
        padding: 0 4px;
        line-height: 1;
    }

.timetable-overview-heading-group {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    line-height: 1;
}

    .timetable-overview-heading-group .timetable-overview-heading {
        font-weight: 600;
        line-height: 1.2;
    }

    .timetable-overview-heading-group .timetable-overview-entry {
        color: #69758a;
        font-size: 12px;
        font-weight: 500;
        line-height: 1;
        margin-bottom: 2px;
    }

.timetable-overview-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .5rem;
    margin-left: auto;
}

.timetable-overview-refresh {
    flex: 0 0 auto;
    width: 24px;
    min-width: 24px;
    height: 24px;
    line-height: 1;
}

.timetable-overview-home {
    flex: 0 0 auto;
    width: 24px;
    min-width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 1;
    margin-left: auto;
}

    .timetable-overview-refresh::part(control),
    .timetable-overview-home::part(control) {
        width: 24px;
        min-width: 24px;
        height: 24px;
        padding: 0;
        border-radius: 4px;
    }

    .timetable-overview-refresh::part(content),
    .timetable-overview-home::part(content) {
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
    }

.timetable-overview-summary {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    color: #42526b;
    font-size: .9rem;
}

    .timetable-overview-summary span {
        border: 1px solid #d9e2ef;
        background: #f6f9fe;
        border-radius: .3rem;
        padding: .25rem .5rem;
    }

.timetable-overview-table-container {
    flex: 1;
    overflow: auto;
}

.timetable-overview-table {
    --overview-first-column-width: 8.75rem;
    --overview-second-column-width: 5.25rem;

    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-size: .88rem;
}

    .timetable-overview-table th,
    .timetable-overview-table td {
        padding: .45rem .4rem;
        border-bottom: 1px solid #e7edf5;
        text-align: left;
        /*vertical-align: top;*/
        overflow-wrap: anywhere;
    }

    .timetable-overview-table th:first-child,
    .timetable-overview-table td:first-child {
        position: sticky;
        left: 0;
        width: var(--overview-first-column-width);
        min-width: var(--overview-first-column-width);
        max-width: var(--overview-first-column-width);
        z-index: 2;
    }

    .timetable-overview-table th:nth-child(2),
    .timetable-overview-table td:nth-child(2) {
        position: sticky;
        left: var(--overview-first-column-width);
        width: var(--overview-second-column-width);
        min-width: var(--overview-second-column-width);
        max-width: var(--overview-second-column-width);
        z-index: 2;
    }

    .timetable-overview-table tbody tr {
        background: #ffffff;
    }

    .timetable-overview-table th {
        position: sticky;
        top: 0;
        background: var(--neutral-layer-card-container);
        color: #3b4b63;
        z-index: 1;
    }

        .timetable-overview-table th:first-child,
        .timetable-overview-table th:nth-child(2) {
            z-index: 3;
        }

    .timetable-overview-table tbody tr:nth-child(even) {
        background: #faf9f8;
    }

    .timetable-overview-table td:first-child,
    .timetable-overview-table td:nth-child(2) {
        background: inherit;
    }

        .timetable-overview-table th:last-child,
        .timetable-overview-table td:last-child {
            text-align: center;
        }

.timetable-overview-empty {
    padding: 1rem;
    text-align: center;
    color: #667085;
}

@media (max-width: 640px) {
    .timetable-overview-actions {
        width: 100%;
    }

        .timetable-overview-actions fluent-select {
            flex: 1 1 10rem;
        }
}


/* 课表 */

/* .grid-item 课表课程内容格子样式 */


/* 【全局】设置课表的内容格子的背景色和字体颜色 */
.grid-item {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2px 0; /* 使用rem单位来表示相对于根元素字体大小的内边距 */
    text-align: center;
    word-break: break-word;
    border: 1px solid #f2d3d8; /* 使用rem单位来表示相对于根元素字体大小的边框宽度 */
    border-radius: 0.2rem; /* 使用rem单位来表示相对于根元素字体大小的圆角半径 */
    box-shadow: 0 0.32rem 0.72rem #000000,0 .06rem .18rem #000000; /*fallback*/
    box-shadow: 0 0.32rem 0.72rem rgba(0,0,0,.132),0 .06rem .18rem rgba(0,0,0,.108); /* 使用rem单位来表示相对于根元素字体大小的阴影偏移量和模糊半径 */
    transition: transform .167s cubic-bezier(.1,.9,.2,1),opacity .167s cubic-bezier(.1,.9,.2,1); /* 使用固定值 */
    background: #8f3c84;
    margin: 0.05rem;
    text-wrap: balance; /* https://developer.chrome.com/blog/css-text-wrap-balance/ */
    overflow: auto; /*2023.9.24 修复当课程格子过长时 会显示错位的bug*/
}
    /*课程名*/
    .grid-item div:first-child {
        flex: 1;
        overflow: auto;
        padding: 0 .1rem;
    }

    /*点击课程格子时一个微弱的动画*/
    .grid-item:hover {
        transform: scale(1.02);
        /*opacity: 0.9;*/
    }

    /*教室*/
    .grid-item span {
        color: #ECE2F3;
        font-weight: bold;
        font-size: 90%;
        /*text-decoration: underline;*/
        /*white-space: nowrap;*/ /*教室换行*/
        word-break: break-word;
        border-top: 1px dashed var(--timetable-classroom-border-color);
    }

    /*重课：格子变透明*/
    .grid-item.overlapped {
        opacity: .5;
    }

        /*重课：格子右侧有一条虚线*/
        .grid-item .overlapped::after {
            content: '';
            position: absolute;
            right: 0;
            top: 0;
            bottom: 0;
            z-index: 1;
            border-right: 2px dotted red;
        }

    .grid-item:has(.non-curricular) {
        opacity: .4;
        pointer-events: none;
    }

.non-curricular {
    padding: 0 .1rem;
}

fluent-tabs {
    padding: unset !important;
}

.divider {
    display: flex;
    align-items: center;
    justify-content: center;
}

    .divider::before,
    .divider::after {
        content: "";
        flex: 1;
        height: 1px;
        background: #ccc;
        margin: 0 10px;
    }

    .divider > span.dot {
        color: #ccc;
    }
