html {
  overflow-y: scroll;
}

body {
  background-image: radial-gradient(rgba(255, 255, 255, 0.9) 1.5px, transparent 2px),
    linear-gradient(135deg, #c7dbf3 0%, #e4ecf6 45%, #c9e6da 100%);
  background-size: 20px 20px, 100% 100%;
  background-attachment: fixed;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 14px;
  margin: 0;
  padding: 0;
}
div#back {
  max-width: 1100px;
  width: 90%;
  margin: 0 auto;
  padding: 20px;
  background-color: white;
  text-align: center;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  box-sizing: border-box;
}

h1 {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 28px;
  color: #444;
  font-weight: 500;
}

h3 {
  margin: 12px 0;
  line-height: 1.4;
  text-align: left;
  font-weight: bold;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 20px;
  color: #444;
}

h4 {
  margin: 0px;
  font-weight: bold;
  text-align: left;
  color: #444;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 12px;
}

hr {
  border: 1.5px solid #cccccc;
}


.lang {
  text-align: right;
  margin-bottom: 4px;
}

.lang a {
  font-weight: bold;
  color: #0033cc;
  text-decoration: none;
  font-size: 14px;
}

.menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  border-bottom: 3px solid #cccccc;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: bold;
  color: #3399ff;
  text-align: center;
  margin-bottom: 10px;
}

.menu a {
  color: #666666;
  font-family: 'Noto Sans JP', sans-serif;
  font-weight: inherit;
  text-decoration: none;
  padding: 4px 10px;
}

.menu a:hover {
  color: #999999;
}

#copyright {
  font-weight: normal;
  color: #999999;
  font-size: 12px;
  text-align: center;
  margin-top: 20px;
}

h1#title {
  text-align: left;
  margin-left: 12px;
}

a {
  text-decoration: none;
}

h1.en {
  font-size: 36px;
  font-family: Haettenschweiler;
}

.en {
  color: #666666;
}

td {
  vertical-align: top;
  word-break: break-word;
}

a[target="_blank"]:not(.imglink) {
  background: url(../img/back/opennew.gif) no-repeat right center;
  padding-right: 18px;
}

.waku {
  background-color: #f9f9f9;
  border: 1px solid #666;
  border-radius: 5px;
  padding: 15px;
  margin-top: 20px;
  text-align: left;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow-wrap: break-word;
}

.boshu {
  font-size: 14px;
  color: #333333;
}

.boshu li {
  margin-bottom: 8px;
  list-style-position: inside;
}

.email-note {
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
  word-break: break-word;
  white-space: normal;
  margin: 20px 0;
  padding: 0 10px;
}

.long-title {
  font-size: 16px;
  line-height: 1.6;
  word-break: break-word;
  white-space: normal;
  text-align: left;
  margin: 10px 0;
}

@media screen and (max-width: 768px) {
  body {
    font-size: 15px;
    padding: 10px;
  }

  div#back {
    width: 95%;
    padding: 10px;
  }

  h1 {
    font-size: 22px;
  }

  h3 {
    font-size: 18px;
  }

  h4 {
    font-size: 13px;
  }

  .lang {
    text-align: center;
    margin-bottom: 8px;
  }

  .menu {
    justify-content: center;
    font-size: 14px;
    text-align: center;
  }

  .menu a {
    margin: 4px 6px;
  }

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

  table {
    width: 100%;
    table-layout: auto;
  }

  td {
    display: block;
    width: 100%;
    padding: 8px 0;
  }

  .waku {
    padding: 10px;
    font-size: 14px;
  }

  .boshu {
    font-size: 14px;
    }

  .email-note {
    font-size: 15px;
    padding: 0 10px;
  }

  .long-title {
    font-size: 15px;
    padding: 0 10px;
    text-align: left;
  }
}

/* ===== ヘッダー（大学名・研究室名）を中央にそろえて整える ===== */
#back > h4 {
  text-align: center;
  font-size: 13px;
  font-weight: normal;
  color: #5b6573;
  letter-spacing: 0.06em;
  margin: 6px 0 4px;
}
#back > h3:not(.long-title) {
  text-align: center;
  font-size: 26px;
  color: #2b3a4a;
  letter-spacing: 0.05em;
  margin: 0 0 16px;
}
#back > h3:not(.long-title)::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin: 10px auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, #6fa3d8, #79c2a8);
}
/* [English] / [Japanese] の切り替えリンク：右上に小さなボタンとして置く */
#back { position: relative; }
#back > h3:not(.long-title) span {
  position: absolute;
  top: 14px;
  right: 20px;
  margin: 0 !important;
}
#back > h3:not(.long-title) a {
  display: inline-block;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.03em;
  color: #1a5fb4;
  border: 1px solid #1a5fb4;
  border-radius: 14px;
  padding: 2px 10px;
  vertical-align: middle;
}
#back > h3:not(.long-title) a:hover {
  background: #1a5fb4;
  color: #fff;
}

@media screen and (max-width: 768px) {
  #back > h4 { font-size: 11px; letter-spacing: 0; padding-right: 0; }
  #back > h3:not(.long-title) { font-size: 16px; letter-spacing: 0; }
  #back > h3:not(.long-title) span { position: static; display: block; margin: 8px 0 0 0 !important; }
}
