/* ═══════════ Fucking Our Study Life — Logical Series 톤 ═══════════ */
:root {
  --bg: #0c0d0f;
  --bg-2: #111215;
  --panel: #15171b;
  --panel-2: #1b1d22;
  --line: #25272d;
  --line-2: #33363d;
  --text: #ecebe6;
  --muted: #a3a3a8;
  --faint: #6e6f75;
  --cream: #f3efe6;

  --teal: #6fdcc8;  --teal-bg: #16231f;
  --lav: #ab9cf7;   --lav-bg: #1c1a2e;
  --gold: #e9b85b;  --gold-bg: #2a2418;
  --rose: #d9a5a0;  --rose-bg: #2a2120;
  --oly: #5ff59d;   --oly-bg: #13261c;
  --peach: #ecb497; --peach-bg: #2c211c;
  --red: #f07a72;   --red-bg: #2c1716;
  --green: #79d99a; --green-bg: #15241b;

  --serif: 'DM Serif Display', 'Pretendard Variable', Pretendard, sans-serif;
  --kserif: 'Pretendard Variable', Pretendard, sans-serif;
  --sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;

  --r: 14px;
  --r-sm: 9px;
  --maxw: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 var(--sans); letter-spacing: -0.01em;
  word-break: keep-all; overflow-wrap: anywhere; font-synthesis: none;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.25; }
p { margin: 0; }
::selection { background: rgba(111, 220, 200, .3); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 6px; }

