/* 학원 쇼츠·블로그 — 어두운 고급 테마. 외부 글꼴·인라인 스타일 없이(보안 6겹 CSP) 이 파일 하나로 */
:root {
  --bg: #07080d; --ink: #eef0f6; --sub: #a3a9bd; --faint: #6c7389;
  --card: rgba(255, 255, 255, .028); --card2: rgba(255, 255, 255, .045); --line: rgba(255, 255, 255, .08); --line2: rgba(255, 255, 255, .14);
  --a1: #7c8cff; --a2: #a771ff; --a3: #ff7ac6; --ok: #3ddc97; --warn: #ffb35c; --bad: #ff6b6b;
  --grad: linear-gradient(120deg, var(--a1), var(--a2) 55%, var(--a3));
  --r: 18px;
  --mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%237c8cff'/%3E%3Cstop offset='.55' stop-color='%23a771ff'/%3E%3Cstop offset='1' stop-color='%23ff7ac6'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='40' height='40' rx='11' fill='url(%23g)'/%3E%3Crect x='10' y='9' width='12' height='22' rx='3' fill='none' stroke='%23fff' stroke-width='2.2'/%3E%3Cpath d='M14.5 16.5v7l5-3.5z' fill='%23fff'/%3E%3Cpath d='M25 14h6M25 20h6M25 26h4' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");
  --up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M7 9l5-5 5 5'/%3E%3Cpath d='M4 15v3a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-3'/%3E%3C/svg%3E");
  --play: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 5.5v13l11-6.5z' fill='%23ffffff'/%3E%3C/svg%3E");
  --doc: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233ddc97' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5M9 13h6M9 17h4'/%3E%3C/svg%3E");
  --check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2307080d' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  --dl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 10l5 5 5-5M5 20h14'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--ink); background:
    radial-gradient(900px 520px at 85% -12%, rgba(167, 113, 255, .22), transparent 62%),
    radial-gradient(760px 480px at -8% 8%, rgba(124, 140, 255, .18), transparent 60%),
    radial-gradient(600px 400px at 50% 115%, rgba(255, 122, 198, .08), transparent 65%), var(--bg);
  background-attachment: fixed;
  font: 15px/1.6 "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  letter-spacing: -.012em; -webkit-font-smoothing: antialiased;
  -webkit-user-select: none; user-select: none;
}
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 56px 56px; -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%); mask-image: radial-gradient(ellipse at 50% 0%, #000 0%, transparent 70%); }
input, textarea { -webkit-user-select: text; user-select: text; }
main { max-width: 820px; margin: 0 auto; padding: 32px 18px 56px; }
h1, h2 { letter-spacing: -.03em; font-weight: 700; }
h2 { font-size: 16px; margin: 0; }
.box {
  position: relative; margin: 0 0 16px; padding: 26px; border-radius: var(--r);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015)); border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 24px 60px -30px rgba(0, 0, 0, .8);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}

/* 버튼 */
button, .btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 18px;
  font: 600 14px/1 inherit; font-family: inherit; letter-spacing: -.01em; color: #fff; border: 0; border-radius: 11px; cursor: pointer; text-decoration: none;
  background: var(--grad); box-shadow: 0 8px 24px -8px rgba(167, 113, 255, .7), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .15s, box-shadow .15s, filter .15s, background .15s;
}
button:hover, .btn:hover { transform: translateY(-1px); filter: brightness(1.08); box-shadow: 0 12px 30px -8px rgba(167, 113, 255, .85), inset 0 1px 0 rgba(255, 255, 255, .3); }
button:active, .btn:active { transform: translateY(0); }
button.sub, .btn.sub { color: var(--ink); background: rgba(255, 255, 255, .05); border: 1px solid var(--line2); box-shadow: none; }
button.sub:hover, .btn.sub:hover { background: rgba(255, 255, 255, .09); filter: none; box-shadow: none; }
button:disabled { opacity: .45; cursor: default; transform: none; }

/* 로그인 */
#login { max-width: 410px; margin: 10vh auto 18px; padding: 40px 34px 30px; border: 1px solid transparent;
  background: linear-gradient(180deg, #11131c, #0b0c13) padding-box, linear-gradient(140deg, rgba(124,140,255,.6), rgba(255,255,255,.06) 40%, rgba(255,122,198,.45)) border-box; }
#login::before { content: ""; display: block; width: 54px; height: 54px; margin: 0 0 22px; background: var(--mark) center/contain no-repeat; border-radius: 15px; box-shadow: 0 14px 40px -6px rgba(167, 113, 255, .7); }
#login h1 { font-size: 26px; margin: 0 0 6px; background: linear-gradient(180deg, #fff, #c9cde0); -webkit-background-clip: text; background-clip: text; color: transparent; }
#login .lead { color: var(--sub); margin: 0 0 30px; font-size: 14px; }
label { display: block; margin: 0 0 14px; color: var(--sub); font-size: 12px; font-weight: 600; letter-spacing: .02em; }
input { display: block; width: 100%; height: 48px; margin-top: 7px; padding: 0 15px; font: 15px inherit; font-family: inherit; color: var(--ink);
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line2); border-radius: 12px; transition: border-color .15s, box-shadow .15s, background .15s; }
input:focus { outline: 0; background: rgba(255, 255, 255, .06); border-color: var(--a1); box-shadow: 0 0 0 4px rgba(124, 140, 255, .18); }
#login button { width: 100%; height: 50px; margin-top: 10px; font-size: 15px; }
.msg { color: var(--warn); min-height: 1.5em; margin: 12px 0 0; font-size: 13px; }

