/* 布局样式 */

/* 应用容器 */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 顶部导航栏 */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: var(--sidebar-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
  box-shadow: var(--shadow-md);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
}

.header-title {
  font-size: 18px;
  font-weight: 600;
  color: white;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 搜索框 */
.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.8);
  transition: background-color var(--transition-fast);
  min-width: 200px;
}

.header-search:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.header-search:focus-within {
  background-color: rgba(255, 255, 255, 0.25);
  color: white;
}

.header-search-input {
  background: transparent;
  border: none;
  outline: none;
  color: white;
  font-size: 14px;
  width: 100%;
  min-width: 120px;
}

.header-search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

/* 主题切换按钮 */
.theme-toggle {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: rgba(255, 255, 255, 0.8);
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

/* 主布局 */
.main-layout {
  display: flex;
  margin-top: 60px;
  flex: 1;
}

/* 侧边栏 */
.sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  width: 280px;
  height: calc(100vh - 60px);
  background-color: var(--sidebar-bg);
  overflow-y: auto;
  z-index: 100;
}

/* 1280px及以上屏幕增加侧边栏宽度 */
@media (min-width: 1280px) {
  .sidebar {
    width: 300px;
  }
  
  .main-content {
    margin-left: 300px;
  }
}

/* 1600px及以上屏幕进一步优化 */
@media (min-width: 1600px) {
  .sidebar {
    width: 320px;
  }
  
  .main-content {
    margin-left: 320px;
  }
}

.sidebar-title {
  padding: 20px 20px 12px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* 导航组 */
.nav-group {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-header:hover {
  background-color: var(--sidebar-hover);
  color: white;
}

.nav-header-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-arrow {
  font-size: 10px;
  opacity: 0.5;
  transition: transform var(--transition-fast);
}

.nav-group.open .nav-arrow {
  transform: rotate(90deg);
}

/* 导航列表 */
.nav-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal);
  background-color: rgba(0, 0, 0, 0.15);
}

.nav-group.open .nav-list {
  max-height: 800px;
}

.nav-item {
  display: block;
  padding: 10px 20px 10px 48px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all var(--transition-fast);
}

.nav-item:hover {
  color: rgba(255, 255, 255, 0.9);
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
  color: rgba(255, 255, 255, 0.9);
  background-color: var(--sidebar-active);
  border-left-color: rgba(255, 255, 255, 0.4);
}

/* 搜索匹配高亮 */
.nav-item.search-match {
  color: var(--accent-color);
  background-color: rgba(255, 255, 255, 0.1);
  font-weight: 500;
}

/* 主内容区 */
.main-content {
  flex: 1;
  margin-left: 280px;
  padding: 32px 48px;
  max-width: none; /* 移除最大宽度限制 */
  position: relative;
  z-index: 1;
}

/* 1280px及以上屏幕优化 */
@media (min-width: 1280px) {
  .main-content {
    padding: 40px 64px;
  }
  
  .content-section h2 {
    font-size: 32px;
  }
  
  .content-section h3 {
    font-size: 22px;
  }
  
  .content-section p,
  .content-section li {
    font-size: 16px;
    line-height: 1.8;
  }
}

/* 1440px及以上屏幕进一步优化 */
@media (min-width: 1440px) {
  .main-content {
    padding: 48px 80px;
  }
  
  .content-section h2 {
    font-size: 36px;
  }
}

/* 内容区块 */
.content-section {
  margin-bottom: 64px;
  padding: 32px 0;
  scroll-margin-top: 80px; /* 为锚点跳转预留空间 */
}

.content-section:not(:last-child) {
  border-bottom: 1px solid var(--border-color);
}

/* 内容区块标题固定效果 */
.content-section h2 {
  position: sticky;
  top: 60px; /* 固定在导航栏下方 */
  background-color: var(--bg-primary);
  padding: 16px 0;
  margin: 0 0 24px;
  z-index: 10;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 2px solid var(--heading-border);
  display: inline-block;
  width: 100%;
}

.content-section h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 32px 0 16px;
}

.content-section h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 24px 0 12px;
}

.content-section p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.8;
}

.content-section ul {
  margin: 16px 0;
  padding-left: 24px;
}

.content-section ul li {
  position: relative;
  padding-left: 16px;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.content-section ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  background-color: var(--accent-color);
  border-radius: 50%;
}

.content-section ul li ul {
  margin-top: 8px;
}

.content-section ul li ul li::before {
  background-color: var(--text-tertiary);
}

/* 粗体字样式 */
.content-section strong,
.content-section b {
  color: var(--text-primary);
  font-weight: 600;
}

/* 功能模块网格 */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

/* 1280px及以上屏幕优化网格 */
@media (min-width: 1280px) {
  .feature-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
  }
}

/* 1600px及以上屏幕显示更多列 */
@media (min-width: 1600px) {
  .feature-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
  }
}

.feature-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.feature-card:hover {
  background-color: var(--bg-primary);
  border-color: var(--accent-color);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-card h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  background-color: var(--accent-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: var(--accent-dark);
  transform: translateY(-2px);
}

/* 页脚 */
.footer {
  margin-left: 280px;
  padding: 32px 48px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.footer p {
  color: var(--text-tertiary);
  font-size: 13px;
  margin-bottom: 8px;
}

.footer a {
  color: var(--text-secondary);
}

.footer a:hover {
  color: var(--accent-color);
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  color: white;
  border-radius: var(--radius-md);
}

.mobile-menu-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content,
  .footer {
    margin-left: 0;
  }
  
  .mobile-menu-btn {
    display: flex;
  }
  
  .search-shortcut {
    display: none;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 0 16px;
  }
  
  .header-title {
    font-size: 16px;
  }
  
  .main-content {
    padding: 24px 20px;
  }
  
  .footer {
    padding: 24px 20px;
  }
  
  .feature-grid {
    grid-template-columns: 1fr;
  }
  
  .content-section h2 {
    font-size: 24px;
  }
}
