/* ===== 背景全体 ===== */
body,
html {
  margin: 23px 0;
  width: 100%;
  min-height: 100%;
  font-family: "Segoe UI", sans-serif;
  overflow-x: hidden;
  overflow-y: auto;
  display: block;
  box-sizing: border-box;
}

.bg-video {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  z-index: -1;
}

.inner-wrapper {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  box-shadow:
    0 0 10px #5e0909,
    0 0 20px #5e0909,
    0 0 30px #5e0909; /* ネオン風に段階で重ねる */
  padding: 0;
  max-width: 680px;
  margin: 40px auto 8vh;
  box-sizing: border-box;
}

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

/* ===== ヘッダー部分 ===== */
.custom-header {
  background: #7a1616;
  border: 1px solid #9e1111;
  border-bottom: 1px solid #9e1111;
  padding: 4.333px 20.667px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-url {
  font-size: 1.125em;
  font-weight: 400;
  color: #030303;
}

.close-button {
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
  text-decoration: none;
}

.close-button i {
  color: #030303;
  transition: color 0.3s ease;
  display: inline-block;
  vertical-align: middle;
  text-decoration: none;
}

.close-button:hover i {
  color: #290a0a5c;
}

.header-icons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.header-icons i {
  font-size: 25px;
  color: #030303;
}

/* 仮想検索バー */
.custom-subheader {
  max-width: 676px;
  margin: 0 auto;
  border: 1px solid #9e1111;
  border-top: 1px solid #9e1111;
  background: #7a1616;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  padding: 5px 14px;
  font-size: 1.1rem;
  color: #ffffff;
}

.nav-icons {
  display: flex;
  gap: 18px;
  color: #030303;
  flex-basis: 28%;
  flex-shrink: 0;
  align-items: center;
}

.nav-icons i {
  font-size: 1.3rem;
  vertical-align: middle;
  line-height: 1;
  display: inline-block;
}

.search-link {
  flex-grow: 1;
  margin-left: 14px;
  background: #290a0a5c;
  color: #ffffff;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  transition: background 0.3s;
  flex-basis: 72%;
  max-width: 100%;
  justify-content: space-between;
}

.search-link:hover {
  background: #030303;
}

.search-text {
  flex-grow: 1;
  text-align: left;
}

/* ===== トップセクション ===== */
.top-section {
  padding: 0 0 20px;
  border: 1px solid #9e1111;
  background: #030303;
  text-align: center;
}

.top-video {
  position: relative;
  display: flex;
  justify-content: center;
}

.top-video video {
  max-width: 100%;
  object-fit: cover;
  display: block;
  margin: 0 auto;
}

.top-video img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.top-divider {
  border-top: 2px solid #a81818;
  margin: 0;
  width: 100%;
}

.top-subtext {
  color: #a81818;
  font-size: 18px;
  margin-bottom: 24px;
  line-height: 1.8rem;
}

.start-button {
  display: inline-block;
  padding: 12px 28px;
  text-decoration: none;
  font-weight: bold;
  border-radius: 10px;
  transition: background-color 0.3s ease;
  position: relative;
  z-index: 10;
  background: #a81818;
  color: white;
  font-size: 18px;
}

.start-button:hover {
  background-color: #7a1616;
}

/* ===== タブ風ボタンボックス ===== */
.tab-container {
  background-color: #7a1616;
  border: 1px solid #a81818;
  padding: 3px 6px;
  display: flex;
  gap: 4px;
  justify-content: flex-start;
  border-top: none;
}

.tab-button {
  background-color: #290a0a5c;
  color: #fff;
  padding: 4px 14px;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background-color 0.3s;
}

.tab-button:hover {
  background-color: #030303;
}

.tab-button.active {
  background-color: #030303;
}

.tab-button i {
  font-size: 0.85rem;
}

/* ===== 患者ログセクション ===== */
.patient-log-section {
  padding: 0;
}

.patient-log-box {
  display: flex;
  flex-direction: column;
  border: 1px solid #a81818;
  background: #030303;
  padding: 0;
  gap: 0;
}

.patient-table {
  width: 100%;
}

.patient-table table {
  width: 100%;
  border-collapse: collapse;
  color: #b00020;
  font-size: 1rem;
}

.patient-table th,
.patient-table td {
  border: 1px solid #a81818;
  padding: 10px 12px;
  line-height: 1.8;
  text-align: center;
  vertical-align: middle;
}

.patient-table th {
  background: #310000;
  color: #ff4d4d;
  font-weight: bold;
}

/* ===== 監視カメラセクション ===== */
.surveillance-section {
  padding: 0;
  background-color: #030303;
}

.top-video {
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.top-video video {
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  display: block;
  object-fit: contain;
}

/* AOSが複数に効かない対策 */
[data-aos] {
  opacity: 0;
  transition-property: opacity, transform;
}

[data-aos].aos-animate {
  opacity: 1;
}

/* 上に戻る */
.scroll-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #9e1111;
  color: white;
  padding: 10px 14px;
  border-radius: 50px;
  text-decoration: none;
  font-size: 14px;
  z-index: 1000;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  transition: opacity 0.3s ease;
}

.scroll-to-top:hover {
  opacity: 0.7;
}

.external-link {
  color: #a81818;
  font-size: 18px;
  text-decoration: underline; /* 下線あり */
}

.external-link:hover {
  color: #d23434;
  text-decoration: none;
}

.narrow-gap {
  display: block;
  height: 25px;
}

/* レスポンシブ（スマホ対応） */
@media (max-width: 768px) {
  html,
  body {
    overflow-x: hidden;
  }

  /* 画像のサイズ調整（画像が幅を超えないように） */
  img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    box-sizing: border-box;
  }

  video {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    box-sizing: border-box;
  }

  .header-url {
    font-size: 0.85rem;
  }

  .inner-wrapper {
    padding: 0; /* ←ネオンを保つため余白ナシでOK！ */
    margin: 30px auto 16vh;
    width: min(100vw - 24px, 680px);
    box-sizing: border-box;
  }

  /* テキスト部分 */
  .top-subtext,
  .external-link {
    line-height: 1.8;
    width: 100%;
    font-size: 0.92rem;
  }

  .patient-table table {
    font-size: 0.8rem;
    table-layout: auto; /* 固定しないように */
  }

  .patient-table th,
  .patient-table td {
    padding: 4px 6px; /* 少し詰めるけど読みやすく */
    word-break: break-word;
  }

  /* テーブルが入りきらないときは横スクロールにする */
  .patient-table {
    overflow-x: auto;
    display: block;
  }

  /* タブボタン */
  .tab-button,
  .tab-button.active,
  .search-link {
    max-width: 100%;
    height: auto;
    min-width: 0;
    font-size: 0.78rem;
    padding: 6px 9px;
    gap: 6px;
    border-radius: 7px;
    text-align: center;
    white-space: normal;
  }

  /* ボタンサイズ変更 */
  .start-button {
    font-size: 0.9rem;
    padding: 8px 16px;
  }

  .scroll-to-top {
    font-size: 0.75rem;
    padding: 8px 12px;
  }
}

/* タブレット対応レスポンシブ */
@media screen and (min-width: 601px) and (max-width: 1024px) {
  html,
  body {
    overflow-x: hidden;
  }

  .top-subtext,
  .external-link {
    font-size: 1.4rem;
  }

  .header-url {
    font-size: 1.2rem;
  }

  .patient-table table {
    font-size: 1.3rem;
  }

  /* タブボタン */
  .tab-button,
  .tab-button.active,
  .search-link {
    font-size: 1.15rem;
    padding: 8px 12px;
  }

  /* ボタンサイズ変更 */
  .start-button,
  .start-button {
    font-size: 1.3rem;
  }

  .scroll-to-top {
    font-size: 1rem;
  }

  .nav-icons i {
    font-size: 1.3rem;
  }
}