/* 이용 안내 */
.terms { max-width: 410px; margin: 0 auto; padding: 14px 18px; font-size: 11.5px; color: var(--faint); background: transparent; border-color: rgba(255,255,255,.05); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.terms h2 { font-size: 12px; margin: 0 0 6px; color: var(--sub); }
.terms ul { margin: 0; padding-left: 16px; }
.terms li { margin: 2px 0; }
.terms p { margin: 6px 0 0; }
#app:not(:empty) ~ .terms { max-width: none; margin-top: 10px; }

/* 위 띠 */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 26px; }
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand::before { content: ""; flex: none; width: 42px; height: 42px; background: var(--mark) center/contain no-repeat; border-radius: 12px; box-shadow: 0 10px 30px -6px rgba(167, 113, 255, .65); }
.brand b { display: block; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { display: block; color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }

/* 올리기 */
.drop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0; padding: 44px 16px 40px; text-align: center; cursor: pointer;
  border-radius: 16px; border: 1px dashed rgba(167, 113, 255, .35); background: radial-gradient(400px 160px at 50% 0%, rgba(167, 113, 255, .12), transparent 70%), rgba(255, 255, 255, .015);
  transition: border-color .2s, background .2s, transform .2s; }
.drop:hover, .drop.over { border-color: rgba(167, 113, 255, .8); background: radial-gradient(420px 180px at 50% 0%, rgba(167, 113, 255, .22), transparent 70%), rgba(255, 255, 255, .025); }
.drop.over { transform: scale(1.01); }
.drop::before { content: ""; width: 58px; height: 58px; margin-bottom: 10px; border-radius: 18px; background: var(--up) center/24px no-repeat, var(--grad);
  box-shadow: 0 14px 36px -8px rgba(167, 113, 255, .8), inset 0 1px 0 rgba(255,255,255,.3); transition: transform .2s; }
.drop:hover::before { transform: translateY(-3px); }
.drop strong { color: var(--ink); font-size: 18px; letter-spacing: -.03em; }
.drop span { color: var(--faint); font-size: 13px; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; height: auto; margin: 0; }
[hidden], .drop[hidden], .prog[hidden] { display: none !important; }
.prog { padding: 6px 2px 2px; }
.big { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.big b { font-size: 54px; line-height: 1; font-weight: 800; letter-spacing: -.05em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.big b small { font-size: 22px; margin-left: 2px; }
.big span { color: var(--sub); font-size: 13px; font-variant-numeric: tabular-nums; }
.bar, .track { position: relative; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.bar i, .track i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--grad); transition: width .4s ease; box-shadow: 0 0 18px rgba(167, 113, 255, .8); }
.bar i::after, .track i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent); transform: translateX(-100%); animation: shine 1.6s ease-in-out infinite; }
@keyframes shine { to { transform: translateX(100%); } }
.up .msg { color: var(--sub); margin-top: 12px; }
.up .msg:empty { display: none; }

