:root {
  --accent-color: {{theme.accentColor}};
  --bg-primary: #fafafa;
  --bg-secondary: #f5f5f7;
  --bg-card: rgba(255, 255, 255, 0.8);
  --text-primary: #1d1d1f;
  --text-secondary: #86868b;
  --border-color: rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
  --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border-color: #334155;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

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

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent-color);
  color: white;
  padding: 8px 16px;
  z-index: 1000;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

button {
  cursor: pointer;
  font-family: inherit;
}

input {
  font-family: inherit;
}

.background-animation {
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, var(--accent-color)10, transparent 50%), radial-gradient(circle at 70% 80%, var(--accent-color)08, transparent 50%);
  animation: float 25s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.background-animation-2 {
  background: radial-gradient(circle at 60% 30%, var(--accent-color)08, transparent 50%), radial-gradient(circle at 20% 70%, var(--accent-color)06, transparent 50%);
  animation: float 30s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(2%, 2%) rotate(1deg);
  }
  50% {
    transform: translate(0, 4%) rotate(0deg);
  }
  75% {
    transform: translate(-2%, 2%) rotate(-1deg);
  }
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .header {
  background: rgba(15, 23, 42, 0.9);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}

.logo:hover {
  color: var(--accent-color);
  transform: scale(1.02);
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  position: relative;
  transition: var(--transition);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent-color);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.theme-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 1.2rem;
}

.theme-toggle:hover {
  transform: rotate(20deg);
  background: var(--accent-color);
  border-color: var(--accent-color);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.search-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--text-secondary);
}

.search-toggle:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

.search-toggle svg {
  width: 20px;
  height: 20px;
}

.mobile-menu-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--text-secondary);
}

.mobile-menu-toggle:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

.mobile-menu-toggle svg {
  width: 24px;
  height: 24px;
}

.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}

.search-modal.active {
  display: flex;
}

.search-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.search-modal-content {
  position: relative;
  width: 90%;
  max-width: 640px;
  background: var(--bg-primary);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  z-index: 1;
}

.search-header {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  gap: 0.75rem;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1.125rem;
  color: var(--text-primary);
  padding: 0.5rem 0;
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-close {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  padding: 0.5rem;
  border-radius: 8px;
  transition: var(--transition);
}

.search-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.search-results {
  max-height: 480px;
  overflow-y: auto;
  padding: 0.5rem;
}

.search-result-item {
  padding: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: block;
  color: inherit;
}

.search-result-item:hover {
  background: var(--bg-secondary);
}

.search-result-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
}

.search-result-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.search-result-date,
.search-result-tag {
  color: var(--text-tertiary);
}

.search-result-excerpt {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.search-highlight {
  background: var(--accent-color);
  color: white;
  padding: 0.125rem 0.25rem;
  border-radius: 2px;
}

.search-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-secondary);
}

.search-loading {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-secondary);
}

.search-results:empty::after {
  content: '暂无搜索结果';
  display: block;
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}

.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: flex-end;
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.mobile-menu-content {
  position: relative;
  width: 80%;
  max-width: 320px;
  height: 100%;
  background: var(--bg-primary);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.active .mobile-menu-content {
  transform: translateX(0);
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.mobile-menu-header .logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

.mobile-menu-close {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: var(--transition);
  color: var(--text-secondary);
}

.mobile-menu-close:hover {
  background: var(--bg-secondary);
  color: var(--accent-color);
}

.mobile-menu-close svg {
  width: 24px;
  height: 24px;
}

.mobile-menu-links {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-menu-link {
  display: block;
  padding: 0.875rem 1rem;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 8px;
  transition: var(--transition);
  font-weight: 500;
}

.mobile-menu-link:hover {
  background: var(--bg-secondary);
  color: var(--accent-color);
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .search-modal {
    padding-top: 20px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .search-modal-content {
    width: 100%;
    max-width: 100%;
  }

  .search-results {
    max-height: calc(100vh - 200px);
  }
}

.main {
  padding-top: 100px;
  padding-bottom: 60px;
}

.hero {
  text-align: center;
  padding: 6rem 0 4rem 0;
  position: relative;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-primary) 50%, var(--accent-color) 100%);
  background-clip: text;
  animation: fadeInUp 0.8s ease;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.75rem);
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  animation: fadeInUp 0.8s ease 0.2s both;
  font-weight: 400;
  letter-spacing: 0.01em;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero-divider {
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
  margin: 0 auto 3rem auto;
  border-radius: 2px;
  animation: fadeInUp 0.8s ease 0.4s both;
  opacity: 0.8;
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.posts-section {
  margin-top: 4rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 2.5rem;
  perspective: 1000px;
}

.post-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border-color);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease both;
  backdrop-filter: blur(20px);
}

.post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-color), transparent);
  opacity: 0;
  transition: all 0.4s ease;
}

