/* ========================================= */
/* 1. 全局变量与重置 (Variables & Reset) */
/* ========================================= */
:root {
  --fz-h1: 40px;
  --fz-desc: 16px;
  --fz-head-sub: 13px;
  --fz-index-tags: 13px;
  --fz-button: 14px;
  --fz-card-title: 15px;
  --fz-card-meta: 12px;
  --fz-table-title: 15px;
  --fz-d-h1: 32px;
  --fz-bread: 18px;
  --fz-btn-down: 18px;
  --fz-article: 16px;
  --fz-d-table: 16px;

  --bg-color: #ffffff;
  --gray-bg: #f7f7f5;
  --border-color: #495057;
  --text-main: #37352f;
  --text-light: #787774;
  --primary-color: #4ccadb;
  --hover-bg: #efefef;
  --script-icon-bg: #9aaecb;
  --black: #000000;
  --shadow-offset: 4px;

  --md-pink: #f06595;

}

* {
  box-sizing: border-box;

  input,
  button,
  select,
  textarea {
    font-family: inherit;
  }
}

/* style.css - 找到 1. 全局变量与重置 */

/* 保持 html 锁定，防止浏览器原生的双滚动条 */
/* style.css */

/* 1. 先设置所有页面的默认状态（恢复正常网页的滚动能力） */
html {
  margin: 0;
  padding: 0;
  /* 移除 overflow: hidden 和 height: 100vh，让普通页面能正常滚动 */
  height: auto;
  overflow: auto;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-color);
  margin: 0;
  padding: 0;
  /* 默认让 body 自动撑开 */
  height: auto;
  display: block;
  position: relative;
}

/* 2. 【关键】只针对加了 "app-lock" 的页面（比如主页）开启 App 模式 */
html.app-lock {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  /* 只锁住主页 */
}

/* 配合 html.app-lock 的 body 样式 */
html.app-lock body {
  height: 100vh;
  width: 100vw;
  overflow: auto;
  /* 让主页的滚动条出现在 body 上 */
}

a {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

/* ========================================= */
/* 2. 顶部导航栏 (Navbar) */
/* ========================================= */
/* style.css - 找到 .navbar */

.navbar {
  /* 移除 flex-shrink 等之前的布局属性 */
  padding: 10px 10px;
  border-bottom: 2px solid var(--border-color);
  background: #fff;
  z-index: 1000;
  /* 提高层级，防止被内容遮盖 */
  text-align: center;

  /* 【关键修改】 */
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;

  /* 让 Navbar 在竖向滚动时随文档流移动（默认行为），
     但在横向滚动时，始终吸附在左侧，保证不被滚出屏幕 
  */
  position: sticky;
  left: 0;
  /* 确保背景色遮挡下面的内容 */
  background: #fff;
}

.navbar h1 {
  margin: 0;
  font-size: var(--fz-h1);
  display: flex;
  align-items: end;
  font-weight: bold;
  gap: 5px;
  justify-content: center;
  width: 100%;
}

.header-logo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s ease;
  transform-origin: center center;
}

.header-logo:hover {
  transform: scale(1.15) rotate(15deg);
  border-color: #f06595;
  cursor: pointer;
}

.navbar p {
  margin: 0px 0 40px 0;
  max-width: 600px;
  line-height: 1.5;
}

.controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  width: 90%;
  flex-wrap: wrap;
  gap: 10px;
}

.my-link{
display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 12px;
  object-fit: cover;
  margin-bottom:80px;
}
.my-link-logo {
  height: 20px;
  width: 20px;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s ease;
  transform-origin: center center;
}
.my-link-logo:hover {
  transform: scale(1.3) rotate(-10deg);
  cursor: pointer;
}

/* 按钮样式 */
.view-switcher button {
  background: #fff;
  border: 2px solid var(--border-color);
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 6px;
  color: var(--text-main);
  font-size: var(--fz-button);
  font-weight: 500;
  margin: 4px;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  white-space: nowrap;
}

.view-switcher button:hover {
  border-color: var(--black);
  transform: translate(-3px, -3px);
  box-shadow: 3px 3px 0px 0px var(--black);
}

.view-switcher button.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--black);
  box-shadow: 2px 2px 0px 0px var(--black);
  transform: translate(-1px, -1px);
}

/* 搜索框 */
#search-input {
  padding: 8px 12px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  width: 240px;
  font-size: var(--fz-button);
  outline: none;
  transition: all 0.2s ease;
}

