* {
  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: 0;
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #F8F9FC;
}

::-webkit-scrollbar-thumb {
  background: #C9BEF2;
  border-radius: 999px;
}

.header {
  background: rgba(255, 255, 255, 0.7);
  padding: 0 24px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(124, 108, 240, 0.12);
}

.header-content {
  max-width: 1230px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  position: relative;
}

.mode-switch {
  position: absolute;
  right: -30px;
  top: 50%;
  transform: translateY(-50%);
  color: #5A6070;
  font-size: 14px;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  background: transparent;
  border: none;
  transition: all 0.3s ease;
}

.mode-switch:hover {
  background: rgba(50, 50, 50, 0.8);
  color: #fff;
  border-color: rgba(50, 50, 50, 0.8);
}

.logo {
  height: 30px;
  width: auto;
  flex-shrink: 0;
  position: absolute;
  left: 75px;
  transform: translateX(-50%);
}

.logo:hover {
  transform: translateX(-50%) scale(1.08);
}

.search-box {
  background: #4a5568;
  border-radius: 8px;
  padding: 0;
  display: flex;
  align-items: center;
  box-shadow: 0 1px 8px rgba(0,0,0,0.1);
  width: 400px;
  height: 40px;
  position: relative;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
  border: 1px solid rgba(226, 232, 240, 0.5);
}

.search-box:hover {
  box-shadow: 0 0 20px rgba(124, 108, 240, 0.3), 0 0 40px rgba(124, 108, 240, 0.15);
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.9rem;
  padding: 0 12px;
  background: #4a5568;
  color: #e2e8f0;
}

.search-box input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.engine-selector {
  position: relative;
  cursor: pointer;
  padding: 0 10px;
  height: 100%;
  display: flex;
  align-items: center;
}

.engine-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.engine-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  padding: 8px 0;
  min-width: 120px;
  z-index: 1000;
  display: none;
}

.engine-selector:hover .engine-dropdown,
.engine-dropdown:hover,
.engine-selector.active .engine-dropdown {
  display: block;
}

.dropdown-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.dropdown-item:hover {
  background: #f5f5f5;
}

.dropdown-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  margin-right: 8px;
}

.dropdown-label {
  font-size: 0.85rem;
  color: #333;
}

.search-icon-btn {
  border: none;
  background: none;
  padding: 0 10px;
  cursor: pointer;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.main-content {
  display: flex;
  max-width: 1230px;
  margin: 75px auto 80px;
  padding: 0;
  gap: 24px;
  min-height: calc(100vh - 64px);
}

.sidebar {
  width: 150px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  padding: 16px 12px;
  box-shadow: 0 2px 12px rgba(138, 114, 216, 0.08);
  position: sticky;
  top: 80px;
  height: fit-content;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  text-align: center;
  backdrop-filter: blur(10px);
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #222638;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #E5E7F0;
}

.category-item {
  padding: 10.5px 8px;
  margin-bottom: 6px;
  border-radius: 5px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  font-size: 0.95rem;
  color: #5A6070;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  position: relative;
  gap: 11px;
}

.category-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.category-item:hover {
  background: #00A876;
  color: #fff;
  border-color: #009966;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 169, 118, 0.15);
}

.category-item.active {
  background: #009966;
  color: #fff;
  font-weight: 500;
}

.category-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  background: #fff;
  border-radius: 0 5px 5px 0;
}

.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.subcategory-bar {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 5px;
  padding: 12px 12px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-start;
  backdrop-filter: blur(10px);
}

