/* /public/shared-layout.css */
:root {
  --bg-card: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --link-color: #007bff;
  --link-hover-color: #0056b3;
  --border-color: #dddddd;
  --button-bg: #f0f0f0;
  --button-text: #333;
}

[data-theme="dark"] {
  --bg-card: #1e1e1e;
  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;
  --link-color: #6ec1e4;
  --link-hover-color: #4fc3f7;
  --border-color: #444444;
  --button-bg: #2a2a2a;
  --button-text: #ddd;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  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;
}

.page-layout {
  max-width: 1400px;
  margin: 60px auto 40px;
  padding: 0 20px;
  display: flex;
  gap: 30px;
  position: relative;
  z-index: 1;
}

#dynamic-sidebar {
  width: 280px;
  position: relative;
  left: -40px;
}

.main-content {
  flex: 1;
  background: rgba(255, 255, 255, 0.75); /* 浅色模式：白色 85% 不透明 */
  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);
}

.back-home,
.back-link {
  display: inline-block;
  margin-bottom: 20px;
  padding: 8px 16px;
  background: var(--button-bg);
  color: var(--button-text);
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  transition: all 0.2s;
}

.back-home:hover,
.back-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.post-list {
  list-style: none;
  padding-left: 0;
}

.post-item {
  padding: 12px 0;
  border-bottom: 1px dashed var(--border-color);
}

.post-item:last-child {
  border-bottom: none;
}

.post-item a {
  color: var(--link-color);
  text-decoration: none;
  font-size: 16px;
}

.post-item a:hover {
  color: var(--link-hover-color);
  text-decoration: underline;
}

#theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.7);
  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;
}

[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);
}

.design-credit {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  margin: 32px 0 0;
  opacity: 0.85;
  line-height: 1.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;
    padding: 20px 16px; /* 调整内边距以适应移动设备 */
    min-height: calc(100vh - 120px);
    background: rgba(255, 255, 255, 0.85); /* 浅色模式：白色 85% 不透明 */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); /* Safari 兼容 */
  }

  [data-theme="dark"] .main-content {
    background: rgba(30, 30, 30, 0.85); /* 深灰 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);
  }
}
