* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
textarea {
  font: inherit;
}

code,
pre,
.tt_article_useless_p_margin pre,
.tt_article_useless_p_margin code {
  font-family: "JetBrains Mono", "D2Coding", Consolas, monospace;
}

.site-header {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 0;
}

.site-header__inner {
  padding: 0 0 24px;
  text-align: center;
}

.site-title {
  margin: 0;
  font-size: clamp(26px, 4.2vw, 35px);
  line-height: 1.12;
  font-weight: 700;
}

.site-title a:hover {
  color: var(--accent);
}

.site-tagline {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.top-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 42px;
  min-height: 86px;
  padding: 0 28px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(12px);
}

.top-nav__metric {
  margin-right: auto;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.top-nav__metric > span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.top-nav__metric-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  font-weight: 700;
}

.top-nav__metric strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.top-nav a {
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  transition: color 160ms ease;
}

.top-nav a:hover,
.search-trigger:hover {
  color: var(--accent);
}

.search-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.search-trigger svg {
  width: 26px;
  height: 26px;
}

.app-shell {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 48px;
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.left-rail,
.main-stage,
.content-column {
  display: grid;
  gap: 16px;
}

.main-stage,
.left-rail {
  min-width: 0;
}

.rail-card,
.post-card,
.article-detail,
.section-head,
.tag-cloud-page,
.guestbook-page {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 10px 28px rgba(17, 36, 51, 0.07);
}

.eyebrow,
.rail-card__eyebrow,
.neighbor-card__label {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.link-stack a:hover,
.post-card h3:hover,
.article-detail__meta a:hover,
.mini-list a:hover,
.tag-chip:hover,
.pagination a:hover,
.category-list a:hover {
  color: var(--accent);
}

.rail-card {
  padding: 20px 22px;
}

.rail-card__header {
  margin-bottom: 14px;
}

.rail-card__header h2 {
  margin: 0;
  font-size: 20px;
}

.category-list ul,
.mini-list,
.tt_category .c_cnt,
.article-tags__items,
.tag-cloud,
.tag-cloud-page__list,
.link-stack {
  margin: 0;
  padding: 0;
}

.category-list ul {
  list-style: none;
  display: grid;
  gap: 8px;
}

.category-list li {
  list-style: none;
  display: block;
}

.category-list a {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  background: transparent;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease, border-color 160ms ease;
  font-size: 17px;
  line-height: 1.55;
  text-decoration: none;
}

.category-list a:hover,
.category-list a.is-current {
  color: var(--text);
  background: #edf3f8;
  border-color: rgba(15, 157, 147, 0.18);
}

.category-list a:hover {
  transform: translateX(2px);
}

.category-list a.is-current {
  background: #d9e4ea;
  color: var(--text);
  font-weight: 600;
}

.category-list a.is-ancestor {
  color: #516277;
}

.category-list .c_cnt {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  flex-shrink: 0;
}

.category-list img {
  display: inline-block;
  vertical-align: middle;
}

.category-list a > img {
  margin-left: 6px;
  flex-shrink: 0;
}

.category-list ul ul {
  width: 100%;
  margin-left: 12px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.link-stack {
  display: grid;
  gap: 10px;
}

.link-stack a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--surface-2);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
}

.section-head h2 {
  margin: 0;
  font-size: 28px;
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.section-head__meta {
  align-self: flex-start;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
}

.post-grid {
  display: grid;
  gap: 18px;
}

.post-card {
  overflow: hidden;
}

.post-card__inner {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.post-card__thumb {
  height: 100%;
  border-right: 1px solid var(--line);
  background: #f3f7fa;
}

.post-card__thumb img {
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
}

.post-card__body {
  padding: 22px 24px;
  display: grid;
  align-content: center;
}

.post-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: var(--muted);
  font-size: 13px;
  align-items: center;
}

.post-card__meta-right {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
  min-width: 0;
  text-align: right;
  white-space: nowrap;
}

.post-card__category {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 13px;
  border: 1px solid rgba(15, 24, 38, 0.18);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

.post-card__category:hover {
  color: var(--text);
  border-color: rgba(15, 157, 147, 0.28);
  background: rgba(15, 157, 147, 0.06);
}

.post-card__date,
.post-card__comments {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.post-card h3 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card p {
  margin: 12px 0 0;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-detail {
  padding: 28px;
}

body.is-detail .app-shell {
  width: min(1280px, calc(100% - 40px));
  grid-template-columns: 288px minmax(0, 930px);
  justify-content: start;
  position: relative;
}

body.is-detail .left-rail {
  display: block;
  align-self: start;
  position: relative;
  padding-top: 0;
}

body.is-detail .rail-card--category,
body.is-detail .rail-card--recent {
  display: none;
}

body.is-detail .rail-card--toc {
  position: relative;
  top: auto;
  overflow: auto;
  max-height: calc(100vh - 120px);
  padding: 22px 22px;
}

body.is-detail .main-stage {
  max-width: 900px;
}

.article-detail__header {
  display: grid;
  gap: 12px;
  max-width: 930px;
  margin: 0 auto;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.article-detail__header h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 44px);
  line-height: 1.15;
}

.article-detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.article-body {
  max-width: 930px;
  margin: 0 auto;
  padding-top: 28px;
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
  margin: 1.8em 0 0.65em;
  line-height: 1.25;
  scroll-margin-top: 88px;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote,
.article-body table {
  margin: 0 0 1.15em;
}

.article-body ul,
.article-body ol {
  padding-left: 1.2em;
}

.article-body blockquote {
  margin-left: 0;
  padding: 18px 20px;
  border-left: 3px solid var(--accent);
  background: rgba(15, 157, 147, 0.08);
  color: #24414c;
  border-radius: 0 16px 16px 0;
}

.article-body pre {
  overflow-x: auto;
  padding: 6px;
  max-width: 100%;
  border: 1px solid #12202a;
  border-radius: 18px;
  background: #0f1720;
  color: #edf3f7;
}

.article-body code:not(pre code) {
  padding: 0.18em 0.42em;
  border-radius: 8px;
  background: #eef3f7;
  color: #1a2d39;
  font-size: 0.94em;
}

.article-body table,
.article-body table[style],
.article-body table[width] {
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  display: table !important;
  table-layout: auto !important;
  border-collapse: collapse;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}

.article-body table col,
.article-body table col[style],
.article-body table th[style],
.article-body table td[style] {
  width: auto !important;
}

.article-body th,
.article-body td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: keep-all;
  white-space: normal;
}

.article-body th {
  background: var(--surface-2);
}

.article-body hr {
  margin: 2.2em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  max-width: 930px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.article-tags__label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.article-tags__items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.article-tags__items a,
.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(15, 157, 147, 0.18);
  background: rgba(15, 157, 147, 0.08);
  color: #17665f;
  font-size: 13px;
}

.article-neighbors {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 930px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 28px;
}

.neighbor-card {
  min-height: 104px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-2);
}

.neighbor-card strong {
  display: block;
  line-height: 1.45;
}

.comment-area {
  max-width: 930px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.tag-cloud-page,
.guestbook-page {
  padding: 28px;
}

.tag-cloud-page__list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.search-box {
  display: flex;
  gap: 10px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
}

.search-box button {
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.mini-list {
  list-style: none;
  display: grid;
  gap: 12px;
}

.mini-list li {
  display: grid;
  gap: 4px;
}

.mini-list a {
  line-height: 1.45;
}

.mini-list span {
  color: var(--muted);
  font-size: 12px;
}

.counter-grid {
  display: grid;
  gap: 12px;
  margin: 0;
}

.counter-grid div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.counter-grid dt {
  color: var(--muted);
}

.counter-grid dd {
  margin: 0;
  font-weight: 700;
}

.toc-list {
  list-style: none;
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0 0 0 12px;
}

.toc-list li {
  position: relative;
}

.toc-list a {
  display: block;
  position: relative;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.toc-list a:hover,
.toc-list a.is-active {
  background: rgba(15, 157, 147, 0.1);
  color: #12433f;
}

.toc-list a.is-active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: #ff4f7d;
}

.toc-list .toc-depth-3 {
  padding-left: 22px;
  font-size: 14px;
}

.toc-empty {
  color: var(--muted);
  font-size: 15px;
}

.search-modal[hidden] {
  display: none;
}

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.search-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 31, 41, 0.18);
  backdrop-filter: blur(6px);
}

.search-modal__panel {
  position: relative;
  width: min(980px, calc(100% - 32px));
  margin: 72px auto 0;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(216, 227, 234, 0.9);
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(17, 36, 51, 0.14);
}

.search-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.search-modal__close svg,
.search-modal__icon svg {
  width: 22px;
  height: 22px;
}

.search-modal__form {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
}

.search-modal__icon {
  display: inline-flex;
  color: var(--text);
}

.search-modal__form input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 18px;
}

body.search-open {
  overflow: hidden;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.pagination__numbers {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.pagination__numbers a {
  text-decoration: none;
}

.pagination__arrow,
.pagination__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
}

.pagination__numbers .selected .pagination__number,
.pagination__numbers .pagination__number[aria-current="page"],
.pagination .paging .selected,
.pagination__number:hover,
.pagination__numbers a:hover .pagination__number,
.pagination__arrow:hover {
  color: var(--text);
  border-color: rgba(15, 157, 147, 0.25);
  background: rgba(15, 157, 147, 0.08);
}

.pagination__numbers .selected .pagination__number {
  border-color: rgba(15, 157, 147, 0.42);
  background: linear-gradient(135deg, rgba(15, 157, 147, 0.16), rgba(15, 157, 147, 0.08));
  box-shadow: inset 0 0 0 1px rgba(15, 157, 147, 0.08);
  font-weight: 700;
}

.pagination__numbers .pagination__number[aria-current="page"] {
  border-color: rgba(15, 157, 147, 0.42);
  background: linear-gradient(135deg, rgba(15, 157, 147, 0.16), rgba(15, 157, 147, 0.08));
  box-shadow: inset 0 0 0 1px rgba(15, 157, 147, 0.08);
  font-weight: 700;
}

.site-footer {
  margin-top: 56px;
  padding: 56px 0 64px;
  background: #0f1724;
  color: rgba(234, 242, 247, 0.86);
}

.site-footer__inner {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  gap: 28px;
  justify-items: center;
  text-align: center;
}

.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px 36px;
}

.site-footer__nav a {
  color: #f7fbff;
  font-size: 16px;
  font-weight: 600;
  transition: color 160ms ease;
}

.site-footer__nav a:hover {
  color: #73e1d8;
}

.site-footer__divider {
  width: min(760px, 100%);
  height: 1px;
  background: rgba(255, 255, 255, 0.14);
}

.site-footer__copy {
  margin: 0;
  color: rgba(214, 226, 235, 0.72);
  font-size: 14px;
  line-height: 1.7;
}

.tt_category .sub_category_list {
  margin-top: 8px;
  margin-left: 12px;
}

.tt_category .c_cnt {
  color: var(--muted);
  font-size: 12px;
}

.tt_article_useless_p_margin .another_category,
.tt_article_useless_p_margin .container_postbtn,
.tt_article_useless_p_margin .book-toc,
.article-body .another_category,
.article-body .container_postbtn {
  margin-top: 28px;
}

.article-body iframe,
.article-body embed,
.article-body video {
  width: 100%;
  max-width: 100%;
  border: 0;
  border-radius: 18px;
}

.article-body figure {
  max-width: 930px;
  margin: 1.4em auto;
}

.tt_article_useless_p_margin a,
.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  font-weight: 600;
  transition: color 160ms ease, text-decoration-color 160ms ease;
  word-break: break-word;
}

.tt_article_useless_p_margin a:hover,
.tt_article_useless_p_margin a:focus-visible,
.article-body a:hover,
.article-body a:focus-visible {
  color: #0d8f88;
  text-decoration-color: #0d8f88;
}

.tt_article_useless_p_margin a:visited,
.article-body a:visited {
  color: #147973;
}

.article-body img,
.article-body figure img {
  width: auto;
  max-width: min(100%, 930px);
  height: auto;
  margin-left: auto;
  margin-right: auto;
}

.article-body figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 1320px) {
  .app-shell {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .post-card__inner {
    grid-template-columns: 240px minmax(0, 1fr);
  }
}

@media (max-width: 960px) {
  .site-header {
    width: min(100% - 24px, 100%);
    padding-top: 22px;
  }

  .site-header__inner {
    padding-bottom: 22px;
  }

  .top-nav {
    justify-content: center;
    gap: 18px;
    min-height: 60px;
    padding: 0 12px;
  }

  .top-nav__metric {
    width: 100%;
    justify-content: center;
    margin-right: 0;
    padding-top: 10px;
    gap: 14px;
    flex-wrap: wrap;
  }

  .top-nav a {
    font-size: 16px;
  }

  .app-shell {
    width: min(100% - 24px, 100%);
    grid-template-columns: minmax(0, 1fr);
    padding-top: 22px;
  }

  body.is-detail .app-shell {
    width: min(100% - 24px, 100%);
    grid-template-columns: minmax(0, 1fr);
  }

  .left-rail {
    order: 2;
  }

  .article-detail,
  .tag-cloud-page,
  .guestbook-page {
    padding: 24px 18px;
  }

  .post-card__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-card__thumb {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .post-card__thumb img {
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .article-neighbors {
    grid-template-columns: minmax(0, 1fr);
  }

  .search-modal__panel {
    margin-top: 56px;
    padding: 16px 18px;
  }

  .search-modal__form input {
    font-size: 16px;
  }

  .site-footer {
    margin-top: 40px;
    padding: 44px 0 48px;
  }

  .site-footer__inner {
    width: min(100% - 24px, 100%);
    gap: 24px;
  }

  .site-footer__nav {
    gap: 18px 24px;
  }

  .site-footer__nav a {
    font-size: 15px;
  }
}
