<style>
    body {
        font-family: Arial, sans-serif;
        margin: 0;
        padding: 0;
    }
    .header-container {
        background-color: #f8f8f8;
        padding: 10px 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    .logo-container {
        display: flex;
        align-items: center;
    }
    .logo-container a {
        display: flex;
        align-items: center;
        text-decoration: none;
        color: black;
    }
    .logo {
        width: auto;
        height: 3em;
        margin-right: 10px;
    }
    h1 {
        font-size: 1.5em;
        margin: 0;
    }
    nav ul {
        list-style-type: none;
        padding: 0;
        margin: 0;
        display: flex;
    }
    nav ul li {
        margin-left: 20px;
        position: relative;
    }
    nav ul li a {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: black;
    }
    nav ul li a .en {
        font-size: 0.7em;
        color: #666;
        font-weight: normal;
        text-decoration: none;
        color: teal;
    }
    .dropdown-content {
        display: none;
        position: absolute;
        background-color: #f9f9f9;
        min-width: 160px;
        box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
        z-index: 1;
        border-radius: 4px;
    }
    .dropdown-content li {
        margin: 0;
    }
    .dropdown-content a {
        color: black;
        padding: 12px 16px;
        text-decoration: none;
        display: block;
    }
    .dropdown:hover .dropdown-content {
        display: block;
    }
    .dropdown-content a:hover {
        background-color: #f1f1f1;
    }
    @media (max-width: 768px) {
        .header-container {
            flex-direction: column;
            align-items: flex-start;
        }
        nav ul {
            flex-direction: column;
            margin-top: 10px;
        }
        nav ul li {
            margin: 5px 0;
        }
        .dropdown-content {
            position: static;
            display: none;
        }
        .dropdown:hover .dropdown-content {
            display: block;
        }
    }
    #back-to-top {
        position: fixed;
        bottom: 20px;
        right: 20px;
        background-color: #333;
        color: #fff;
        width: 50px;
        height: 50px;
        text-align: center;
        border-radius: 5px;
        font-size: 20px;
        cursor: pointer;
        display: none;
        transition: opacity 0.3s;
        opacity: 0.7;
    }
    #back-to-top::before {
        content: "▲";
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    #back-to-top:hover {
        opacity: 1;
    }

    /* タイトル画像 */
    main {
        position: relative;
        width: 100%;
        overflow: hidden;
    }

    .responsive-image {
    width: 96%;
    height: auto;
    max-width: 100%;
    display: block;
    }

    .title-image {
      position: relative;
      width: 100%;
      max-width: 1200px; 
      margin: 0 auto;
      overflow: hidden;
    }

    .title-image::before {
      content: "";
      display: block;
      padding-top: 20%; 
    }

    .title-image img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center 25%;
        opacity: 0.25;
    }

    .text-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      padding: 20px;
      box-sizing: border-box;
    }

    .text-overlay p {
      color: black;
      font-size: 36px;
      font-weight: bold;
      text-shadow: 2px 2px 4px rgba(255,255,255,0.5);
      margin: 0;
      line-height:1;
    }


    @media (max-width: 768px) {
        .text-overlay p {
            color: black;
            font-size: 18px;
            font-weight: bold;
            text-shadow: 2px 2px 4px rgba(255,255,255,0.5);
            margin: 0;
            line-height:1;
        }
    }

    /* スクロールバー  */
    #navigation-bar {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    background-color: #ddd;
    border-radius: 5px;
    z-index: 100;
    }

    /* ここで点の幅、下のtopで文字と点の棒に対する相対位置を調整できる。  */
    .nav-item-container {
        position: relative;
        height: 24px;
    }

    .nav-item {
        position: absolute;
        right: 0;
        top: 10%;
        transform: translateY(-50%);
        width: 10px;
        height: 10px;
        background-color: #333;
        border-radius: 50%;
        margin: 10px 0;
        cursor: pointer;
    }

    .nav-label {
        position: absolute;
        right: 20px;
        top: 50%; 
        transform: translateY(-50%); 
        font-size: 16px;
        color: #333;
        width: 9ch;
        text-align: right; 
        padding-right: 2px;
        box-sizing: border-box; 
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-item.active {
        background-color: #007bff;
    }

    .nav-label.active {
        font-weight: bold;
        background-color: rgba(200, 200, 200, 0.7);
        padding: 2px 5px;
        border-radius: 3px;
    }

    @media (max-width: 768px) {
        #navigation-bar {
            right: 5px;
            width: 10px;
        }

        .nav-label {
            display: none;
        }
        :root {
        --right-space: 20px;  /* モバイル表示ではラベルが非表示になるため調整TODO */
        }
    }

    :root {
        --scrollbar-width: 20px;  /* スクロールバーの幅 */
        --label-width: 10ch;      /* ラベルの幅 */
        --right-space: calc(var(--scrollbar-width) + var(--label-width) - 30px);  /* 30pxは.nav-labelのright値 */
    }

    section {
        position: relative;  /* 疑似要素の基準点 */
    }

    /* 本文の左側字下げ。*/
    section h2 {
        color: teal;
        position: relative;
        padding-bottom: 10px;
        padding-left: 40px; /* 左のパディングを追加して右に移動 */
    }


    section h2::after {
        content: '';
        position: absolute;
        left: 40px;
        right: var(--right-space);
        bottom: 5px;
        height: 4px;
        background-color: teal;
    }

    .content-enumeration {
        padding-left: 40px;
        display: flex;
        flex-direction: column;
        gap: 0px; /* 行間のスペースを調整 */
    }

    .content-enumeration-text {
        flex: 1;
        margin: 4px;
        min-width: 0; /* テキストの折り返しを確保 */
        padding-right: var(--right-space);
    }

    .content {
        padding-left: 40px;
        display: flex;
        align-items: flex-start;
        gap: 20px;
        padding-right: var(--right-space);
    }

    .content-image {
        width: 300px; /* 基本の画像サイズ */
        height: auto;
        object-fit: cover;
    }

    .content-text {
        flex: 1;
        min-width: 0; /* テキストの折り返しを確保 */
        padding-right: var(--right-space);
    }

    @media (max-width: 768px) {
        .content {
            flex-direction: column;
        }
      
        .content-image {
            width: 100%;
            max-width: 300px;
        }  
    }

    /* Cover pictureをうまく並べる */
    .cover {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 20px;
        padding: 20px;
        max-width: 1200px; /* コンテナの最大幅を設定 */
        margin: 0 auto; /* 中央揃え */
    }

    .cover-item {
        flex: 1 0 250px; /* 最小幅を250pxに縮小 */
        max-width: calc(33.333% - 20px);
        display: flex;
        flex-direction: column;
        aspect-ratio: 3 / 2;
    }

    .cover-item img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* または contain */
    }

    .cover-item p {
        width: 100%;
        margin-top: 10px;
        text-align: left;
        word-wrap: break-word;
        font-size: 0.9em; /* テキストサイズを少し小さく */
    }

    @media screen and (max-width: 900px) {
        .cover-item {
            flex-basis: calc(50% - 20px);
            max-width: calc(50% - 20px);
        }
    }

    @media screen and (max-width: 600px) {
        .cover-item {
            flex-basis: 100%;
            max-width: 100%;
        }
    }

    @media screen and (max-width: 400px) {
        .cover-item {
            aspect-ratio: 4 / 3; /* 小さい画面ではアスペクト比を変更 */
        }
    }

    /*  研究内容用 */
    .topic {
        margin-left: 10px;
        margin-bottom: 40px; /* トピック間の間隔 */
        max-width: calc(100% - 20px); /* 右側にも少しマージンを確保 */
    }

    .profile-main {
        display: flex;
        justify-content: center; 
        gap: 20px;
        margin-bottom: 20px;
    }

    .profile-main img {
        width: 50%;
        text-align: center;
        max-width: 175px; /* 画像の最大幅を制限（必要に応じて調整） */
        height: auto;
        object-fit: cover;
    }

    .topic-main {
        gap: 20px;
        margin-bottom: 20px;
    }

    .topic-main img {
        width: 50%;
        max-width: 800px; /* 画像の最大幅を制限（必要に応じて調整） */
        height: auto;
        object-fit: cover;
    }

    .topic-text {
        width: 50%;
        max-width: 800px; /* テキストの最大幅を制限（必要に応じて調整） */
    }

    .topic-text h2 {
        margin-top: 0;
    }

    .topic-description {
        width: 100%;
        margin-top: 0;
    }

    /* レスポンシブデザイン */
    @media screen and (max-width: 768px) {
        .topic-main {
            flex-direction: column;
        }

        .topic-main img,
        .topic-text {
            width: 100%;
            max-width: none;
        }
    }

        footer {
            background-color: #f8f8f8;
            text-align: center;
            padding: 10px;
            font-size: 0.8em;
            color: #666;
        }
</style>