/* 自定义改进样式 */
:root {
  --primary-color: #3a7ca5;
  --secondary-color: #2a628f;
  --accent-color: #d9b310;
  --text-color: #333;
  --text-light: #666;
  --bg-color: #fff;
  --bg-light: #f8f9fa;
  --border-color: #e9ecef;
  --sidebar-width: 280px;
  --header-height: 60px;
  --transition-speed: 0.3s;
  --highlight-color: #ffeb3b;
  --highlight-bg: #fff3cd;
}

/* 搜索高亮样式 */
.search-highlight {
  background-color: var(--highlight-bg);
  color: var(--text-color);
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(217, 179, 16, 0.3);
}

.search-result-descr {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
}

/* 头部导航 */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.header-nav {
  display: flex;
  gap: 20px;
}

.header-nav a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color var(--transition-speed);
}

.header-nav a:hover {
  color: var(--primary-color);
}

.header-actions {
  display: flex;
  gap: 15px;
  align-items: center;
}

.search-box {
  position: relative;
}

.search-box input {
  padding: 8px 12px 8px 35px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 14px;
  width: 200px;
  transition: all var(--transition-speed);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-color);
  width: 250px;
  box-shadow: 0 0 0 2px rgba(58, 124, 165, 0.2);
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

.search-box-component {
  position: relative;
  display: flex;
  align-items: center;
  background: white;
  border-radius: 20px;
  padding: 0 12px;
  height: 36px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  width: 200px;
  transition: all var(--transition-speed);
}

.search-box-component:focus-within {
  width: 250px;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(58, 124, 165, 0.2);
}

.search-box-component i {
  color: var(--text-light);
}

.search-box-component input {
  border: none;
  outline: none;
  background: transparent;
  padding: 8px 12px;
  width: 100%;
  font-size: 14px;
  margin-left: 8px;
}

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-top: 4px;
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
}

.search-suggestions ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.search-suggestions li {
  padding: 10px 15px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.search-suggestions li:hover {
  background-color: #f5f5f5;
}

.search-suggestions li:last-child {
  border-bottom: none;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-color);
  cursor: pointer;
}

/* 主容器 */
.main-container {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* 侧边栏导航 */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-light);
  border-right: 1px solid var(--border-color);
  padding: 20px 0;
  overflow-y: auto;
  height: calc(100vh - var(--header-height));
  position: fixed;
  left: 0;
  top: var(--header-height);
  transition: transform var(--transition-speed);
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav > li {
  margin-bottom: 10px;
}

.sidebar-nav > li > a {
  display: block;
  padding: 12px 20px;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--transition-speed);
}

.sidebar-nav > li > a:hover {
  background-color: rgba(58, 124, 165, 0.1);
  border-left-color: var(--primary-color);
  color: var(--primary-color);
}

.sidebar-nav > li.active > a {
  background-color: rgba(58, 124, 165, 0.15);
  border-left-color: var(--primary-color);
  color: var(--primary-color);
}

/* 子菜单 */
.submenu {
  list-style: none;
  margin-left: 0;
  background-color: rgba(0, 0, 0, 0.02);
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-speed) ease-out;
}

.submenu.open {
  max-height: 500px;
  transition: max-height var(--transition-speed) ease-in;
}

.submenu > li > a {
  display: block;
  padding: 10px 20px 10px 40px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 14px;
  transition: all var(--transition-speed);
}

.submenu > li > a:hover {
  background-color: rgba(58, 124, 165, 0.1);
  color: var(--primary-color);
  padding-left: 45px;
}

.submenu > li.active > a {
  color: var(--primary-color);
  font-weight: 500;
  background-color: rgba(58, 124, 165, 0.05);
}

/* 内容区域 */
.content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 30px 40px;
  max-width: 1200px;
  transition: margin-left var(--transition-speed);
}

.content.full-width {
  margin-left: 0;
}

/* 面包屑导航 */
.breadcrumb {
  display: flex;
  gap: 10px;
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb span:last-child {
  color: var(--text-color);
  font-weight: 500;
}

/* 页面标题 */
.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-color);
  line-height: 1.2;
}

.page-subtitle {
  font-size: 1.2rem;
  color: var(--text-light);
  margin-bottom: 30px;
  font-weight: 400;
}

/* 内容卡片 */
.content-card {
  background-color: var(--bg-color);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 30px;
  margin-bottom: 30px;
  border: 1px solid var(--border-color);
}

/* 文档目录 */
.doc-toc {
  background-color: var(--bg-light);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 30px;
  border: 1px solid var(--border-color);
}

.doc-toc-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--primary-color);
}

.doc-toc ul {
  list-style: none;
  padding-left: 0;
}

.doc-toc > ul > li > a {
  display: block;
  padding: 10px 0;
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
  transition: color var(--transition-speed);
}

.doc-toc > ul > li > a:hover {
  color: var(--primary-color);
}

.doc-toc ul ul {
  padding-left: 20px;
  margin-top: 10px;
}

.doc-toc ul ul li a {
  display: block;
  padding: 6px 0;
  color: var(--text-light);
  text-decoration: none;
  font-size: 14px;
  transition: color var(--transition-speed);
}

.doc-toc ul ul li a:hover {
  color: var(--primary-color);
}

/* 章节标题 */
h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-top: 40px;
  margin-bottom: 20px;
  color: var(--text-color);
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-top: 30px;
  margin-bottom: 15px;
  color: var(--text-color);
}

/* 段落 */
p {
  margin-bottom: 1.5rem;
  text-align: justify;
}

/* 列表 */
ul, ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

li {
  margin-bottom: 0.5rem;
}

/* 按钮 */
.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-speed);
  margin-right: 10px;
  margin-bottom: 10px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(58, 124, 165, 0.3);
}

.btn-secondary {
  background-color: var(--bg-light);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--border-color);
}

/* 特性卡片 */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.feature-card {
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.feature-icon {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.feature-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-color);
}

.feature-description {
  color: var(--text-light);
  font-size: 14px;
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-speed);
  box-shadow: 0 4px 12px rgba(58, 124, 165, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--secondary-color);
  transform: translateY(-3px);
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .content {
    padding: 20px 30px;
  }
  
  .page-title {
    font-size: 2rem;
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }
  
  .header-nav {
    display: none;
  }
  
  .search-box input {
    width: 150px;
  }
  
  .search-box input:focus {
    width: 180px;
  }
  
  .search-box-component {
    width: 150px;
  }
  
  .search-box-component:focus-within {
    width: 180px;
  }
  
  .sidebar {
    z-index: 999;
  }
  
  .content {
    margin-left: 0;
    padding: 20px;
  }
  
  .features {
    grid-template-columns: 1fr;
  }
  
  .page-title {
    font-size: 1.8rem;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 0 15px;
  }
  
  .content {
    padding: 15px;
  }
  
  .content-card {
    padding: 20px;
  }
  
  .page-title {
    font-size: 1.6rem;
  }
  
  /* 确保搜索框组件在小屏幕上也可见 */
  .search-box {
    display: block;
    width: 120px;
  }
  
  .search-box input {
    width: 100%;
  }
  
  .search-box-component {
    width: 120px;
  }
  
  .search-box-component:focus-within {
    width: 150px;
  }
}

/* 侧边栏样式 */
.sidebar {
  width: 250px;
  background: #f8f9fa;
  padding: 0;
  position: fixed;
  height: 100%;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.1);
}