/* ==========================================
   1) 제목 스타일
   ========================================== */
   #preview h1 {
    color: #ffffff;
    font-size: 2em;
    margin: 0px 0;
  }
  
  #preview h3 {
    color: #ffffff;
    font-size: 1.7em;
    margin: 0px 0;
  }
  
  #preview h5 {
    color: #ffffff;
    font-size: 1.4em;
    margin: 0px 0;
  }
  
  #preview p {
    color: #ffffff;
    line-height: 1.4 !important;
  }
  
  /* ==========================================
     2) 링크 기본 스타일
     ========================================== */
  #preview a {
    color: #007BFF;
    text-decoration: none;
    cursor: pointer;
    transition: 0.1s;
  }
  #preview a:hover {
    color: #005abb;
  }
  
  /* ==========================================
     3) 블록 인용 & 툴팁(footnote)
     ========================================== */
  .custom-blockquote {
    margin: 16px 0 !important; /* 위아래 간격 */
    padding: 16px 24px !important; /* 좌우 패딩 */
    background-color: #ffffff08;
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.4 !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    border-left: 4px solid #ffffff;
    box-sizing: border-box;
  }
  
  .custom-blockquote h1,
  .custom-blockquote h3,
  .custom-blockquote h5 {
    font-size: inherit;
    line-height: 1.4;
    padding: 0;
    margin: 0;
    text-align: left;
  }
  
  .custom-blockquote::before {
    content: "";
    display: none;
  }
  
  .custom-blockquote + .custom-blockquote {
    padding: 0;
  }
  
  /* 툴팁: footnote */
  .footnote {
    position: relative;
    cursor: pointer;
    text-decoration: none;
    color: #ffa000;
    font-size: 1em;
    vertical-align: super;
  }
  .footnote:hover {
    border-bottom: 2px solid #ffa000;
  }
  .footnote:checked {
    border-bottom: 2px solid #ffa000;
  }
  
  .footnote-content {
    display: none;
    position: absolute;
    bottom: 120%;
    left: 0;
    background-color: #000000;
    color: #fff;
    padding: 16px;
    border: 1px solid #ffffff50;
    border-radius: 8px;
    font-size: 1em;
    white-space: normal;
    word-wrap: break-word;
    text-align: left;
    z-index: 999;
    min-width: 480px;
  }
  
  .footnote:hover .footnote-content,
  .footnote.active .footnote-content {
    display: block;
  }
  
  /* 툴팁 내 인라인 코드 스타일 */
  .footnote-content code {
    display: inline;
    white-space: pre-wrap;
    background-color: #ffffff08;
    color: #ffffff;
    padding: 2px 4px;
    border: 1px solid #ffffff50;
    border-radius: 4px;
    font-size: 0.8rem;
  }
  
  /* ==========================================
     4) 리스트 스타일 (간격 줄이기)
     ========================================== */
     ul {
      color: #ffffff;
      margin: 0 !important;
      padding-left: 1em !important;
      line-height: 0.4 !important;
    }
    li {
      color: #ffffff;
      margin: 0 !important;
      line-height: 1 !important;
    }
  
  /* ==========================================
     5) 인라인/블록 문법
     ========================================== */
  #preview code {
    display: inline-block;
    background-color: #ffffff08;
    color: #ffffff;
    padding: 4px;
    border: 1px solid #ffffff50;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: pre-wrap;
  }
  .colored-text {
    color: black;
  }
  .bold-text {
    font-weight: bold;
  }
  .italic-text {
    font-style: italic;
  }
  .underline-text {
    text-decoration: underline;
  }
  .cancelline-text {
    text-decoration: line-through;
  }
  
  /* ==========================================
     6) 코드 블록 (복사 버튼 포함)
     ========================================== */
  .custom-code-block-wrapper {
    position: relative;
    margin: 16px 0;
    background-color: #18181a;
    border: 1px solid #ffffff50;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
  }
  .custom-code-block {
    padding: 16px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #000000;
    background-color: #ffffff;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
  }
  .custom-code-block-buttons {
    position: absolute;
    top: 8px;
    right: 8px;
    pointer-events: none;
    z-index: 5;
  }
  .code-copy-button {
    position: relative;
    background-color: #18181a;
    border: 1px solid #ffffff50;
    border-radius: 4px;
    color: #ffffff;
    font-size: 12px;
    padding: 4px 8px;
    cursor: pointer;
    pointer-events: all;
    margin: 0;
  }
  .custom-code-block::-webkit-scrollbar {
    height: 8px;
  }
  .custom-code-block::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
  }
  .custom-code-block::-webkit-scrollbar-track {
    background: #ffffff;
  }
  
  /* ==========================================
     7) infobox, warning, info, tag
     ========================================== */
  .infobox {
    border: 1px solid #ffffff50;
    background-color: #ffffff05;
    padding: 8px;
    margin: 8px 0;
    border-radius: 4px;
  }
  .infobox-title {
    font-weight: bold;
    margin-bottom: 4px;
  }
  .infobox-desc {
    margin-bottom: 4px;
  }
  .warning-box {
    border: 1px solid #ffa000;
    background-color: #ffa00020;
    color: #ffffff;
    padding: 8px;
    margin: 8px 0;
    border-radius: 4px;
  }
  .info-box {
    border: 1px solid #00ffdd;
    background-color: #00ffdd20;
    color: #ffffff;
    padding: 8px;
    margin: 8px 0;
    border-radius: 4px;
  }
  .info-title {
    font-weight: bold;
    margin-bottom: 4px;
  }
  .info-content {
    white-space: pre-wrap;
  }
  .tag {
    display: inline-block;
    border: 1px solid #ffffff50;
    background: #ffffff05;
    padding: 8px;
    margin: 2px;
    border-radius: 4px;
    color: #ffffff;
    font-weight: bold;
  }
  
  /* ==========================================
     8) 수평선 스타일
     ========================================== */
  hr {
    border: 0;
    height: 1px;
    background: #ffffff50;
    margin: 16px 0;
  }

  img {
    border-radius: 4px;
    width: 100%;
  }
  
  /* ==========================================
     9) 유튜브 임베드 스타일
     ========================================== */
     .youtube-embed {
      position: relative;
      width: 100%;
      padding-bottom: 56.25%; /* 16:9 비율 유지 */
      height: 0;
  }
  
  .youtube-embed iframe {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      border-radius: 4px;
  }  

  .download-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px;
    border: 1px solid #ffffff50;
    border-radius: 4px;
    background-color: #18181a;
    color: #ffffff;
    cursor: pointer;
  }
  .download-file .download-title {
    font-weight: bold;
    font-size: 1.2em;
    padding-bottom: 8px;
  }
  .download-file .download-filename {
    font-size: 1em;
    color: #ffffff50;
  }
  .download-file .download-arrow {
    font-size: 1.2em;
    margin-left: 8px;
  }
  
  /* ==========================================
     10) 테이블 스타일 (가운데 정렬 & 깨짐 방지)
     ========================================== */
  #preview table.custom-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* 열 너비 고정 */
  }
  #preview table.custom-table th,
  #preview table.custom-table td {
    border: 1px solid #ffffff50;
    padding: 8px;
    text-align: center;
    vertical-align: middle;
    white-space: normal;
    word-wrap: break-word;
    color: #ffffff;
  }
  #preview table.custom-table th {
    border: 1px solid #ffffff50;
    background-color: #ffffff;
    font-weight: bold;
    color: #000000;
  }
  
  /* ==========================================
     11) LaTeX 스타일
     ========================================== */
  .latex-inline {
    font-family: 'Times New Roman', serif;
  }
  .latex-display {
    text-align: center;
    margin: 16px 0;
  }
  
  /* ==========================================
     12) 글자 간격 조정
     ========================================== */
  #preview {
    color: #ffffff;
    word-wrap: break-word;
    overflow-wrap: break-word;
    /* 필요시 overflow-x: auto; */
  }
  

  /* ----- 추가된 스타일: 스포일러(텍스트, 이미지, 동영상 모두 적용) ----- */
.spoiler {
  position: relative;
  display: block; /* 필요에 따라 block으로 변경할 수 있음 */
  cursor: pointer;
  filter: blur(10px);       /* 기본 블러 효과 적용 */
  transition: filter 0.1s;
}

/* revealed 상태에서는 블러 효과 제거 */
.spoiler.revealed {
  filter: none;
}

  /* 숨김 앵커: ==텍스트== → 렌더링 시 보이지 않음 */
  .hidden-anchor {
    display: none;
  }
  
  /* 클릭 앵커: ##텍스트## → #텍스트와 유사한 디자인으로 표시 */
  .toc-link {
    color: #007BFF;
    text-decoration: underline;
    cursor: pointer;
  }