.boot { min-height: 100dvh; display: grid; place-content: center; text-align: center; gap: 4px; }
.boot-f { font: italic 22px var(--serif); color: #cfd0d4; }
.boot-t { font: 44px var(--serif); color: var(--teal); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* ── 레이아웃 ── */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.main { padding: 36px 0 96px; min-height: calc(100dvh - 64px - 120px); }
.stack { display: flex; flex-direction: column; gap: var(--gap, 16px); }
.row { display: flex; align-items: center; gap: var(--gap, 12px); flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: var(--gap, 18px); grid-template-columns: repeat(auto-fill, minmax(var(--min, 260px), 1fr)); }
.split { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (max-width: 960px) { .split { grid-template-columns: 1fr; } }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.small { font-size: 13px; } .tiny { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; }
.serif { font-family: var(--serif); font-weight: 600; }
.pre { white-space: pre-wrap; word-break: break-word; }
.hide-sm { } @media (max-width: 720px) { .hide-sm { display: none !important; } }
.c-peach { color: var(--peach); } .c-oly { color: var(--oly); } .c-teal { color: var(--teal); } .c-lav { color: var(--lav); } .c-gold { color: var(--gold); } .c-rose { color: var(--rose); } .c-red { color: var(--red); } .c-green { color: var(--green); }

/* ── 헤더 ── */
.hdr { position: sticky; top: 0; z-index: 50; background: rgba(12, 13, 15, .82); backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3); border-bottom: 1px solid var(--line); }
.hdr .wrap { height: 64px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; flex-direction: column; line-height: 1; gap: 2px; flex-shrink: 0; }
.brand i { font: italic 13px var(--serif); color: #c9cad0; }
.brand b { font: 400 21px var(--serif); color: var(--teal); letter-spacing: .005em; }
.nav { display: flex; gap: 4px; flex: 1; min-width: 0; }
.nav a { padding: 8px 12px; border-radius: 8px; color: var(--muted); font-size: 14.5px; font-weight: 500; white-space: nowrap; transition: color .15s, background .15s; }
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.on { color: var(--text); }
.nav a.on::after { content: ''; display: block; height: 2px; margin: 4px auto -6px; width: 16px; border-radius: 2px; background: var(--teal); }
.hdr-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.me-chip { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 99px; border: 1px solid var(--line); font-size: 13.5px; }
.me-chip:hover { border-color: var(--line-2); }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; background: var(--lav-bg); color: var(--lav); flex-shrink: 0; }
.avatar.admin { background: var(--gold-bg); color: var(--gold); }
.burger { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: none; place-items: center; cursor: pointer; }
@media (max-width: 960px) {
  .nav { display: none; }
  .burger { display: grid; }
  .nav.open { display: flex; flex-direction: column; position: fixed; inset: 64px 0 auto 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 12px var(--gutter) 20px; gap: 2px; max-height: calc(100dvh - 64px); overflow: auto; }
  .nav.open a { padding: 13px 12px; font-size: 16px; }
  .nav.open a.on::after { display: none; }
  .nav.open a.on { background: var(--panel); }
  .me-chip .nm { display: none; }
  .me-chip { padding: 4px; }
}
.demo-bar { background: var(--gold-bg); color: var(--gold); font-size: 12.5px; text-align: center; padding: 6px 16px; border-bottom: 1px solid #3a3020; }
.demo-bar b { font-weight: 600; }

/* ── 페이지 헤드 ── */
.ph { margin-bottom: 28px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.eyebrow { font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.ph h1 { font: 700 clamp(38px, 6vw, 60px)/1.02 var(--serif); letter-spacing: -.01em; color: var(--teal); }
.ph h1 .k { font-family: var(--sans); font-weight: 700; font-size: .7em; letter-spacing: -.03em; }
.ph p { color: var(--muted); margin-top: 10px; }
.section-t { font-size: 17px; font-weight: 650; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.section-t .more { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--faint); }
.section-t .more:hover { color: var(--text); }

/* ── 카드/패널 ── */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.card.pad-lg { padding: 28px; }
.card.flush { padding: 0; overflow: hidden; }
a.card, .card.hover { transition: border-color .2s, transform .2s var(--ease), background .2s; }
a.card:hover, .card.hover:hover { border-color: var(--line-2); background: var(--panel-2); }
.divider { height: 1px; background: var(--line); margin: 4px 0; border: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--faint); } .kv dd { margin: 0; }

/* ── 버튼 ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2); font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s, opacity .15s; user-select: none; }
.btn:hover { background: #22252b; border-color: #41444c; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--teal); color: #08201b; border-color: transparent; }
.btn.primary:hover { background: #8ae6d5; }
.btn.gold { background: var(--gold); color: #2a1e05; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--panel); color: var(--text); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-bg); border-color: #5a2a27; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.icon-btn { width: 36px; height: 36px; padding: 0; border-radius: 9px; }

/* ── 폼 ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .lbl { font-size: 13px; color: var(--muted); font-weight: 500; }
.input, .select, .textarea { width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 0 13px; height: 42px; font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.textarea { padding: 11px 13px; height: auto; min-height: 110px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(111, 220, 200, .14); }
.input.sm, .select.sm { height: 34px; font-size: 13.5px; border-radius: 8px; padding: 0 10px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239a9a9f' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--teal); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
input[type=file] { font-size: 13px; color: var(--muted); }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; color: var(--text); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 12px; margin-right: 10px; cursor: pointer; }

/* ── 뱃지/진도 ── */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--panel-2); color: var(--muted); white-space: nowrap; border: 1px solid transparent; }
.badge.teal { background: var(--teal-bg); color: var(--teal); }
.badge.lav { background: var(--lav-bg); color: var(--lav); }
.badge.gold { background: var(--gold-bg); color: var(--gold); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.rose { background: var(--rose-bg); color: var(--rose); }
.badge.peach { background: var(--peach-bg); color: var(--peach); }
.badge.oly { background: var(--oly-bg); color: var(--oly); }
.badge.line { background: transparent; border-color: var(--line-2); }
.bar { height: 6px; background: #24262c; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--teal); transition: width .6s var(--ease); }
.bar.peach > i { background: var(--peach); } .bar.oly > i { background: var(--oly); } .bar.lav > i { background: var(--lav); } .bar.gold > i { background: var(--gold); } .bar.rose > i { background: var(--rose); }
.bar.thin { height: 4px; }
.ring { --p: 0; --c: var(--teal); width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), #24262c 0); flex-shrink: 0; }
.ring::before { content: attr(data-l); width: 52px; height: 52px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── 테이블 ── */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; color: var(--faint); font-size: 12.5px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl td { padding: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, .018); }
.tbl .c { text-align: center; } .tbl .r { text-align: right; }
.tbl.dense td { padding: 9px 10px; } .tbl.dense th { padding: 9px 10px; }

/* ── 리스트 아이템 ── */
.li { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.li:last-child { border-bottom: 0; }
a.li:hover .li-t { color: var(--teal); }
.li-t { font-weight: 600; transition: color .15s; overflow: hidden; text-overflow: ellipsis; }
.dday { font: 600 13px var(--sans); font-variant-numeric: tabular-nums; min-width: 52px; text-align: center; padding: 4px 0; border-radius: 7px; background: var(--panel-2); color: var(--muted); }
.dday.hot { background: var(--red-bg); color: var(--red); }
.dday.soon { background: var(--gold-bg); color: var(--gold); }

.empty { text-align: center; padding: 48px 20px; color: var(--faint); font-size: 14px; }
.empty .ico { font-size: 28px; margin-bottom: 8px; opacity: .7; }
.loading { padding: 60px; display: grid; place-items: center; }
.spin { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--teal); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 탭 ── */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 11px 14px; font-size: 14.5px; font-weight: 600; color: var(--faint); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--text); border-bottom-color: var(--teal); }
.seg { display: inline-flex; padding: 3px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; }
.seg button { border: 0; background: none; height: 30px; padding: 0 12px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--faint); cursor: pointer; }
.seg button.on { background: var(--panel-2); color: var(--text); }

/* ── 토스트 ── */
.toasts { position: fixed; z-index: 200; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); }
.toast { pointer-events: auto; background: #f3efe6; color: #15161a; padding: 11px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); animation: toastIn .35s var(--ease); max-width: 480px; }
.toast.err { background: var(--red); color: #200; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } }

/* ── 모달 ── */
.modal-bg { position: fixed; inset: 0; z-index: 150; background: rgba(0, 0, 0, .6); display: grid; place-items: center; padding: 16px; animation: fade .2s; backdrop-filter: blur(4px); }
.modal { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; padding: 26px; animation: pop .28s var(--ease); }
.modal h3 { font-size: 19px; margin-bottom: 18px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ══════════ 홈 ══════════ */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-waves { position: absolute; inset: 0; pointer-events: none; }
.hero-waves svg { width: 100%; height: 100%; }
.hero-waves::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 80%, var(--bg) 100%); }
.hero-sub, .hero-rule { text-shadow: 0 0 6px var(--bg), 0 0 14px var(--bg), 0 0 24px var(--bg), 0 0 24px var(--bg); }
.hero .wrap { position: relative; padding-top: clamp(80px, 14vw, 150px); padding-bottom: clamp(56px, 9vw, 96px); }
.hero-top { position: absolute; top: 28px; left: var(--gutter); right: var(--gutter); display: flex; justify-content: space-between; font-size: 12px; letter-spacing: .3em; color: #8e8f95; }
.hero-title { line-height: .92; }
.hero-title .f { font: italic 400 clamp(30px, 5vw, 54px) var(--serif); color: #d6d7dc; display: block; margin-bottom: 8px; }
.hero-title .t { font: 400 clamp(56px, 11vw, 132px) var(--serif); letter-spacing: -.02em; background: linear-gradient(100deg, var(--teal) 0%, #9fb4f0 45%, var(--lav) 62%, var(--gold) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; display: block; padding-bottom: .08em; }
.hero-sub { margin-top: 26px; max-width: 540px; color: #b5b5ba; font-size: clamp(15px, 1.7vw, 17px); line-height: 1.75; }
.hero-cta { margin-top: 32px; display: flex; gap: 10px; flex-wrap: wrap; }
.hero-rule { margin-top: clamp(48px, 7vw, 80px); border-top: 1px solid #2a2c32; padding-top: 18px; display: flex; justify-content: space-between; color: #9a9ba1; font-size: 13.5px; gap: 12px; flex-wrap: wrap; }
.hero-rule b { font: 400 17px var(--serif); color: #d8d8dc; letter-spacing: .01em; }

.home-sec { padding: 64px 0 0; }
.series { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
@media (max-width: 1000px) { .series { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .series { grid-template-columns: 1fr 1fr; } }
.cover-card { display: block; }
.cover { position: relative; border-radius: 10px; overflow: hidden; aspect-ratio: 707 / 1000; background: #111; box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 24px 60px -24px rgba(0, 0, 0, .9); transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-fallback { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 8% 8% 10%; background: #111; }
.cover-fallback i { font: italic 400 clamp(12px, 1.6vw, 18px) var(--serif); color: #cfd0d4; }
.cover-fallback b { font: 400 clamp(24px, 3.6vw, 44px)/1 var(--serif); }
.cover-card:hover .cover { transform: translateY(-6px); box-shadow: 0 34px 70px -26px rgba(0, 0, 0, .95); }
.cover-meta { margin-top: 14px; }
.cover-meta .k { font-size: 12px; color: var(--faint); letter-spacing: .12em; }
.cover-meta .n { font: 400 24px var(--serif); margin-top: 3px; }
.cover-meta .d { font-size: 13.5px; color: var(--muted); margin-top: 4px; }

.dash { display: grid; gap: 18px; grid-template-columns: 1.3fr 1fr; }
@media (max-width: 860px) { .dash { grid-template-columns: 1fr; } }
.continue { display: flex; gap: 18px; align-items: center; }
.continue .th { width: 168px; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; flex-shrink: 0; position: relative; background: #000; }
.continue .th img { width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.continue .th::after { content: '▶'; position: absolute; inset: 0; display: grid; place-items: center; font-size: 22px; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
@media (max-width: 520px) { .continue { flex-direction: column; align-items: stretch; } .continue .th { width: 100%; } }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat .v { font: 400 30px/1.1 var(--serif); font-variant-numeric: tabular-nums; }
.stat .v small { font: 500 13px var(--sans); color: var(--faint); margin-left: 2px; }
.stat .l { font-size: 12.5px; color: var(--faint); margin-top: 4px; }

/* ══════════ 커리큘럼 ══════════ */
.cur { border-top: 1px solid var(--line-2); }
.cur-step { display: grid; grid-template-columns: 200px 1fr; border-bottom: 1px solid var(--line-2); }
.cur-step-h { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 24px 12px; gap: 4px; }
.cur-step-h b { font: 400 30px var(--serif); letter-spacing: .02em; }
.cur-step-h span { color: var(--muted); font-size: 14.5px; }
.cur-item { display: grid; grid-template-columns: 300px 1fr; min-height: 150px; }
.cur-item + .cur-item { border-top: 1px solid var(--line-2); }
.cur-name { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 22px; text-align: center; transition: filter .2s; }
.cur-name i { font: italic 17px var(--serif); opacity: .9; }
.cur-name b { font: 400 34px/1.1 var(--serif); }
.cur-name b.k { font-family: var(--sans); font-weight: 500; font-size: 28px; letter-spacing: -.02em; }
.cur-desc { padding: 26px 34px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.cur-desc h3 { font-size: 21px; font-weight: 600; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cur-desc h3 .sep { width: 1px; height: 18px; background: var(--line-2); }
.cur-desc p { font-size: 15px; }
.cur-desc .links { margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; }
a.cur-item:hover .cur-name { filter: brightness(1.2); }
@media (max-width: 860px) {
  .cur-step { grid-template-columns: 1fr; }
  .cur-step-h { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 18px 4px; }
  .cur-step-h b { font-size: 24px; }
  .cur-item { grid-template-columns: 1fr; }
  .cur-name { padding: 26px; }
  .cur-desc { padding: 20px 4px 26px; }
}
.bg-peach { background: var(--peach-bg); } .bg-oly { background: var(--oly-bg); } .bg-teal { background: var(--teal-bg); } .bg-lav { background: var(--lav-bg); } .bg-gold { background: var(--gold-bg); } .bg-rose { background: var(--rose-bg); }

/* ══════════ 교재 ══════════ */
.book { display: grid; grid-template-columns: 360px 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (max-width: 820px) { .book { grid-template-columns: 1fr; } .book .cover { max-width: 320px; } }
.book h2 { font: 400 clamp(40px, 6vw, 64px)/1 var(--serif); }
.book h2 i { display: block; font: italic 24px var(--serif); color: #cfd0d4; margin-bottom: 8px; }
.book-tag { font-size: 12px; letter-spacing: .26em; color: var(--faint); margin-bottom: 18px; }
.book-lead { font-size: 18px; margin-top: 22px; line-height: 1.8; }
.feat { margin-top: 32px; border-bottom: 1px solid var(--line-2); }
.feat > div { display: grid; grid-template-columns: 160px 1fr; gap: 16px; align-items: baseline; border-top: 1px solid var(--line-2); padding: 16px 0; }
.feat b { font: 650 19px var(--sans); letter-spacing: -.02em; }
.feat span { color: var(--muted); font-size: 15px; }
@media (max-width: 520px) { .feat > div { grid-template-columns: 1fr; gap: 4px; } }
.book-nav { display: flex; gap: 10px; margin-bottom: 32px; flex-wrap: wrap; }
.book-nav a { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); font: 400 16px var(--serif); color: var(--muted); }
.book-nav a.on { border-color: currentColor; }

/* ══════════ 강좌 ══════════ */
.course-card { display: flex; gap: 18px; align-items: stretch; }
.course-card .cv { width: 92px; flex-shrink: 0; }
.course-card .cv .cover { border-radius: 6px; }
.course-card .cv .ph-cover { aspect-ratio: 707/1000; border-radius: 6px; display: grid; place-items: center; font: italic 15px var(--serif); text-align: center; padding: 8px; }
.course-card h3 { font: 400 23px/1.15 var(--serif); }
.course-head { display: grid; grid-template-columns: 120px 1fr auto; gap: 24px; align-items: center; }
@media (max-width: 720px) { .course-head { grid-template-columns: 84px 1fr; } .course-head > :last-child { grid-column: 1 / -1; } }
.course-head h1 { font: 400 clamp(28px, 4vw, 38px)/1.1 var(--serif); }
.lec-no { width: 34px; text-align: center; color: var(--faint); font-variant-numeric: tabular-nums; }
.lec-title { font-weight: 600; font-size: 15px; }
.lec-meta { font-size: 12.5px; color: var(--faint); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.play-btn { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line-2); display: inline-grid; place-items: center; transition: all .2s; }
.play-btn:hover { border-color: var(--teal); color: var(--teal); background: var(--teal-bg); }
.play-btn.lock { opacity: .4; cursor: not-allowed; }
.play-btn svg { width: 14px; height: 14px; }

/* ══════════ 플레이어 ══════════ */
.player { position: relative; aspect-ratio: 16/9; background: #000; border-radius: var(--r); overflow: hidden; outline: none; user-select: none; -webkit-user-select: none; }
.player.fs, .player:fullscreen { border-radius: 0; aspect-ratio: auto; width: 100%; height: 100%; }
.player.pseudo-fs { position: fixed; inset: 0; z-index: 300; border-radius: 0; aspect-ratio: auto; }
.player .yt, .player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.p-shield { position: absolute; inset: 0; cursor: pointer; }
.p-start { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(transparent, rgba(0, 0, 0, .55)); cursor: pointer; border: 0; }
.p-start span { width: 76px; height: 76px; border-radius: 50%; background: rgba(243, 239, 230, .95); color: #111; display: grid; place-items: center; transition: transform .2s var(--ease); box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.p-start:hover span { transform: scale(1.06); }
.p-start svg { width: 26px; height: 26px; margin-left: 4px; }
.p-ctrl { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 14px 10px; background: linear-gradient(transparent, rgba(0, 0, 0, .82)); transition: opacity .3s; display: flex; flex-direction: column; gap: 6px; }
.player.idle .p-ctrl { opacity: 0; }
.player.idle { cursor: none; }
.p-seek { position: relative; height: 18px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.p-track { position: relative; width: 100%; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .18); transition: height .15s; }
.p-seek:hover .p-track { height: 6px; }
.p-allowed { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255, 255, 255, .22); border-radius: 4px; }
.p-watched { position: absolute; top: 0; bottom: 0; background: rgba(111, 220, 200, .45); }
.p-played { position: absolute; left: 0; top: 0; bottom: 0; background: var(--teal); border-radius: 4px; }
.p-thumb { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(111, 220, 200, .3); transform: scale(0); transition: transform .15s; }
.p-seek:hover .p-thumb, .p-seek.drag .p-thumb { transform: scale(1); }
.p-hint { position: absolute; bottom: 22px; transform: translateX(-50%); background: rgba(0, 0, 0, .85); padding: 3px 8px; border-radius: 6px; font-size: 12px; white-space: nowrap; pointer-events: none; }
.p-row { display: flex; align-items: center; gap: 4px; }
.p-btn { width: 38px; height: 36px; border: 0; background: none; color: #fff; display: grid; place-items: center; cursor: pointer; border-radius: 8px; flex-shrink: 0; }
.p-btn:hover { background: rgba(255, 255, 255, .1); }
.p-btn svg { width: 20px; height: 20px; }
.p-time { font-size: 13px; color: #e8e8e8; font-variant-numeric: tabular-nums; margin: 0 6px; white-space: nowrap; }
.p-rate { height: 28px; padding: 0 8px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(0, 0, 0, .3); color: #fff; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.p-vol { width: 80px; accent-color: #fff; }
@media (max-width: 560px) { .p-vol { display: none; } .p-ctrl { padding: 24px 6px 4px; } .p-btn { width: 34px; } }
.p-end { position: absolute; inset: 0; background: rgba(8, 9, 11, .94); display: grid; place-items: center; text-align: center; padding: 20px; }
.p-end h3 { font: 700 24px var(--sans); margin-bottom: 6px; }
.p-lock-note { position: absolute; top: 14px; left: 14px; background: rgba(0, 0, 0, .7); padding: 5px 10px; border-radius: 8px; font-size: 12px; color: #ddd; pointer-events: none; }
.p-flash { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0, 0, 0, .78); padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; pointer-events: none; animation: fade .2s; max-width: 80%; text-align: center; }

.playlist { max-height: 560px; overflow: auto; }
.pl-item { display: flex; gap: 12px; padding: 12px 14px; align-items: center; border-bottom: 1px solid var(--line); transition: background .15s; }
.pl-item:hover { background: var(--panel-2); }
.pl-item.on { background: var(--teal-bg); }
.pl-item.locked { opacity: .45; }
.pl-n { width: 22px; font-size: 13px; color: var(--faint); text-align: center; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.pl-item .t { font-size: 14px; font-weight: 600; line-height: 1.4; }
.ts { display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border-radius: 6px; background: var(--teal-bg); color: var(--teal); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; border: 0; }
.ts:hover { background: #1d3530; }

/* ── Q&A ── */
.qa { padding: 18px 0; border-bottom: 1px solid var(--line); }
.qa:last-child { border-bottom: 0; }
.qa-a { margin-top: 12px; padding: 14px 16px; border-radius: 12px; background: var(--bg-2); border-left: 3px solid var(--gold); }
.qa-a .who { font-size: 12.5px; color: var(--gold); font-weight: 700; margin-bottom: 4px; }

/* ── 숙제 ── */
.files { display: flex; flex-wrap: wrap; gap: 8px; }
.file-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 9px; background: var(--bg-2); border: 1px solid var(--line-2); font-size: 13px; cursor: pointer; max-width: 100%; }
.file-chip:hover { border-color: var(--teal); }
.file-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: zoom-in; border: 1px solid var(--line); }
.lightbox { position: fixed; inset: 0; z-index: 250; background: rgba(0, 0, 0, .9); display: grid; place-items: center; padding: 16px; cursor: zoom-out; animation: fade .2s; }
.lightbox img { max-height: 92dvh; border-radius: 8px; }
.drop { border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 20px; text-align: center; color: var(--muted); font-size: 14px; transition: border-color .15s, background .15s; cursor: pointer; display: block; }
.drop:hover, .drop.over { border-color: var(--teal); background: var(--teal-bg); }
.feedback { padding: 16px; border-radius: 12px; background: var(--gold-bg); border: 1px solid #3c331f; }
.feedback .who { color: var(--gold); font-weight: 700; font-size: 13px; margin-bottom: 4px; }

/* ── 시험 / OMR ── */
.omr { display: grid; gap: 0; }
.omr-row { display: grid; grid-template-columns: 54px 1fr auto; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--line); }
.omr-n { font: 400 20px var(--serif); text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; }
.bubbles { display: flex; gap: 8px; flex-wrap: wrap; }
.bubble { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--line-2); background: none; font-weight: 700; font-size: 15px; cursor: pointer; transition: all .12s; color: var(--muted); }
.bubble:hover { border-color: var(--lav); color: var(--text); }
.bubble.on { background: var(--lav); border-color: var(--lav); color: #17142c; transform: scale(1.04); }
.omr-pts { font-size: 12px; color: var(--faint); white-space: nowrap; }
.res-ox { font: 400 22px var(--serif); width: 30px; text-align: center; }
.score-big { font: 400 clamp(54px, 9vw, 80px)/1 var(--serif); font-variant-numeric: tabular-nums; }
.score-big small { font-size: .35em; color: var(--faint); margin-left: 4px; }

/* ── 차트 ── */
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-l { stroke: #26282e; stroke-width: 1; }
.chart .ax { fill: #7b7c82; font-size: 11.5px; font-family: var(--sans); }
.chart .tip { position: absolute; pointer-events: none; background: #f3efe6; color: #15161a; border-radius: 10px; padding: 9px 12px; font-size: 12.5px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); transform: translate(-50%, calc(-100% - 14px)); white-space: nowrap; z-index: 2; }
.chart .tip b { display: block; font-size: 12px; color: #55565c; font-weight: 600; margin-bottom: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; }

/* ── 캘린더 ── */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-h { padding: 10px; font-size: 12.5px; color: var(--faint); text-align: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-2); }
.cal-d { min-height: 112px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; cursor: pointer; transition: background .15s; min-width: 0; }
.cal-d:hover { background: var(--panel); }
.cal-d.out { opacity: .32; }
.cal-d.sel { background: var(--panel-2); }
.cal-d .n { font-size: 13px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cal-d.today .n { background: var(--teal); color: #08201b; }
.cal-d .sun { color: var(--red); }
.ev { font-size: 11.5px; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; display: block; }
.ev.hw { background: var(--gold-bg); color: var(--gold); }
.ev.exam { background: var(--lav-bg); color: var(--lav); }
.ev.lec { background: var(--teal-bg); color: var(--teal); }
.ev.event { background: var(--rose-bg); color: var(--rose); }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.hw { background: var(--gold); } .dot.exam { background: var(--lav); } .dot.lec { background: var(--teal); } .dot.event { background: var(--rose); }
@media (max-width: 720px) {
  .cal-d { min-height: 58px; padding: 4px; align-items: center; }
  .cal-d .ev { display: none; }
  .cal-d .dots { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
}
@media (min-width: 721px) { .cal-d .dots { display: none; } }

/* ── 관리자 ── */
.admin-nav { display: flex; gap: 6px; margin-bottom: 28px; overflow-x: auto; padding-bottom: 2px; }
.admin-nav a { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.admin-nav a.on { background: var(--gold-bg); color: var(--gold); border-color: #4a3c20; }
.q-rows .tbl td { padding: 6px 8px; }
.alert { padding: 14px 16px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line-2); font-size: 14px; color: var(--muted); }
.alert.gold { background: var(--gold-bg); border-color: #3c331f; color: #e2cfa6; }
.alert b { color: var(--text); }
code { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: .9em; background: var(--bg-2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 5px; }

/* ── 로그인 ── */
.login { min-height: calc(100dvh - 64px); display: grid; grid-template-columns: 1fr 1fr; }
.login-art { position: relative; overflow: hidden; border-right: 1px solid var(--line); display: flex; align-items: flex-end; padding: 48px; }
.login-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-form { display: grid; place-items: center; padding: 40px 16px; }
.login-form form { width: min(380px, 100%); }
@media (max-width: 860px) { .login { grid-template-columns: 1fr; } .login-art { min-height: 260px; padding: 28px var(--gutter); } }

.footer { border-top: 1px solid var(--line); padding: 32px 0 40px; color: var(--faint); font-size: 13px; }
.footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }

/* 웨이브 드로잉 애니메이션 */
.draw path.w { stroke-dasharray: var(--len, 3000); stroke-dashoffset: var(--len, 3000); animation: draw 2.4s var(--ease) forwards; }
.draw .star { opacity: 0; animation: starIn .6s 1.6s var(--ease) forwards; transform-box: fill-box; transform-origin: center; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes starIn { from { opacity: 0; transform: scale(.2) rotate(-45deg); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp .7s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
  .draw path.w { stroke-dashoffset: 0; }
  .draw .star { opacity: 1; }
}
.thumbs.large { grid-template-columns: 1fr; gap: 12px; }
.thumbs.large img { aspect-ratio: auto; object-fit: contain; max-height: 80vh; width: auto; max-width: 100%; }
.timer { position: sticky; top: 76px; z-index: 5; text-align: center; padding: 16px; background: rgba(21, 23, 27, .92); backdrop-filter: blur(10px); }
.timer-v { font-size: 40px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }

/* ── 블로그형 본문 ── */
.rich { line-height: 1.85; color: #dcdce0; font-size: 15.5px; word-break: keep-all; }
.rich > * + * { margin-top: .9em; }
.rich p { margin: 0; }
.rich h2 { font-size: 22px; font-weight: 700; color: var(--text); margin-top: 1.6em; }
.rich h3 { font-size: 18px; font-weight: 700; color: var(--text); margin-top: 1.4em; }
.rich img { max-width: 100%; height: auto; border-radius: 10px; margin: 6px 0; display: block; }
.rich a { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.rich blockquote { margin: 1em 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--line-2); color: var(--muted); }
.rich ul, .rich ol { padding-left: 1.4em; }
.rich li[data-list="bullet"] { list-style: disc; } .rich li[data-list="ordered"] { list-style: decimal; }
.rich .ql-ui { display: none; }
.rich iframe, .rich .ql-video { width: 100%; aspect-ratio: 16/9; height: auto; border: 0; border-radius: 10px; display: block; }
.rich-editor .ql-toolbar.ql-snow { border: 1px solid var(--line-2); border-radius: 10px 10px 0 0; background: var(--panel-2); }
.rich-editor .ql-container.ql-snow { border: 1px solid var(--line-2); border-top: 0; border-radius: 0 0 10px 10px; background: var(--bg-2); font: inherit; }
.rich-editor .ql-editor { min-height: 320px; max-height: 60vh; overflow: auto; font-size: 15px; line-height: 1.8; color: var(--text); }
.rich-editor .ql-editor.ql-blank::before { color: var(--faint); font-style: normal; }
.rich-editor .ql-editor img { max-width: 100%; border-radius: 8px; }
.rich-editor .ql-editor iframe { width: 100%; aspect-ratio: 16/9; height: auto; }
.rich-editor .ql-snow .ql-stroke { stroke: #c8c8cc; } .rich-editor .ql-snow .ql-fill { fill: #c8c8cc; }
.rich-editor .ql-snow .ql-picker { color: #c8c8cc; }
.rich-editor .ql-snow .ql-picker-options { background: var(--panel-2); border-color: var(--line-2) !important; }
.rich-editor .ql-snow button:hover .ql-stroke, .rich-editor .ql-snow .ql-active .ql-stroke { stroke: var(--teal); }
.rich-editor .ql-snow button:hover .ql-fill, .rich-editor .ql-snow .ql-active .ql-fill { fill: var(--teal); }
.rich-editor .ql-snow .ql-tooltip { background: var(--panel-2); border-color: var(--line-2); color: var(--text); box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.rich-editor .ql-snow .ql-tooltip input[type=text] { background: var(--bg-2); color: var(--text); border-color: var(--line-2); }
.modal.wide { width: min(920px, 100%); }
.notice-thumb { width: 72px; height: 48px; border-radius: 6px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--line); }
.rich-editor .ql-editor:focus, .rich-editor .ql-editor:focus-visible { outline: none; }
.rich-editor .ql-container.ql-snow:focus-within { border-color: var(--teal); }
.rich-editor .ql-snow .ql-picker.ql-header { width: 84px; }
.rich-editor .ql-snow .ql-picker.ql-header .ql-picker-label::before, .rich-editor .ql-snow .ql-picker.ql-header .ql-picker-item::before { content: '본문'; }
.rich-editor .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, .rich-editor .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { content: '제목'; }
.rich-editor .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, .rich-editor .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { content: '소제목'; }
.rich-editor .ql-snow .ql-tooltip::before { content: '링크'; }
.rich-editor .ql-snow .ql-tooltip[data-mode=link]::before { content: '링크 주소'; }
.rich-editor .ql-snow .ql-tooltip a.ql-action::after { content: '수정'; }
.rich-editor .ql-snow .ql-tooltip a.ql-remove::before { content: '삭제'; }
.rich-editor .ql-snow .ql-tooltip.ql-editing a.ql-action::after { content: '저장'; }
.chip { height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: #4a4d55; color: var(--text); }
.chip.on { background: var(--teal-bg); border-color: var(--teal); color: var(--teal); }
.chip.sm { height: 24px; padding: 0 9px; font-size: 12px; }
