/* ==========================================================================
   그리드 랩 (Modern Grid Lab) — Tistory Skin
   화이트 배경 · 인디고 포인트 · 모노스페이스 메타 · 플랫 대시보드 톤
   색상이나 폭을 바꾸려면 아래 :root 값만 수정하면 전체에 반영됩니다.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f6fb;
  --ink: #14141a;
  --ink-soft: #6b6b76;
  --ink-faint: #9a9aa5;
  --border: #e4e4ec;
  --border-strong: #c9c9d6;
  --white: #ffffff;
  --accent: #4f46e5;
  --accent-dark: #3730a3;
  --accent-soft: #eeedfc;

  --content-width: 1160px;
  --article-width: 800px;
  --radius: 8px;
  --radius-sm: 4px;

  --font-base: "Pretendard", -apple-system, BlinkMacSystemFont, "Malgun Gothic", sans-serif;
  --font-mono: "JetBrains Mono", "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-base);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  word-break: keep-all;
  font-size: 16px;
}
img { max-width: 100%; height: auto; vertical-align: middle; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }

.screen_out {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.skip-link {
  position: absolute; top: -100px; left: 0;
  background: var(--accent); color: #fff;
  padding: 10px 16px; z-index: 999; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { top: 0; }

/* --------------------------------------------------------------------------
   헤더 (스티키)
   -------------------------------------------------------------------------- */
.site-header {
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(1.6) blur(6px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
  height: 62px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-logo { width: 28px; height: 28px; border-radius: var(--radius-sm); object-fit: cover; }
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }

.gnb { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow: hidden; }
.gnb ul.category_list, .gnb > ul { display: flex; }
.gnb ul li a {
  display: block; padding: 21px 14px; font-size: 14px; font-weight: 600;
  color: var(--ink-soft); border-bottom: 2px solid transparent; white-space: nowrap;
}
.gnb ul li a:hover, .gnb ul li a:focus { color: var(--ink); border-bottom-color: var(--accent); }
.gnb-extra { display: flex; }
.gnb-extra a { font-size: 13px; color: var(--ink-faint); padding: 21px 12px; }
.gnb-extra a:hover { color: var(--accent); }

.header-tools { display: flex; align-items: center; gap: 10px; flex: none; }
.area_search .frm_search {
  display: flex; align-items: center;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 6px 6px 12px;
}
.area_search .tf_search {
  border: 0; background: transparent; outline: none;
  font-family: var(--font-mono); font-size: 12.5px; width: 120px; color: var(--ink);
}
.area_search .btn_search { border: 0; background: transparent; color: var(--ink-soft); width: 22px; height: 22px; font-size: 14px; }
.btn_share {
  border: 1px solid var(--border-strong); background: var(--white); color: var(--ink);
  border-radius: var(--radius-sm); padding: 7px 14px; font-size: 13px; font-weight: 700;
  font-family: var(--font-mono);
}
.btn_share:hover { border-color: var(--accent); color: var(--accent); }
.menu-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 34px; height: 34px; border: 1px solid var(--border); background: var(--white); border-radius: var(--radius-sm);
  align-items: center;
}
.menu-toggle span { display: block; width: 16px; height: 2px; background: var(--ink); transition: transform .15s ease, opacity .15s ease; }
.menu-toggle.is-active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.is-active span:nth-child(2) { opacity: 0; }
.menu-toggle.is-active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   홈 히어로 — 대시보드 스타일
   -------------------------------------------------------------------------- */
.home-hero { display: none; }
body#tt-body-index .home-hero { display: block; border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.home-hero-inner { max-width: var(--content-width); margin: 0 auto; padding: 52px 24px 0; }
.home-hero-eyebrow {
  font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--accent); margin-bottom: 14px;
}
.home-hero-title { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); margin-bottom: 26px; max-width: 640px; }

.hero-search { display: flex; max-width: 460px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--white); margin-bottom: 34px; }
.hero-search-input { flex: 1; min-width: 0; border: 0; outline: none; font-family: var(--font-base); font-size: 14.5px; padding: 13px 16px; color: var(--ink); }
.hero-search-btn { border: 0; border-left: 1px solid var(--border-strong); background: var(--accent); color: #fff; padding: 13px 22px; font-weight: 700; font-size: 13.5px; font-family: var(--font-mono); }
.hero-search-btn:hover { background: var(--accent-dark); }

.home-hero-badges {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; margin-bottom: 34px;
}
.badge-item { background: var(--white); padding: 20px 18px; display: flex; align-items: center; gap: 14px; }
.badge-num { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--accent-soft); -webkit-text-stroke: 1px var(--accent); }
.badge-label { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.4; }

