:root {
  --bg-primary: #f3f2ee;
  --bg-secondary: #ffffff;
  --text-primary: #1f0909;
  --text-secondary: #666666;
  --border-color: #e0e0e0;
  --accent-color: #06B6D4;
  --sidebar-bg: #f3f2ee;
  --hover-bg: #e8e7e0;
  --code-bg: #f5f5f5;
  --code-text: #2d2d2d;
  --progress-bar: #06B6D4;
  --sidebar-width: 280px;
  --toc-width: 240px;
  --max-content-width: 800px;
  --header-height: 60px;
  --mobile-breakpoint: 768px;
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
  --font-body: "PT Serif", 'Times New Roman', Times, serif;
  --font-ui: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "Lucida Console", Consolas, "Courier", monospace; }

html.dark-mode {
  --bg-primary: #121212;
  --bg-secondary: #1a1a1a;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0a0;
  --border-color: #333333;
  --accent-color: #22D3EE;
  --sidebar-bg: #121212;
  --hover-bg: #1e1e1e;
  --code-bg: #1e1e1e;
  --code-text: #e0e0e0;
  --progress-bar: #22D3EE; }

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal); }

.blog-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr var(--toc-width);
  grid-template-areas: "sidebar content toc";
  min-height: 100vh;
  position: relative;
  padding-top: var(--header-height); }
  @media (max-width: 1200px) {
    .blog-layout {
      grid-template-columns: var(--sidebar-width) 1fr;
      grid-template-areas: "sidebar content"; } }
  @media (max-width: 768px) {
    .blog-layout {
      grid-template-columns: 1fr;
      grid-template-areas: "content"; } }
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--progress-bar), var(--accent-color));
  z-index: 9999;
  transition: width 100ms linear; }

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  z-index: 1000;
  padding: 0 2rem;
  backdrop-filter: blur(10px);
  background-color: rgba(243, 242, 238, 0.95);
  transition: all var(--transition-normal); }
  .navbar a {
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
    text-decoration: none;
    position: relative;
    padding: 0.5rem 0;
    transition: color var(--transition-fast); }
    .navbar a::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      width: 0;
      height: 2px;
      background-color: var(--accent-color);
      transition: width var(--transition-normal); }
    .navbar a:hover {
      color: var(--accent-color); }
      .navbar a:hover::after {
        width: 100%; }
  @media (max-width: 768px) {
    .navbar {
      padding: 0 1rem;
      gap: 1rem; }
      .navbar a {
        font-size: 0.9rem; } }
html.dark-mode .navbar {
  background-color: rgba(18, 18, 18, 0.95); }

.sidebar {
  grid-area: sidebar;
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background-color: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2rem 1.5rem;
  transition: transform var(--transition-normal), background-color var(--transition-normal);
  z-index: 900; }
  .sidebar::-webkit-scrollbar {
    width: 6px; }
  .sidebar::-webkit-scrollbar-track {
    background: transparent; }
  .sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px; }
    .sidebar::-webkit-scrollbar-thumb:hover {
      background: var(--text-secondary); }
  @media (max-width: 768px) {
    .sidebar {
      transform: translateX(-100%);
      box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1); }
      .sidebar.open {
        transform: translateX(0); } }
