/* ==========================================================================
   강학고등학교 학생생활기록부 — 星雲 (금성제×연로운) 백업 블로그
   컨셉: 바랜 공문서/생활기록부 스타일
   이 파일 전체를 style.css에 그대로 덮어써도 됩니다.
   ========================================================================== */

/* --------------------------------------------------------------------
   0. 리셋 & 컬러/디자인 토큰
   -------------------------------------------------------------------- */
* { box-sizing: border-box; }
body, h1, h2, h3, p, ul, ol, li, figure, table { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { text-decoration: none; }
img { max-width: 100%; display: block; }
table { border-collapse: collapse; width: 100%; }

:root {
  --c-geum: #7A1519;          /* 금성제 대표색 */
  --c-yeon: #4A5568;          /* 연로운 대표색 */
  --stamp: #a3221f;           /* 도장 색 */

  --paper: #EBE2C8;           /* 페이지 배경 (바랜 종이) */
  --paper-panel: #F4EED9;     /* 문서 창 배경 (조금 더 밝은 종이) */
  --paper-dark: #DDCFA6;      /* 타이틀/패널 헤더 배경 */

  --ink: #2B2620;             /* 메인 텍스트 */
  --ink-sub: #6b6250;         /* 보조 텍스트 */
  --ink-faint: #9c937a;       /* 옅은 텍스트 */
  --line: #3a3428;            /* 테두리 */

  --radius: 2px;
  --shadow-window: 4px 4px 0 rgba(43, 38, 32, 0.16);
  --shadow-window-hover: 5px 6px 0 rgba(43, 38, 32, 0.2);

  --font-serif: "Song Myung", serif;
  --font-body: "Noto Sans KR", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --font-mono: "JetBrains Mono", "D2Coding", SFMono-Regular, Consolas, monospace;
}

/* --------------------------------------------------------------------
   1. 배경 — 바랜 종이 질감
   -------------------------------------------------------------------- */
html, body { min-height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(163, 34, 31, 0.05), transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(74, 85, 104, 0.06), transparent 45%),
    radial-gradient(circle at 60% 40%, rgba(120, 100, 60, 0.05), transparent 55%),
    repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.012) 0px, rgba(0, 0, 0, 0.012) 1px, transparent 1px, transparent 3px),
    var(--paper);
  background-attachment: fixed;
}

#scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--c-geum), var(--c-yeon));
  z-index: 9999;
  transition: width 0.1s ease-out;
}

#header, #wrap, #footer { position: relative; z-index: 1; }

/* --------------------------------------------------------------------
   2. 문서형 창 공통 컴포넌트
   -------------------------------------------------------------------- */
.doc-window {
  background: var(--paper-panel);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px var(--paper-dark), var(--shadow-window);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.doc-window:hover { transform: translate(-1px, -1px); box-shadow: 0 0 0 1px var(--paper-dark), var(--shadow-window-hover); }

.doc-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--paper-dark);
  border-bottom: 2px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.win-btns { display: flex; gap: 4px; flex-shrink: 0; }
.win-btn {
  width: 18px; height: 16px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--paper-panel);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 10px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.win-btn:hover { background: var(--c-yeon); color: #fff; border-color: var(--c-yeon); }
.win-btn.win-close:hover { background: var(--stamp); border-color: var(--stamp); }

.win-window.is-minimized .win-body,
.doc-window.is-minimized .win-body { display: none; }
.draggable-window.is-maximized { width: 340px !important; }

/* --------------------------------------------------------------------
   3. 헤더 — 강학고등학교 학생생활기록부
   -------------------------------------------------------------------- */
#header { max-width: 900px; margin: 32px auto 0; }

.doc-head {
  text-align: center;
  padding: 26px 20px 16px;
  border-bottom: 3px double var(--line);
}
.school-name {
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--ink-sub);
}
.doc-head h1 {
  font-family: var(--font-serif);
  font-size: 26px;
  margin: 8px 0 0;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.doc-subtag {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-sub);
  letter-spacing: 0.12em;
}