.quick-links { padding-bottom: 30px; }
.quick-links-label { font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; color: var(--ink-faint); margin-bottom: 12px; }
.quick-links-list { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.quick-links-list li a { display: flex; align-items: center; gap: 10px; padding: 11px 2px; font-size: 14px; font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--border); }
.quick-links-list li a:hover { color: var(--accent); }
.quick-links-list li a::before { content: "→"; color: var(--accent); font-family: var(--font-mono); }

/* --------------------------------------------------------------------------
   컨테이너 / 리스트 헤더
   -------------------------------------------------------------------------- */
.container { max-width: var(--content-width); margin: 0 auto; padding: 40px 24px 90px; }
.list-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--ink); }
.list-head h2 { font-size: 19px; font-weight: 800; color: var(--ink); }
.list-head .count { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-faint); }

/* --------------------------------------------------------------------------
   글 목록 — 인덱스 번호 + 모노스페이스 메타
   -------------------------------------------------------------------------- */
.post-list { display: flex; flex-direction: column; counter-reset: postrow; }
.post-row { border-bottom: 1px solid var(--border); counter-increment: postrow; }
.post-row.notice { background: var(--accent-soft); }

.row-link { display: flex; align-items: center; gap: 20px; padding: 20px 4px; }
.row-index {
  flex: none; width: 40px; text-align: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--ink-faint);
}
.post-row:not(.notice) .row-index::before { content: counter(postrow, decimal-leading-zero); }
.post-row.notice .row-index { color: var(--accent); font-weight: 700; }
.row-thumb { flex: none; width: 76px; height: 76px; overflow: hidden; border-radius: var(--radius-sm); background: var(--bg-soft); border: 1px solid var(--border); }
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }

.row-body { flex: 1; min-width: 0; }
.row-body .tit_post { display: block; font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 5px; }
.row-link:hover .tit_post { color: var(--accent); }
.row-body .txt_post {
  font-size: 13.5px; color: var(--ink-soft);
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
}
.detail_info {
  flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  font-family: var(--font-mono); font-size: 12px; color: var(--ink-faint);
}
.link_cate {
  font-family: var(--font-base); font-size: 11.5px; font-weight: 700; color: var(--accent);
  background: var(--accent-soft); padding: 2px 8px; border-radius: var(--radius-sm);
}
.txt_bar { display: none; }

/* --------------------------------------------------------------------------
   글 화면(permalink)
   -------------------------------------------------------------------------- */
.wrap_btn_etc { display: none; }
body:has(.skin_view) .home-hero { display: none; }
.post-row:has(.skin_view) { border: 0; }

.skin_view { max-width: var(--article-width); margin: 0 auto; padding-top: 36px; }
.area_title { padding-bottom: 26px; border-bottom: 1px solid var(--ink); margin-bottom: 30px; }
.tit_category {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--accent);
  margin-bottom: 16px;
}
.tit_category::before { content: "#"; }
.area_title .tit_post { font-size: 30px; font-weight: 800; line-height: 1.4; letter-spacing: -0.01em; }
.txt_detail { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-faint); display: flex; gap: 8px; margin-top: 14px; }
.area_title .tit_post:not(:last-child) { margin-bottom: 6px; }

/* --------------------------------------------------------------------------
   목차 (자동 생성, 기본 접힘)
   -------------------------------------------------------------------------- */
.area-toc { border: 1px solid var(--ink); border-radius: var(--radius); padding: 4px 22px; margin: 0 0 32px; }
.area-toc summary {
  cursor: pointer; padding: 15px 0; font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  letter-spacing: 0.04em; color: var(--ink); list-style: none; display: flex; align-items: center; justify-content: space-between;
}
.area-toc summary::-webkit-details-marker { display: none; }
.area-toc summary::after { content: "[+]"; font-size: 12px; color: var(--accent); }
.area-toc[open] summary::after { content: "[-]"; }
.area-toc ul { margin: 0; padding: 4px 0 16px; border-top: 1px dashed var(--border-strong); }
.area-toc li { padding: 6px 0; font-size: 14px; }
.area-toc li a { display: flex; align-items: baseline; gap: 10px; }
.toc-num { font-family: var(--font-mono); font-size: 11.5px; color: var(--accent); flex: none; }
.area-toc li.toc-level-1 { font-weight: 700; }
.area-toc li.toc-level-3 { padding-left: 20px; color: var(--ink-soft); }
.area-toc li.toc-level-4 { padding-left: 36px; font-size: 13px; color: var(--ink-faint); }
.area-toc a:hover { color: var(--accent); }

