body {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: #ffffff00;
    z-index: 0;
}

#container {
    width: calc(100% - 50px);
    margin: 0 auto;
    box-sizing: border-box;
}

@media screen and (max-width: 600px) {
    #container {
        width: calc(100% - 20px);
    }
}

@media screen and (max-width: 500px) {
    #container {
        width: 100%;
    }
}

#pageTitle {
    font-size: 39px;
    font-weight: 700;
    color: #e50011;
    margin: 80px 0 0 0;
    height: fit-content;
    width: 40%;
    display: grid;
    place-items: center;
}

#pageTitle img {
    height: 40px;
    width: auto;
}

@media screen and (max-width: 1200px) {
    #pageTitle {
        width: 100%;
    }
}

@media screen and (max-width: 800px) {
    #pageTitle {
        margin: 80px 0 40px 0;
    }

    #pageTitle img {
        height: 37px;
    }
}

@media screen and (max-width: 600px) {
    #pageTitle {
        margin: 80px 0 40px 0;
    }

    #pageTitle img {
        height: 35px;
    }
}

#main {
    width: 100%;
    display: grid;
    grid-template-columns: 40% 1fr;
    grid-auto-rows: auto;
    column-gap: 20px;
    align-items: start;
    margin-top: 20px;
    margin-bottom: 20px;
}

@media screen and (max-width: 1200px) {
    #main {
        grid-template-columns: 1fr;
    }
}

#checkBoxContainer {
    grid-column: 1;
    grid-row: 1;
    box-sizing: border-box;
    margin-left: 10px;
    z-index: 5;
    background-color: #ffffff00;
    user-select: none;
}

#checkBoxContainer:focus {
    outline: none;
}

#checkBoxContainer h3 {
    margin-top: 15px;
    margin-bottom: 10px;
    font-size: 16px;
    color: #333;
}

/*
#seminarCheckBox,
#worktypeCheckBox {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

#checkBoxContainer label {
    display: inline-block;
    cursor: pointer;
    user-select: none;
    font-size: 14px;
    color: #333;
}
*/

/* ボタンスタイルのチェックボックス */
#checkBoxContainer input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    display: none;
}

label span {
    user-select: none;
}

#filterBtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 2px solid #9990;
    padding: 8px 12px;
    cursor: pointer;
    background-color: #fff;
    transition: all 0.2s ease;
    margin-right: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #333;
    width: fit-content;
    height: auto;
    display: none;
    margin-left: 10px;
    text-decoration-line: underline;
    text-decoration-color: #e50011;
    text-decoration-thickness: 1px;
    -webkit-text-decoration-line: underline;
    -webkit-text-decoration-color: #e50011;
}

#filterBtn:hover {
    border-color: #e50011;
    background-color: #ebdedf;
}

/* ラベルをボタンのように見せる */
#checkBoxContainer label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 2px solid #999;
    padding: 8px 12px;
    cursor: pointer;
    background-color: #fff;
    transition: all 0.2s ease;
    margin-right: 8px;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: #333;
    width: auto;
    height: auto;
}

#checkBoxContainer label.pulse {
    animation: pulse 0.5s ease;
}

#checkBoxContainer label:has(input[type="checkbox"]:checked).pulse {
    animation: none;
}

#checkBoxContainer label:has(input[type="checkbox"]) {
    border: solid 2px #00000000;
    box-sizing: border-box;
    text-decoration-line: underline;
    text-decoration-color: #e50011;
    text-decoration-thickness: 1px;
    -webkit-text-decoration-line: underline;
    -webkit-text-decoration-color: #e50011;
}

#checkBoxContainer label:hover:has(input[type="checkbox"]) {
    border-color: #e50011;
    background-color: #ebdedf;
}

#checkBoxContainer label:has(input[type="checkbox"]:checked) {}

#checkBoxContainer label:hover {
    border-color: #e50011;
    /*background-color: #f9f9f9;*/
}

/* サブ作品ジャンル用トグルスイッチ */
#subWorkTypeFilterConf+label {
    position: relative;
    border: none;
    padding: 0 0 0 56px;
    margin-bottom: 12px;
    background: transparent;
    font-size: 0.8rem;
    color: #333;
}

#subWorkTypeFilterConf+label:hover {
    background: #fff;
}

