:root {
  --brand: #534AB7;
  --brand-deep: #3C3489;
  --brand-soft: #EEEDFE;
  --brand-softer: #F6F5FE;
  --text: #23262F;
  --text-2: #5D6070;
  --text-3: #9AA0B0;
  --bg: #FFFFFF;
  --bg-soft: #F7F7FB;
  --border: #E8E8F2;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(35, 38, 47, 0.04), 0 4px 16px rgba(83, 74, 183, 0.06);
  --shadow-hover: 0 2px 4px rgba(35, 38, 47, 0.06), 0 10px 28px rgba(83, 74, 183, 0.12);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px;
  gap: 24px;
}
.logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 19px; flex-shrink: 0; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, #6C63E0, #534AB7);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700;
  box-shadow: 0 4px 10px rgba(83, 74, 183, 0.22);
}
.logo-text { display: flex; align-items: baseline; gap: 6px; }
.logo small { font-size: 12px; color: var(--text-3); font-weight: 400; }

/* Desktop nav */
.desktop-nav {
  display: flex; align-items: center; gap: 2px;
  flex: 1;
  justify-content: center;
}
.nav-link {
  position: relative;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  transition: color 0.18s, background 0.18s;
  white-space: nowrap;
}
.nav-link:hover {
  color: var(--brand);
  background: var(--brand-softer);
}
.nav-link.active {
  color: var(--brand);
}
.nav-link.active::after,
.desktop-nav > .nav-link:not(.dropdown-toggle):hover::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--brand);
  opacity: 0.85;
}
.nav-link.active::after { opacity: 1; }

/* Dropdown */
.nav-dropdown { position: relative; }
.dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.dropdown-toggle .caret {
  font-size: 10px;
  transition: transform 0.2s;
  opacity: 0.7;
}
.nav-dropdown.open .dropdown-toggle .caret { transform: rotate(180deg); }
.nav-dropdown.open .dropdown-toggle {
  color: var(--brand);
  background: var(--brand-softer);
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 180px;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(35, 38, 47, 0.12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}
.nav-dropdown.open .dropdown-menu,
.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}
.dropdown-item:hover {
  background: var(--brand-softer);
  color: var(--brand);
}
.dropdown-item.active { color: var(--brand); font-weight: 600; }
.dropdown-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--brand-soft);
  flex-shrink: 0;
}
.dropdown-item:hover .dropdown-dot,
.dropdown-item.active .dropdown-dot { background: var(--brand); }

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.btn-sm {
  padding: 8px 18px;
  font-size: 14px;
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: var(--brand-softer);
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  border-radius: 2px;
  background: var(--brand);
  transition: transform 0.2s, opacity 0.2s;
}

/* Mobile drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  pointer-events: none;
  visibility: hidden;
  overflow: hidden;
}
.mobile-drawer.open {
  pointer-events: auto;
  visibility: visible;
}
.mobile-drawer-backdrop {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: rgba(35, 38, 47, 0.35);
  opacity: 0;
  transition: opacity 0.25s;
}
.mobile-drawer.open .mobile-drawer-backdrop { opacity: 1; }
.mobile-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 85vw);
  height: 100%;
  background: #fff;
  box-shadow: -8px 0 40px rgba(35, 38, 47, 0.12);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mobile-drawer.open .mobile-drawer-panel { transform: translateX(0); }
.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.menu-close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text-2);
  font-size: 18px;
  cursor: pointer;
}
.menu-close:hover { background: var(--brand-softer); color: var(--brand); }
.mobile-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mobile-nav-link {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}
.mobile-nav-link:hover,
.mobile-nav-link.active {
  background: var(--brand-softer);
  color: var(--brand);
}
.mobile-nav-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 0;
}

/* Hero */
.hero { padding: 72px 0 48px; text-align: center; }
.hero h1 {
  font-size: 42px; font-weight: 600; letter-spacing: -0.5px; line-height: 1.25;
  background: linear-gradient(120deg, #23262F 30%, #534AB7 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { margin-top: 14px; color: var(--text-2); font-size: 17px; }
.hero-stats { margin-top: 28px; display: flex; justify-content: center; gap: 40px; }
.hero-stats .num { font-size: 26px; font-weight: 600; color: var(--brand); }
.hero-stats .label { font-size: 13px; color: var(--text-3); }

/* Search */
.search-wrap { max-width: 620px; margin: 36px auto 0; position: relative; }
.search-input {
  width: 100%; height: 56px; padding: 0 52px 0 20px;
  border: 1.5px solid var(--border); border-radius: 999px;
  font-size: 16px; color: var(--text); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  background: var(--bg);
}
.search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(83, 74, 183, 0.12);
}
.search-icon {
  position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-size: 18px; pointer-events: none;
}

/* Section */
.section { padding: 40px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; }
.section-title { font-size: 22px; font-weight: 600; }
.section-sub { color: var(--text-3); font-size: 14px; }

/* Category chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.chip {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--bg); font-size: 14px; color: var(--text-2); cursor: pointer;
  transition: all 0.15s; user-select: none;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }

/* Category entry cards */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cat-card {
  padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg); box-shadow: var(--shadow); transition: all 0.18s;
  display: flex; align-items: flex-start; gap: 14px;
}
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: #C9C5F2; }
.cat-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.cat-card h3 { font-size: 16px; font-weight: 600; }
.cat-card p { font-size: 13px; color: var(--text-3); margin-top: 3px; }
.cat-card .count { font-size: 12px; color: var(--brand); margin-top: 6px; font-weight: 500; }

