main {
  margin-bottom: 20vh;
  min-height: 100vh;
}
.main {
    width: 100%;
    padding: 40px;
    display: flex;
    flex-wrap: wrap;        /* 折り返す */
    gap: 40px;              /* アイテム間の間隔（お好みで） */
    justify-content: flex-start; /* 左詰めに並べる */
}
.form {
    width: 100%;
    margin: 15px 0;
    display: flex;
    justify-content: space-evenly;
    padding: 10px;
    align-items: center;
    border-bottom: 2px solid #aaa;
}
input {
    height: 40px;
    border-radius: 20px;
    border: 2px solid black;
    width: 380px;
    font-size: 18px;
    padding-left: 15px;
}
#search-form {
  display: flex;
  gap: 15px;
  justify-content: center;
}
.search-button {
    padding: 5px 25px;
    font-size: 17px;
    color: #222;
    border-radius: 5px;
    transition: all 0.5s ease;
    border: #777 1px solid;
    background-color: #d0d0ff;
    cursor: pointer;
}
.search-button:hover {
    background-color: #8080ff;
}
.form h2 {
    cursor: pointer;
    text-decoration: none; 
}
.form h2:hover {
    text-decoration: underline; 
}
.form .filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.form .filter button {
  border: 1px solid black;
  outline: none;
  border-radius: 5px;
  padding: 5px 0;
  font-size: 14px;
  width: 100px;
  height: 40px;
  background-color: white;
  color: black;
  cursor: pointer;
  transition: all 0.4s ease;
}
.form .filter button.focus {
  background-color: black;
  color: white;
}
.container {
    background-color: #fff;
    padding: 15px;
    width: 250px;
    aspect-ratio: 10 / 16;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    box-sizing: border-box;
    cursor: default;
    position: relative;
    transition: background-color 0.3s ease;
}
.container.available:hover {
  background-color: #ddd;
}
.load-more-label {
    position: absolute;
    font-size: 23px;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.subject {
  position: absolute;
  font-size: 13px;
  padding: 3px 5px;
  border-radius: 5px;
  color: white;
  width: 60px;
  top: 10px;
  left: 10px;
  box-sizing: border-box;
}
.container .title {
    font-size: 23px;
    min-width: 0;
    width: 100%;
    height: 40px;
    margin: 28px 0 2px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.container .title:hover {
    overflow: visible;
    white-space: normal;
}
.container .title:hover ~ *,
.container .title:hover ~ table.contents td,
.container .title:hover ~ table.contents td::after,
.container .title:hover ~ button image{
    opacity: 0.7;
}
.fixed {
  box-shadow: 0 4px 8px rgba(255,112,67,0.3);
  transition: all 0.3s ease;
  outline: 2px solid #ff7043; /* ← 置き換え */
  outline-offset: 0px;
}
.fixed::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  background: radial-gradient(
    circle at 30% 30%,
    #ff5252,     /* ハイライト */
    #e53935 40%, /* 基本色 */
    #b71c1c 75%, /* 影 */
    #4e0e0e 80% /* 濃い影 */
  );
  border-radius: 50%;
  box-shadow:
    inset -2px -2px 4px rgba(0, 0, 0, 0.4),  /* 内側の陰影 */
    0 4px 6px rgba(0, 0, 0, 0.3);           /* 外側の影 */
  z-index: 10;
}


.fixed:hover {
  box-shadow: 0 6px 14px rgba(255,112,67,0.6);
}

.NA {
  position: absolute;
  display: none;
  top: 100px;
  font-size: 20px;
  left: 50%;
  width: 100%;
  color: black;
  transform: translateX(-50%);
}
.contents {
    width: 100%;
    max-width: 100%;
}
td {
    display: inline-block;
    min-width: 0;
  max-width: 220px;
  width: 100%;
  padding: 5px 0;
  font-size: 16px;
  color: black;
  height: 40px;
  max-height: 40px;
  box-sizing: border-box;
  white-space: nowrap;       /* 改行しない */
  overflow: hidden;          /* はみ出した部分を非表示 */
  text-overflow: ellipsis;   /* 省略記号「…」を表示 */
}
td.last > mjx-container,
td.last > .MathJax {
  max-width: 100%;
  display: inline-block;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
tr {
    display: inline-block;
    width: 100%;
  border-bottom: 2px solid #777;

}
td.last {
  position: relative;
  padding-right: 40px; /* ← 余白を作ることで、"など" が重ならないように */
}
td.last::after {
  content: "など";
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: black;
  padding-left: 5px;
}
.history,
.edit {
  position: absolute;
  cursor: pointer;
  border: none;
  outline: none;
  align-items: end;
  background-color: rgba(0,0,0,0);
}
.history {
  right: 15px;
  bottom: 40px;
  display: none;
}
.edit {
  display: flex;
  right: 15px;
  top: 10px;

}
.history .image {
  width: 28px;
  height: 28px;
}
.good {
  display: flex;
  position: absolute;
  align-items: end;
  left: 15px;
  bottom: 40px;
  width: 192px;
}
.star {
  width: 30px;
  height: 30px;
  cursor: pointer;
  transition: fill 0.2s;
}
.star.filled path {
  stroke-width: 1px;
  fill: #FFD700;
  stroke: #555555;
}
.star:not(.filled) path {
  stroke-width: 1px;
  fill: none;
  stroke: #444;
}
.goodLabel {
  margin: 0 0 3px 3px;
}
.edit .image {
  width: 25px;
  height: 25px;
}

.id {
  position: absolute;
  margin: 0;
  color: #555;
  bottom: 10px;
  right: 20px;
  font-family: italic;
  font-size: 16px;
}
.modal {
  position: fixed;
  display: none;
  z-index: 999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
}
.modal-content {
  position: relative;
  display: flex;
  flex-direction: column;
  background: white;
  padding: 20px;
  width: 700px;
  border-radius: 8px;
  text-align: center;
}
#back {
  position: absolute;
  width: 50px;
  aspect-ratio: 1;
  top: 0px;
  right: 0px;
  border-top-right-radius: 8px;
  font-size: 30px;
  color: #777;
  cursor: pointer;
  background-color: white;
  border: none;
  outline: none;
  transition: all 0.5s ease;
}
#back:hover {
  color: white;
  background-color: red;
}
#label {
  margin: 10px;
  font-size: 30px;
}
.table-subject {
  font-size: 13px;
  padding: 3px 5px;
  border-radius: 5px;
  color: white;
  width: 60px;
  height: 25px; 
  background-color: #E57373;
  text-align: center;
}
.table-id {
  padding: 10px 0 0 0;
  margin: 10px;
  font-size: 18px;
  text-align: right;
}
#his-table {
  width: 100%;
}
#his-table tr td:not(.table-id){
  padding: 10px 0 0 0;
  margin: 10px;
  font-size: 18px;
  text-align: left;
}
.table-title,
.table-id {
  width: 250px;
  max-width: 250px;
}
.not-available {
  cursor: not-allowed;
}
.not-available .table-id,
.not-available .table-title {
  text-align: left;
}
#his-table tr.available {
  cursor: pointer;
  background-color: white;
  transition: all 0.3s ease;
}
#his-table tr.available:hover {
  background-color: #ddd;
}

h2.title:hover mjx-math {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}

.container {
  animation: bounceIn 0.4s ease-out forwards;
  transform: scale(0.9);
  opacity: 0;
}

.search-modal {
  position: fixed;
  display: none;
  z-index: 999;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(200,200,200,0.5);
  justify-content: center;
  align-items: center;
}
.spinner {
    position: absolute;
    display: block;
    width: 100px;
    height: 100px;
    border: 10px solid #aaa;
    border-top: 10px solid #a0ffa0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 50%;
    left: 50%;
    z-index: 100;
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }
  60% {
    opacity: 1;
    transform: scale(1.05);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}
@media (max-width: 768px) {
  .html {
    width: 100%;
  }
  .main {
    display: flex;
    padding: 0%;
    justify-content: center; /* 横方向の中央寄せ */
    align-items: center; /* 縦方向の中央寄せ */
    width: 100%;
  }
  .form {
    gap: 10px;
    flex-wrap: wrap;
  }
  input {
    width: 225px;
    font-size: 14px;
  }
  .form h2 {
    font-size: 20px;
    margin-right: 15px;
  }
}