/* ===== 基础设置 ===== */
* {
  box-sizing: border-box;
}
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background: #f3f3f3;   /* 全站浅灰底色 */
  color: #111;
}

/* ===== 左侧栏 ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 200px;
  padding: 20px;
  background: #f3f3f3;   /* 左栏同底色 */
  border-right: 1px solid #ccc; /* 分割线 */
}

.brand {
  display: block;
  margin-bottom: 15px;
  font-weight: bold;
  text-decoration: none;
  color: #111;
}

/* 左侧普通导航 (about) */
.sidebar nav {
  margin-top: 16px;
}
.sidebar nav a {
  display: block;
  padding: 4px 0;
  color: #111;
  text-decoration: none;
}
.sidebar nav a:hover {
  text-decoration: underline;
}

/* ===== 目录 (toc-sidebar) ===== */
.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc-list li {
  font-size: 14px;     /* 字号 */
  line-height: 1.2em;  /* 行距紧凑 */
  margin: 0;
  padding: 2px 0;
}
.toc-list .year {
  margin-top: 8px;
  font-weight: bold;
  font-size: 12px;
  color: #555;
}
.toc-list a {
  color: #000;
  text-decoration: none;
}
.toc-list a:hover {
  text-decoration: underline;
}
.toc-list a.is-active {
  font-weight: bold;
  text-decoration: underline;
}

/* ===== 右侧内容区 ===== */
.content {
  margin-left: 200px;   /* 给左侧栏留出空间 */
  padding: 30px;
  min-height: 100vh;
}

/* ===== 卡片样式 ===== */
.card {
  display: block;
  background: #fff;         /* 白底 */
  border: 1px solid #888;   /* 深灰边框 */
  border-radius: 6px;
  margin: 20px auto;
  max-width: 800px;         /* 控制宽度 */
  text-decoration: none;
  color: #111;
  overflow: hidden;
}
.card img {
  display: block;
  width: 100%;
  height: auto;
}
.card h3 {
  font-size: 18px;
  font-weight: bold;
  margin: 12px 16px 4px;
}
.card p {
  margin: 0 16px 12px;
  font-size: 14px;
  color: #555;
}

.content .content-inner {
  display: flex;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

/* 左中两列（你已有样式的补充，确保可被挤压） */
.works { flex: 1 1 auto; min-width: 0; }
.toc   { flex: 0 0 220px; }

/* === 第三列：详情面板（默认隐藏） === */
.detail-panel {
  display: none;             /* 关闭状态 */
  flex: 0 0 360px;           /* 固定宽度，出现时会挤压中列 */
  background: #fff;
  border: 1px solid #888;
  border-radius: 6px;
  position: relative;
  overflow: auto;
  max-height: calc(100vh - 60px); /* 防止过高溢出 */
  align-self: flex-start;    /* 贴近上边 */
}

.detail-panel.open {         /* 打开状态 */
  display: block;
}

.detail-wrap { padding: 16px; }
.detail-title { margin: 8px 0 6px; font-size: 18px; font-weight: bold; }
.detail-meta  { margin: 0 0 10px; color: #555; font-size: 14px; }
.detail-body  { font-size: 14px; line-height: 1.6; }

/* 右上角关闭按钮 */
.detail-close {
  position: absolute;
  top: 6px; right: 8px;
  width: 28px; height: 28px;
  line-height: 26px;
  border: 1px solid #bbb;
  background: #fafafa;
  border-radius: 14px;
  cursor: pointer;
  font-size: 18px;
}
.detail-close:hover { background: #f0f0f0; }

/* 窄屏：面板改为覆盖式抽屉，不再挤压中列 */
@media (max-width: 1000px){
  .detail-panel {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: 92vw;
    max-height: none;
    z-index: 999;
    box-shadow: -8px 0 20px rgba(0,0,0,.15);
    border-radius: 0;
  }
  .detail-wrap { padding: 18px; }
}