/* --------------------------------------------------------------------------
   본문
   -------------------------------------------------------------------------- */
.area_view { font-size: 16.5px; line-height: 1.9; color: var(--ink); }
.area_view img { border-radius: var(--radius-sm); margin: 10px 0; }
.area_view a {
  display: inline-block;
  color: var(--white);
  background: var(--accent);
  padding: 3px 12px;
  margin: 0 1px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92em;
  transition: background-color .15s ease;
}
.area_view a:hover { background: var(--accent-dark); }

.area_view p.p-link-button { margin: 30px 0; }
.area_view p.p-link-button > a {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; text-align: center; margin: 0;
  padding: 16px 20px; border-radius: var(--radius); font-size: 1em;
}
.area_view p.p-link-button > a::after { content: "→"; }

.area_view a:has(img), .area_view a:has(img):hover {
  display: inline; color: inherit; background: none; padding: 0; margin: 0; border-radius: 0; font-weight: inherit;
}
.area_view table a {
  display: inline; color: var(--accent); background: none; padding: 0; margin: 0; border-radius: 0;
  font-weight: inherit; text-decoration: underline;
}
.area_view table a:hover { color: var(--accent-dark); background: none; }

.area_view .table-scroll { overflow-x: auto; margin: 26px 0; }
.area_view table { display: table; border-collapse: collapse; width: 100%; font-size: 14px; }
.area_view th, .area_view td { border: 1px solid var(--border-strong); padding: 11px 14px; text-align: left; }
.area_view th { background: var(--ink); color: #fff; font-weight: 700; font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.03em; }

.area_view h1 {
  font-size: 25px; font-weight: 800; color: var(--ink);
  margin: 42px 0 18px; padding-bottom: 14px; border-bottom: 3px solid var(--ink);
}
.area_view h2 {
  font-size: 22px; font-weight: 800; color: var(--ink);
  margin: 38px 0 16px; padding: 4px 0 4px 16px; border-left: 4px solid var(--accent);
}
.area_view h3 {
  font-size: 18.5px; font-weight: 700; color: var(--ink);
  margin: 30px 0 14px; padding: 10px 16px; background: var(--bg-soft); border-radius: var(--radius-sm);
}
.area_view h3::before { content: "§ "; color: var(--accent); font-weight: 800; }
.area_view h4 {
  font-family: var(--font-mono); font-size: 14.5px; font-weight: 700; color: var(--accent-dark);
  margin: 24px 0 10px; letter-spacing: 0.01em;
}
.area_view h4::before { content: "> "; color: var(--accent); }
.area_view blockquote {
  margin: 24px 0; padding: 14px 18px; background: var(--bg-soft);
  border-left: 3px solid var(--accent); color: var(--ink-soft);
}

.area_etc { margin-top: 32px; }
.list_tag { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tit_tag { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--ink-faint); margin-right: 4px; }
.desc_tag a, .link_tag {
  display: inline-block; padding: 5px 12px; border-radius: var(--radius-sm);
  background: var(--bg-soft); border: 1px solid var(--border); font-size: 12.5px; color: var(--ink-soft); font-family: var(--font-mono);
}
.desc_tag a:hover, .link_tag:hover { border-color: var(--accent); color: var(--accent); }


/* --------------------------------------------------------------------------
   댓글 / 방명록
   -------------------------------------------------------------------------- */
.area_reply { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--ink); }
.list_reply { display: flex; flex-direction: column; gap: 12px; margin-bottom: 22px; }
.list_reply li { display: flex; gap: 12px; padding: 14px; background: var(--bg-soft); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.list_reply li.re_reply { margin-left: 36px; }
.img_profile { width: 34px; height: 34px; border-radius: 50%; flex: none; background: var(--border); }
.reply_content { flex: 1; min-width: 0; }
.tit_nickname { display: block; font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.txt_reply { display: block; font-size: 14px; margin-bottom: 4px; }
.txt_date { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }
.my_edit { display: flex; gap: 10px; font-size: 12px; }
.my_edit a { color: var(--ink-faint); }

.fld_reply { border: 0; padding: 0; margin: 0; }
.reply_write { margin-bottom: 10px; }
.tf_reply {
  width: 100%; min-height: 86px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 12px 14px; font-family: inherit; font-size: 14px; resize: vertical; outline: none;
}
.tf_reply:focus { border-color: var(--accent); }
.reply_writer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; }
.writer_info { display: flex; gap: 8px; }
.inp_info { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 13px; font-family: inherit; outline: none; width: 122px; }
.writer_check { display: flex; align-items: center; }
.lab_secret { font-size: 12.5px; color: var(--ink-soft); display: flex; align-items: center; gap: 4px; }
.btn_enter { border: 0; background: var(--ink); color: #fff; padding: 10px 22px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 700; }
.btn_enter:hover { background: var(--accent); }

.protected_form { margin-top: 16px; display: flex; gap: 8px; }
.protected_form input { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 10px 12px; font-family: inherit; }
.protected_form button { border: 0; background: var(--ink); color: #fff; border-radius: var(--radius-sm); padding: 10px 18px; font-weight: 700; }

.skin_tag .list_tag, .skin_visitor { padding: 30px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); }
.skin_tag .list_tag { display: flex; flex-wrap: wrap; gap: 10px; }

/* --------------------------------------------------------------------------
   페이지네이션
   -------------------------------------------------------------------------- */
.area_paging { display: flex; justify-content: center; margin-top: 44px; font-family: var(--font-mono); }
.inner_paging { display: flex; align-items: center; gap: 4px; }
.inner_paging a, .inner_paging .link_page {
  display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px;
  border-radius: var(--radius-sm); font-size: 13px; color: var(--ink-soft); border: 1px solid transparent;
}
.inner_paging .link_page:hover { border-color: var(--ink); }
.inner_paging .link_prev, .inner_paging .link_next { padding: 0 14px; border: 1px solid var(--border-strong); color: var(--ink); font-weight: 700; }
.no_more_prev, .no_more_next { opacity: 0.3; pointer-events: none; }

/* --------------------------------------------------------------------------
   푸터
   -------------------------------------------------------------------------- */
.site-footer { background: var(--ink); color: rgba(255,255,255,0.6); margin-top: 60px; }
.footer-inner { max-width: var(--content-width); margin: 0 auto; padding: 40px 24px; text-align: center; }
.footer-title { font-size: 16px; font-weight: 800; color: #fff; margin-bottom: 8px; }
.footer-desc { font-size: 13px; margin-bottom: 16px; }
.footer-copy { font-family: var(--font-mono); font-size: 11.5px; color: rgba(255,255,255,0.4); }

/* --------------------------------------------------------------------------
   반응형 (모바일) — 좌우 여백은 최소화해 폭을 넓게 확보합니다.
   -------------------------------------------------------------------------- */
@media (max-width: 800px) {
  .menu-toggle { display: flex; }
  .header-inner { padding: 0 16px; gap: 12px; }
  .brand-name { font-size: 15px; }
  .area_search .tf_search { width: 70px; }

  .gnb {
    display: none; position: absolute; top: 62px; left: 0; right: 0;
    background: var(--white); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: stretch; padding: 8px 16px;
  }
  .gnb.is-open { display: flex; }
  .gnb ul.category_list, .gnb > ul { flex-direction: column; }
  .gnb ul li a { padding: 12px 4px; border-bottom: 1px solid var(--border); }
  .gnb-extra { flex-direction: column; }

  .home-hero-inner { padding: 36px 16px 0; }
  .home-hero-title { font-size: 24px; }
  .home-hero-badges { grid-template-columns: 1fr; }

  .container { padding: 26px 16px 60px; }

  .row-link { padding: 16px 2px; gap: 12px; }
  .row-index { width: 26px; font-size: 11.5px; }
  .row-thumb { width: 60px; height: 60px; }
  .row-body .tit_post { font-size: 15.5px; }
  .detail_info { align-items: flex-start; }

  .skin_view { padding-top: 22px; }
  .area_title .tit_post { font-size: 22px; }
  .area-toc { padding: 2px 16px; }

  .list_reply li.re_reply { margin-left: 12px; }
  .reply_writer { flex-direction: column; align-items: stretch; }
  .writer_info { flex-direction: column; }
  .inp_info { width: 100%; }
  .btn_enter { width: 100%; }
}
