/* 基本样式 */
:root {
  --primary-color: #f7931a;
  --secondary-color: #4d4d4d;
  --background-color: #ffffff;
  --text-color: #333333;
  --link-color: #0066cc;
  --border-color: #e0e0e0;
}

.featured-bips {
  margin: 20px 0;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 5px;
  border-left: 4px solid var(--primary-color);
}

.new-badge {
  background-color: var(--primary-color);
  color: white;
  font-size: 0.8em;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 5px;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 标题样式 */
header {
  text-align: center;
  margin-bottom: 40px;
  padding: 20px;
  border-bottom: 2px solid var(--primary-color);
}

header h1 {
  color: var(--primary-color);
  font-size: 2.5rem;
}

header p {
  font-size: 1.2rem;
  color: var(--secondary-color);
}

/* 章节样式 */
section {
  margin-bottom: 40px;
}

h2 {
  color: var(--secondary-color);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

h3 {
  color: var(--secondary-color);
  margin: 20px 0 10px;
}

p {
  margin-bottom: 15px;
}

/* 链接样式 */
a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* 表格样式 */
.bip-table {
  overflow-x: auto;
  width: 100%;
  margin-bottom: 20px;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  table-layout: fixed; /* 固定表格布局 */
}

th, td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap; /* 防止所有列换行 */
  overflow: hidden;
  text-overflow: ellipsis; /* 超出部分显示省略号 */
}

/* 设置各列宽度 */
th:nth-child(1), td:nth-child(1) { width: 10%; } /* 编号 */
th:nth-child(2), td:nth-child(2) { width: 10%; } /* 层级 */
th:nth-child(3), td:nth-child(3) { width: 10%; } /* 类型 */
th:nth-child(4), td:nth-child(4) { width: 10%; } /* 状态 */
th:nth-child(5), td:nth-child(5) { width: 40%; } /* 标题 */
th:nth-child(6), td:nth-child(6) { width: 20%; } /* 作者 */

th {
  background-color: #f8f8f8;
  font-weight: bold;
}

tr:hover {
  background-color: #f5f5f5;
}

/* 添加工具提示，当鼠标悬停时显示完整内容 */
td[title] {
  cursor: help;
}

/* 搜索框样式 */
.search-container {
  margin-bottom: 20px;
}

#search-input {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
}

/* 筛选功能样式 */
.filter-container {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 5px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label {
  font-weight: bold;
  color: var(--secondary-color);
}

.filter-group select {
  padding: 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background-color: white;
}

#reset-filters {
  padding: 8px 15px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  margin-left: auto;
}

#reset-filters:hover {
  background-color: #e67e00;
}

/* 表格排序指示器 */
th.sort-asc::after {
  content: " ↑";
  color: var(--primary-color);
}

th.sort-desc::after {
  content: " ↓";
  color: var(--primary-color);
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: none;
  z-index: 100;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.back-to-top:hover {
  background-color: #e67e00;
}

/* 页脚样式 */
footer {
  margin-top: 50px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--secondary-color);
  font-size: 0.9rem;
}

/* 表格容器样式 */
.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* 响应式设计 */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  header {
    padding: 10px;
  }
  
  header h1 {
    font-size: 2rem;
  }
  
  th, td {
    padding: 8px 10px;
  }
  
  /* 在小屏幕上调整表格列宽 */
  th:nth-child(1), td:nth-child(1) { width: 15%; } /* 编号 */
  th:nth-child(2), td:nth-child(2) { width: 15%; } /* 层级 */
  th:nth-child(3), td:nth-child(3) { width: 15%; } /* 类型 */
  th:nth-child(4), td:nth-child(4) { width: 15%; } /* 状态 */
  th:nth-child(5), td:nth-child(5) { width: 25%; } /* 标题 */
  th:nth-child(6), td:nth-child(6) { width: 15%; } /* 作者 */
}