*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.category-modern {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(29,78,216,.10), transparent 34%),
    linear-gradient(300deg, rgba(22,163,74,.10), transparent 32%),
    linear-gradient(180deg, #f8fbff 0%, #eef4ff 48%, #f7fff9 100%);
  color: #111827;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

.category-modern a { color: inherit; text-decoration: none; }
.category-shell { min-height: 100vh; }

.category-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.88);
  border-bottom: 1px solid rgba(226,232,240,.9);
  backdrop-filter: blur(18px);
}

.category-topbar-inner {
  max-width: 1240px;
  min-height: 68px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.category-brand img {
  display: block;
  width: 144px;
  height: auto;
}

.category-nav,
.quick-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.category-nav a,
.quick-row a,
.section-title > a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 13px;
}

.category-nav a:hover,
.quick-row a:hover,
.section-title > a:hover {
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.category-nav .primary {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
  font-weight: 700;
}

.category-nav .danger {
  border-color: #fecaca;
  background: #fff7f7;
  color: #b91c1c;
}

main,
.category-footer {
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
}

.category-hero {
  min-height: 280px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
  padding: 44px 0 24px;
}

.category-kicker {
  margin: 0 0 10px;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.category-hero h1 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(36px, 7vw, 74px);
  line-height: 1;
}

.category-hero p {
  max-width: 760px;
  margin: 18px 0 0;
  color: #526178;
  font-size: 16px;
  line-height: 1.85;
}

.category-stats {
  display: grid;
  grid-template-columns: repeat(3, 112px);
  gap: 10px;
}

.category-stats div {
  min-height: 98px;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(255,255,255,.86);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(15,23,42,.08);
}

.category-stats span {
  color: #0f172a;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.category-stats small {
  color: #64748b;
  font-size: 12px;
}

.search-panel,
.category-card,
.site-section {
  margin-bottom: 18px;
  padding: 20px;
  background: rgba(255,255,255,.90);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15,23,42,.07);
}

.category-search {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 132px;
  gap: 10px;
  margin-bottom: 14px;
}

.category-search select,
.category-search input,
.category-search button {
  min-height: 48px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  outline: none;
}

.category-search select {
  padding: 0 12px;
}

.category-search input {
  padding: 0 16px;
}

.category-search input:focus,
.category-search select:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}

.category-search button {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-title p {
  margin: 0 0 5px;
  color: #64748b;
  font-size: 12px;
  text-transform: uppercase;
}

.section-title h2 {
  margin: 0;
  color: #0f172a;
  font-size: 24px;
  line-height: 1.2;
}

.section-title.compact h2 {
  font-size: 22px;
}

.category-pills,
.branch-links,
.site-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 10px;
}

.category-pills a,
.branch-links a,
.site-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #1f2937;
  transition: transform .16s, border-color .16s, box-shadow .16s, background .16s;
}

.category-pills a:hover,
.branch-links a:hover,
.site-link:hover {
  transform: translateY(-2px);
  border-color: #bfdbfe;
  background: #fff;
  box-shadow: 0 12px 24px rgba(29,78,216,.10);
}

.branch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.branch-card {
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fbfdff;
}

.branch-card h3 {
  margin: 0 0 12px;
  color: #0f172a;
  font-size: 17px;
}

.site-sections {
  display: grid;
  gap: 18px;
}

.site-link span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-link em {
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  background: #fee2e2;
  color: #b91c1c;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.empty-state {
  padding: 28px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  text-align: center;
}

.ad-modern {
  overflow: auto;
}

.category-footer {
  margin-top: 20px;
  padding: 26px 0 42px;
  border-top: 1px solid rgba(203, 213, 225, .78);
  color: #64748b;
  text-align: center;
  font-size: 13px;
}

.category-footer div {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.category-footer div a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: rgba(255,255,255,.72);
  color: #1d4ed8;
}

.category-footer div a:hover {
  border-color: #bfdbfe;
  background: #eef2ff;
}

.category-footer p {
  margin: 0;
  line-height: 1.7;
}

.category-footer p a {
  color: #64748b;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 900px) {
  main,
  .category-footer {
    width: min(100% - 28px, 1240px);
  }
  .category-topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 16px;
  }
  .category-nav {
    justify-content: flex-start;
    width: 100%;
  }
  .category-hero,
  .category-search {
    grid-template-columns: 1fr;
  }
  .category-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .category-footer {
    padding-bottom: 32px;
  }
}

@media (max-width: 560px) {
  .category-hero {
    min-height: auto;
    padding-top: 30px;
  }
  .category-hero h1 {
    font-size: 40px;
  }
  .category-stats {
    grid-template-columns: 1fr;
  }
  .category-footer div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .category-footer div a {
    min-width: 0;
  }
  .search-panel,
  .category-card,
  .site-section {
    padding: 16px;
  }
  .section-title {
    align-items: flex-start;
    flex-direction: column;
  }
  .category-nav a,
  .quick-row a,
  .section-title > a {
    flex: 1;
  }
  .category-pills,
  .branch-links,
  .site-grid {
    grid-template-columns: 1fr;
  }
}