/* Tool grid & cards */
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tool-card {
  display: block; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg); box-shadow: var(--shadow); transition: all 0.18s;
}
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); border-color: #C9C5F2; }
.tool-top { display: flex; align-items: center; gap: 12px; }
.tool-logo {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 17px; font-weight: 600;
}
.tool-name { font-size: 16px; font-weight: 600; line-height: 1.3; }
.tool-nameen { font-size: 12px; color: var(--text-3); }
.tool-badges { margin-left: auto; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 500; }
.badge-free { background: #EAF3DE; color: #3B6D11; }
.badge-freemium { background: #E6F1FB; color: #185FA5; }
.badge-paid { background: #FAEEDA; color: #854F0B; }
.badge-cn { background: #FBEAF0; color: #993556; }
.tool-desc { margin-top: 12px; font-size: 13.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool-tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; color: var(--text-2); background: var(--bg-soft); padding: 3px 10px; border-radius: 999px; }
.tool-meta { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-3); }
.tool-go { color: var(--brand); font-weight: 500; }

.hidden-card { display: none !important; }

/* Detail page */
.breadcrumb { padding: 26px 0 0; font-size: 13px; color: var(--text-3); }
.breadcrumb a:hover { color: var(--brand); }
.detail { padding: 28px 0 60px; }
.detail-card { padding: 36px; border: 1px solid var(--border); border-radius: 20px; background: var(--bg); box-shadow: var(--shadow); }
.detail-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.detail-logo { width: 64px; height: 64px; border-radius: 16px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 26px; font-weight: 600; }
.detail-title { font-size: 28px; font-weight: 600; }
.detail-nameen { font-size: 15px; color: var(--text-3); }
.detail-desc { margin-top: 18px; font-size: 16px; color: var(--text-2); max-width: 720px; }
.detail-actions { margin-top: 26px; display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 26px;
  border-radius: 999px; font-size: 15px; font-weight: 500; transition: all 0.15s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-deep); }
.btn-ghost { border: 1px solid var(--border); color: var(--text-2); background: var(--bg); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.detail-info { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; }
.detail-info .tag { font-size: 13px; padding: 5px 14px; }

/* Simple pages */
.simple-page { padding: 56px 0 80px; max-width: 760px; }
.simple-page h1 { font-size: 30px; font-weight: 600; margin-bottom: 12px; }
.simple-page .lead { color: var(--text-2); font-size: 16px; margin-bottom: 32px; }
.simple-card { padding: 28px; border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 16px; }
.simple-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.simple-card p { color: var(--text-2); font-size: 14px; }
.simple-card ul { padding-left: 20px; color: var(--text-2); font-size: 14px; margin-top: 6px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: 36px 0 44px; margin-top: 48px; background: var(--bg-soft); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.site-footer .logo { font-size: 16px; }
.site-footer .copy { font-size: 13px; color: var(--text-3); }
.footer-links { display: flex; gap: 20px; font-size: 13px; color: var(--text-2); }
.footer-links a:hover { color: var(--brand); }
.contact-line { font-size: 13px; color: var(--text-2); margin-top: 8px; }
.contact-line a { color: var(--brand); }
.contact-line a:hover { text-decoration: underline; }
.contact-list { padding-left: 20px; color: var(--text-2); font-size: 14px; margin-top: 6px; }
.contact-list li { margin-bottom: 8px; }
.contact-list a { color: var(--brand); }
.contact-list a:hover { text-decoration: underline; }

/* Empty state */
.empty { text-align: center; padding: 60px 0; color: var(--text-3); font-size: 15px; }

/* Responsive */
@media (max-width: 1100px) {
  .desktop-nav { gap: 0; }
  .nav-link { padding: 8px 11px; font-size: 14px; }
}
@media (max-width: 960px) {
  .desktop-nav,
  .header-actions .nav-link[href="/about"] {
    display: none;
  }
  .header-actions .btn-primary {
    display: none;
  }
  .menu-toggle { display: flex; }
  .header-inner { gap: 12px; }
}
@media (max-width: 900px) {
  .tool-grid, .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 32px; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .tool-grid, .cat-grid { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 36px; }
  .hero h1 { font-size: 26px; }
  .detail-card { padding: 24px; }
  .logo-text small { display: none; }
}