.post-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(99, 102, 241, 0.06), transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 1;
}

.post-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08), 0 16px 48px rgba(0, 0, 0, 0.12);
  border-color: var(--accent-color);
}

.post-card:hover::before {
  opacity: 1;
  height: 4px;
}

.post-card:hover::after {
  opacity: 1;
}

.post-card-inner {
  position: relative;
  z-index: 2;
}

.post-card .post-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.post-card .post-title a {
  color: var(--text-primary) !important;
  text-decoration: none !important;
  border: none !important;
  transition: all 0.3s ease;
  display: block;
  position: relative;
  padding-left: 1rem;
}

.post-card .post-title a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 0;
  background: linear-gradient(180deg, var(--accent-color), transparent);
  border-radius: 2px;
  transition: height 0.4s ease;
}

.post-card:hover .post-title a::before {
  height: 80%;
}

.post-card .post-title a:hover {
  color: var(--accent-color) !important;
  transform: translateX(4px);
}

.post-title {
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.post-title a {
  color: var(--text-primary) !important;
  text-decoration: none;
  transition: all 0.3s ease;
  display: block;
}

.post-title a:hover {
  color: var(--accent-color) !important;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.post-date {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.post-views {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.post-views svg {
  vertical-align: middle;
}

.post-tag {
  background: var(--bg-secondary);
  color: var(--accent-color);
  border: 1.5px solid var(--accent-color);
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  letter-spacing: 0.02em;
}

.post-tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
  background: var(--accent-color);
  color: white;
}

[data-theme="dark"] .post-tag {
  background: var(--bg-secondary);
  border-color: var(--accent-color);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .post-tag:hover {
  background: linear-gradient(135deg, var(--accent-color), #818cf8);
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.toc-container {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.toc-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.toc-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.toc-toggle:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.toc-toggle svg {
  transition: transform 0.3s ease;
}

.toc-toggle.collapsed svg {
  transform: rotate(-90deg);
}

.toc-content {
  max-height: 500px;
  overflow-y: auto;
  transition: max-height 0.3s ease;
}

.toc-content.collapsed {
  max-height: 0;
  overflow: hidden;
}

.toc-item {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.25rem;
  border-radius: 6px;
  transition: var(--transition);
  font-size: 0.9rem;
  line-height: 1.5;
}

.toc-item:hover {
  background: var(--bg-card);
  color: var(--accent-color);
  transform: translateX(4px);
}

.toc-item.toc-level-2 {
  font-weight: 600;
  color: var(--text-primary);
}

.toc-item.toc-level-3 {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.post-excerpt {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.read-more {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.read-more:hover {
  transform: translateX(4px);
}

.post-layout-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.post-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.posts-sidebar {
  flex: 0 0 200px;
  position: sticky;
  top: 6rem;
  max-height: calc(100vh - 8rem);
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow-y: auto;
}

.post {
  flex: 1;
  min-width: 0;
  max-width: 800px;
}

.toc-container {
  flex: 0 0 200px;
  position: sticky;
  top: 6rem;
  max-height: calc(100vh - 8rem);
  overflow-y: auto;
}

@media (min-width: 1200px) {
  .posts-sidebar,
  .toc-container {
    flex: 0 0 220px;
  }
  
  .post {
    max-width: 900px;
  }
}

@media (min-width: 1600px) {
  .post-layout-container {
    max-width: 1600px;
    padding: 0 2rem;
  }
  
  .post-layout {
    gap: 2rem;
  }
  
  .posts-sidebar,
  .toc-container {
    flex: 0 0 240px;
  }
  
  .post {
    max-width: 1000px;
  }
}

.post-layout.reading-mode .posts-sidebar,
.post-layout.reading-mode .toc-container {
  display: none;
}

.post-layout.reading-mode .post {
  max-width: 900px;
  margin: 0 auto;
}

.posts-sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.posts-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.posts-sidebar-item {
  margin-bottom: 0.5rem;
}

.posts-sidebar-link {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: var(--transition);
  line-height: 1.5;
}

.posts-sidebar-link:hover {
  background: var(--bg-card);
  color: var(--accent-color);
  transform: translateX(4px);
}

.posts-sidebar-link.active {
  color: var(--accent-color);
  font-weight: 700;
  font-size: 1rem;
  border-left: 3px solid var(--accent-color);
  padding-left: 0.5rem;
}

.reading-mode-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent-color) 0%, #818cf8 100%);
  border: none;
  color: white;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.reading-mode-toggle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.reading-mode-toggle:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.4), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.reading-mode-toggle:hover::before {
  opacity: 1;
}

.reading-mode-toggle:active {
  transform: translateY(-2px) scale(0.98);
}

.reading-mode-toggle svg {
  width: 24px;
  height: 24px;
  position: relative;
  z-index: 1;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.reading-mode-toggle.active svg {
  transform: scale(1.2);
}

.reading-mode-toggle.active {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.reading-mode-toggle.active:hover {
  box-shadow: 0 12px 40px rgba(245, 158, 11, 0.4), 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .reading-mode-toggle {
    width: 48px;
    height: 48px;
    bottom: 1.5rem;
    right: 1.5rem;
    border-radius: 12px;
  }
}

.post-layout .toc-container {
  position: sticky;
  top: 2rem;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  margin-bottom: 0;
}

.post-layout .toc-content {
  max-height: none;
  overflow: visible;
}

.post {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 3.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  animation: fadeInUp 0.8s ease;
  position: relative;
  overflow: hidden;
}

.post::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-color), transparent);
  opacity: 0.8;
}

.post-header {
  margin-bottom: 3rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}

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

.post-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-color));
  background-clip: text;
}

.post-content {
  color: var(--text-primary);
  font-size: 1.1rem;
  line-height: 1.9;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  margin-top: 2.8rem;
  margin-bottom: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.post-content h1 {
  font-size: 2.5rem;
  margin-top: 2rem;
}

.post-content h2 {
  font-size: 1.85rem;
  position: relative;
  padding-left: 1rem;
  border-left: 4px solid var(--accent-color);
}

.post-content h3 {
  font-size: 1.45rem;
  position: relative;
  padding-left: 0.8rem;
}

.post-content h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.post-content h5 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.post-content h6 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.post-content p {
  margin-bottom: 1.6rem;
  text-align: justify;
}

.post-content a {
  color: var(--accent-color);
  text-decoration: none;
  border-bottom: 1.5px solid transparent;
  transition: var(--transition);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(99, 102, 241, 0.1));
  padding: 0 0.2rem;
  border-radius: 3px;
}

.post-content a:hover {
  border-bottom-color: var(--accent-color);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.2));
}

.post-content ul,
.post-content ol {
  margin: 1.6rem 0;
  padding-left: 1.8rem;
}

.post-content ul {
  list-style: none;
}

.post-content ul li {
  position: relative;
  padding-left: 1.8rem;
  margin-bottom: 0.8rem;
}

.post-content ul li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent-color);
  font-weight: bold;
  font-size: 1.2em;
  line-height: 1.8;
}