.doc-menu {
  display: flex;
  border-bottom: 2px solid var(--line);
}
.doc-menu a {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--ink-sub);
  border-right: 1px solid var(--paper-dark);
  position: relative;
}
.doc-menu a:last-child { border-right: none; }
.doc-menu a:hover { color: var(--ink); background: rgba(122, 21, 25, 0.05); }
.doc-menu a:hover::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--c-geum);
}

/* 프로필 카드 */
#header.doc-window { overflow: visible; }

.profiles {
  position: relative;
  display: flex;
  gap: 16px;
  padding: 22px;
  border-bottom: 1px dashed var(--ink-sub);
}

/* 금성제 낙서 — 손글씨 느낌으로 프로필 주변에 흩뿌림 */
.profile-scribbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
.scribble {
  position: absolute;
  font-family: "Gaegu", cursive;
  font-weight: 700;
  color: var(--c-geum);
  white-space: nowrap;
  opacity: 0.85;
  -webkit-text-stroke: 2px #fff;
  paint-order: stroke fill;
  transform: rotate(var(--r, 0deg));
  animation: scribble-wiggle 3.2s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
.s1 { top: -80px;  left: 2%;    font-size: 15px; --r: -9deg;  --d: 0s;    animation-duration: 3.1s; }
.s2 { top: -30px;  left: 43%;   font-size: 14px; --r: 6deg;   --d: 0.4s;  animation-duration: 3.6s; }
.s3 { top: 42%;    left: -10px; font-size: 14px; --r: -6deg;  --d: 0.8s;  animation-duration: 2.9s; }
.s4 { top: 4%;     right: -6px; font-size: 15px; --r: 10deg;  --d: 0.2s;  animation-duration: 3.4s; }
.s5 { top: 24%;    right: -22px; font-size: 13px; --r: -8deg; --d: 1.1s;  animation-duration: 3.0s; }
.s6 { bottom: -18px; left: 36%; font-size: 14px; --r: 4deg;   --d: 0.6s;  animation-duration: 3.8s; }
.s7 { bottom: -24px; right: 2%; font-size: 18px; --r: -11deg; --d: 0.9s;  animation-duration: 3.3s; }
.s8 { top: 30%; left: 45%; font-size: 30px; --r: -11deg;      --d: 0.3s;  animation-duration: 3.5s; }

@keyframes scribble-wiggle {
  0%   { transform: rotate(var(--r)) translate(0, 0); }
  25%  { transform: rotate(calc(var(--r) + 3deg)) translate(1px, -1px); }
  50%  { transform: rotate(calc(var(--r) - 2deg)) translate(-1px, 1px); }
  75%  { transform: rotate(calc(var(--r) + 2deg)) translate(1px, 1px); }
  100% { transform: rotate(var(--r)) translate(0, 0); }
}

@media (max-width: 640px) {
  .profile-scribbles { display: none; }
}

.profile-card {
  flex: 1;
  background: var(--paper-panel);
  border: 1.5px solid var(--line);
  padding: 14px;
}
.profile-card.geum { transform: rotate(-2deg); box-shadow: 3px 3px 0 rgba(122, 21, 25, 0.14); }
.profile-card.yeon { box-shadow: 3px 3px 0 rgba(74, 85, 104, 0.14); }

.profile-photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  background:
    repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.05) 0 2px, transparent 2px 8px),
    var(--paper-dark);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-bottom: 10px;
}
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }

.profile-name {
  font-family: var(--font-serif);
  font-size: 16px;
  margin: 0 0 8px;
  display: flex; align-items: center; gap: 6px;
}
.tag-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.geum .tag-dot { background: var(--c-geum); }
.yeon .tag-dot { background: var(--c-yeon); }