.sidebar-nav {
  list-style: none; }
  .sidebar-nav-item {
    margin-bottom: 0.25rem; }
  .sidebar-nav-link-wrapper {
    display: flex;
    align-items: center;
    border-radius: 6px;
    transition: background-color var(--transition-fast); }
    .sidebar-nav-link-wrapper:hover {
      background-color: var(--hover-bg); }
      .sidebar-nav-link-wrapper:hover .sidebar-nav-arrow {
        opacity: 1; }
  .sidebar-nav-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-left: 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0;
    transition: all var(--transition-fast);
    flex-shrink: 0; }
    .sidebar-nav-arrow svg {
      stroke: var(--text-secondary);
      transition: transform var(--transition-normal); }
    .sidebar-nav-arrow:hover {
      background-color: var(--border-color); }
      .sidebar-nav-arrow:hover svg {
        stroke: var(--text-primary); }
    .sidebar-nav-arrow.expanded svg {
      transform: rotate(90deg); }
  .sidebar-nav-link {
    flex: 1;
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: color var(--transition-fast);
    font-family: var(--font-ui); }
    .sidebar-nav-link:hover {
      color: var(--accent-color); }
    .sidebar-nav-link.active {
      color: var(--accent-color);
      background-color: var(--hover-bg);
      border-radius: 6px; }
    .sidebar-nav-link-no-children {
      padding: 0.5rem 1rem;
      border-radius: 6px;
      transition: all var(--transition-fast); }
      .sidebar-nav-link-no-children:hover {
        background-color: var(--hover-bg);
        color: var(--accent-color); }
  .sidebar-nav-submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease-in-out;
    margin-top: 0;
    opacity: 0; }
    .sidebar-nav-submenu.expanded {
      max-height: 5000px;
      margin-top: 0.25rem;
      opacity: 1; }
  .sidebar-nav-level-0 {
    padding-left: 0; }
  .sidebar-nav-level-1 {
    padding-left: 2.25rem; }
    .sidebar-nav-level-1 .sidebar-nav-link {
      font-size: 0.875rem;
      opacity: 0.95; }
    .sidebar-nav-level-1 .sidebar-nav-link-no-children {
      opacity: 0.9; }
  .sidebar-nav-level-2 {
    padding-left: 2.25rem; }
    .sidebar-nav-level-2 .sidebar-nav-link {
      font-size: 0.85rem;
      color: var(--text-secondary);
      opacity: 0.9; }
    .sidebar-nav-level-2 .sidebar-nav-link-no-children {
      opacity: 0.85; }
  .sidebar-nav-level-3 {
    padding-left: 2.25rem; }
    .sidebar-nav-level-3 .sidebar-nav-link {
      font-size: 0.825rem;
      color: var(--text-secondary);
      opacity: 0.85; }
    .sidebar-nav-level-3 .sidebar-nav-link-no-children {
      opacity: 0.8; }
  .sidebar-nav-level-4 {
    padding-left: 2.25rem; }
    .sidebar-nav-level-4 .sidebar-nav-link {
      font-size: 0.8rem;
      color: var(--text-secondary);
      opacity: 0.8; }
    .sidebar-nav-level-4 .sidebar-nav-link-no-children {
      opacity: 0.75; }

.menu-toggle {
  display: none;
  position: fixed;
  top: calc(var(--header-height) / 2 - 24px);
  left: 1rem;
  z-index: 1001;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all var(--transition-fast); }
  .menu-toggle svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-primary);
    transition: transform var(--transition-normal); }
  .menu-toggle:hover {
    transform: scale(1.05);
    background-color: var(--hover-bg); }
  .menu-toggle.open svg {
    transform: rotate(90deg); }
  @media (max-width: 768px) {
    .menu-toggle {
      display: flex; } }
.content-area {
  grid-area: content;
  max-width: var(--max-content-width);
  width: 100%;
  margin: 0 auto;
  padding: 3rem 2rem; }
  @media (max-width: 768px) {
    .content-area {
      padding: 2rem 1.5rem; } }
