/* ===== 全局重置 & 字体 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #f8f9fc;
  min-height: 100vh;
  padding: 20px;
  margin: 0;
  padding-top: 80px; /* 为固定导航栏留出空间 */
}

/* ============================================ */
/* ===== 导航栏样式 ===== */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.top-nav {
  transform: translateY(0);
  opacity: 1;
}

.top-nav.hidden-nav {
  transform: translateY(-100%);
  opacity: 0;
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 60px;
}

.nav-brand {
  flex-shrink: 0;
}

.nav-logo {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1e293b;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.2s;
}

.nav-logo:hover {
  color: #5b7cfa;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 8px;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-menu li {
  margin: 0;
}

.nav-link {
  display: block;
  padding: 8px 18px;
  color: #475569;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 40px;
  transition: all 0.25s ease;
  position: relative;
}

.nav-link:hover {
  background: #f1f4fa;
  color: #1e293b;
}

.nav-link.active {
  background: #5b7cfa;
  color: #ffffff;
}

.nav-link.active:hover {
  background: #4a6ae0;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.nav-toggle:hover {
  background: #f1f4fa;
}

.hamburger {
  display: block;
  width: 26px;
  height: 3px;
  background: #1e293b;
  border-radius: 3px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.nav-toggle.active .hamburger:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.nav-toggle.active .hamburger:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active .hamburger:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ============================================ */
/* ===== 主内容容器 ===== */
.table-container {
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 8px 20px rgba(0, 0, 0, 0.02);
  padding: 30px 28px 20px;
  transition: padding 0.2s ease;
}

/* ===== 顶部行：SVG + 标题 ===== */
.header-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  border-bottom: 3px solid #e9edf4;
  padding-bottom: 12px;
}

.svg-placeholder {
  width: 100%;
  max-width: 300px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.header-svg {
  width: 100%;
  height: auto;
  display: block;
}

h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: #1e293b;
  margin: 0;
  text-align: center;
  width: 100%;
}

/* ===== 筛选区域 ===== */
.filter-area {
  margin: 18px 0 22px 0;
}

.filter-wrapper {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

#filterInput {
  flex: 1;
  min-width: 200px;
  padding: 12px 18px;
  font-size: 0.95rem;
  border: 1.5px solid #dce1ea;
  border-radius: 40px;
  background: #f9fafc;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.2s;
  color: #1e293b;
  font-weight: 450;
}

#filterInput:focus {
  border-color: #5b7cfa;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(91, 124, 250, 0.12);
}

#filterInput::placeholder {
  color: #9aa6b9;
  font-weight: 400;
  letter-spacing: 0.2px;
}

/* ===== 重置按钮样式 ===== */
.reset-btn {
  flex-shrink: 0;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #ffffff;
  background: #5b7cfa;
  border: none;
  border-radius: 40px;
  cursor: pointer;
  transition: background 0.25s, transform 0.1s, box-shadow 0.25s;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 12px rgba(91, 124, 250, 0.2);
}

.reset-btn:hover {
  background: #4a6ae0;
  box-shadow: 0 6px 20px rgba(91, 124, 250, 0.3);
}

.reset-btn:active {
  transform: scale(0.96);
  background: #3d5cc9;
}

.reset-btn:focus-visible {
  outline: 3px solid #5b7cfa;
  outline-offset: 2px;
}

/* ===== 表格外层 ===== */
.table-container table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 4px;
  display: table;
  font-size: 0.95rem;
}

/* ===== 表头 ===== */
thead th {
  text-align: left;
  padding: 14px 18px;
  background: #f1f4fa;
  color: #1e293b;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  border-bottom: 2px solid #dce1ea;
}

thead th:first-child {
  border-radius: 16px 0 0 16px;
  padding-left: 22px;
}

thead th:last-child {
  border-radius: 0 16px 16px 0;
  padding-right: 22px;
}

