:root {
  --bg: #0d0b08; --panel: #17130d; --panel2: #201a11; --line: #3a2f1c;
  --gold: #f2c45a; --gold2: #ffdf8a; --red: #e2462f; --text: #efe7d6; --muted: #b3a58a; --ok: #6fcf7c;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.6;
       font-family: "Pretendard", "맑은 고딕", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; }
a { color: var(--gold2); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* 상단 바 */
.top { position: sticky; top: 0; z-index: 10; background: rgba(13,11,8,.94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 18px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 20px; color: var(--gold2); white-space: nowrap; }
.brand img { width: 34px; height: 34px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.top nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; }
.top nav a { color: var(--muted); padding: 6px 12px; border-radius: 8px; white-space: nowrap; font-weight: 600; }
.top nav a.on, .top nav a:hover { color: var(--gold2); background: var(--panel2); text-decoration: none; }
.btn { display: inline-block; border: 0; cursor: pointer; font: inherit; font-weight: 800; color: #241800;
       background: linear-gradient(180deg, var(--gold2), var(--gold)); padding: 10px 18px; border-radius: 10px; }
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--gold2); border: 1px solid var(--gold); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.btn.danger { background: #5a1a12; color: #ffd2c8; border: 1px solid #8a2a1c; }
.btn:disabled { opacity: .5; cursor: default; }

/* 홈 */
.hero { background: radial-gradient(ellipse at 25% 0%, #3b2a0c 0%, #0d0b08 70%); border-bottom: 1px solid var(--line); }
.hero .wrap { display: grid; grid-template-columns: 300px 1fr; gap: 36px; align-items: center; padding: 36px 16px; }
.hero img.poster { width: 100%; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(242,196,90,.25); }
.hero h1 { margin: 0 0 8px; font-size: 34px; color: var(--gold2); line-height: 1.25; }
.hero p { margin: 0 0 18px; font-size: 17px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.stats { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; color: var(--muted); font-size: 14px; }
.stat b { color: var(--gold2); font-size: 18px; margin-right: 4px; }

section.block { padding: 28px 0 8px; }
h2 { color: var(--gold2); font-size: 22px; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
h2 .more { margin-left: auto; font-size: 14px; font-weight: 600; }

/* 영상 카드 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: block; color: var(--text); transition: transform .12s, border-color .12s; }
.card:hover { transform: translateY(-2px); border-color: var(--gold); text-decoration: none; }
.card .th { position: relative; aspect-ratio: 16/9; background: #000; }
.card .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .dur { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.8); color: #fff; font-size: 12px; padding: 1px 6px; border-radius: 5px; }
.card .tag { position: absolute; left: 8px; top: 8px; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 6px; }
.tag.admin { background: var(--gold); color: #241800; }
.tag.member { background: #2b4a7a; color: #e3eeff; }
.tag.yt { left: auto; right: 8px; background: #c4302b; color: #fff; }
.card .meta { padding: 10px 12px 12px; }
.card .t { font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.card .s { color: var(--muted); font-size: 13px; margin-top: 4px; }
.empty { color: var(--muted); background: var(--panel); border: 1px dashed var(--line); border-radius: 12px; padding: 28px; text-align: center; }

.tabs { display: flex; gap: 6px; margin: 4px 0 18px; flex-wrap: wrap; }
.tabs a { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-weight: 600; }
.tabs a.on { background: var(--gold); color: #241800; border-color: var(--gold); text-decoration: none; }

/* 재생 */
.watch { display: grid; grid-template-columns: 1fr 320px; gap: 24px; padding: 24px 0; }
.player { background: #000; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16/9; }
.player video, .player iframe { width: 100%; height: 100%; display: block; border: 0; background: #000; }
.watch h1 { font-size: 22px; margin: 14px 0 4px; color: var(--gold2); }
.watch .info { color: var(--muted); font-size: 14px; }
.watch .desc { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-top: 12px; white-space: pre-wrap; }
.side h3 { color: var(--gold); margin: 0 0 10px; font-size: 16px; }
.side .card { margin-bottom: 12px; }

/* 폼 */
.form { max-width: 640px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; margin: 24px 0; }
.form label { display: block; font-weight: 700; margin: 14px 0 6px; color: var(--gold2); }
.form .hint { color: var(--muted); font-size: 13px; font-weight: 400; }
input[type=text], input[type=password], input[type=url], textarea {
  width: 100%; background: #0a0806; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; }
input:focus, textarea:focus { outline: 2px solid var(--gold); border-color: transparent; }
textarea { min-height: 80px; resize: vertical; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 26px; text-align: center; color: var(--muted); cursor: pointer; }
.drop.on { border-color: var(--gold); background: #1d170c; color: var(--gold2); }
.prog { height: 12px; background: #0a0806; border: 1px solid var(--line); border-radius: 99px; overflow: hidden; margin-top: 14px; display: none; }
.prog > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold2)); transition: width .2s; }
.msg { margin-top: 12px; padding: 10px 12px; border-radius: 8px; display: none; }
.msg.err { display: block; background: #2a120d; border: 1px solid #6a2416; color: #ffcfc4; }
.msg.ok { display: block; background: #102414; border: 1px solid #2c5a33; color: #c9f5cf; }
.msg.info { display: block; background: #261d0b; border: 1px solid var(--line); color: var(--gold2); }

/* 관리자 */
table.adm { width: 100%; border-collapse: collapse; font-size: 14px; }
table.adm th, table.adm td { border-bottom: 1px solid var(--line); padding: 10px 8px; vertical-align: top; text-align: left; }
table.adm th { color: var(--gold2); background: var(--panel2); position: sticky; top: 58px; }
table.adm img { width: 120px; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
table.adm form { display: inline; }
table.adm .row-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
table.adm input[type=url] { padding: 5px 8px; font-size: 13px; width: 230px; }
.st { font-size: 12px; font-weight: 800; padding: 1px 7px; border-radius: 5px; }
.st.ready { background: #183a1f; color: var(--ok); } .st.hidden { background: #333; color: #ccc; }
.st.processing { background: #3a300f; color: var(--gold2); } .st.failed { background: #4a1510; color: #ffb4a6; }
.bar { height: 8px; background: #0a0806; border-radius: 99px; overflow: hidden; border: 1px solid var(--line); width: 220px; display: inline-block; vertical-align: middle; }
.bar > div { height: 100%; background: var(--gold); }

footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 22px 0 36px; color: var(--muted); font-size: 13px; }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; padding: 22px 16px; }
  .hero img.poster { max-width: 280px; margin: 0 auto; display: block; }
  .hero h1 { font-size: 26px; }
  .watch { grid-template-columns: 1fr; }
  .brand span { display: none; }
  table.adm .hide-m { display: none; }
}

/* ===== v2: 파트 구분 ===== */
.nav-sep { width: 1px; background: var(--line); margin: 6px 6px; }
.top nav a.adm { color: #f5b38a; }
.top nav a.adm.on, .top nav a.adm:hover { color: #ffd2b0; background: #2a1810; }
.pagehead { background: linear-gradient(180deg, #1c150a, var(--bg)); border-bottom: 1px solid var(--line); }
.pagehead .wrap { display: flex; gap: 16px; align-items: center; padding: 26px 16px 20px; }
.pagehead .pn, .part .pn { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 14px;
  background: var(--gold); color: #241800; font-size: 26px; font-weight: 900; flex: none; }
.pagehead h1 { margin: 0; font-size: 26px; color: var(--gold2); }
.pagehead h1 small { font-size: 14px; color: #f5b38a; border: 1px solid #6a3a20; border-radius: 6px; padding: 1px 8px; margin-left: 8px; vertical-align: 4px; }
.pagehead p { margin: 4px 0 0; color: var(--muted); }
.pagehead.adm .pn { background: #d9773f; color: #fff; }
.parts { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.part { display: flex; flex-direction: column; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; color: var(--text); transition: transform .12s, border-color .12s; }
.part:hover { transform: translateY(-2px); border-color: var(--gold); text-decoration: none; }
.part b { font-size: 19px; color: var(--gold2); }
.part span:not(.pn) { color: var(--muted); font-size: 14px; flex: 1; }
.part em { font-style: normal; color: var(--gold); font-weight: 700; font-size: 14px; }
.part.adm { border-color: #6a3a20; } .part.adm .pn { background: #d9773f; color: #fff; }
.tabs.small a { padding: 3px 10px; font-size: 13px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin: 18px 0; }
.panel h2 .n, .gstep h2 .n { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--gold); color: #241800; font-size: 15px; }
.panel h2 .more { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.s { color: var(--muted); font-size: 13px; }
.chk { display: flex; gap: 6px; align-items: center; cursor: pointer; margin: 4px 0; font-size: 14px; }
.lbl { display: block; color: var(--gold2); margin-bottom: 6px; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.opt-grid .row { display: flex; gap: 6px; align-items: center; margin: 6px 0; font-size: 14px; }
input[type=number], select { background: #0a0806; color: var(--text); border: 1px solid var(--line); border-radius: 7px; padding: 5px 8px; font: inherit; }
input[type=number] { width: 70px; }
select { width: 100%; max-width: 280px; }
.pick-wrap { max-height: 460px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
table.pick { width: 100%; border-collapse: collapse; font-size: 14px; }
table.pick th { position: sticky; top: 0; background: var(--panel2); color: var(--gold2); text-align: left; padding: 8px; z-index: 1; }
table.pick td { border-top: 1px solid var(--line); padding: 6px 8px; vertical-align: middle; cursor: pointer; }
table.pick tr:hover td { background: #1d170c; }
table.pick img { width: 96px; aspect-ratio: 16/9; object-fit: cover; border-radius: 5px; display: block; }
table.pick input { width: 18px; height: 18px; }
table.pick tr.is-admin td { opacity: .8; }
pre.log { background: #0a0806; border: 1px solid var(--line); border-radius: 8px; padding: 10px; max-height: 260px; overflow: auto;
  font-size: 12px; color: #cfc5b0; white-space: pre-wrap; }
.job { border-top: 1px solid var(--line); padding: 12px 0; }
.job:first-of-type { border-top: 0; }
.job-h { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
table.res td.acts { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
table.res td.acts form { display: flex; gap: 6px; }
.tips { color: var(--muted); font-size: 14px; padding-left: 18px; margin: 16px 0 0; }
.tips li { margin: 4px 0; }
/* 녹화 가이드 */
.guide .callout { border-left: 4px solid var(--red); background: #2a120d; padding: 12px 16px; border-radius: 8px; margin: 18px 0; }
.steps-nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0 0; }
.steps-nav a { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 14px; color: var(--muted); }
.gstep { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin: 16px 0; }
.gstep h2 small { color: var(--muted); font-size: 14px; font-weight: 600; }
.gstep table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 15px; }
.gstep th, .gstep td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.gstep th { background: var(--panel2); color: var(--gold2); width: 38%; }
.hl { color: #fff; background: #5a1a12; border: 1px solid var(--red); border-radius: 5px; padding: 0 6px; }
.shot { margin: 12px 0; }
.shot img { max-width: 100%; border: 1px solid var(--line); border-radius: 10px; display: block; }
.shot figcaption { color: var(--muted); font-size: 13px; margin-top: 4px; }
.shot.missing { border: 2px dashed #6a3a20; color: #f5b38a; border-radius: 10px; padding: 14px; font-size: 14px; }
.gstep details { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 8px 0; }
.gstep summary { cursor: pointer; font-weight: 700; color: var(--gold2); }
@media (max-width: 860px) { .pagehead .pn { width: 42px; height: 42px; font-size: 20px; } .pagehead h1 { font-size: 21px; } }

/* ---- 공지 ---- */
.notice details { background: linear-gradient(180deg, #241b0c, var(--panel)); border: 1px solid var(--gold); border-radius: 14px; padding: 16px 22px; }
.notice summary { list-style: none; cursor: pointer; }
.notice summary::-webkit-details-marker { display: none; }
.notice summary h2 { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.notice .nupd { font-size: 13px; font-weight: 400; color: var(--muted); }
.notice .ntoggle { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--gold); }
.notice .ntoggle::after { content: "접기 ▲"; }
.notice details:not([open]) .ntoggle::after { content: "펼치기 ▼"; }
.notice .nbody { margin-top: 12px; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.notice .nsec { background: rgba(0,0,0,.25); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; }
.notice .nsec h3 { margin: 0 0 6px; font-size: 16px; color: var(--gold2); }
.notice ul { margin: 4px 0; padding-left: 18px; }
.notice li { margin: 4px 0; line-height: 1.55; font-size: 14.5px; }
.notice ul ul li { color: var(--muted); font-size: 13.5px; }
.notice a { word-break: break-all; }
.notice p { margin: 6px 0; }
.notice .nedit { margin-top: 10px; text-align: right; font-size: 13px; }