.post-content ol {
  counter-reset: item;
}

.post-content ol li {
  position: relative;
  padding-left: 2.5rem;
  counter-increment: item;
}

.post-content ol li::before {
  content: counter(item) '.';
  position: absolute;
  left: 0;
  color: var(--accent-color);
  font-weight: bold;
  font-size: 1em;
}

.post-content li {
  margin-bottom: 0.75rem;
  line-height: 1.8;
}

.post-content blockquote {
  border-left: 4px solid var(--accent-color);
  padding: 1.2rem 1.5rem;
  margin: 2rem 0;
  background: var(--bg-secondary);
  border-radius: 8px;
  color: var(--text-secondary);
}

.post-content blockquote p {
  margin-bottom: 0;
}

.post-content code {
  background: rgba(99, 102, 241, 0.08);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
  font-size: 0.9em;
  color: var(--accent-color);
}

.post-content pre {
  background: #1e1e1e;
  border-radius: 10px;
  overflow: hidden;
  margin: 2rem 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: relative;
}

.post-content pre[class*='language-'] {
  background: #f8f9fa;
  margin: 2rem 0;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.post-content pre code {
  display: block;
  background: transparent;
  padding: 1.25rem 1.5rem;
  font-size: 0.9rem;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
  line-height: 1.7;
  color: #24292f;
  overflow-x: auto;
  border: none;
  border-radius: 0;
}

[data-theme="dark"] .post-content pre,
[data-theme="dark"] .post-content pre[class*='language-'] {
  background: #0d1117;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .post-content pre code {
  color: #e6edf3;
}

[data-theme="light"] .post-content pre,
[data-theme="light"] .post-content pre[class*='language-'] {
  background: #f8f9fa;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .post-content pre code {
  color: #24292f;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  user-select: none;
}

[data-theme="light"] .code-header {
  background: rgba(0, 0, 0, 0.03);
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .code-header {
  background: rgba(255, 255, 255, 0.05);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.code-lang {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.copy-button {
  background: transparent;
  border: 1px solid var(--text-secondary);
  color: var(--text-secondary);
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.copy-button:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
  transform: translateY(-1px);
}

.copy-button:active {
  transform: translateY(0);
}

.copy-button.copied {
  background: #10b981;
  border-color: #10b981;
  color: white;
}

.code-wrapper {
  position: relative;
  overflow-x: auto;
}

.code-lines {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3.5em;
  background: rgba(0, 0, 0, 0.02);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  padding: 1.25rem 0;
  overflow: hidden;
}

[data-theme="light"] .code-lines {
  background: rgba(0, 0, 0, 0.02);
  border-right-color: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .code-lines {
  background: rgba(255, 255, 255, 0.02);
  border-right-color: rgba(255, 255, 255, 0.08);
}

.code-lines > div {
  text-align: right;
  padding-right: 0.8em;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
  user-select: none;
  opacity: 0.5;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
  color: #6e7781;
  font-style: italic;
}

.token.punctuation {
  color: #57606a;
}

.token.namespace {
  opacity: 0.7;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
  color: #0550ae;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
  color: #0a3069;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
  color: #57606a;
}

.token.atrule,
.token.attr-value,
.token.keyword {
  color: #cf222e;
}

.token.function,
.token.class-name {
  color: #8250df;
}

.token.regex,
.token.important,
.token.variable {
  color: #bf8700;
}

[data-theme="dark"] .token.comment,
[data-theme="dark"] .token.prolog,
[data-theme="dark"] .token.doctype,
[data-theme="dark"] .token.cdata {
  color: #6a9955;
  font-style: italic;
}

[data-theme="dark"] .token.punctuation {
  color: #d4d4d4;
}

[data-theme="dark"] .token.property,
[data-theme="dark"] .token.tag,
[data-theme="dark"] .token.boolean,
[data-theme="dark"] .token.number,
[data-theme="dark"] .token.constant,
[data-theme="dark"] .token.symbol,
[data-theme="dark"] .token.deleted {
  color: #b5cea8;
}

[data-theme="dark"] .token.selector,
[data-theme="dark"] .token.attr-name,
[data-theme="dark"] .token.string,
[data-theme="dark"] .token.char,
[data-theme="dark"] .token.builtin,
[data-theme="dark"] .token.inserted {
  color: #ce9178;
}

[data-theme="dark"] .token.operator,
[data-theme="dark"] .token.entity,
[data-theme="dark"] .token.url,
[data-theme="dark"] .language-css .token.string,
[data-theme="dark"] .style .token.string {
  color: #d4d4d4;
}

[data-theme="dark"] .token.atrule,
[data-theme="dark"] .token.attr-value,
[data-theme="dark"] .token.keyword {
  color: #569cd6;
}

[data-theme="dark"] .token.function,
[data-theme="dark"] .token.class-name {
  color: #dcdcaa;
}

[data-theme="dark"] .token.regex,
[data-theme="dark"] .token.important,
[data-theme="dark"] .token.variable {
  color: #d16969;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 2rem 0;
  box-shadow: var(--shadow-md);
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  border-radius: 8px;
  overflow: hidden;
}

.post-content th,
.post-content td {
  padding: 0.875rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.post-content th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
}

.post-content tr:hover td {
  background: var(--bg-secondary);
}

.post-content tbody tr:last-child td {
  border-bottom: none;
}

.post-content strong {
  font-weight: 700;
  color: var(--text-primary);
}

.post-content em {
  font-style: italic;
  color: var(--text-primary);
}

.post-content hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
  margin: 3rem 0;
  opacity: 0.5;
}

.page-title {
  max-width: 800px;
  margin: 0 auto;
  font-size: 3rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 3rem;
  background: linear-gradient(135deg, var(--text-primary), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.archive-month {
  margin-bottom: 3rem;
}

.archive-month-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.archive-month-title::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent-color);
  border-radius: 50%;
}

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

.archive-item {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.archive-item:hover {
  background: var(--bg-secondary);
  padding-left: 1rem;
  padding-right: 1rem;
  margin-left: -1rem;
  margin-right: -1rem;
  border-radius: 8px;
}

.archive-date {
  color: var(--text-secondary);
  font-size: 0.9rem;
  min-width: 120px;
}

.archive-title {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  flex: 1;
  transition: var(--transition);
}

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

.page-description {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.125rem;
  margin-bottom: 3rem;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 4rem;
}

.tag-cloud-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
  font-weight: 500;
}

.tag-cloud-item:hover {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tag-count {
  font-size: 0.75rem;
  background: var(--accent-color);
  color: white;
  padding: 0.125rem 0.5rem;
  border-radius: 10px;
  font-weight: 600;
}

.tag-cloud-item:hover .tag-count {
  background: white;
  color: var(--accent-color);
}

@media (max-width: 768px) {
  .tag-cloud {
    gap: 0.75rem;
  }

  .tag-cloud-item {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
  }

  .page-title {
    font-size: 2rem;
    margin-bottom: 2rem;
  }

  .page-description {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .toc-container {
    padding: 1rem;
  }

  .toc-title {
    font-size: 0.9rem;
  }

  .toc-item {
    padding: 0.375rem 0.5rem;
    font-size: 0.85rem;
  }

  .post-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .posts-sidebar {
    display: none;
  }

  .post-layout .toc-container {
    position: static;
    max-height: none;
  }

  .post-layout .toc-content {
    max-height: none;
  }
}

.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-secondary);
  margin-top: 4rem;
}

.footer-links {
  margin-top: 0.5rem;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: #818cf8;
}

.footer-links a svg {
  vertical-align: middle;
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.2rem;
  }
  
  .posts-grid {
    grid-template-columns: 1fr;
  }
  
  .post {
    padding: 2rem 1.5rem;
  }
  
  .post-title {
    font-size: 2rem;
  }
  
  .post-content h1 {
    font-size: 2rem;
  }
  
  .post-content h2 {
    font-size: 1.5rem;
  }
  
  .nav-links {
    display: none;
  }
  
  .archive-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}



.task-list-item {
  list-style: none;
  margin-left: -1.5rem;
  padding-left: 1.5rem;
  position: relative;
}

.task-list-item input[type="checkbox"] {
  margin-right: 0.5rem;
  accent-color: var(--accent-color);
  width: 18px;
  height: 18px;
}

.task-list-item.checked {
  opacity: 0.6;
  text-decoration: line-through;
}

.headerlink {
  opacity: 0;
  margin-left: 0.5rem;
  color: var(--accent-color);
  text-decoration: none;
  transition: opacity 0.3s ease;
}

h2:hover .headerlink,
h3:hover .headerlink,
h4:hover .headerlink,
h5:hover .headerlink,
h6:hover .headerlink {
  opacity: 1;
}

.comments-section {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border-color);
}

.comments-container {
  max-width: 800px;
  margin: 0 auto;
}

.comments-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  text-align: center;
}

.giscus-wrapper {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
  .comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
  }

  .comments-title {
    font-size: 1.25rem;
  }
}