.profile-table { font-size: 12px; margin-bottom: 10px; }
.profile-table td { padding: 4px 2px; border-bottom: 1px dotted var(--paper-dark); }
.profile-table td.label { color: var(--ink-sub); width: 34%; }
.profile-table td.val { font-weight: 700; }

.record-history { border-top: 1px dashed var(--ink-sub); padding-top: 8px; }
.history-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-sub);
  margin-bottom: 4px;
}
.record-history ul { font-size: 11px; }
.record-history li { padding: 2px 0; color: var(--ink); }
.record-history li::before { content: "· "; color: var(--c-geum); }
.history-empty { font-size: 11px; color: var(--ink-faint); font-style: italic; }

/* --------------------------------------------------------------------
   4. 레이아웃
   -------------------------------------------------------------------- */
#wrap {
  max-width: 1160px;
  margin: 22px auto 0;
  padding: 0 20px;
  display: flex;
  align-items: flex-start;
  gap: 22px;
}
#container { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
/* #sidebar 안 요소는 전부 독립 플로팅 창(position:fixed)이라 실제 레이아웃 공간을 차지하지 않음 */
#sidebar { width: 0; overflow: visible; }

/* --------------------------------------------------------------------
   4-1. 카테고리 화면: 홈/글 화면과 다르게 압축된 "장부" 리스트로 표시
   -------------------------------------------------------------------- */
body.is-category-page #wrap { justify-content: center; }
body.is-category-page #container { gap: 0; max-width: 720px; margin: 0 auto; width: 100%; }

/* 카테고리 화면에서는 프로필 카드(연로운/금성제)도 숨김 */
body.is-category-page .profiles { display: none; }

/* 단일 글(퍼머링크) 화면에서도 프로필 카드는 숨김 — 다른 건 그대로 */
body.is-single-page .profiles { display: none; }

body.is-category-page .post {
  border: none;
  border-bottom: 1px solid var(--paper-dark);
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
body.is-category-page .post:nth-child(even) { background: rgba(43, 38, 32, 0.02); }
body.is-category-page .post:hover { transform: none; }
body.is-category-page .post:hover .post-inner { background: rgba(122, 21, 25, 0.035); }

body.is-category-page .approval-box,
body.is-category-page .win-toolbar,
body.is-category-page .post-thumb,
body.is-category-page .post-content,
body.is-category-page .dotted-divider,
body.is-category-page .post-footer-row {
  display: none;
}

body.is-category-page .post-inner {
  padding: 14px 20px 14px 16px;
  border-left: 3px solid var(--ink-faint);
  transition: background 0.15s ease;
}

body.is-category-page .post-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
body.is-category-page .record-no {
  background: var(--paper-dark);
  border: 1px solid var(--line);
  padding: 1px 7px;
}
body.is-category-page .record-cat {
  font-weight: 700;
}
body.is-category-page .record-date {
  margin-left: auto;
  color: var(--ink-faint);
}
body.is-category-page .post-title a {
  font-size: 16px;
  font-family: var(--font-serif);
}
body.is-category-page .post-title a:hover { color: var(--c-geum); }

body.is-category-page .paging { max-width: 720px; margin: 16px auto 0; }

/* --------------------------------------------------------------------
   5. 본문(글)
   -------------------------------------------------------------------- */
.approval-box {
  display: flex;
  border-bottom: 2px solid var(--line);
}
.approval-cell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-right: 1px solid var(--paper-dark);
  background: var(--paper-dark);
}
.approval-cell:last-child { border-right: none; }
.approval-cell .role {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-sub);
  letter-spacing: 0.05em;
}
.stamp-mark {
  width: 28px; height: 28px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 3px;
}
.stamp-mark.is-stamped {
  border-color: var(--stamp);
  color: var(--stamp);
  font-family: var(--font-serif);
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(-8deg);
  font-weight: 700;
}