#write {
  width: 100%; }
  #write h1, #write h2, #write h3, #write h4, #write h5, #write h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2em;
    margin-bottom: 0.75em;
    color: var(--text-primary); }
  #write h1 {
    font-size: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem; }
  #write h2 {
    font-size: 1.6rem; }
  #write h3 {
    font-size: 1.3rem; }
  #write h4 {
    font-size: 1.1rem; }
  #write p {
    margin-bottom: 1.25em;
    line-height: 1.8; }
  #write a {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--text-secondary);
    transition: all var(--transition-fast); }
    #write a:hover {
      color: var(--text-secondary);
      border-bottom-color: var(--text-primary); }
  #write ul, #write ol {
    margin: 1.5em 0;
    padding-left: 2em; }
    #write ul li, #write ol li {
      margin: 0.5em 0;
      line-height: 1.7; }
  #write ul {
    list-style-type: disc; }
  #write ol {
    list-style-type: decimal; }
  #write blockquote {
    margin: 2em 0;
    padding: 1em 1.5em;
    border-left: 4px solid var(--accent-color);
    background-color: var(--code-bg);
    font-style: italic;
    color: var(--text-secondary);
    border-radius: 0 8px 8px 0; }
  #write pre, #write code {
    font-family: var(--font-mono);
    font-size: 0.9em; }
  #write code {
    background-color: var(--code-bg);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    color: var(--code-text); }
  #write pre {
    position: relative;
    background-color: var(--code-bg);
    padding: 1.25em;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5em 0;
    border: 1px solid var(--border-color);
    color: var(--code-text); }
    #write pre code {
      background: none;
      padding: 0;
      color: inherit; }
  #write img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2em 0; }
  #write table {
    width: 100%;
    border-collapse: collapse;
    margin: 2em 0; }
    #write table th, #write table td {
      padding: 0.75em;
      border: 1px solid var(--border-color);
      text-align: left; }
    #write table th {
      background-color: var(--code-bg);
      font-weight: 600; }
    #write table tr:nth-child(even) {
      background-color: var(--code-bg); }
  #write hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 3em 0; }

.toc-wrapper {
  grid-area: toc;
  position: fixed;
  top: var(--header-height);
  right: 0;
  width: var(--toc-width);
  height: calc(100vh - var(--header-height));
  padding: 2rem 1.5rem;
  overflow-y: auto;
  border-left: 1px solid var(--border-color);
  background-color: var(--bg-primary); }
  .toc-wrapper::-webkit-scrollbar {
    width: 6px; }
  .toc-wrapper::-webkit-scrollbar-track {
    background: transparent; }
  .toc-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px; }
    .toc-wrapper::-webkit-scrollbar-thumb:hover {
      background: var(--text-secondary); }
  @media (max-width: 1200px) {
    .toc-wrapper {
      display: none; } }
.toc-title {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 1rem; }

.toc-list {
  list-style: none; }

.toc-item {
  margin: 0.5rem 0; }
  .toc-item a {
    display: block;
    font-family: var(--font-ui);
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.4rem 0.75rem;
    border-left: 2px solid transparent;
    transition: all var(--transition-fast);
    line-height: 1.4; }
    .toc-item a:hover {
      color: var(--accent-color);
      border-left-color: var(--accent-color);
      padding-left: 1rem; }
    .toc-item a.active {
      color: var(--accent-color);
      border-left-color: var(--accent-color);
      font-weight: 500; }

.toc-h2 {
  margin-left: 0; }

.toc-h3 {
  margin-left: 1rem;
  font-size: 0.825rem; }

.toc-h4 {
  margin-left: 2rem;
  font-size: 0.8rem; }

.theme-toggle {
  position: fixed;
  top: calc(var(--header-height) / 2 - 20px);
  right: 1.5rem;
  z-index: 9999;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); }
  .theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
  .theme-toggle svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-primary);
    transition: transform var(--transition-normal); }
  .theme-toggle:active svg {
    transform: rotate(360deg); }

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast) ease;
  opacity: 0.7;
  z-index: 10; }
  .copy-btn:hover {
    opacity: 1;
    transform: scale(1.05);
    background-color: var(--bg-primary); }
  .copy-btn:active {
    transform: scale(0.95); }
  .copy-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor; }
  .copy-btn--copied {
    background-color: var(--accent-color);
    color: white;
    opacity: 1; }

@media (max-width: 768px) {
  .copy-btn {
    width: 32px;
    height: 32px;
    padding: 6px;
    top: 6px;
    right: 6px; }
    .copy-btn svg {
      width: 14px;
      height: 14px; } }