#search-input:focus {
  border-color: var(--black);
  transform: translate(-3px, -3px);
  box-shadow: 3px 3px 0px 0px rgba(0, 0, 0, 0.8);
}

/* 筛选与排序工具栏样式 */
.filter-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  margin-right: 10px;
  flex-grow: 0;
}

.notion-select {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  background-color: #fff;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  padding: 6px 30px 6px 12px;
  font-size: var(--fz-button);
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  outline: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
}

.notion-select:hover {
  border-color: var(--black);
  transform: translate(-3px, -3px);
  box-shadow: 3px 3px 0px 0px var(--black);
}

.notion-select:focus {
  border-color: var(--primary-color);
}

@media (max-width: 800px) {
  #search-input {
    width: 100%;
    order: 3;
  }

  .filter-toolbar {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
    margin-right: 0;
  }

  .notion-select {
    flex-grow: 1;
  }
}

/* ========================================= */
/* 【新增】主内容区域 (App Container) */
/* ========================================= */
/* style.css - 找到 #app-container */

#app-container {
  width: 100%;
  height: auto;
  overflow: visible;
  /* 内容自然撑开 */
  position: relative;
}

/* ========================================= */
/* 3. 看板视图 (Board View) */
/* ========================================= */

.board-view {
  display: flex;
  min-width: 100%;
  width: fit-content;
  height: auto;
  padding: 20px 0 30px 20px;
  gap: 20px;
  align-items: flex-start;
  box-sizing: border-box;
}

.board-view::after {
  content: "";
  display: block;
  width: 20px;
  flex-shrink: 0;
  height: 1px;
}

.board-column {
  min-width: 280px;
  width: 280px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.column-header {
  font-weight: 500;
  margin-bottom: 12px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fz-card-title);
  color: var(--text-main);
}

.column-count {
  background: #eee;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: var(--fz-card-meta);
  color: #555;
}

.board-card {
  background: #fff;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  display: block;
  /* transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1); */
  transition: all 0.2s ease;
  box-shadow: 0 0 0 0 var(--black);
}

.board-card:hover {
  /* border-color: var(--black) ; */
  transform: translate(-5px, -5px);
  box-shadow: 5px 5px 0px 0px var(--black);
  z-index: 10;
}

.board-card:hover .card-title {
  font-size: 1.1em;
  /* padding-left: 5px; */

}

.card-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.card-icon img,
.card-icon svg {
  width: 24px;
  height: 24px;
  object-fit: contain;
  background-color: var(--script-icon-bg);
  border: 1px solid var(--script-icon-bg);
  border-radius: 4px;
  padding: 2px;
}

.card-title {
  font-weight: bold;
  font-size: var(--fz-card-title);
  line-height: 1.4;
  color: #333;
  transition: all 0.2s ease;
}

.card-meta {
  font-size: var(--fz-card-meta);
  color: var(--text-light);
  display: flex;
  gap: 10px;
  padding-left: 36px;
}

/* 颜色侧边栏 */
.color-red {
  border-left: 5px solid #ff6b6b ;
  background: #fffcfc;
}

.color-red:hover {
  background: #ffebeb;
}

.color-blue {
  border-left: 5px solid #2eaadc ;
  background: #f8fbff;
}

.color-blue:hover {
  background: #e6f4ff;
}

.color-green {
  border-left: 5px solid #45b649 ;
  background: #fafffa;
}

.color-green:hover {
  background: #eaffea;
}

.color-purple {
  border-left: 5px solid #9d4edd ;
  background: #fdfaff;
}

.color-purple:hover {
  background: #f5e6ff;
}

.color-orange {
  border-left: 5px solid #ff9f1c ;
  background: #fffdf8;
}

.color-orange:hover {
  background: #fff0d4;
}

.color-gray {
  border-left: 5px solid #b0b0b0 ;
  background: #f9f9f9;
}

.color-gray:hover {
  background: #eeeeee;
}

.color-teal {
  border-left: 5px solid #20c997 ;
  background: #f0fff9;
}

.color-teal:hover {
  background: #e5ffef;
}

.color-pink {
  border-left: 5px solid #f06595 ;
  background: #fffcfc;
}

.color-pink:hover {
  background: #ffebeb;
}

.color-indigo {
  border-left: 5px solid #5c7cfa ;
  background: #f8f9ff;
}

.color-indigo:hover {
  background: #e6e9ff;
}

.color-lime {
  border-left: 5px solid #94d82d ;
  background: #f5fff8;
}