.win-toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 14px;
  border-bottom: 1.5px solid var(--line);
  background: var(--paper-panel);
  font-size: 12px;
}
.toolbar-back {
  color: var(--ink);
  border: 1px solid var(--line);
  width: 20px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; flex-shrink: 0;
}
.toolbar-back:hover { background: var(--c-geum); color: #fff; border-color: var(--c-geum); }
.toolbar-crumb { color: var(--ink-sub); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toolbar-crumb a { color: var(--ink-sub); }
.toolbar-crumb a:hover { color: var(--c-geum); }
.crumb-sep { margin: 0 4px; color: var(--ink-faint); }
.toolbar-admin { display: flex; gap: 6px; flex-shrink: 0; }
.toolbar-btn { border: 1px solid var(--line); padding: 2px 8px; font-size: 11px; color: var(--ink); background: var(--paper-panel); }
.toolbar-btn:hover { background: var(--c-geum); color: #fff; border-color: var(--c-geum); }

.post-inner { padding: 24px clamp(18px, 4vw, 36px); }

.post-meta-row {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-sub);
  margin-bottom: 10px;
}
.record-no { font-weight: 700; color: var(--c-geum); }
.record-cat { border: 1px solid var(--ink-faint); padding: 1px 7px; }

.post-title a {
  font-family: var(--font-serif);
  color: var(--ink);
  font-size: 22px;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.post-thumb { width: 100%; border: 1.5px solid var(--line); margin: 16px 0; }

.post-content {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink);
  word-break: keep-all;
  margin-top: 18px;
  text-align: center;
}
.post-content h1 { font-family: var(--font-serif); font-size: 22px; margin: 36px 0 14px; }
.post-content h2 { font-family: var(--font-serif); font-size: 19px; margin: 30px 0 12px; }
.post-content h3 { font-size: 16px; font-weight: 700; margin: 26px 0 10px; }
.post-content p { margin: 0 0 18px; }
.post-content ul, .post-content ol { margin: 0 0 18px 22px; list-style: revert; }
.post-content img { border: 1.5px solid var(--line); margin: 18px 0; }
/* <a>로 감싼 배너/링크 이미지는 inline-block으로 되돌려서
   부모의 text-align: center가 정상적으로 먹히게 함 */
.post-content a img { display: inline-block; border: none; margin: 0; }
.post-content blockquote { margin: 18px 0; padding: 4px 18px; border-left: 3px solid var(--c-geum); color: var(--ink-sub); }
.post-content a { color: var(--c-geum); text-decoration: underline; text-underline-offset: 3px; }

/* 검열/블랙바 스포일러 가림막: <span class="censor">텍스트</span> */
.post-content .censor {
  background: #1b1a17;
  color: #1b1a17;
  cursor: pointer;
  padding: 0 3px;
  border-radius: 1px;
  transition: color 0.12s ease;
}
.post-content .censor.is-revealed { background: rgba(122, 21, 25, 0.08); color: inherit; }

.dotted-divider { border: none; border-top: 2px dotted var(--ink-faint); margin: 22px 0 16px; }

.post-footer-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.post-remarks { font-size: 12px; color: var(--ink-sub); }
.remarks-label {
  font-family: var(--font-mono);
  color: var(--ink-faint);
  margin-right: 6px;
  border: 1px solid var(--ink-faint);
  padding: 1px 6px;
}

.sympathy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid var(--line);
  background: var(--paper-panel);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
}
.sympathy-btn .sympathy-icon { font-size: 13px; }
.sympathy-btn:hover { border-color: var(--stamp); color: var(--stamp); }
.sympathy-btn.is-active { background: var(--stamp); border-color: var(--stamp); color: #fff; }

.related-list { padding: 4px 14px 12px; }
.related-list li { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13px; border-bottom: 1px dashed var(--ink-faint); }
.related-list li:last-child { border-bottom: none; }
.related-list a { color: var(--ink-sub); }
.related-list a:hover { color: var(--c-geum); }
.related-date { color: var(--ink-faint); font-size: 11px; }

.post-nav { display: flex; justify-content: space-between; padding: 12px 16px; }
.post-nav a { color: var(--ink-sub); font-size: 12px; }
.post-nav a:hover { color: var(--c-geum); }

.comment-inner { padding: 16px; color: var(--ink-sub); font-size: 13px; }

.list-items { padding: 4px 14px 14px; }
.list-items li { display: flex; justify-content: space-between; padding: 8px 0; font-size: 13px; border-bottom: 1px dashed var(--ink-faint); }
.list-items li:last-child { border-bottom: none; }
.list-items a { color: var(--ink); }
.list-items a:hover { color: var(--c-geum); }
.list-date { color: var(--ink-faint); font-size: 11px; }
.no-result { padding: 16px; color: var(--ink-faint); font-size: 12px; }

.paging { display: flex; justify-content: center; align-items: center; gap: 14px; padding: 12px 16px; }
.paging a { color: var(--ink-sub); font-size: 12px; }
.paging a:hover { color: var(--c-geum); }
.paging .num { padding: 3px 8px; border: 1px solid transparent; }
.paging .num:hover { border-color: var(--c-geum); color: var(--c-geum); }

/* --------------------------------------------------------------------
   6. 코드블록
   -------------------------------------------------------------------- */
.post-content pre {
  position: relative;
  background: #23211c !important;
  border: 1.5px solid var(--line);
  padding: 34px 16px 16px !important;
  overflow-x: auto;
  box-shadow: var(--shadow-window);
}
.post-content pre::before {
  content: "";
  position: absolute; top: 12px; left: 14px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--c-geum);
  box-shadow: 15px 0 0 #cfa93f, 30px 0 0 var(--c-yeon);
}
.post-content pre code, .post-content pre, .post-content code {
  font-family: var(--font-mono) !important;
  font-size: 13px !important; line-height: 1.7 !important;
  color: #ece7d8 !important; background: transparent !important;
}
.post-content p code, .post-content li code {
  font-family: var(--font-mono);
  background: var(--paper-dark);
  border: 1px solid var(--line);
  padding: 1px 6px; font-size: 0.85em;
}

/* --------------------------------------------------------------------
   7. 사이드바 — SNB 메뉴
   -------------------------------------------------------------------- */
.snb-search { padding: 12px 14px; border-bottom: 2px solid var(--line); }
.snb-search input[type="text"] {
  width: 100%; padding: 7px 9px; margin-bottom: 7px;
  background: var(--paper-panel);
  border: 1.5px solid var(--line);
  color: var(--ink);
  font-family: var(--font-body); font-size: 13px;
}
.snb-search input[type="text"]::placeholder { color: var(--ink-faint); }
.snb-search input[type="button"] {
  width: 100%; padding: 7px 0;
  background: var(--paper-dark);
  border: 1.5px solid var(--line);
  color: var(--ink);
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.snb-search input[type="button"]:hover { background: var(--c-yeon); color: #fff; border-color: var(--c-yeon); }

.snb-section { border-bottom: 1px solid var(--paper-dark); }
.snb-section:last-child { border-bottom: none; }

.snb-head {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px;
  background: var(--paper-panel);
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-align: left;
}
.snb-head:hover { background: rgba(122, 21, 25, 0.05); color: var(--c-geum); }
.snb-head .chevron {
  color: var(--ink-faint);
  font-size: 10px;
  transition: transform 0.15s ease;
  flex-shrink: 0;
  margin-left: 8px;
}
.snb-section.is-open .snb-head .chevron { transform: rotate(180deg); }

.snb-body {
  display: none;
  background: var(--paper-panel);
  border-top: 1px dashed var(--ink-faint);
}
.snb-section.is-open .snb-body { display: block; }

/* 폭이 좁으므로 컴팩트하게 */
.snb-body .list-items { padding: 4px 12px 12px; }
.snb-body .list-items li { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 0; }
.snb-body .list-items a { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.snb-body .no-result { padding: 12px 14px; }
.snb-body .comment-inner { padding: 12px 14px; font-size: 12px; }

.snb-body .category-list, .snb-body .category-list * { background: none !important; background-color: transparent !important; }
.snb-body .category-list li, .snb-body .category-list a, .snb-body .category-list span, .snb-body .category-list strong {
  color: var(--ink-sub) !important; font-weight: 400 !important; text-decoration: none !important; font-size: 13px;
}
.snb-body .category-list { padding: 10px 14px; }
.snb-body .category-list a:hover { color: var(--c-yeon) !important; font-weight: 700 !important; }
.snb-body .category-list ul { margin-left: 12px; }
.snb-body .category-list ul li { position: relative; padding-left: 12px; }
.snb-body .category-list ul li::before { content: "└"; position: absolute; left: -2px; color: var(--ink-faint); }

.snb-body .recent-list { padding: 10px 14px; }
.snb-body .recent-list li { margin-bottom: 8px; }
.snb-body .recent-list a { color: var(--ink-sub); font-size: 13px; }
.snb-body .recent-list a:hover { color: var(--c-yeon); }

/* --------------------------------------------------------------------
   8. 독립 플로팅 위젯 3종
   -------------------------------------------------------------------- */
.draggable-window { position: fixed; width: 246px; z-index: 500; transition: opacity 0.2s ease, transform 0.2s ease; }
#snb-window { top: 100px; left: 24px; width: 280px; }
#toc-dock { top: 100px; right: 24px; }
#playlist-window { top: 320px; right: 24px; }
#dday-window { top: 590px; right: 24px; }
.draggable-window:hover { transform: none; }
.draggable-window.is-hidden { opacity: 0; transform: scale(0.94); pointer-events: none; }
.drag-handle { cursor: grab; }
.drag-handle:active { cursor: grabbing; }
.win-body { max-height: 46vh; overflow-y: auto; }
.widget-panel { padding: 12px 14px; }

#toc-list { font-size: 13px; }
#toc-list li { margin: 0 0 7px; }
#toc-list a { color: var(--ink-sub); display: block; padding: 2px 0 2px 8px; border-left: 2px solid transparent; }
#toc-list a:hover, #toc-list a.is-active { color: var(--c-yeon); border-left-color: var(--c-yeon); font-weight: 700; }
#toc-list .toc-h3 { padding-left: 18px; font-size: 12px; }

/* --------------------------------------------------------------------
   8-1. 방송부 카세트테이프 플레이어
   -------------------------------------------------------------------- */
.cassette-player { padding: 16px 14px; display: flex; flex-direction: column; align-items: center; }
.cassette {
  width: 100%;
  background: linear-gradient(160deg, #3c362a, #211d17);
  border: 2px solid var(--line);
  border-radius: 4px;
  padding: 12px;
  box-shadow: var(--shadow-window);
}
.cassette-window {
  background: #100e0b;
  border: 1px solid #000;
  border-radius: 3px;
  height: 54px;
  display: flex; align-items: center; justify-content: space-around;
  padding: 0 22px;
}
.reel {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle, #d8cfae 0 5px, #55503f 5px 7px, #2b2822 7px 15px);
  animation: reel-spin 2.2s linear infinite;
  animation-play-state: paused;
}
.cassette.is-playing .reel { animation-play-state: running; }
@keyframes reel-spin { to { transform: rotate(360deg); } }
.cassette-label {
  margin-top: 8px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10px;
  text-align: center;
  padding: 3px 0;
  border: 1px solid var(--line);
}

#yt-player-mount { position: absolute; width: 2px; height: 2px; opacity: 0; overflow: hidden; }

.now-playing {
  margin-top: 12px; font-size: 11px; color: var(--ink-sub); text-align: center;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.player-controls { margin-top: 10px; display: flex; align-items: center; gap: 16px; }
.ctrl-btn { background: transparent; border: none; color: var(--ink-sub); font-size: 15px; cursor: pointer; }
.ctrl-btn:hover { color: var(--ink); }
.ctrl-play {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--c-geum), var(--c-yeon));
  color: #fff; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.ctrl-play:hover { color: #fff; }

.volume-control { margin-top: 10px; display: flex; align-items: center; gap: 8px; width: 100%; padding: 0 4px; }
.volume-control .ctrl-btn { font-size: 13px; flex-shrink: 0; }
#volume-slider {
  flex: 1; -webkit-appearance: none; appearance: none; height: 4px;
  background: linear-gradient(90deg, var(--c-geum), var(--c-yeon));
  outline: none; cursor: pointer;
}
#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper-panel); border: 1.5px solid var(--line); cursor: pointer;
}
#volume-slider::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--paper-panel); border: 1.5px solid var(--line); cursor: pointer;
}

/* --------------------------------------------------------------------
   8-2. 관찰기록 (D-Day)
   -------------------------------------------------------------------- */
.dday-box { text-align: center; padding: 18px 14px 20px; }
.dday-label { margin: 0 0 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; color: var(--ink-sub); }
.dday-num {
  margin: 0; font-family: var(--font-mono); font-size: 30px; font-weight: 700;
  background: linear-gradient(90deg, var(--c-geum), var(--c-yeon));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* --------------------------------------------------------------------
   8-3. 위젯 런처
   -------------------------------------------------------------------- */
#widget-launcher { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 700; }
.launcher-btn {
  width: 44px; height: 44px;
  border: 1.5px solid var(--line);
  background: var(--paper-panel);
  color: var(--ink);
  font-size: 16px; cursor: pointer;
  box-shadow: var(--shadow-window);
}
.launcher-btn:hover {
  background: linear-gradient(135deg, var(--c-geum), var(--c-yeon));
  color: #fff;
  transform: translate(-1px, -1px);
  box-shadow: var(--shadow-window-hover);
}

/* --------------------------------------------------------------------
   9. 푸터
   -------------------------------------------------------------------- */
#footer { max-width: 1160px; margin: 24px auto 60px; text-align: center; padding: 12px; }
#footer p { color: var(--ink-faint); font-family: var(--font-mono); font-size: 11px; }

/* --------------------------------------------------------------------
   10. 반응형
   -------------------------------------------------------------------- */
@media (max-width: 1024px) {
  #wrap { flex-direction: column; }
  #sidebar { width: 0; }
  .draggable-window { width: min(80vw, 230px); }
  #snb-window { top: 90px; left: 8px; }
  #toc-dock { top: 90px; right: 8px; }
  #playlist-window { top: 300px; right: 8px; }
  #dday-window { top: 560px; right: 8px; }
}

@media (max-width: 640px) {
  .post-content { font-size: 15px; line-height: 1.8; }
  .post-inner { padding: 18px 14px; }
  .doc-head { padding: 20px 14px 14px; }
  #wrap { padding: 0 14px; }
  .doc-menu a { font-size: 10px; padding: 8px 0; }
  .win-toolbar { flex-wrap: wrap; }

  /* 프로필 2개를 좁은 화면에서도 나란히 유지 */
  .profiles { gap: 8px; padding: 14px; }
  .profile-card { padding: 8px; }
  .profile-card.geum { transform: rotate(-1.5deg); }
  .profile-name { font-size: 13px; margin-bottom: 5px; gap: 4px; }
  .profile-photo { margin-bottom: 6px; }
  .profile-table { font-size: 10px; margin-bottom: 6px; }
  .profile-table td { padding: 2px 1px; }
  .record-history { padding-top: 5px; }
  .history-label { font-size: 8px; }
  .record-history ul, .history-empty { font-size: 9px; }

  .draggable-window { width: min(64vw, 190px); }
  #snb-window { top: 80px; left: 6px; }
  #toc-dock { top: 80px; right: 6px; }
  #playlist-window { top: 260px; right: 6px; }
  #dday-window { top: 480px; right: 6px; }
}