#subWorkTypeFilterConf+label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: #e0e0e0;
    transition: background 0.2s ease;
    border: solid 2px #999;
}

#subWorkTypeFilterConf+label::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e50011;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, background 0.2s ease;
}

#subWorkTypeFilterConf:checked+label {}

#subWorkTypeFilterConf:checked+label::before {
    background: #e50011;
    border-color: #e50011;
}

#subWorkTypeFilterConf:checked+label::after {
    transform: translate(20px, -50%);
    background: #fff;
}

#subWorkTypeFilterConf+label:hover::before {
    /*background: #bfbfbf;*/
}

#subWorkTypeFilterConf:checked+label:hover::before {
    /*background: #e05273;*/
}

#worktypeCheckBox label:has(input[type="checkbox"]:checked),
#seminarCheckBox label:has(input[type="checkbox"]:checked) {
    background-color: #e50011;
    border-color: #e50011;
    color: #fff;
}

@media screen and (max-width: 1200px) {
    #checkBoxContainer {
        width: 82vw;
    }
}

@media screen and (max-width: 800px) {
    #filterBtn {
        display: inline-flex;
    }

    #checkBoxContainer {
        height: 0;
        width: 0;
        margin-top: 0;
        padding: 0;
        position: fixed;
        top: 50vh;
        left: 50vw;
        grid-column: 1;
        grid-row: 1;
        margin-left: 0;
        height: 0;
        width: 0;
        opacity: 0;
        transition: all 0.3s ease;
        box-sizing: border-box;
        border: solid 2px #e50011;
        background-color: #fff;

        overflow-y: auto;
        overscroll-behavior-y: contain;
        /* iOS対策 */
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    #checkBoxContainer.open {
        min-height: 100dvh;
        width: 100%;
        padding: 70px 15% 10px 15%;
        top: 0;
        left: 0;
        opacity: 1;
    }

    #checkBoxContainer #worktypeCheckBox {
        margin-bottom: 60px;
    }

    #closeCheckBoxContainer {
        display: grid !important;
    }
}

#worksContainer {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
    box-sizing: border-box;
    padding: 10px;
}

#worksContainer.fadeIn {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.work-item {
    width: calc((100% - 16px) / 3);
    height: 300px;
    flex-shrink: 0;
    padding: 6px;
    box-sizing: border-box;
    border: solid 2px #9990;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background-color: #fff;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
}

.work-item:hover {
    background-color: #ebdedf;
    border-color: #e50011;
}

.work-item.highlight {
    border-color: #e50011;
    background-color: #e50011;
    color: #fff;
}

@media screen and (max-width: 1200px) {

    #worksContainer {
        grid-column: 1 / span 2;
        grid-row: 2;
        width: 100%;
        height: auto;
    }

    .work-item {
        width: calc((100% - 40px) / 6);
        height: 300px;
    }

    @media screen and (max-width: 1000px) {

        .work-item {
            width: calc((100% - 32px) / 5);
            height: 300px;
        }

        @media screen and (max-width: 900px) {
            .work-item {
                height: 270px;
            }
        }
    }

    @media screen and (max-width: 800px) {
        .work-item {
            width: calc((100% - 24px) / 4);
            height: 300px;
        }

        @media screen and (max-width: 700px) {
            .work-item {
                height: 270px;
            }
        }
    }

    @media screen and (max-width: 600px) {
        .work-item {
            width: calc((100% - 16px) / 3);
            height: 300px;
        }

        @media screen and (max-width: 500px) {
            .work-item {
                height: 270px;
            }
        }
    }

    @media screen and (max-width: 400px) {
        .work-item {
            width: calc((100% - 8px) / 2);
            height: 300px;
        }

        @media screen and (max-width: 350px) {
            .work-item {
                height: 270px;
            }
        }
    }
}

.work-item img {
    width: 100%;
    height: auto;
    margin-bottom: 5px;
    box-sizing: border-box;
    transition: all 0.5s ease;
    background-color: #111;
    display: block;
}

.work-item.highlight img {
    transform: rotate(3deg) scale(0.95);
    border: solid 2px #e0e0e0;
}

