/* ============================================================
   手術室DX（18663・page-or-dx.php）だけで読み込む部品の見た目
   ほかのページの CSS は読み込まず、使う部分だけをここへ写している（2026-10-26 ひろゆきさん指示「他のページは触るな」）。
   写し元を変えたときは、こちらも合わせる。
   ============================================================ */

/* --- 技術の詳細のタブ：pages/services.css のタブ切り替えの写し --- */
/* タブ切り替え（components/tabs.js がボタンを作り is-tabbed を付ける）
   見出しのタブ：下の線の上にタブを並べ、選んでいるタブは紺の地で、すぐ下のパネルにつながる（2026-10-25 ひろゆきさん「タブの方が分かりやすい」）。
   スマホでは折り返さず、横にすべらせて選ぶ */
.qc-tabs__list{
  position: relative; /* tabs.js が選んだタブの位置（offsetLeft）をこの中で測る */
  display: flex;
  gap: 4px;
  border-bottom: 3px solid #1D4382;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.qc-tabs__list::-webkit-scrollbar{ display: none; }
.qc-tabs__tab{
  flex: none;
  scroll-snap-align: start;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #475569;
  background: #e8eef6;
  border: 0;
  border-radius: 10px 10px 0 0;
  padding: 12px 22px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.qc-tabs__tab:hover{ color: #1D4382; background: #dbe5f2; }
.qc-tabs__tab[aria-selected="true"]{
  color: #ffffff;
  background: #1D4382;
}
.qc-tabs__tab:focus-visible,
.qc-tabs [role="tabpanel"]:focus-visible{
  outline: 3px solid #60a5fa;
  outline-offset: -3px;
}
/* パネルはタブの線にくっつける（上の角は丸めない） */
.qc-tabs.is-tabbed{ gap: 0; }
.qc-tabs.is-tabbed > [role="tabpanel"]{
  border-top: 0;
  border-radius: 0 0 16px 16px;
}
@media (max-width: 768px){
  .qc-tabs__tab{ font-size: 13px; padding: 11px 16px; }
}
/* パネルの地に display を指定している要素でも、選んでいないタブのパネルは隠す */
.qc-tabs [role="tabpanel"][hidden]{ display: none !important; }

/* --- QuadWAN の節の「QuadWANのしくみ」の図（inc/quadwan-how.php）：pages/quadwan.css の写し --- */
/* === QuadWANのしくみ（2026-10-12）===
   拠点 →（閉域SIM）→ セントラルサーバー ←（WireGuard）← 保守担当者 を
   HTML で組んだ図。PC は横1列、767px 以下は縦に並べる */
.qw-how__diagram { max-width: 1080px; margin: 0 auto; }
.qw-how__top {
  width: calc((100% - 2 * 150px) / 3);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.qw-how__internet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border: 1px dashed #94a3b8;
  border-radius: 999px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
  background: #ffffff;
}
.qw-how__blocked {
  position: relative;
  height: 64px;
  display: flex;
  align-items: center;
}
.qw-how__blocked::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  border-left: 2px dashed #cbd5e1;
}
.qw-how__cross {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #dc2626;
  margin: 0 auto;
}
.qw-how__cross::before,
.qw-how__cross::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 12px;
  width: 12px;
  height: 2px;
  background: #ffffff;
  transform: rotate(45deg);
}
.qw-how__cross::after { transform: rotate(-45deg); }
.qw-how__blocked p {
  position: absolute;
  left: calc(50% + 24px);
  top: 50%;
  transform: translateY(-50%);
  width: max-content;
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: #b91c1c;
  text-align: left;
  font-weight: 700;
}
.qw-how__flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 150px 1fr 150px 1fr;
  align-items: stretch;
}
.qw-how__node {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}
.qw-how__node--center {
  border: 2px solid #1D4382;
  box-shadow: 0 12px 28px rgba(29, 67, 130, .12);
}
.qw-how__icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #1D4382;
  background: linear-gradient(135deg, #eef2f7 0%, #dbeafe 100%);
}
.qw-how__name {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 10px;
  line-height: 1.4;
  border: none !important;
  padding: 0 !important;
}
.qw-how__name::before,
.qw-how__name::after { display: none !important; }
.qw-how__desc {
  font-size: 13px;
  line-height: 1.8;
  color: #64748b;
  margin: 0;
  text-align: left;
}
/* つなぎ（線と名前） */
.qw-how__link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  text-align: center;
}
.qw-how__link::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
}
.qw-how__link--closed::before { border-top: 4px solid #1D4382; }
.qw-how__link--wg::before { border-top: 3px dashed #60a5fa; }
.qw-how__link-name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #1D4382;
}
.qw-how__link--wg .qw-how__link-name { color: #2563eb; }
.qw-how__link-desc {
  font-size: 11.5px;
  line-height: 1.6;
  color: #64748b;
}

@media (max-width: 767px) {
  .qw-how__top { width: 100%; }
  /* 幅が足りないので、注記は × の右ではなく下に置く */
  .qw-how__blocked {
    height: auto;
    flex-direction: column;
    gap: 6px;
    padding: 24px 0 14px;
  }
  .qw-how__blocked::before { bottom: auto; height: 24px; }
  .qw-how__blocked p {
    position: static;
    transform: none;
    width: auto;
    text-align: center;
  }
  .qw-how__flow { grid-template-columns: 1fr; }
  .qw-how__link {
    gap: 0;
    height: 84px;
    padding-left: calc(50% + 18px);
    align-items: flex-start;
    text-align: left;
  }
  .qw-how__link::before {
    left: 50%;
    right: auto;
    top: 0;
    bottom: 0;
  }
  .qw-how__link--closed::before { border-top: 0; border-left: 4px solid #1D4382; }
  .qw-how__link--wg::before { border-top: 0; border-left: 3px dashed #60a5fa; }
}

/* しくみの図の動き（2026-10-19 ひろゆきさん依頼「流れているようなアニメーションに」）
   図の矢印の向きどおり、拠点 →（閉域SIM）→ サーバー ←（WireGuard）← 保守担当者 に粒が流れる。
   インターネットからの粒は × で止まって消える。サーバーは監視の波紋。動きを減らす設定では止めて今の図のまま */
@media (prefers-reduced-motion: no-preference) {
  /* WireGuard の破線を、保守担当者 → サーバーの向きに流す */
  .qw-how__link--wg::before {
    border-top: 0;
    height: 3px;
    margin-top: -1px;
    background: repeating-linear-gradient(90deg, #60a5fa 0 7px, transparent 7px 13px);
    animation: qw-how-dash-left 0.9s linear infinite;
  }
  /* 流れる粒 */
  .qw-how__link::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    margin-top: -4px;
    border-radius: 50%;
    pointer-events: none;
  }
  .qw-how__link--closed::after {
    background: #1D4382;
    box-shadow: 0 0 0 4px rgba(29, 67, 130, .15), 0 0 14px rgba(29, 67, 130, .45);
    animation: qw-how-flow-right 2.4s cubic-bezier(.45, 0, .55, 1) infinite;
  }
  .qw-how__link--wg::after {
    margin-top: -5px;
    background: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .15), 0 0 14px rgba(37, 99, 235, .45);
    animation: qw-how-flow-left 2.4s cubic-bezier(.45, 0, .55, 1) 1.2s infinite;
  }
  /* インターネットから来た粒は × で止まって消える */
  .qw-how__blocked::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 12px;
    height: 12px;
    margin-left: -5px;
    border-radius: 50%;
    background: #64748b;
    box-shadow: 0 0 0 3px rgba(100, 116, 139, .18);
    animation: qw-how-blocked 3s ease-in infinite;
  }
  .qw-how__cross { animation: qw-how-cross 3s ease-in-out infinite; }
  /* サーバーの監視の波紋 */
  .qw-how__node--center .qw-how__icon { position: relative; }
  .qw-how__node--center .qw-how__icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #1D4382;
    animation: qw-how-ripple 2.4s ease-out infinite;
  }

  @keyframes qw-how-dash-left { to { background-position-x: -13px; } }
  @keyframes qw-how-flow-right {
    0% { left: 0; opacity: 0; }
    12%, 88% { opacity: 1; }
    100% { left: calc(100% - 12px); opacity: 0; }
  }
  @keyframes qw-how-flow-left {
    0% { left: calc(100% - 12px); opacity: 0; }
    12%, 88% { opacity: 1; }
    100% { left: 0; opacity: 0; }
  }
  @keyframes qw-how-blocked {
    0% { top: 0; opacity: 0; }
    15% { opacity: 1; }
    55% { top: calc(50% - 5px); opacity: 1; transform: scale(1); }
    75%, 100% { top: calc(50% - 5px); opacity: 0; transform: scale(.3); }
  }
  @keyframes qw-how-cross {
    0%, 50%, 80%, 100% { transform: scale(1); }
    60% { transform: scale(1.18); }
  }
  @keyframes qw-how-ripple {
    0% { transform: scale(1); opacity: .5; }
    100% { transform: scale(1.6); opacity: 0; }
  }

  /* スマホ（縦並び）：粒は上下に流れる（拠点が上・保守担当者が下） */
  @media (max-width: 767px) {
    .qw-how__link--wg::before {
      height: auto;
      width: 3px;
      margin-top: 0;
      margin-left: -1px;
      background: repeating-linear-gradient(180deg, #60a5fa 0 7px, transparent 7px 13px);
      animation-name: qw-how-dash-up;
    }
    .qw-how__link::after { top: 0; left: 50%; margin-top: 0; margin-left: -4px; }
    .qw-how__link--wg::after { margin-left: -5px; }
    .qw-how__link--closed::after { animation-name: qw-how-flow-down; }
    .qw-how__link--wg::after { animation-name: qw-how-flow-up; }
    .qw-how__blocked::after { animation-name: qw-how-blocked-sp; }

    @keyframes qw-how-dash-up { to { background-position-y: -13px; } }
    @keyframes qw-how-flow-down {
      0% { top: 0; opacity: 0; }
      12%, 88% { opacity: 1; }
      100% { top: calc(100% - 12px); opacity: 0; }
    }
    @keyframes qw-how-flow-up {
      0% { top: calc(100% - 12px); opacity: 0; }
      12%, 88% { opacity: 1; }
      100% { top: 0; opacity: 0; }
    }
    @keyframes qw-how-blocked-sp {
      0% { top: 0; opacity: 0; }
      15% { opacity: 1; }
      55% { top: 30px; opacity: 1; transform: scale(1); }
      75%, 100% { top: 30px; opacity: 0; transform: scale(.3); }
    }
  }
}
