/*
Theme Name: ZOB主题
Theme URI: https://www.01boy.com
Author: Zero One Boy
Author URI: https://www.01boy.com
Description: 适用于企业展示、个人博客。
Version: 1.0
License: Proprietary (Not Open Source)
License URI: https://www.01boy.com/license
Text Domain: zerooneboy
*/
/* ========== 顶部导航栏 ========== */
header.navbar {
  z-index: 1050;
  height: 56px; /* 固定高度 */
}

/* 搜索框 */
.search {
  z-index: 1100; /* 确保在导航栏之上 */
  top: 56px;
}

/* 主题切换按钮（亮/暗模式）过渡动画 */
html[data-bs-theme="dark"], 
html[data-bs-theme="light"] {
  transition: background-color 0.3s ease, color 0.3s ease;
}
/* 暗色模式优化 */
[data-bs-theme="dark"] .zero-title a {
    color: var(--bs-heading-color);
}
[data-bs-theme="dark"] .list-group-item {
    background-color: #222;
    border-color: #333;
}

/* 顶部栏内的下拉按钮 */
.topbar .dropdown-toggle {
  display: flex;
  align-items: center;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none !important;
}
.topbar .dropdown-toggle::after {
  display: none; /* 移除默认箭头 */
}
.topbar .dropdown-toggle img {
  border-radius: 50%;
  width: 32px;
  height: 32px;
  object-fit: cover;
  transition: transform 0.2s ease;
}
.topbar .dropdown-toggle:hover img {
  transform: scale(1.05); /* 轻微放大 */
}
.topbar .btn-sm,
.topbar .dropdown-toggle img {
  height: 32px;
  line-height: 1.2;
}
.topbar .btn-login {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* ========== 侧边栏 ========== */
/*右侧边栏跟随浮动*/
.position-sticky {
    top: 56px !important;
}

#sidebar {
  background-color: var(--bs-body-bg); /* 保持与主题一致 */
}

/* 桌面端侧边栏 */
@media (min-width: 992px) {
  #sidebar {
    transform: none !important;
    visibility: visible !important;
    position: fixed !important;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 240px;
    flex-shrink: 0;
    z-index: 1000;
    overflow-y: auto;
  }
  .main-content {
    margin-left: 240px; /* 让出侧边栏空间 */
  }
}

/* 移动端侧边栏 */
@media (max-width: 991.98px) {
  .main-content {
    margin-left: 0 !important;
  }
  .offcanvas {
    z-index: 1080 !important; /* 高于 header */
  }
  .offcanvas-backdrop {
    z-index: 1040 !important; /* 遮罩能点到 */
  }
  header.navbar {
    z-index: 1020 !important; /* 稍微降低 */
  }
}

/* ========== 列表与组件 ========== */
/* 列表激活状态 */
.list-group-item.is-active {
  background-color: var(--bs-tertiary-bg);
}

/* 列表控制 */
.zero-list-control {
  width: 100%;
  display: inline-block;
}
.zero-list-control .avatar {
  width: 32px;
  height: 32px;
  margin-right: 0.5rem;
}
.zero-list-control .zero-list-control-right {
  width: calc(100% - 40px); /* 40px=头像+间距 */
  float: right;
}
.zero-list-control .zero-list-control-top {
  background: linear-gradient(90deg, rgb(23,162,184) 19%, rgb(155,81,224) 100%);
  min-height: 2rem; /* 32px */
  margin: 0;
  padding: 0 var(--wp--preset--spacing--20);
  color: #fff;
}
.zero-list-control .zero-list-control-top strong {
  line-height: 0.25rem;
}
.zero-list-control .zero-list-control-bottom {
  border-top: 1px dashed #cfcfcf;
  padding-top: 0.3125rem; /* 5px */
  margin-top: 0.3125rem;
}
.zero-list-control .zero-t-link {
  background: linear-gradient(323deg, rgb(6,147,227) 0%, rgb(155,81,224) 82%);
  border-radius: 0;
  border: 0;
  padding: 0.3125rem 0.5rem;
  margin: 0;
  color: #fff;
}
.zero-list-control .zero-column-link {
  border-radius: 0;
  border: 0;
  padding: 0.3125rem 0.5rem;
  margin: 0;
  color: #03A9F4;
}

