/* /blog/article-page.css */

:root {
  --bg-card: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --link-color: #007bff;
  --link-hover-color: #0056b3;
  --border-color: #dddddd;
  --error-color: #d32f2f;
}

[data-theme="dark"] {
  --bg-card: #1e1e1e;
  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;
  --link-color: #6ec1e4;
  --link-hover-color: #4fc3f7;
  --border-color: #444444;
  --error-color: #f44336;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  position: relative;
  color: var(--text-primary);
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  z-index: -1;
}

#theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  z-index: 100;
}

[data-theme="dark"] #theme-toggle {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.page-layout {
  max-width: 1400px;
  margin: 60px auto 40px;
  padding: 20px;
  display: flex;
  gap: 30px;
  position: relative;
  z-index: 1;
}

.main-content {
  flex: 1;
  background: rgba(255, 255, 255, 0.70); /* 半透明白色 */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); /* Safari 兼容 */
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 32px;
  color: var(--text-primary);
  margin-left: 40px;
}

[data-theme="dark"] .main-content {
  background: rgba(30, 30, 30, 0.85); /* 半透明深灰 */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-primary);
}

.article-title {
  font-size: 28px;
  font-weight: bold;
  text-align: center;
  margin: 0 0 24px;
}

.article-content h1,
.article-content h2,
.article-content h3 {
  margin: 24px 0 16px;
  color: var(--text-primary);
}

.article-content p,
.article-content li {
  line-height: 1.8;
  margin: 12px 0;
  color: var(--text-primary);
}

.article-content pre {
  background: var(--bg-card) !important;
  border-radius: 8px;
  padding: 16px !important;
  overflow-x: auto;
  margin: 16px 0;
  color: var(--text-primary);
}

.article-content blockquote {
  background: rgba(0, 0, 0, 0.05);
  border-left: 4px solid var(--link-color);
  padding: 12px 16px;
  margin: 20px 0;
  font-style: italic;
  color: var(--text-secondary);
}

[data-theme="dark"] .article-content blockquote {
  background: rgba(255, 255, 255, 0.05);
}

.back-link {
  display: inline-block;
  margin-top: 24px;
  color: var(--link-color);
  text-decoration: none;
  font-weight: bold;
}

.back-link:hover {
  text-decoration: underline;
  color: var(--link-hover-color);
}

#dynamic-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: relative;
  left: -40px;
  z-index: 2;
}
.home-link {
  display: inline-block;
  padding: 10px 24px;
  background-color: #007bff;
  color: white;
  text-decoration: none;
  /* 关键：去掉下划线 */
  border-radius: 8px;
  font-weight: 500;
  transition:
    background-color 0.2s,
    transform 0.2s;
  box-shadow: 0 2px 6px rgba(0, 123, 255, 0.3);
}

.home-link:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.4);
}

/* 📱 移动端响应式 */
@media (max-width: 900px) {
  .page-layout {
    flex-direction: column;
    padding: 0 15px;
  }

  #dynamic-sidebar {
    order: 1;
    width: 100% !important;
    max-width: 320px;
    margin: 0 auto 24px !important;
    left: 0 !important;
    position: static !important;
    padding: 20px;
    background: var(--bg-card); /* 侧边栏保持不透明，按你要求 */
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }

  .main-content {
    order: 2;
    margin-left: 0 !important;
    padding: 20px 16px !important;
    min-height: calc(100vh - 120px);
    /* 👇 关键：添加半透明背景 + 毛玻璃 */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  /* 深色模式下的移动端主内容区 */
  [data-theme="dark"] .main-content {
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .design-credit {
    font-size: 14px;
    padding: 12px 16px;
    margin: 24px 0;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
  }

  [data-theme="dark"] .design-credit {
    background: rgba(255, 255, 255, 0.03);
  }
}

.design-credit {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  margin: 24px 0;
  opacity: 0.85;
  line-height: 1.4;
}