@media print {
  .copy-btn {
    display: none; } }

#topBtn {
  display: none;
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 999;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all var(--transition-fast); }
  #topBtn:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2); }
  @media (max-width: 768px) {
    #topBtn {
      bottom: 1.5rem;
      right: 1.5rem;
      width: 44px;
      height: 44px; } }
.page-header-icon {
  font-size: 4.5rem;
  line-height: 1;
  margin-bottom: 0.75rem;
  margin-top: 0; }
  .page-header-icon .icon {
    display: inline-block; }

.page-title {
  margin-top: 0.5rem !important;
  margin-bottom: 1rem !important; }

.page-description {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem; }

.article-date {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-family: var(--font-ui); }

.page-footer {
  grid-column: 1 / -1;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  margin-top: 4rem; }
  .page-footer .line {
    border: none;
    margin: 0 0 2rem 0; }
  .page-footer .social {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem; }
    .page-footer .social__icon a {
      color: var(--text-secondary);
      transition: color var(--transition-fast); }
      .page-footer .social__icon a:hover {
        color: var(--accent-color); }
      .page-footer .social__icon a svg {
        width: 24px;
        height: 24px;
        fill: var(--text-secondary);
        transition: fill var(--transition-fast); }
      .page-footer .social__icon a:hover svg {
        fill: var(--accent-color); }
  .page-footer .copyright {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: var(--font-ui); }

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px); }
  to {
    opacity: 1;
    transform: translateY(0); } }

.content-area {
  animation: fadeIn 0.4s ease-out; }

@media print {
  .sidebar,
  .toc-wrapper,
  .navbar,
  .menu-toggle,
  .theme-toggle,
  #topBtn,
  .page-footer {
    display: none !important; }
  .blog-layout {
    grid-template-columns: 1fr;
    grid-template-areas: "content"; }
  .content-area {
    max-width: 100%;
    padding: 0; } }

.article-tags-section {
  margin-top: 3rem;
  margin-bottom: 2rem; }
  .article-tags-section .tags-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin-bottom: 1.5rem; }
  .article-tags-section .article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-family: var(--font-ui); }
  .article-tags-section .article-tag {
    display: inline-block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 500;
    transition: color var(--transition-fast); }
    .article-tags-section .article-tag::before {
      content: '#';
      margin-right: 0.1em; }
    .article-tags-section .article-tag:hover {
      color: var(--accent-color); }
  @media (max-width: 768px) {
    .article-tags-section {
      margin-top: 2rem; }
      .article-tags-section .article-tag {
        font-size: 0.95rem; } }
.recent-posts-list {
  margin-top: 2rem; }
  .recent-posts-list .recent-post-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color); }
    .recent-posts-list .recent-post-item:last-child {
      border-bottom: none;
      margin-bottom: 0;
      padding-bottom: 0; }
  .recent-posts-list .recent-post-title {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem; }
    .recent-posts-list .recent-post-title a {
      font-size: 1rem;
      font-weight: 600;
      color: var(--text-primary);
      text-decoration: none;
      border-bottom: 1px solid transparent;
      transition: all var(--transition-fast);
      font-family: var(--font-ui); }
      .recent-posts-list .recent-post-title a:hover {
        color: var(--accent-color);
        border-bottom-color: var(--accent-color); }
    .recent-posts-list .recent-post-title .recent-post-date {
      font-size: 0.9rem;
      color: var(--text-secondary);
      font-family: var(--font-ui); }
  .recent-posts-list .recent-post-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0; }
  @media (max-width: 768px) {
    .recent-posts-list .recent-post-title {
      flex-direction: column;
      gap: 0.25rem;
      align-items: flex-start; }
      .recent-posts-list .recent-post-title a {
        font-size: 0.95rem; }
      .recent-posts-list .recent-post-title .recent-post-date {
        font-size: 0.85rem; }
    .recent-posts-list .recent-post-description {
      font-size: 0.9rem; } }