/* 回転アニメーションは一旦保留
.work-item img {
    width: 100%;
    height: auto;
    margin-bottom: 5px;
    box-sizing: border-box;
    transition: transform 0.5s ease, border 0.2s ease;
    display: block;
}

.work-item.highlight img {
    animation: rotateOnce 0.5s ease forwards;
    border: solid 2px #e0e0e0;
}

@keyframes rotateOnce {
    0% {
        transform: rotate(0deg) scale(1);
    }

    100% {
        transform: rotate(363deg) scale(0.95);
    }
}

.work-item img {
    transform: rotate(0deg) scale(1);
}

.work-item:not(.highlight) img {
    transition: transform 0.2s ease, border 0.2s ease;
    transform: rotate(0deg) scale(1);
}
*/

.work-item .work-title {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    white-space: normal;
    /* 折り返し許可 */
    overflow-wrap: anywhere;
    /* 長い単語や連続文字を折り返し */
    word-break: break-word;
    /* Safari等の互換対策 */
}

.work-item.highlight .work-title {
    color: #fff;
}

.work-item .student-name {
    width: fit-content;
    height: auto;
    padding: 4px 8px;
    position: absolute;
    bottom: 0;
    left: 0;
    display: block;
    font-size: 14px;
    color: #666;
}

.work-item.highlight .student-name {
    color: #fff;
}

#worksContainer .pulse {
    animation: pulse 0.5s ease;
}

#worksContainer .work-item.highlight.pulse {
    animation: none;
}

@keyframes pulse {
    0% {
        background-color: #fd8991;
    }

    100% {
        background-color: #ffffff;
    }
}

#worksDisplay {
    margin-top: 20px;
    position: sticky;
    top: 108px;
    height: 600px;
    grid-column: 2;
    grid-row: 1 / span 2;
    box-sizing: border-box;
    border: solid 2px #e50011;
    padding: 10px 9%;
    overflow-y: auto;
    background-color: #fff;
    z-index: 5;
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.4);
}

#worksDisplay:focus {
    outline: none;
}

.closeButton {
    height: 40px;
    width: 40px;
    position: absolute;
    top: 70px;
    right: 16px;
    cursor: pointer;
    display: none;
    place-items: center;
    font-size: 50px;
    /*
    color: #999;
    border: solid 3px #999;
    */
    transition: all 0.2s ease;
    background-color: #fff;
    z-index: 1000;
}

@media screen and (max-width: 800px) {
    .closeButton {
        height: 35px;
        width: 35px;
    }
}

@media screen and (max-width: 600px) {
    .closeButton {
        height: 27px;
        width: 27px;
    }
}

.closeButton img {
    width: 100%;
    height: 100%;
    filter: invert(62%) sepia(5%) saturate(15%) hue-rotate(202deg) brightness(94%) contrast(88%);
    /*実質#999*/
}

.closeButton:hover {
    color: #e50011;
    border-color: #e50011;
}

.closeButton:hover img {
    filter: invert(34%) sepia(91%) saturate(7473%) hue-rotate(340deg) brightness(95%) contrast(101%);
    /*実質#e50011*/
}

#closeWorksDisplay {
    display: none;
}

#closeCheckBoxContainer {
    display: none;
}

@media screen and (min-width: 801px) {
    #closeCheckBoxContainer {
        display: none !important;
    }
}

#worksDisplay .work-thumbnail {
    width: 100%;
    height: auto;
    box-sizing: border-box;
    position: relative;
    user-select: none;
}

#worksDisplay .work-thumbnail img {
    width: 100%;
    height: auto;
}

#worksDisplay .work-subtitle {
    display: block;
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 15px 0;
}

#worksDisplay .work-title {
    display: block;
    font-size: 26px;
    font-weight: 700;
    color: #333;
    margin: 15px 0 10px 0;
}

#worksDisplay .work-description {
    font-size: 16px;
}

#worksDisplay .student-name {
    font-size: 19px;
    font-weight: 600;
    color: #333;
    margin: 15px 0 10px 0;
}

.student-name .seminar-name {
    font-size: 15px;
    font-weight: 400;
    color: #e50011;
    margin-left: 18px;
}

.student-name .seminar-name:hover {
    text-decoration-line: underline;
    text-decoration-color: #e50011;
    text-decoration-thickness: 1px;
    -webkit-text-decoration-line: underline;
    -webkit-text-decoration-color: #e50011;
    cursor: pointer;
}

#worksDisplay .work-tools {
    margin: 18px 0 20px 0;
}

