@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&family=Roboto:wght@400;500;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
}

body {
  font-family: "Noto Sans SC", sans-serif;
  line-height: 1.5;
  color: #34495e;
  background-color: #ffffff;
}

#root {
  min-height: 100vh;
}

hr {
  border: none;
  border-top: 2px solid #bb5649;
}

a {
  font-family: "Noto Sans SC", sans-serif;
  color: #34495e;
  text-decoration: none;
  font-size: 18px;
}

.page-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
  padding: 2rem 0;
}

.container {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

.header {
  padding: 1rem 0;
  margin-top: 0.5rem;
  margin-bottom: 10px;
}

.header-row {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
}

.profile-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.profile {
  width: 60px;
  height: 60px;
}

.profile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 2px solid #bb5649;
}

.profile-content {
  margin: 0;
  font-size: 0.7rem;
  color: #888;
  text-align: left;
  line-height: 1.5;
  max-width: 110px;
}

.header-content {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 12.5px;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(52, 73, 94, 0.16);
  border-radius: 10px;
  background: #ffffff;
  color: #34495e;
  padding: 0;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 10px 24px rgba(52, 73, 94, 0.08);
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.nav-toggle:hover {
  border-color: rgba(187, 86, 73, 0.35);
  box-shadow: 0 14px 28px rgba(52, 73, 94, 0.12);
  transform: translateY(-1px);
}

.nav-toggle-line {
  width: 18px;
  height: 1.5px;
  border-radius: 999px;
  background: #bb5649;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav {
  flex: 1;
  display: flex;
  justify-content: center;
  position: relative;
}

.nav-list {
  list-style: none;
  padding: 0;
  display: flex;
  gap: 1.5rem;
}

.nav-panel {
  display: none;
}

.hover-underline-animation {
  position: relative;
  display: inline-block;
  width: max-content;
  max-width: 100%;
}

.hover-underline-animation::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: #bb5649;
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.hover-underline-animation:hover::after {
  width: 100%;
}

.posts-grid {
  display: grid;
}

.post-card {
  background: white;
  padding: 1rem 0;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-detail-card {
  border-bottom: none;
}

.post-detail-container {
  max-width: 1080px;
}

.post-detail-layout {
  display: grid;
}

.post-detail-layout-with-toc {
  grid-template-columns: minmax(0, 800px) 220px;
  gap: 2rem;
  align-items: start;
}

.post-title {
  font-family: inherit;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.28;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.post-date {
  color: #7f8c8d;
  font-size: 0.9rem;
  font-family: 'Roboto', system-ui, sans-serif;
  margin-top: -0.3rem;
}

.post-meta-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: -0.3rem;
  flex-wrap: wrap;
}

.post-meta-row .post-date {
  margin-top: 0;
}

.post-source-link {
  color: #bb5649;
  font-size: 0.82rem;
  line-height: 1;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2.2rem;
  font-size: 0.88rem;
}

.pagination-link {
  color: #34495e;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1;
  display: inline-block;
  transition: color 0.3s ease, transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  will-change: transform;
}

.pagination-link:hover {
  color: #bb5649;
}

.pagination-link-prev:hover {
  transform: translateX(-4px);
}

.pagination-link-next:hover {
  transform: translateX(4px);
}

.post-content {
  margin-top: 1rem;
  font-size: 1.1rem;
  line-height: 1.8;
  width: 100%;
}

.post-content p {
  margin-bottom: 1rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  color: #34495e;
  font-weight: 500;
  line-height: 1.35;
  scroll-margin-top: 1.2rem;
}

.post-content h1 {
  font-size: 1.75rem;
  margin: 0 0 1rem;
}

.post-content h2 {
  font-size: 1.45rem;
  margin: 1.7rem 0 0.85rem;
}

.post-content h3 {
  font-size: 1.2rem;
  margin: 1.45rem 0 0.75rem;
}

.post-content h4,
.post-content h5,
.post-content h6 {
  font-size: 1.05rem;
  margin: 1.2rem 0 0.7rem;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 0.9rem;
  margin-top: 0.4rem;
}

.post-tag-link {
  color: #bb5649;
  font-size: 0.94rem;
  line-height: 1.5;
  display: inline-block;
  transition: color 0.2s ease, transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.post-tag-link:hover {
  transform: translateX(4px);
}

.post-tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.1rem;
}

.post-toc {
  position: sticky;
  top: 16px;
  align-self: start;
}

.post-toc-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 14px 32px rgba(52, 73, 94, 0.08);
  padding: 1rem 1rem 1.05rem;
}

.post-toc-heading {
  color: #34495e;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0.04em;
  margin-bottom: 0.9rem;
}

.post-toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.post-toc-level-2,
.post-toc-level-3,
.post-toc-level-4,
.post-toc-level-5,
.post-toc-level-6 {
  margin-top: 0.35rem;
}

.post-toc-level-2 {
  padding-left: 0.95rem;
}

.post-toc-level-3,
.post-toc-level-4,
.post-toc-level-5,
.post-toc-level-6 {
  padding-left: 1.55rem;
}

.post-toc-link {
  color: #bb5649;
  font-size: 0.92rem;
  line-height: 1.6;
  display: inline-flex;
  align-items: baseline;
  gap: 0.42rem;
}

.post-toc-link::before {
  content: '·';
  color: #bb5649;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.sign {
  color: rgb(12, 68, 90);
  text-decoration: none;
  font-size: 28px;
}

.comments-block {
  margin-top: 0;
  padding-top: 0;
}

.post-detail-divider {
  width: 100%;
  height: 1px;
  background: #e0e0e0;
  margin: 1rem 0;
}

.comments-empty {
  color: #7f8c8d;
  font-size: 0.9rem;
  line-height: 1.8;
}

.comments-empty a {
  color: #bb5649;
  font-size: 0.9rem;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.comment-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 1.25rem;
  padding: 0.95rem 0;
  align-items: stretch;
}

.comment-side {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.comment-avatar-link {
  flex-shrink: 0;
  line-height: 0;
}

.comment-avatar {
  width: 60px;
  height: 60px;
  border-radius: 0;
  object-fit: cover;
}

.comment-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.comment-author {
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.45;
  color: #bb5649;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.comment-main {
  min-width: 0;
  padding: 0.9rem 1rem 0.8rem;
  border-radius: 2px;
  border-right: 2px solid rgba(52, 73, 94, 0.18);
  border-bottom: 2px solid rgba(52, 73, 94, 0.18);
  box-shadow: 0 8px 18px rgba(52, 73, 94, 0.1);
  background: #fff;
  align-self: stretch;
  width: fit-content;
  max-width: 100%;
  justify-self: start;
}

.comment-date {
  color: #7f8c8d;
  font-size: 0.76rem;
  line-height: 1.4;
  font-family: 'Roboto', system-ui, sans-serif;
}

.comment-body {
  font-size: 0.98rem;
  line-height: 1.9;
  color: #34495e;
}

.comment-body p,
.comment-body ul,
.comment-body ol,
.comment-body blockquote,
.comment-body pre {
  margin: 0 0 0.9rem;
}

.comment-body p:last-child,
.comment-body ul:last-child,
.comment-body ol:last-child,
.comment-body blockquote:last-child,
.comment-body pre:last-child {
  margin-bottom: 0;
}

.comment-body img {
  max-width: 100%;
  height: auto;
}

.comment-body blockquote {
  margin-left: 0;
  padding-left: 0.9rem;
  border-left: 2px solid rgba(187, 86, 73, 0.35);
  color: #5e6c76;
}

.comment-body code {
  padding: 0.06rem 0.28rem;
  background: #f7f7f7;
  border-radius: 4px;
  font-size: 0.9em;
}

.comment-body pre {
  padding: 0.9rem 1rem;
  overflow-x: auto;
  background: #fafafa;
  border: 1px solid #ededed;
}

.comment-body pre code {
  padding: 0;
  background: transparent;
}

.post-navigation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.2rem;
  margin-top: 1.8rem;
}

.post-nav-item {
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: color 0.2s ease, transform 0.2s ease;
}

.post-nav-title {
  color: #bb5649;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: baseline;
  gap: 0;
}

.post-nav-item:hover {
  transform: translateY(-1px);
}

.post-nav-item:hover .post-nav-title {
  color: #bb5649;
}

.post-nav-arrow {
  font-size: 0.84rem;
  line-height: 1;
  flex-shrink: 0;
  color: inherit;
  display: inline-block;
  vertical-align: baseline;
}

.post-nav-arrow-prev {
  margin-right: 0.02rem;
  transform: translateY(0.01em);
}

.post-nav-arrow-next {
  margin-left: -0.04rem;
  transform: translateY(0.01em);
}

.post-nav-next {
  grid-column: 2;
  margin-top: 0.65rem;
  justify-self: end;
  text-align: right;
}

@media (max-width: 720px) {
  .comment-item {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .post-navigation {
    grid-template-columns: 1fr;
  }

  .post-nav-next {
    grid-column: auto;
    margin-top: 0;
    justify-self: start;
    text-align: left;
  }
}

@media (max-width: 960px) {
  .post-detail-layout-with-toc {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .post-toc {
    position: static;
    order: -1;
  }

  .post-detail-layout {
    max-width: 760px;
    width: 100%;
    margin: 0 auto;
  }
}

@media (max-width: 920px) {
  .page-content {
    padding: 1.5rem 0;
  }

  .container {
    padding: 0 1.25rem;
  }

  .header {
    padding: 0.8rem 0 0.7rem;
    margin-bottom: 0;
  }

  .header-row {
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .header-content {
    flex: 0;
    justify-content: flex-end;
    padding-top: 0;
  }

  .nav {
    flex: 0;
    justify-content: flex-end;
    position: static;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-list-desktop {
    display: none;
  }

  .nav-panel {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(82vw, 300px);
    opacity: 1;
    visibility: visible;
    transform: translateX(-104%);
    pointer-events: none;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 40;
  }

  .nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(52, 73, 94, 0.14);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.24s ease, visibility 0.24s ease;
    z-index: 30;
  }

  body.nav-open .nav-panel {
    transform: translateX(0);
    pointer-events: auto;
  }

  body.nav-open .nav-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open .nav-toggle-line:nth-child(1) {
    transform: translateY(5.5px) rotate(45deg);
  }

  body.nav-open .nav-toggle-line:nth-child(2) {
    opacity: 0;
  }

  body.nav-open .nav-toggle-line:nth-child(3) {
    transform: translateY(-5.5px) rotate(-45deg);
  }

  .nav-panel-inner {
    height: 100%;
    background: #fbfbfa;
    border-right: 1px solid rgba(52, 73, 94, 0.08);
    box-shadow: 18px 0 36px rgba(52, 73, 94, 0.12);
    padding: 1.15rem 0.9rem 1rem;
    display: flex;
    flex-direction: column;
  }

  .nav-panel-head {
    padding: 0 0.55rem 0.95rem;
    margin-bottom: 0.4rem;
    border-bottom: 1px solid rgba(52, 73, 94, 0.08);
  }

  .nav-panel-title {
    color: #34495e;
    font-size: 0.86rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .nav-list-mobile {
    padding: 0.45rem 0;
    gap: 0.18rem;
    flex-direction: column;
  }

  .nav-list-mobile li {
    list-style: none;
  }

  .nav-list-mobile a {
    width: 100%;
    font-size: 1rem;
    line-height: 1.35;
    padding: 0.78rem 0.75rem;
    border-radius: 10px;
    transition: background-color 0.22s ease, color 0.22s ease, transform 0.22s ease;
  }

  .nav-list-mobile a:hover,
  .nav-list-mobile a.is-active {
    background: rgba(187, 86, 73, 0.08);
    color: #bb5649;
    transform: translateX(4px);
  }

  .nav-list-mobile .hover-underline-animation::after {
    display: none;
  }

  .post-title {
    font-size: 1.38rem;
    width: auto;
    max-width: 100%;
    display: inline-block;
    justify-self: start;
    align-self: start;
  }

  .hover-underline-animation {
    width: auto;
    max-width: 100%;
  }

  .post-card {
    padding: 1rem 0.2rem;
  }

  .post-detail-layout,
  .posts-grid,
  .post-detail-card,
  .top-posts-timeline,
  .comments-list,
  .post-navigation {
    max-width: 680px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .post-detail-layout-with-toc {
    gap: 1.2rem;
  }

  .post-toc-card {
    padding: 0.95rem 1rem 1rem;
  }

  .post-toc-heading {
    font-size: 18px;
    margin-bottom: 0.75rem;
  }

  .post-meta-row {
    gap: 0.55rem;
  }

  .post-content {
    margin-top: 0.8rem;
    font-size: 1rem;
    line-height: 1.75;
  }

  .post-content h1 {
    font-size: 1.38rem;
    margin-bottom: 0.85rem;
  }

  .post-content h2 {
    font-size: 1.2rem;
    margin: 1.35rem 0 0.7rem;
  }

  .post-content h3 {
    font-size: 1.08rem;
    margin: 1.2rem 0 0.65rem;
  }

  .post-tags {
    gap: 0.55rem 0.8rem;
  }

  .comment-item {
    padding: 0.75rem 0.2rem;
  }

  .comment-side {
    gap: 0.35rem;
  }

  .comment-main {
    width: 100%;
    max-width: 100%;
  }

  .top-post-row {
    flex-direction: column;
    gap: 0.15rem;
  }

  .top-post-date {
    font-size: 0.95rem;
  }

  .top-post-title {
    font-size: 1rem;
  }

  .post-toc {
    display: none;
  }

  .post-detail-layout-with-toc {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 0 1rem;
  }

  .post-card {
    padding: 0.95rem 0;
  }

  .post-title {
    font-size: 1.24rem;
    line-height: 1.34;
  }

  .post-date {
    font-size: 0.82rem;
  }

  .post-source-link {
    font-size: 0.76rem;
  }

  .post-content h1 {
    font-size: 1.26rem;
  }
}

.top-posts-timeline {
  position: relative;
  padding-left: 25px;
}

.top-post-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.1rem 0;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.top-post-row::before {
  content: '';
  position: absolute;
  left: -15px;
  top: 0;
  bottom: 0;
  width: 1.5px;
  background-color: #bac4d1;
  transform: translateX(0);
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.top-post-row:hover {
  transform: translateX(4px);
}

.top-post-row:hover::before {
  width: 4px;
  background-color: #bb5649;
}

.top-post-date {
  color: #999;
  font-size: 1.11rem;
  font-family: monospace;
  flex-shrink: 0;
}

.top-post-title {
  color: #bb5649;
  font-size: 1.1rem;
  font-weight: 400;
  font-family: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer {
  color: rgb(12, 68, 90);
  padding: 1rem 0;
  text-align: center;
  margin-top: auto;
}