.color-lime:hover {
  background: #e5ffe6;
}

.color-yellow {
  border-left: 5px solid #ffc40d ;
  background: #fffdf0;
}

.color-yellow:hover {
  background: #fff8d4;
}

/* ========================================= */
/* 4. 表格视图 (Table View) */
/* ========================================= */
.table-mode-container {
  width: 100%;
  /* 【修改】去掉 overflow-x，让父容器处理滚动 */
  padding-bottom: 20px;
  justify-content: center;
  display: flex;
}

.table-view {
  width: 100%;
  min-width: 900px;
  /* 保持最小宽度以触发横向滚动 */
  margin-left: 50px;
  margin-right: 50px;
  border-collapse: separate;
  border-spacing: 0 8px;
  white-space: nowrap;
  table-layout: fixed;
}

.table-view th {
  text-align: left;
  color: var(--text-light);
  font-weight: 500;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-color);
}

.table-view tbody tr {
  background: #f8f9fa;
  transition: all 0.2s ease;
  cursor: pointer;
}

.table-view tbody tr:nth-child(odd) {
  background-color: #fff;
}

.table-view td {
  padding: 16px;
  border-top: 2px solid var(--border-color);
  border-bottom: 2px solid var(--border-color);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  /* 超出显示省略号 */
  white-space: nowrap;
  /* 强制不换行 */
}