.subcategory-btn {
  background: transparent;
  color: #707690;
  border: 1px solid #E5E7F0;
  padding: 9px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.subcategory-btn:hover {
  border-color: #009966;
  background: #00A876;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 169, 118, 0.15);
}

.subcategory-btn.active {
  background: #009966;
  color: #fff;
  border-color: #009966;
  font-weight: 500;
}

.search-result-count {
  color: #8A72D8;
  font-weight: 500;
  font-size: 0.95rem;
}

.tertiary-group {
  margin-top: 24px;
  padding-left: 20px;
  border-left: 3px solid #E5E7F0;
}

.tertiary-group.border-red { border-left-color: #FFB3B3; }
.tertiary-group.border-blue { border-left-color: #B3D1FF; }
.tertiary-group.border-orange { border-left-color: #FFD4B3; }
.tertiary-group.border-green { border-left-color: #B3FFC6; }
.tertiary-group.border-purple { border-left-color: #D4B3FF; }
.tertiary-group.border-pink { border-left-color: #FFB3E6; }
.tertiary-group.border-cyan { border-left-color: #B3FFFF; }
.tertiary-group.border-yellow { border-left-color: #FFE6B3; }

.tertiary-title {
  font-size: 17px;
  font-weight: 500;
  color: #222638;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #F0F0F0;
}

.websites-container {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  padding: 10px 24px 24px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
  flex: 1;
  backdrop-filter: blur(10px);
}

.subcategory-group {
  margin-bottom: 32px;
}

.subcategory-title {
  font-size: 17px;
  font-weight: 500;
  color: #222638;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #F0F0F0;
}

.websites {
  display: grid;
  grid-template-columns: repeat(4, 230px);
  gap: 12px;
  justify-content: center;
}

.website-card {
  background: transparent;
  border-radius: 5px;
  padding: 11px 5px 11px 16px;
  transition: transform 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 70px;
  width: 230px;
  box-sizing: border-box;
}

.website-card:hover {
  transform: translateY(-4px);
  border-color: #00cc99;
}

.website-card:hover .website-icon {
  transform: scale(1.1);
}

.website-card.no-desc {
  height: 60px;
  padding: 12px;
  gap: 10px;
}

.website-card a {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.website-icon {
  width: 43px;
  height: 43px;
  border-radius: 8px;
  flex-shrink: 0;
  object-fit: contain;
  transition: transform 0.2s ease;
  background-color: #cccccc;
}

.website-card.no-desc .website-icon {
  width: 32px;
  height: 32px;
}

.website-content {
  flex: 1;
  overflow: hidden;
}

.website-name {
  font-size: 15px;
  font-weight: 500;
  color: #33384F;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.website-card.no-desc .website-name {
  font-size: 14px;
}

.website-description {
  font-size: 12px;
  color: #707690;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.website-category-path {
  font-size: 11px;
  color: #9CA3AF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.no-results {
  text-align: center;
  color: #8A8FA8;
  padding: 40px;
  font-size: 1.1rem;
}

.empty-category {
  text-align: center;
  color: #8A8FA8;
  padding: 60px 20px;
  font-size: 1.2rem;
}

@media (max-width: 1024px) {
  .main-content {
    flex-direction: column;
    margin-bottom: 80px;
  }

  .sidebar {
    width: 100%;
    position: static;
    max-height: none;
  }

  .websites {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .search-box {
    flex-direction: column;
    border-radius: 5px;
    gap: 10px;
  }

  .search-box input {
    width: 100%;
    text-align: center;
  }

  .websites {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .websites-container {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .websites {
    grid-template-columns: 1fr;
  }

  .subcategory-bar {
    justify-content: center;
  }
}

/* ===== 详细模式深色模式样式 ===== */
body.dark-mode {
  background-color: #1a202c;
  color: #e2e8f0;
}

body.dark-mode .header {
  background: rgba(45, 55, 72, 0.7);
}

body.dark-mode .search-box {
  background: #e2e8f0;
  border-color: rgba(226, 232, 240, 0.5);
}

body.dark-mode .search-box input {
  background: #e2e8f0;
  color: #4a5568;
}

body.dark-mode .search-box input::placeholder {
  color: rgba(74, 85, 104, 0.7);
}

body.dark-mode .mode-switch {
  background: transparent;
  border: none;
  color: #e2e8f0;
}

body.dark-mode .mode-switch:hover {
  background: rgba(200, 200, 200, 0.8);
  color: #333;
  border: none;
}

body.dark-mode .sidebar {
  background: rgba(45, 55, 72, 0.7);
}

body.dark-mode .category-item {
  color: #cbd5e0;
}

body.dark-mode .category-item:hover {
  background: #00A876;
  color: #fff;
  border-color: #009966;
}

body.dark-mode .category-item.active {
  background: #009966;
  color: #fff;
}

body.dark-mode .subcategory-bar {
  background: rgba(45, 55, 72, 0.7);
}

body.dark-mode .subcategory-btn {
  background: transparent;
  color: #cbd5e0;
  border: 1px solid rgba(74, 85, 104, 0.5);
}

body.dark-mode .subcategory-btn:hover {
  background: #00A876;
  border-color: #009966;
  color: #fff;
}

body.dark-mode .subcategory-btn.active {
  background: #009966;
  color: #fff;
  border-color: #009966;
}

body.dark-mode .websites-container {
  background: rgba(45, 55, 72, 0.7);
}

body.dark-mode .website-card {
  background: transparent;
}

body.dark-mode .website-card:hover {
  background: transparent;
  border-color: #00cc99;
}

body.dark-mode .website-name {
  color: #e2e8f0;
}

body.dark-mode .website-description {
  color: #a0aec0;
}

body.dark-mode .website-category-path {
  color: #718096;
}

body.dark-mode .website-icon {
  background-color: #cccccc;
}

body.dark-mode .tertiary-title {
  color: #e2e8f0;
  border-bottom-color: rgba(74, 85, 104, 0.5);
}

body.dark-mode .empty-category,
body.dark-mode .no-results {
  color: #a0aec0;
}

body.dark-mode .search-result-count {
  color: #a78bfa;
}

body.dark-mode .logo:hover {
}

/* 底部栏样式 */
.footer-bar {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  box-shadow: 0 -2px 12px rgba(124, 108, 240, 0.08);
  padding: 16px 24px;
  position: relative;
  z-index: 100;
  font-size: 13px;
  color: #5A6070;
  margin-top: 24px;
  border-radius: 0 0 8px 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.footer-content {
  text-align: center;
  color: #5A6070;
}

.footer-divider {
  color: #5A6070;
}

body.dark-mode .footer-bar {
  background: rgba(45, 55, 72, 0.7);
  color: #cbd5e0;
}

body.dark-mode .footer-content,
body.dark-mode .footer-divider {
  color: #cbd5e0;
}

/* 简洁模式隐藏底部栏 */
.simple-mode .footer-bar {
  display: none;
}

/* 服务声明链接样式 */
.disclaimer-link {
  color: #5A6070;
  font-size: 13px;
  text-decoration: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.disclaimer-link:hover {
  color: #8A72D8;
  text-decoration: underline;
}

body.dark-mode .disclaimer-link {
  color: #cbd5e0;
}

body.dark-mode .disclaimer-link:hover {
  color: #a78bfa;
}