#worksDisplay .work-type {
    display: inline-block;
    width: fit-content;
    height: auto;
    padding: 4px 8px;
    font-size: 15px;
    color: #e50011;
    margin: 10px 2px 0 0;
    border: solid 2px #e50011;
}

#worksDisplay .work-type.work {
    background-color: #e50011;
    border-color: #e50011;
    color: #fff;
}

#worksDisplay .work-type.work:hover {
    text-decoration-line: underline;
    text-decoration-color: #fff;
    text-decoration-thickness: 1px;
    -webkit-text-decoration-line: underline;
    -webkit-text-decoration-color: #fff;
}

#worksDisplay .work-type.subwork:hover {
    text-decoration-line: underline;
    text-decoration-color: #e50011;
    text-decoration-thickness: 1px;
    -webkit-text-decoration-line: underline;
    -webkit-text-decoration-color: #e50011;
}

#worksDisplay .work-link-buttons {
    /*margin-bottom: 25px;*/
}

#worksDisplay .work-link-button {
    display: inline-block;
    width: fit-content;
    height: auto;
    margin-right: 12px;
}

#worksDisplay .work-link-button img {
    width: auto;
    height: 26px;
    /*filter: invert(34%) sepia(91%) saturate(7473%) hue-rotate(340deg) brightness(95%) contrast(101%);*/
}

#worksDisplay .work-place {
    width: 100%;
    height: auto;
    /*margin-bottom: 25px;*/
    margin-bottom: 20px;
}

#worksDisplay .work-place img {
    width: 100%;
    height: auto;
    transition: all 0.3s ease;
}

#worksDisplay .work-place img:hover {
    cursor: pointer;
    transform: scale(1.04);
}

#worksDisplay .backToMenu {
    font-size: 16px;
    color: #e50011;
    cursor: pointer;
    display: none;
}

#worksDisplay .work-thumbnail .thumbnail-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 18px;
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
}

.thumbnail-navigation .thumbnail-index {
    color: #e50011;
}

@media screen and (max-width: 1200px) {

    #worksDisplay {
        height: 0;
        width: 0;
        margin-top: 0;
        padding: 0;
        position: fixed;
        top: 50vh;
        left: 50vw;
        grid-column: 1 / span 2;
        grid-row: 3;
        height: 0;
        width: 0;
        opacity: 0;
        transition: all 0.3s ease;

        overflow-y: auto;
        overscroll-behavior-y: contain;
        /* iOS対策 */
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    #worksDisplay.open {
        min-height: 100dvh;
        width: 100%;
        padding: 70px 14% 10px 14%;
        top: 0;
        left: 0;
        opacity: 1;
    }

    #worksDisplay.open #closeWorksDisplay {
        display: grid;
    }

    #worksDisplay .work-place {
        margin-bottom: 10px;
    }

    #worksDisplay .backToMenu {
        display: inline-block;
        margin-bottom: 25px;
    }

    @media screen and (max-width: 800px) {
        #worksDisplay.open {
            padding: 90px 8% 10px 8%;
        }

        #worksDisplay .work-type {
            font-size: 13px;
            padding: 3px 7px;
        }

        #worksDisplay .work-thumbnail .thumbnail-navigation {
            font-size: 16px;
        }
    }

    @media screen and (max-width: 600px) {
        #worksDisplay.open {
            padding: 90px 5% 10px 5%;
        }

        #worksDisplay .work-type {
            font-size: 12px;
            padding: 2px 6px;
        }

        #worksDisplay .work-thumbnail .thumbnail-navigation {
            font-size: 16px;
        }
    }
}


#returnToTop {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 4;
    background-image: url('../assets/icons/up-arrow-white.svg');
    background-size: 24px 24px;
    background-repeat: no-repeat;
    background-position: center;
    display: grid;
    place-items: center;
    font-size: 30px;
    color: #e50011;
    border: solid 2px #e50011;
    transition: background-color 0.3s ease;
    user-select: none;
}

#returnToTop.fadeHighlight {
    animation: fadeHighlight 0.7s ease;
}

@keyframes fadeHighlight {
    0% {
        color: #fff;
        background-color: #e50011;
    }

    100% {
        color: #e50011;
        background-color: #fff;
    }
}

.bold {
    font-weight: 700;
}

/* iOSのデフォルトCSS対策 */
input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

input[type="checkbox"]:checked {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}