/*内容部分css*/
/* 优化后的内容区域样式 - 适配 Bootstrap 5.3 */
.zero-content {
  color: var(--bs-body-color, #333);
  margin: 0;
  padding: 0;
  min-height: 100px;
  line-height: 1.5;
}

/* 标题样式 */
.zero-content h1 {
  font-size: 2rem;
  font-weight: 700;
}

.zero-content h2 {
  font-size: 1.75rem;
  font-weight: 700;
}

.zero-content h3 {
  font-size: 1.5rem;
  font-weight: 600;
}

.zero-content h4 {
  font-size: 1.25rem;
  font-weight: 600;
}

.zero-content h5 {
  font-size: 1.125rem;
  font-weight: 500;
}

.zero-content h6 {
  font-size: 1rem;
  font-weight: 500;
}

.zero-content h1,
.zero-content h2,
.zero-content h3,
.zero-content h4,
.zero-content h5,
.zero-content h6 {
  color: var(--bs-heading-color, #333);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.25;
  letter-spacing: -0.05rem;
}

/* 段落样式 */
.zero-content p {
  margin-bottom: 0.625rem; /* 10px */
  font-size: 0.875rem;     /* 14px */
  color: var(--bs-heading-color);
  line-height: 1.5;
}
.zero-content strong {
  font-weight: bold; /* 使文本加粗 */
  color: var(--bs-heading-color); /* 更改颜色，如果需要 */
}
/* 列表样式 */
.zero-content ul,
.zero-content ol {
  margin-left: 1.875rem;   /* 30px */
  margin-bottom: 1.25rem;   /* 20px */
  list-style-position: outside;
}
.zero-content ul li,
.zero-content ol li {
  margin-bottom: 0.5rem;    /* 8px */
  padding-left: 0.3125rem;  /* 5px */
}

/* 链接样式 */
.zero-content a {
  color: var(--bs-link-color, #0d6efd);
  text-decoration: none;
  transition: color 0.3s ease;
}
.zero-content a:hover {
  text-decoration: underline;
  color: var(--bs-link-hover-color, #0a58ca);
}

/* 引用样式 */
.zero-content blockquote {
  border-left: 0.25rem solid #ccc;
  padding: 1.25rem;
  font-style: italic;
  color: #555;
  margin: 1.5rem 0;
  background-color: #f9f9f9;
  border-radius: 0.3125rem; /* 5px */
}

/* 代码块样式 */
.zero-content pre {
  background-color: var(--bs-heading-color);
  padding: 1rem;
  border-radius: 0.25rem;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-x: auto;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  border: 1px solid #ced4da;
}
.zero-content pre code {
  background-color: transparent;
  padding: 0;
  border: none;
  font-size: inherit;
  color: #212529;
}
@media (max-width: 767.98px) {
  .zero-content pre {
    font-size: 0.75rem;
  }
}

/* 内联代码样式 */
.zero-content code {
  background-color: #f8f9fa;
  padding: 0.25rem 0.5rem;
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  border-radius: 0.25rem;
  color: #d63384;
  border: 1px solid #ddd;
}

/* 图片样式 */
.zero-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 1.25rem;
  box-shadow: 0 0.125rem 0.625rem rgba(0, 0, 0, 0.2);
  border-radius: 0.5rem;
}

/* 限制 .wp-caption 内的图片不会超出 .wp-caption 容器 */
.wp-caption img {
    max-width: 100% !important;
    height: auto;
}

/* 让 .wp-caption 也不会超出父级容器 */
.wp-caption {
    max-width: 100% !important;
    overflow: hidden;
}

/* 表格样式 */
.zero-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem; /* 15px */
}
.zero-content table,
.zero-content th,
.zero-content td {
  border: 1px solid #ddd;
}
.zero-content th,
.zero-content td {
  padding: 0.75rem;
  text-align: left;
}
.zero-content th {
  background-color: #f1f1f1;
  font-weight: bold;
  color: #222;
}

/* 按钮样式 */
.zero-content button {
  background-color: var(--bs-primary, #0d6efd);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.3125rem;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s ease;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
}
.zero-content button:hover {
  background-color: var(--bs-primary-dark, #0a58ca);
}

/* 表单输入框样式 */
.zero-content input,
.zero-content textarea,
.zero-content select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 0.3125rem;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
  box-shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.1);
}

/* 垂直居中文本 */
.zero-content .center-text {
  text-align: center;
  margin: 1.875rem 0;
  font-size: 1.125rem;
  color: #222;
}

/* 清除浮动 */
.zero-content::after {
  content: "";
  display: table;
  clear: both;
}