/* ===== 行 & 单元格 ===== */
tbody tr {
  background: #ffffff;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

/* ===== 隔行背景色 - 灰色交替 ===== */
tbody tr:nth-child(odd) {
  background: #f8f9fc;
}

tbody tr:nth-child(even) {
  background: #ffffff;
}

/* 悬停效果覆盖隔行背景 */
tbody tr:hover {
  background: #f0f2f7 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* details 内容背景保持透明，继承行背景 */
tbody tr td details {
  background: transparent;
}

tbody tr td details summary {
  cursor: pointer;
  font-weight: 500;
  color: #1e293b;
  transition: color 0.2s;
}

tbody tr td details summary:hover {
  color: #5b7cfa;
}

tbody tr td details {
  background: transparent;
}

tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid #edf0f5;
  color: #1e293b;
  vertical-align: middle;
  line-height: 1.5;
  background: transparent; /* 继承行背景 */
}

tbody td:first-child {
  padding-left: 22px;
  font-weight: 480;
}

tbody td:last-child {
  padding-right: 22px;
  color: #475569;
}

/* ===== 分类列 - 按钮样式 ===== */
tbody tr td:last-child {
  background: transparent;
  padding: 6px 4px;
  text-align: left;
  white-space: nowrap;
  width: auto;
  font-weight: 500;
  color: #1e3a5f;
}

/* 分类标签按钮 */
.category-tag {
  display: inline-block;
  padding: 6px 18px;
  background: #eef2f9;
  color: #1e3a5f;
  border-radius: 40px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  border: 2px solid transparent;
  user-select: none;
  position: relative;
}

/* 分类标签悬停效果 */
.category-tag:hover {
  background: #5b7cfa;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(91, 124, 250, 0.3);
}

/* 分类标签点击效果 */
.category-tag:active {
  transform: scale(0.95);
}

/* 分类标签 - 不同颜色主题 */
.category-tag[data-category="快捷键"] {
  background: #e8f5e9;
  color: #2e7d32;
}
.category-tag[data-category="快捷键"]:hover {
  background: #4caf50;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.category-tag[data-category="编辑器"] {
  background: #e3f2fd;
  color: #1565c0;
}
.category-tag[data-category="编辑器"]:hover {
  background: #2196f3;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.category-tag[data-category="前端"] {
  background: #fff3e0;
  color: #e65100;
}
.category-tag[data-category="前端"]:hover {
  background: #ff9800;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.category-tag[data-category="编程"] {
  background: #fce4ec;
  color: #c62828;
}
.category-tag[data-category="编程"]:hover {
  background: #f44336;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.category-tag[data-category="版本控制"] {
  background: #f3e5f5;
  color: #6a1b9a;
}
.category-tag[data-category="版本控制"]:hover {
  background: #9c27b0;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(156, 39, 176, 0.3);
}

.category-tag[data-category="运维"] {
  background: #e0f7fa;
  color: #00695c;
}
.category-tag[data-category="运维"]:hover {
  background: #009688;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 150, 136, 0.3);
}

.category-tag[data-category="数据库"] {
  background: #e8eaf6;
  color: #283593;
}
.category-tag[data-category="数据库"]:hover {
  background: #3f51b5;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(63, 81, 181, 0.3);
}

.category-tag[data-category="设计"] {
  background: #fce4ec;
  color: #880e4f;
}
.category-tag[data-category="设计"]:hover {
  background: #e91e63;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.category-tag[data-category="测试"] {
  background: #e8f5e9;
  color: #1b5e20;
}
.category-tag[data-category="测试"]:hover {
  background: #8bc34a;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(139, 195, 74, 0.3);
}

/* vim 相关分类 */
.category-tag[data-category="vim hex"],
.category-tag[data-category="vim 快速跳转"],
.category-tag[data-category="vim 查找和替换"],
.category-tag[data-category="vim 内容编辑"],
.category-tag[data-category="vim 正则表达式"],
.category-tag[data-category="vim 剪切板或寄存器操作"],
.category-tag[data-category="vim 扩展配置"],
.category-tag[data-category="vim 宏"],
.category-tag[data-category="vim 分屏"],
.category-tag[data-category="vim 鼠标"],
.category-tag[data-category="vim 撤销和重做"],
.category-tag[data-category="vim 显示"],
.category-tag[data-category="vim 文件操作"],
.category-tag[data-category="vim 命令行"],
.category-tag[data-category="vim 模式"],
.category-tag[data-category="vim 初始化"],
.category-tag[data-category="vim 内置函数"] {
  background: #e8eaf6;
  color: #283593;
}
.category-tag[data-category="vim hex"]:hover,
.category-tag[data-category="vim 快速跳转"]:hover,
.category-tag[data-category="vim 查找和替换"]:hover,
.category-tag[data-category="vim 内容编辑"]:hover,
.category-tag[data-category="vim 正则表达式"]:hover,
.category-tag[data-category="vim 剪切板或寄存器操作"]:hover,
.category-tag[data-category="vim 扩展配置"]:hover,
.category-tag[data-category="vim 宏"]:hover,
.category-tag[data-category="vim 分屏"]:hover,
.category-tag[data-category="vim 鼠标"]:hover,
.category-tag[data-category="vim 撤销和重做"]:hover,
.category-tag[data-category="vim 显示"]:hover,
.category-tag[data-category="vim 文件操作"]:hover,
.category-tag[data-category="vim 命令行"]:hover,
.category-tag[data-category="vim 模式"]:hover,
.category-tag[data-category="vim 初始化"]:hover,
.category-tag[data-category="vim 内置函数"]:hover {
  background: #3f51b5;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(63, 81, 181, 0.3);
}

/* 内容列占更多空间 */
tbody td:first-child {
  width: 70%;
}

/* ===== 隐藏行（筛选） ===== */
tbody tr.hidden-row {
  display: none;
}

/* ===== 底部信息 ===== */
.table-footer {
  margin-top: 26px;
  text-align: right;
  font-size: 0.8rem;
  color: #9aa6b9;
  letter-spacing: 0.3px;
  border-top: 1px solid #edf0f5;
  padding-top: 18px;
  font-weight: 400;
}

/* ===================================================== */
/* ===== 响应式：平板 & 手机 ===== */
@media screen and (max-width: 820px) {
  .table-container {
    padding: 20px 16px 16px;
    border-radius: 20px;
  }

  .header-row {
    gap: 6px;
    padding-bottom: 10px;
  }

  .svg-placeholder {
    max-width: 250px;
  }

  h1 {
    font-size: 1.6rem;
  }

  .filter-wrapper {
    gap: 10px;
  }

  #filterInput {
    padding: 11px 16px;
    font-size: 0.9rem;
    min-width: 150px;
  }

  .reset-btn {
    padding: 11px 22px;
    font-size: 0.9rem;
  }

  thead th,
  tbody td {
    padding: 12px 14px;
  }

  thead th:first-child,
  tbody td:first-child {
    padding-left: 16px;
  }

  thead th:last-child,
  tbody td:last-child {
    padding-right: 16px;
  }

  .category-tag {
    padding: 5px 14px;
    font-size: 0.78rem;
  }
}

