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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
}

/* 头部 */
.header {
  background: linear-gradient(135deg, #1a5276, #2980b9);
  color: white;
  text-align: center;
  padding: 30px 20px 20px;
}
.header h1 {
  font-size: 28px;
  margin-bottom: 5px;
}
.header .subtitle {
  font-size: 14px;
  opacity: 0.85;
}

/* 搜索栏 */
.search-bar {
  max-width: 800px;
  margin: -20px auto 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  padding: 15px 20px;
  display: flex;
  gap: 10px;
  position: relative;
  z-index: 10;
}
.search-bar select {
  width: 120px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: white;
}
.search-bar input {
  flex: 1;
  padding: 10px 15px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 15px;
  outline: none;
}
.search-bar input:focus {
  border-color: #2980b9;
}
.search-bar button {
  padding: 10px 25px;
  background: #2980b9;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
}
.search-bar button:hover {
  background: #1a5276;
}

/* 搜索结果 */
.search-result {
  max-width: 1100px;
  margin: 20px auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  padding: 20px;
}
.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}
.result-header span {
  font-size: 15px;
  color: #666;
}
.clear-btn {
  padding: 5px 15px;
  background: #eee;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.clear-btn:hover {
  background: #ddd;
}
.result-list {
  max-height: 500px;
  overflow-y: auto;
}
.result-item {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
}
.result-item:hover {
  background: #f8f9fa;
}
.result-item:last-child {
  border-bottom: none;
}
.result-item .item-class {
  display: inline-block;
  background: #e8f4fd;
  color: #2980b9;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  margin-right: 8px;
}
.result-item .item-subgroup {
  display: inline-block;
  background: #f0f0f0;
  color: #666;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  margin-right: 8px;
}
.result-item .item-name {
  font-size: 14px;
}
.result-item .item-name em {
  color: #e74c3c;
  font-style: normal;
}

/* 类别导航 */
.class-nav {
  max-width: 1100px;
  margin: 20px auto;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  padding: 15px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.class-nav .nav-item {
  display: inline-block;
  padding: 6px 14px;
  background: #f0f4f8;
  border: 1px solid #dce5ed;
  border-radius: 5px;
  font-size: 13px;
  color: #1a5276;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.class-nav .nav-item:hover,
.class-nav .nav-item.active {
  background: #2980b9;
  color: white;
  border-color: #2980b9;
}

/* 分类列表 */
.class-list {
  max-width: 1100px;
  margin: 0 auto 30px;
}
.class-block {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  margin-bottom: 15px;
  overflow: hidden;
}
.class-header {
  background: linear-gradient(135deg, #1a5276, #2980b9);
  color: white;
  padding: 15px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.class-header h3 {
  font-size: 16px;
  font-weight: 600;
}
.class-header .toggle {
  font-size: 20px;
  transition: transform 0.3s;
}
.class-header .toggle.open {
  transform: rotate(180deg);
}
.class-body {
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.class-body.open {
  max-height: 50000px;
  padding: 0;
}
.class-note {
  padding: 12px 20px;
  background: #f8f9fa;
  font-size: 13px;
  color: #666;
  border-bottom: 1px solid #eee;
  display: none;
}
.class-note.show {
  display: block;
}

/* 子类 */
.subgroup {
  border-bottom: 1px solid #f0f0f0;
}
.subgroup:last-child {
  border-bottom: none;
}
.subgroup-header {
  padding: 12px 20px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background 0.2s;
}
.subgroup-header:hover {
  background: #f8f9fa;
}
.subgroup-header .sg-code {
  display: inline-block;
  background: #e8f4fd;
  color: #2980b9;
  padding: 2px 10px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 600;
  margin-right: 10px;
  min-width: 50px;
  text-align: center;
}
.subgroup-header .sg-name {
  flex: 1;
  font-size: 14px;
}
.subgroup-header .sg-count {
  color: #999;
  font-size: 12px;
  margin-left: 10px;
}
.subgroup-header .sg-toggle {
  font-size: 16px;
  color: #999;
  transition: transform 0.3s;
}
.subgroup-header .sg-toggle.open {
  transform: rotate(90deg);
}
.subgroup-items {
  padding: 0 20px 0 80px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.subgroup-items.open {
  max-height: 5000px;
  padding: 5px 20px 15px 80px;
}
.subgroup-items .item {
  display: inline-block;
  padding: 4px 10px;
  margin: 3px 4px;
  background: #f5f7fa;
  border-radius: 4px;
  font-size: 13px;
  color: #555;
}
.subgroup-items .item em {
  color: #e74c3c;
  font-style: normal;
}

/* 底部 */
.footer {
  text-align: center;
  padding: 20px;
  color: #999;
  font-size: 12px;
}

/* 响应式 */
@media (max-width: 768px) {
  .header h1 { font-size: 22px; }
  .search-bar {
    flex-direction: column;
    margin: -15px 15px 0;
  }
  .search-bar select { width: 100%; }
  .class-nav { margin: 15px; }
  .class-list { margin: 0 15px 20px; }
  .subgroup-items { padding-left: 40px; }
  .subgroup-items.open { padding-left: 40px; }
}
