/* JW_CAD講習 動画会員ページ */
:root {
  --bg: #f6f5f3;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #5f6670;
  --line: #dcdad6;
  --accent: #9f1239;
  --accent-ink: #ffffff;
  --ok: #15803d;
  --warn: #b45309;
  --ng: #b91c1c;
  --radius: 10px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Yu Gothic UI", "Meiryo", "Hiragino Sans", system-ui, sans-serif;
  font-size: 17px; line-height: 1.7;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent); }
h1 { font-size: 1.35rem; margin: 0 0 .8rem; }
h2 { font-size: 1.15rem; margin: 0 0 .7rem; }

/* 上の帯 */
header.top { background: var(--accent); color: var(--accent-ink); }
header.top .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; }
.brand { font-weight: 700; font-size: 1.1rem; }
.brand small { margin-left: .6em; padding: 1px 8px; border: 1px solid rgba(255,255,255,.7); border-radius: 99px; font-size: .8rem; font-weight: 400; }
nav.me { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
nav.me a { color: var(--accent-ink); text-decoration: none; padding: 4px 2px; border-bottom: 2px solid transparent; }
nav.me a.on, nav.me a:hover { border-bottom-color: #fff; }

main.wrap { padding-top: 20px; padding-bottom: 40px; }
footer.foot { color: var(--muted); font-size: .85rem; padding: 20px 0 30px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.login { max-width: 440px; margin: 30px auto; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.mono { font-family: Consolas, "MS Gothic", monospace; font-size: 1.05rem; letter-spacing: .03em; }
.nowrap { white-space: nowrap; }
.warn { color: var(--warn); }
.flash { background: #fff7e6; border: 1px solid #f3d19c; border-radius: var(--radius); padding: 10px 14px; }

/* フォーム */
label { display: block; font-weight: 600; margin-bottom: 12px; }
input, select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 11px;
  font: inherit; font-weight: 400; color: inherit; background: #fff;
  border: 1px solid #b9b6b0; border-radius: 8px;
}
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(159,18,57,.25); border-color: var(--accent); }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; }
label.check input { width: auto; margin: 0; }
textarea#guide { font-family: "MS Gothic", Consolas, monospace; font-size: 15px; line-height: 1.6; }
.issue { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.issue .wide { grid-column: 1 / -1; }
form.inline { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
form.inline input, form.inline select { width: auto; margin: 0; }
.filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filter select, .filter input { width: auto; margin: 0; flex: 1 1 200px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions form { margin: 0; }

.btn {
  display: inline-block; padding: 9px 18px; font: inherit; font-weight: 600;
  color: var(--text); background: #fff; border: 1px solid #b9b6b0; border-radius: 8px;
  cursor: pointer; text-decoration: none; line-height: 1.4;
}
.btn:hover { background: #f1efec; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--ng); border-color: #e3a3a3; }
.btn.small { padding: 4px 10px; font-size: .9rem; }

/* 表 */
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
table.list th, table.list td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
table.list th { font-size: .88rem; color: var(--muted); font-weight: 600; }
table.list tr.off td { color: var(--muted); }
table.kv th { text-align: left; font-weight: 600; color: var(--muted); padding: 4px 16px 4px 0; white-space: nowrap; vertical-align: top; }
table.kv td { padding: 4px 0; }
.st { display: inline-block; padding: 1px 10px; border-radius: 99px; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.st-active  { background: #dcfce7; color: var(--ok); }
.st-before  { background: #e0e7ff; color: #3730a3; }
.st-expired { background: #f1f0ee; color: var(--muted); }
.st-stopped { background: #fee2e2; color: var(--ng); }
.st-staff   { background: #fef3c7; color: #92400e; }

/* 会員：動画一覧 */
.period { font-size: 1rem; margin: 0 0 8px; }
h2.section { margin: 24px 0 12px; padding-left: 10px; border-left: 5px solid var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.vcard { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: inherit; text-decoration: none; }
.vcard:hover { border-color: var(--accent); }
.thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: #2b2b2b; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 2rem; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.vtitle { display: block; padding: 10px 12px 4px; font-weight: 600; }
.seen { display: inline-block; margin: 0 12px 10px; font-size: .8rem; color: var(--ok); }
.newbadge { position: absolute; top: 8px; left: 8px; padding: 2px 10px; border-radius: 999px; background: #dc2626; color: #fff; font-size: .8rem; font-weight: 700; letter-spacing: .05em; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.newbadge.inline { position: static; display: inline-block; margin-right: 8px; vertical-align: middle; box-shadow: none; }

/* 会員：再生 */
.crumb { margin: 0 0 8px; }
.vhead { font-size: 1.3rem; }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.desc { white-space: normal; }
.pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: end; margin-top: 8px; }
.pg { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pg-prev { align-items: flex-start; }
.pg-list { align-items: center; }
.pg-next { align-items: flex-end; }
.pg-label { font-size: .85rem; color: var(--muted); }
.pg .btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 600px) {
  body { font-size: 16px; }
  .card { padding: 16px; }
  /* スマホは「前」「次」を横に並べ、「動画一覧」はその下に横いっぱい */
  .pager { grid-template-columns: 1fr 1fr; }
  .pg-list { grid-column: 1 / -1; grid-row: 2; }
  .pg-list .btn { width: 100%; text-align: center; }
}