.table-view td:first-child {
  border-left: 2px solid var(--border-color);
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

.table-view td:last-child {
  border-right: 2px solid var(--border-color);
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  text-align: right;
}

.table-view tbody tr:hover td {
  border-color: var(--black);
  background-color: #fff;
}

.table-view tbody tr:hover {
  transform: translate(-3px, -3px);
  box-shadow: 4px 4px 0px 0px var(--black);
  z-index: 10;
  position: relative;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  border-bottom-left-radius: 8px;
}

.table-icon img,
.table-icon svg {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  margin-right: 8px;
  background-color: var(--script-icon-bg);
  border-radius: 4px;
  border: 1px solid var(--script-icon-bg);
  
}

.table-view tbody tr:hover .row-title {
  font-size: 1.1em;
  padding-left: 5px;
  
}

.row-title {
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-block;
  white-space: nowrap;
}

/* ========================================= */
/* 5. 详情页 (Detail Page) */
/* ========================================= */
.detail-container {
  margin: 20px auto;
  padding: 0 40px;
  min-width: 500px;
}

.content {
  max-width: 55%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.breadcrumb {
  padding: 10px 0;
  margin-bottom: 60px;
  color: var(--text-light);
  font-size: var(--fz-bread);
  display: flex;
  align-items: end;

  /* 【修改】确保在滚动容器顶部吸附 */
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #fff;
  border-bottom: 2px solid var(--border-color);
}

.detail-header {
  display: flex;
  align-items: end;
  gap: 20px;
  padding-top: 40px;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.xiangxishuoming {
  font-size: 22px;
  font-weight: 500;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 10px;
}

.detail-icon img,
.detail-icon svg {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: var(--script-icon-bg);
  border: 2px solid var(--black);
  border-radius: 12px;
  box-shadow: 4px 4px 0px 0px var(--black);
  padding: 8px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.detail-icon img:hover,
.detail-icon svg:hover {
  transform: scale(1.2) rotate(-5deg);
  box-shadow: 6px 6px 0px 0px var(--black);
  /* cursor: grab;*/
 }

.detail-icon img:active {
  cursor: grabbing;
}

.detail-title {
  font-size: var(--fz-d-h1);
  font-weight: 800;
  margin: 0;
}

.prop-table {
  width: 100%;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 20px;
  white-space: nowrap;
  font-size: var(--fz-d-table);
}

.prop-row {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  height: 48px;
  align-items: center;
  background-color: #f8f9fa;
}

.prop-row:last-child {
  border-bottom: none;

}

.prop-row:nth-child(odd) {
  background-color: #fff;

}

.prop-key {
  width: 160px;
  color: var(--text-light);
  padding-left: 16px;
  padding-top: 10px;
  padding-bottom: 10px;
  border-right: 2px solid var(--border-color);
  font-weight: 500;
  flex-shrink: 0;
}

.prop-val {
  flex: 1;
  color: var(--text-main);
  padding-left: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.btn-download {
  display: inline-block;
  background: var(--primary-color);
  color: #fff;
  padding: 14px 32px;
  border-radius: 6px;
  font-weight: 700;
  font-size: var(--fz-btn-down);
  text-align: center;
  border: 2px solid var(--border-color);
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  white-space: nowrap;
  overflow: hidden;
  margin: 20px 0 40px 0;
}

.btn-download:hover {
  transform: translate(-3px, -3px);
  box-shadow: 6px 6px 0px 0px var(--black);

}

.btn-download:active {
  transform: translate(0, 0);
  box-shadow: 0 0 0 0 var(--black);
  
}

.btn-disabled {
  background: #ccc;
  cursor: not-allowed;
  border-color: #999;
  box-shadow: none ;
  transform: none ;
}

/* ========================================= */
/* 6. Markdown 内容样式 */
/* ========================================= */
/* === 引用块 === */
.content-area blockquote {
  border: 2px solid var(--border-color);
  border-left: 6px solid #f7ac7a;
  background: rgba(173, 228, 129, 0.2) ;
  padding: 14px 18px;
  margin: 16px 0;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
  box-shadow: 0 3px 0 0 var(--border-color);
  animation: slideIn 0.5s ease-out;
}

/* === 列表 === */
.content-area ul li::marker {
  color: var(--primary-color);
  font-size: 1.5em;
}

.content-area ol li::marker {
  color: var(--primary-color);
}

.content-area li {
  margin: 10px 0;
}

/* === 链接和强调文本 === */
.content-area a {
  color: #f7ac7a;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  display: inline-block;
}

.content-area a:hover {
  color: #fff;
  border-bottom-color: #faa2c1;
  transform: translateY(-3px);
}

.content-area strong,
.content-area b {
  font-weight: 500;
  background-color: #ffdeeb;
  padding: 3px 8px;
  margin: 0 3px;
}

.content-area em,
.content-area i {
  font-style: italic;
  color: #4dabf7;
  font-weight: 500;
}

/* === 分割线 === */
.content-area hr {
  border-bottom: 3px dashed var(--border-color);
  border-top: 2px dashed transparent;
  transform: scaleX(0.9);
  margin: 30px 0;
}

/* === 图片 === */
.content-area img {
  border: 2px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 0 0 var(--border-color);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  animation: fadeIn 0.6s ease-out;
}

.content-area img:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 0 0 var(--border-color);
  transform: translateY(-5px);
}

.content-area h1 {
  font-size: 1.5em;
  font-weight: 500;
  color: var(--black);
  border-left: 6px solid var(--md-pink);
  width: max-content;
  padding: 0px 12px;
  margin: 15px 0px;
  text-align: left;
}

.content-area h2 {
  font-size: 1.4em;
  font-weight: 500;
  color: var(--black);
  border-left: 6px solid var(--md-pink);
  width: max-content;
  padding: 0px 12px;
  margin: 10px 0px;
  text-align: left;
}

.content-area h3 {
  font-size: 1.3em;
  font-weight: 500;
  color: var(--black);
  border-left: 6px solid var(--md-pink);
  width: max-content;
  padding: 0px 12px;
  margin: 10px 0px;
  text-align: left;
}

.content-area h4 {
  font-size: 1.2em;
  font-weight: 500;
  color: var(--black);
  border-left: 6px solid var(--md-pink);
  width: max-content;
  padding: 0px 12px;
  margin: 10px 0px;
  text-align: left;
}

.content-area h5 {
  font-size: 1.1em;
  font-weight: 500;
  color: var(--black);
  border-left: 6px solid var(--md-pink);
  width: max-content;
  padding: 0px 12px;
  margin: 10px 0px;
  text-align: left;
}

.content-area h6 {
  font-size: 1em;
  font-weight: 500;
  color: var(--black);
  border-left: 6px solid var(--md-pink);
  width: max-content;
  padding: 0px 12px;
  margin: 10px 0px;
  text-align: left;
}

.content-area p {
  line-height: 1.8;
  margin: 12px 0;
}

/* ========================================= */
/* 7. 标签系统 (Tag System) */
/* ========================================= */
.tag-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: var(--fz-index-tags);
  font-weight: 500;
  border: 1px solid transparent;
  line-height: 1.4;
  white-space: nowrap;
}

.tag-blue {
  background-color: #e7f5ff;
  color: #1971c2;
  border-color: #d0ebff;
}

.tag-purple {
  background-color: #f3f0ff;
  color: #6741d9;
  border-color: #e5dbff;
}

.tag-green {
  background-color: #e6fcf5;
  color: #0ca678;
  border-color: #c3fae8;
}

.tag-orange {
  background-color: #fff4e6;
  color: #e8590c;
  border-color: #ffe8cc;
}

.tag-gray {
  background-color: #f8f9fa;
  color: #495057;
  border-color: #dee2e6;
}

.prop-val a.tag-badge:hover {
  transform: translateY(-2px);
  box-shadow: 2px 2px 0px 0px var(--black);
  transition: all 0.2s ease;
  border-color: rgba(0, 0, 0, 0.4);
}

/* ========================================= */
/* 8. 顶部标题与链接优化 */
/* ========================================= */
.top-announcement {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin: 0px 0px 10px 0;
  padding-bottom: 15px;
}

.header-main-title {
  text-decoration: none;
  color: #333;
  font-weight: bold;
  border-bottom: 2px solid transparent;
  display: inline-block;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  transform-origin: center bottom;
}

.header-main-title:hover {
  color: #f06595;
  border-bottom-color: #f06595;
  transform: scale(1.08);
}

.header-desc-container {
  color: var(--text-light);
  font-size: var(--fz-desc);
  font-weight: 500;
  margin: 10px 0 10px 0;
  text-align: center;
}

.header-sub-link {
  display: inline-block;
  padding: 4px 10px;
  margin-right: 10px;
  margin-left: 0;
  background-color: #fff4e6;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: #555;
  font-size: var(--fz-head-sub);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  white-space: nowrap;
}

.header-sub-link:hover {
  border-color: var(--black);
  color: var(--black);
  transform: translate(-3px, -3px);
  box-shadow: 3px 3px 0px 0px var(--black);
  background-color: #ffe8cc;
}

/* ========================================= */
/* 9. 交互细节 */
/* ========================================= */
.breadcrumb {
  white-space: nowrap;
}

.breadcrumb-home-icon {
  width: 34px;
  height: 34px;
  border: 2px solid #687078;
  border-radius: 50%;
  margin-right: 10px;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s ease;
}

.breadcrumb-home-icon:hover {
  transform: rotate(20deg) scale(1.3);
  border-color: #f06595;
  cursor: pointer;
}

.breadcrumb-link {
  margin-left: 15px;
  padding: 0 0px;
  text-decoration: none;
  color: inherit;
  font-weight: normal;
  transition: all 0.2s ease;
  display: flex;
  align-items: end;
  position: sticky;
}

.breadcrumb-link:hover {
  color: #f06595;
  font-weight: bold;
  padding: 0 10px;
  text-decoration: none;
  border-bottom: 2px solid #f06595;
  font-size: 1.1em;
}

/* ========================================= */
/* 10. 文章目录布局 (Table of Contents) */
/* ========================================= */
.article-layout {
  display: flex;
  gap: 50px;
  align-items: stretch;
  margin-top: 30px;
  position: relative;
}

.content-area {
  flex: 1;
  min-width: 0;
}

.toc-container {
  width: 240px;
  flex-shrink: 0;
  display: none;
}

.toc-sticky-box {
  position: sticky;
  top: 100px;
  background: #fff;
  border: none;
  border-left: 2px solid #eee;
  border-radius: 0;
  padding: 10px 0 10px 20px;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.toc-title {
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 15px;
  font-weight: 900;
  color: #333;
  padding-bottom: 0;
  border-bottom: none;
  word-wrap: break-word;
  word-break: break-word;
}

.toc-link {
  display: block;
  color: var(--text-light);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.5;
  transition: all 0.2s;
}

.toc-link:hover {
  color: #f06595;
  transform: translateX(3px);
}

.toc-h1 {
  margin-left: 0;
  font-weight: bold;
}

.toc-h2 {
  margin-left: 10px;
}

.toc-h3 {
  margin-left: 20px;
  font-size: 12px;
  opacity: 0.8;
}

.toc-h4 {
  margin-left: 30px;
  font-size: 12px;
  opacity: 0.8;
}

.toc-h5 {
  margin-left: 40px;
  font-size: 12px;
  opacity: 0.7;
}

.toc-h6 {
  margin-left: 50px;
  font-size: 12px;
  opacity: 0.6;
}

@media (max-width: 800px) {
  .article-layout {
    flex-direction: column-reverse;
    gap: 20px;
  }

  .toc-container {
    width: 100%;
    display: block;
  }

  .toc-sticky-box {
    position: static;
    border-left: none;
    border-bottom: 1px solid #eee;
    padding: 10px 0;
  }
}