/* 만든 것 */
.head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.stats { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.stat { white-space: nowrap; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 99px; color: var(--ok); background: rgba(61, 220, 151, .1); border: 1px solid rgba(61, 220, 151, .2); }
.stat.run { color: var(--a1); background: rgba(124, 140, 255, .1); border-color: rgba(124, 140, 255, .25); }
.stat.quota { color: var(--sub); background: rgba(255, 255, 255, .04); border-color: rgba(255, 255, 255, .12); font-variant-numeric: tabular-nums; }
.stat.quota.low { color: var(--warn); background: rgba(255, 179, 92, .1); border-color: rgba(255, 179, 92, .3); }
.drop.full { cursor: not-allowed; opacity: .45; filter: grayscale(.6); }
.drop.full::before, .drop.full:hover::before { transform: none; }
.drop.full input { pointer-events: none; }
.up .msg.quota { color: var(--warn); }
.hist summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; color: var(--sub); font-size: 14px; font-weight: 700; }
.hist summary::-webkit-details-marker { display: none; }
.hist summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--faint); border-bottom: 2px solid var(--faint); transform: rotate(45deg); transition: transform .2s; }
.hist[open] summary::after { transform: rotate(225deg); }
.hist ol { list-style: none; margin: 14px 0 0; padding: 0; }
.hist li { display: grid; grid-template-columns: 92px 1fr auto; gap: 12px; align-items: baseline; padding: 9px 0; border-top: 1px solid rgba(255, 255, 255, .06); font-size: 13px; }
.hist time, .hist small { color: var(--faint); font-variant-numeric: tabular-nums; }
.hist span { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job { padding: 22px 0; border-top: 1px solid var(--line); }
.job:first-child { border-top: 0; }
.job .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.job .name { font-weight: 700; font-size: 15.5px; word-break: break-all; }
.job .meta { color: var(--faint); font-size: 12px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.empty { color: var(--faint); text-align: center; padding: 26px 0 12px; margin: 0; }
.state { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; font-size: 12px; font-weight: 700; border-radius: 99px; white-space: nowrap;
  color: #c8cfff; background: rgba(124, 140, 255, .12); border: 1px solid rgba(124, 140, 255, .28); }
.state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--a1); box-shadow: 0 0 0 0 rgba(124, 140, 255, .7); animation: ping 1.6s ease-out infinite; }
.state.done { color: var(--ok); background: rgba(61, 220, 151, .1); border-color: rgba(61, 220, 151, .3); }
.state.done::before { background: var(--ok); animation: none; box-shadow: 0 0 10px var(--ok); }
.state.bad { color: var(--warn); background: rgba(255, 179, 92, .1); border-color: rgba(255, 179, 92, .3); }
.state.bad::before { background: var(--warn); animation: none; }
@keyframes ping { 70% { box-shadow: 0 0 0 7px rgba(124, 140, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(124, 140, 255, 0); } }

/* 진행 단계 */
.steps { margin-top: 18px; padding: 18px 18px 14px; border-radius: 14px; background: rgba(255, 255, 255, .025); border: 1px solid var(--line); }
.steps ol { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; list-style: none; margin: 0 0 14px; padding: 0; }
.steps li { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 11.5px; color: var(--faint); font-weight: 600; }
.steps li i { position: relative; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line2); background: rgba(255,255,255,.02); }
.steps li.ok { color: var(--sub); }
.steps li.ok i { border-color: transparent; background: var(--check) center/14px no-repeat, var(--ok); box-shadow: 0 0 14px rgba(61, 220, 151, .45); }
.steps li.now { color: var(--ink); }
.steps li.now i { border-color: transparent; background: radial-gradient(circle, var(--a2) 0 4px, transparent 5px); }
.steps li.now i::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--a1); border-right-color: var(--a3); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.steps .cap { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 12.5px; color: var(--sub); }
.steps .cap b { color: var(--faint); font-weight: 600; font-variant-numeric: tabular-nums; }
.steps.bad .track i { background: var(--warn); box-shadow: none; }

/* 결과물 */
.files { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.files li { display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 14px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); transition: border-color .2s, transform .2s, background .2s; }
.files li:hover { border-color: var(--line2); background: rgba(255, 255, 255, .05); transform: translateY(-2px); }
.thumb { position: relative; aspect-ratio: 9 / 16; max-height: 230px; border-radius: 10px; overflow: hidden;
  background: radial-gradient(120% 70% at 30% 10%, rgba(124, 140, 255, .55), transparent 60%), radial-gradient(90% 60% at 80% 90%, rgba(255, 122, 198, .45), transparent 60%), #141625; }
.thumb .no { position: absolute; left: 10px; top: 8px; font-size: 22px; font-weight: 800; letter-spacing: -.04em; color: rgba(255, 255, 255, .85); }
.thumb .play { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; background: var(--play) 55% 50%/20px no-repeat, rgba(255, 255, 255, .16); border: 1px solid rgba(255,255,255,.3); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.files .tx { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.files .tag { align-self: flex-start; font-size: 10px; font-weight: 800; letter-spacing: .12em; padding: 3px 7px; border-radius: 6px; color: #ff9bd2; background: rgba(255, 122, 198, .12); border: 1px solid rgba(255, 122, 198, .25); }
.files .tag.blog { color: var(--ok); background: rgba(61, 220, 151, .1); border-color: rgba(61, 220, 151, .25); }
.files .t { font-size: 13.5px; font-weight: 600; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.files .acts { display: flex; gap: 6px; margin-top: auto; }
.files .acts > * { flex: 1; height: 36px; padding: 0 12px; font-size: 13px; }
.files .acts .btn::before { content: ""; width: 15px; height: 15px; background: var(--dl) center/contain no-repeat; }
.files li.doc { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; }
.files li.doc .tx { flex: 1; }
.files li.doc .acts { margin: 0; flex: none; }
.files li.doc .acts > * { flex: none; }
.docicon { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--doc) center/22px no-repeat, rgba(61, 220, 151, .1); border: 1px solid rgba(61, 220, 151, .25); }

.offscreen { position: fixed; left: -9999px; top: 0; opacity: 0; }
.guard { text-align: center; padding: 48px 16px; color: var(--sub); }
@media (max-width: 620px) {
  main { padding: 20px 12px 40px; }
  .box { padding: 18px; }
  #login { margin-top: 6vh; padding: 30px 22px 24px; }
  .files { grid-template-columns: repeat(2, 1fr); }
  .files li.doc { flex-wrap: wrap; }
  .files li.doc .acts { width: 100%; }
  .files li.doc .acts > * { flex: 1; }
  .steps { padding: 14px 10px 12px; }
  .steps li span { display: none; }
  .steps ol { margin-bottom: 12px; }
  .steps li i { width: 22px; height: 22px; }
  .big b { font-size: 44px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