@media screen and (max-width: 500px) {
  body {
    padding: 8px;
    padding-top: 70px;
  }

  .table-container {
    padding: 14px 10px 12px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  }

  .header-row {
    gap: 6px;
    padding-bottom: 8px;
  }

  .svg-placeholder {
    max-width: 200px;
  }

  h1 {
    font-size: 1.3rem;
  }

  .filter-wrapper {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  #filterInput {
    width: 100%;
    min-width: unset;
    padding: 10px 14px;
    font-size: 0.85rem;
    border-radius: 30px;
  }

  .reset-btn {
    width: 100%;
    padding: 10px 20px;
    font-size: 0.85rem;
    justify-content: center;
    display: flex;
  }

  thead th,
  tbody td {
    padding: 10px 10px;
    font-size: 0.82rem;
  }

  thead th:first-child,
  tbody td:first-child {
    padding-left: 10px;
  }

  thead th:last-child,
  tbody td:last-child {
    padding-right: 10px;
  }

  .category-tag {
    padding: 4px 12px;
    font-size: 0.7rem;
    border-radius: 30px;
  }

  .table-footer {
    font-size: 0.7rem;
    margin-top: 18px;
    padding-top: 12px;
  }

  tbody td:first-child {
    word-break: break-word;
  }
}

@media screen and (max-width: 380px) {
  .table-container {
    padding: 10px 6px 10px;
  }

  .svg-placeholder {
    max-width: 150px;
  }

  h1 {
    font-size: 1.1rem;
  }

  thead th,
  tbody td {
    padding: 8px 6px;
    font-size: 0.75rem;
  }

  .category-tag {
    padding: 3px 10px;
    font-size: 0.65rem;
    min-width: 40px;
  }
}