/* /var/www/slide/public/assets/app.css   (元: C:\Dropbox\Programs\Claude\slide\public\assets\app.css)
   LabSlide の見た目。スライドの中身の決まり(.pslide .psh .ptx …)は drive の写し(vendor/viewer.css)。 */
:root {
  --ink: #1f2a44; --sub: #5d6776; --line: #e3e6eb; --bg: #f5f6f8; --card: #fff;
  --accent: #c9761c; --accent-ink: #fff; --danger: #b3261e;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.6; font-size: 15px;
}
a { color: #1f5fbf; text-decoration: none; }
a:hover { text-decoration: underline; }
.top {
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--card);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.top .brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); font-size: 17px; }
.top .brand img { width: 28px; height: 28px; }
.top .grow { flex: 1; }
.top .who { color: var(--sub); font-size: 13px; max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 14px;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #eef0f3; text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--danger); border-color: #efc9c6; }
.btn:disabled { opacity: .55; cursor: default; }
main { max-width: 1180px; margin: 0 auto; padding: 18px 16px 48px; }
main.msg { max-width: 640px; padding-top: 60px; }
h1 { font-size: 22px; margin: 0 0 6px; line-height: 1.4; }
h2 { font-size: 16px; margin: 26px 0 10px; }
.muted { color: var(--sub); font-size: 13px; }

/* ---- 一覧 ---- */
.tabs { display: flex; gap: 6px; margin: 4px 0 16px; flex-wrap: wrap; }
.tabs a { padding: 5px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 14px; }
.tabs a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; color: var(--ink); }
.card:hover { text-decoration: none; box-shadow: 0 4px 16px rgba(0, 0, 0, .08); }
.card .thumb { aspect-ratio: 16 / 9; background: #e9ecf0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; display: block; }
.card .thumb .ph { color: var(--sub); font-size: 13px; padding: 0 16px; text-align: center; }
.card .meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.card .ttl { font-weight: 600; font-size: 14.5px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .sub { color: var(--sub); font-size: 12.5px; }
.tag { display: inline-block; font-size: 11px; padding: 0 7px; border-radius: 999px; background: #eef0f3; color: var(--sub); margin-right: 4px; }
.tag.public { background: #e3f2e6; color: #23663a; }
.tag.unlisted { background: #fff2d9; color: #8a5a00; }
.tag.lab { background: #e8eefb; color: #2a4d8f; }
.empty { background: var(--card); border: 1px dashed #cfd4db; border-radius: 10px; padding: 28px; text-align: center; color: var(--sub); }
.empty b { color: var(--ink); }

/* ---- アップロード・編集 ---- */
form.box, .box { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field > label, .field > .lbl { font-weight: 600; font-size: 14px; }
.field input[type=text], .field textarea, .field select {
  font: inherit; padding: 8px 10px; border: 1px solid #cfd4db; border-radius: 8px; background: #fff; color: var(--ink); width: 100%;
}
.field textarea { min-height: 80px; resize: vertical; }
.radios { display: flex; flex-direction: column; gap: 6px; }
.radios label, .checks label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.radios label small, .checks label small { color: var(--sub); display: block; font-size: 12.5px; }
.drop {
  border: 2px dashed #c8cdd5; border-radius: 12px; padding: 30px 16px; text-align: center; background: #fafbfc; cursor: pointer;
}
.drop.over { border-color: var(--accent); background: #fff7ee; }
.drop b { display: block; font-size: 15px; }
.drop .fname { margin-top: 8px; font-weight: 600; word-break: break-all; }
.progress { height: 8px; background: #eceff2; border-radius: 999px; overflow: hidden; margin: 10px 0 4px; }
.progress > div { height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.err { color: var(--danger); font-size: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---- 見る画面 ---- */
.viewer-page main { max-width: 1100px; }
.deck-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.deck-head .ops { display: flex; gap: 8px; flex-wrap: wrap; }
.deck-desc { white-space: pre-wrap; margin: 14px 0 0; }
.notes { white-space: pre-wrap; background: #fffdf3; border: 1px solid #f0e2bd; border-radius: 8px; padding: 10px 12px; font-size: 14px; color: #4b5560; margin-top: 10px; }
.notes:empty { display: none; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 8px; }
.thumbs .th { cursor: pointer; border-radius: 6px; overflow: hidden; border: 2px solid transparent; background: #fff; position: relative; }
.thumbs .th.on { border-color: var(--accent); }
.thumbs .th .tbox { position: relative; overflow: hidden; }
.thumbs .th .tbox > .pslide { position: absolute; left: 0; top: 0; transform-origin: top left; box-shadow: none; pointer-events: none; }
.thumbs .th .n { position: absolute; right: 4px; bottom: 3px; font-size: 11px; background: rgba(0,0,0,.55); color: #fff; border-radius: 4px; padding: 0 5px; }
.thumbs .th.hid { opacity: .5; }
.embed-code { width: 100%; font: 12.5px ui-monospace, Consolas, monospace; padding: 8px; border: 1px solid #cfd4db; border-radius: 8px; }
dialog { border: 1px solid var(--line); border-radius: 12px; padding: 18px; max-width: min(560px, calc(100vw - 32px)); width: 100%; }
dialog::backdrop { background: rgba(20, 24, 31, .45); }

/* ---- 再生役(player.js) ---- */
.player { position: relative; background: #1b1d21; border-radius: 10px; overflow: hidden; outline: none; user-select: none; -webkit-user-select: none; }
.pl-stage { position: relative; overflow: hidden; background: #1b1d21; cursor: pointer; }
.pl-frame { position: absolute; left: 0; top: 0; transform-origin: top left; }
.pl-slide { position: absolute !important; left: 0; top: 0; transform: none !important; box-shadow: none !important; }
.pl-blank { position: absolute; inset: 0; background: #000; z-index: 3; }
.pl-blank[hidden] { display: none; }
.pl-hit { position: absolute; top: 0; bottom: 0; width: 12%; border: 0; background: transparent; cursor: pointer; z-index: 2; opacity: 0; }
.pl-prev { left: 0; } .pl-next { right: 0; }
.pl-hit:focus-visible { opacity: 1; outline: 2px solid var(--accent); }
.pl-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #26292f; color: #d6d9de; font-size: 13px; }
.pl-btn { background: transparent; border: 0; color: #e8eaed; font-size: 20px; line-height: 1; padding: 4px 8px; border-radius: 6px; cursor: pointer; min-width: 34px; }
.pl-btn:hover { background: rgba(255,255,255,.12); }
.pl-num { font-variant-numeric: tabular-nums; min-width: 5.5em; text-align: center; }
.pl-seek { flex: 1; min-width: 60px; accent-color: var(--accent); }
.pl-anim { font-size: 11.5px; background: rgba(233, 162, 59, .2); color: #f3c47e; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.pl-anim[hidden] { display: none; }
.pl-trigger { cursor: pointer; }
.player:fullscreen, .player.pl-full { border-radius: 0; width: 100vw; height: 100vh; background: #000; }
.player.pl-full { position: fixed; inset: 0; z-index: 50; }
.player:fullscreen .pl-stage, .player.pl-full .pl-stage { background: #000; }
.player.pl-presenting .pl-bar { position: absolute; left: 0; right: 0; bottom: 0; opacity: 0; transition: opacity .2s; z-index: 4; }
.player.pl-presenting .pl-bar:hover { opacity: .95; }
.player.pl-presenting .pl-stage { cursor: none; }
.player.pl-presenting .pl-stage:hover { cursor: default; }
/* 動画は押して動かす(▶)。スライドの外の黒い所まで押せるので、▶ を少し大きく */
.pl-slide .pvid video { position: relative; z-index: 1; }

/* ---- 埋め込み ---- */
body.embed { background: #1b1d21; }
body.embed .player { border-radius: 0; }
body.embed .pl-title { position: absolute; left: 0; right: 0; top: 0; z-index: 3; padding: 6px 10px; font-size: 13px; color: #fff; background: linear-gradient(rgba(0,0,0,.55), transparent); pointer-events: none; opacity: 0; transition: opacity .2s; }
body.embed .player:hover .pl-title { opacity: 1; }
body.embed .pl-title a { color: #fff; pointer-events: auto; }

@media (max-width: 640px) {
  .top { padding: 8px 12px; }
  main { padding: 14px 12px 40px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card .meta { padding: 8px; }
  .thumbs { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .pl-seek { display: none; }
}