.related-posts {
  max-width: 800px;
  margin: 3rem auto 0;
  padding: 2rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.related-posts-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.related-posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-posts-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.related-posts-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.related-posts-item:hover {
  background: var(--bg-primary);
  margin: 0 -1rem;
  padding: 1rem;
  border-radius: 8px;
}

.related-posts-link {
  display: block;
  text-decoration: none;
  color: var(--text-primary);
}

.related-posts-item-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.related-posts-item:hover .related-posts-item-title {
  color: var(--primary-color);
}

.related-posts-item-date {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: block;
}

@media (max-width: 768px) {
  .related-posts {
    margin: 2rem 0 0;
    padding: 1.5rem;
  }

  .related-posts-title {
    font-size: 1.125rem;
  }

  .related-posts-item-title {
    font-size: 0.9375rem;
  }

  .giscus-wrapper {
    padding: 1rem;
  }
}

.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 3.5rem;
  height: 3.5rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(1rem);
  transition: all 0.3s ease;
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-color);
  box-shadow: var(--shadow-lg);
  transform: translateY(-0.25rem);
}

.back-to-top:active {
  transform: translateY(0);
}

.back-to-top svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke-width: 2.5;
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3rem;
    height: 3rem;
  }
}

.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), #818cf8);
  width: 0;
  transition: width 0.1s linear;
  z-index: 9999;
}

@media (max-width: 768px) {
  .reading-progress-bar {
    height: 3px;
  }
}
