/* Lab「カメラの映像を、ブラウザの AI で数えてみた」のデモ
   デモの部分は、サイトの配色（白い背景版を含む）に関係なく、暗い画面にする（映像と枠が見やすいように） */
.cam { margin: 0 0 72px; padding: 20px; color: #e8edf5; background: #0a1220; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; font-size: 14px; line-height: 1.7; }
.cam-bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; }
.cam-bar label { display: inline-flex; align-items: center; gap: 8px; }
.cam-bar select, .cam-bar button { font: inherit; color: inherit; background: #13223d; border: 1px solid rgba(255,255,255,.22); border-radius: 6px; padding: 6px 12px; cursor: pointer; }
.cam-bar [disabled] { opacity: .45; cursor: default; }
.cam-bar input[type="range"] { width: 120px; accent-color: #a8d0ff; }
.cam-what-wrap b { color: #ffd27a; font-weight: 600; }
.cam-msg { min-height: 1.7em; margin: 8px 0; color: #ffd27a; }
.cam-main { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.cam-stage { position: relative; aspect-ratio: 16 / 9; background: #000; border: 1px solid rgba(255,255,255,.15); border-radius: 6px; overflow: hidden; }
.cam-stage video, .cam-stage canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.cam-stage canvas { pointer-events: none; }
.cam-cover { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 20px; text-align: center; background: radial-gradient(ellipse at 50% 30%, #16294a, #050810); }
.cam-cover[hidden] { display: none; }
.cam-cover button { font: inherit; font-size: 17px; color: #050810; background: #ffd27a; border: 0; border-radius: 999px; padding: 12px 34px; cursor: pointer; }
.cam-cover button[disabled] { opacity: .5; cursor: default; }
.cam-cover p { margin: 0; font-size: 13px; color: #b8c6dc; }
.cam-side { display: grid; gap: 12px; }
.cam-info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.cam-wide { grid-column: span 3; }
.cam-card { min-width: 0; padding: 12px 14px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.14); border-radius: 8px; }
.cam-card h3 { margin: 0 0 8px; font-size: 12px; font-weight: 400; letter-spacing: .1em; color: #a8d0ff; }
.cam-card h3 small { margin-left: 10px; letter-spacing: 0; color: #8ba0c0; }
.cam-run { float: right; letter-spacing: 0; color: #ffd27a; }
.cam-num { font-size: 34px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.cam-num small { margin-left: 6px; font-size: 13px; color: #8ba0c0; }
.cam-card dl { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.cam-card dt { color: #8ba0c0; }
.cam-card dd { margin: 0; text-align: right; }
#run-list { min-height: 150px; align-content: start; }   /* 6 回分で固定 */
#count-by-class:not(:empty) { min-height: 100px; }
.cam-note { margin: 8px 0 0; font-size: 12px; color: #8ba0c0; }
.cam-note b { color: #e8edf5; font-size: 15px; }
#cam-chart { display: block; width: 100%; height: 150px; }
.cam-table-wrap { height: 274px; overflow: hidden; }   /* 8 行分で固定。行が増えたり減ったりしても、下の欄が上下に動かないように */
.cam-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.cam-table th { padding: 4px 8px; font-weight: 400; font-size: 12px; text-align: left; color: #8ba0c0; border-bottom: 1px solid rgba(255,255,255,.14); }
.cam-table th, .cam-table td { height: 30px; box-sizing: border-box; white-space: nowrap; }
.cam-table td { padding: 4px 8px; border-bottom: 1px solid rgba(255,255,255,.07); }
.cam .bar { display: inline-block; width: 90px; height: 6px; margin-right: 8px; vertical-align: middle; background: rgba(255,255,255,.1); border-radius: 3px; overflow: hidden; }
.cam .bar i { display: block; height: 100%; background: #a8d0ff; }
.cam-speed { grid-template-columns: auto 1fr !important; }
.cam-speed dd { text-align: left; white-space: nowrap; }
.cam-log { list-style: none; height: 132px; margin: 0; padding: 0; overflow-y: auto; font-size: 13px; }
.cam-log li { padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.cam-log time { display: inline-block; width: 64px; color: #8ba0c0; font-variant-numeric: tabular-nums; }
.cam-log .is-count { color: #ffd27a; }
.cam-log .is-skip { color: #8ba0c0; }
.cam-log .is-run { color: #9fe0b0; }
.cam .is-empty { color: #8ba0c0; }
.cam-legend { margin: 14px 0 0; font-size: 12px; color: #8ba0c0; }
@media (max-width: 900px) {
  .cam { padding: 14px; margin-left: -8px; margin-right: -8px; }
  .cam-main { grid-template-columns: minmax(0, 1fr); }
  .cam-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cam-side .cam-card:last-child { grid-column: span 2; }
  .cam-info { grid-template-columns: minmax(0, 1fr); }
  .cam-wide { grid-column: auto; }
  .cam-table th:nth-child(4), .cam-table td:nth-child(4) { display: none; }
  .cam .bar { width: 56px; }
}

/* 白い背景版（.theme-light）は、.wrap に左右の余白（56px。スマホは 20px）がある。デモは、その余白の分だけ外に広げて、白い枠の端から端まで使う */
.theme-light .cam { margin-left: -52px; margin-right: -52px; border-left: 0; border-right: 0; border-radius: 0; }   /* 余白 56px より 4px 内側（本人の調整。白い枠の端に、少しだけ白を残す） */
@media (max-width: 640px) {
  .theme-light .cam { margin-left: -20px; margin-right: -20px; }
}

/* 記事の中のコード（色分けは css/code.css と Prism.js。枠の見た目は、PHP 8.6 の記事と同じ） */
.prose pre { margin: 1.4em 0; padding: 16px 18px; overflow-x: auto; background: #0b1220; border: 1px solid rgba(168,208,255,0.22); border-radius: 8px; -webkit-overflow-scrolling: touch; }
.prose pre code { display: block; padding: 0; background: none; font: 13px/1.75 'JetBrains Mono', 'IBM Plex Mono', Menlo, monospace; color: #d4d4d4; white-space: pre; tab-size: 2; }

/* 記事の見出し。長い記事なので、区切りがひと目で分かるように、太字と色の線を付ける */
.prose h2 { position: relative; font-size: 26px; font-weight: 700; padding-bottom: 16px; border-bottom: 2px solid var(--ink-line); }
.prose h2::after { content: ""; position: absolute; left: 0; bottom: -2px; width: 88px; height: 2px; background: var(--accent); }
.prose h3 { font-size: 19px; font-weight: 700; line-height: 1.6; padding-left: 14px; border-left: 4px solid var(--accent); }
@media (max-width: 640px) {
  .prose h2 { font-size: 22px; }
  .prose h3 { font-size: 17.5px; }
}
