/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #333; background: #f4f6f9; line-height: 1.6; min-height: 100vh;
}
a { color: #2563eb; text-decoration: none; transition: color .2s; }
a:hover { color: #1d4ed8; }
img { max-width: 100%; vertical-align: middle; }
ul, ol { list-style: none; }

/* ===== Layout ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }

/* ===== Header / Navbar ===== */
.header {
  background: #fff; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.header .container { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-size: 1.4rem; font-weight: 700; color: #1e40af; display: flex; align-items: center; gap: 8px; }
.logo img { height: 26px; width: auto; }
.logo span { color: #1e293b; }
.logo:hover { color: #1e40af; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 6px 14px; border-radius: 6px; color: #4b5563; font-size: .93rem; transition: all .2s;
}
.nav-links a:hover, .nav-links a.active { background: #eff6ff; color: #2563eb; }
.nav-links a .nav-icon { width: 16px; height: 16px; margin-right: 4px; vertical-align: -2px; }
.search-box {
  display: flex; align-items: center; background: #f3f4f6; border-radius: 8px; padding: 0 12px; height: 36px;
  border: 1px solid transparent; transition: all .2s;
}
.search-box:focus-within { border-color: #2563eb; background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.search-box input {
  border: none; outline: none; background: transparent; font-size: .9rem; width: 180px; color: #333; height: 100%;
}
.search-box .search-icon { width: 16px; height: 16px; opacity: .5; cursor: pointer; flex-shrink: 0; }
.mobile-search-btn { display: none; width: 36px; height: 36px; border-radius: 8px; background: #f3f4f6; align-items: center; justify-content: center; flex-shrink: 0; }
.mobile-search-btn img { width: 18px; height: 18px; opacity: .6; }

/* ===== Search Page Box ===== */
.search-page-box {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 8px 8px 8px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.search-page-box:focus-within { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.search-page-box input { flex: 1; border: none; outline: none; font-size: 1rem; color: #333; background: transparent; min-width: 0; }
.search-page-box button {
  padding: 10px 24px; background: #2563eb; color: #fff; border: none; border-radius: 8px;
  font-size: .95rem; cursor: pointer; white-space: nowrap; transition: background .2s;
}
.search-page-box button:hover { background: #1d4ed8; }
.section { padding: 28px 0; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title {
  font-size: 1.25rem; font-weight: 700; color: #1e293b; display: flex; align-items: center; gap: 8px;
}
.section-title::before {
  content: ''; display: block; width: 4px; height: 20px; background: #2563eb; border-radius: 2px;
}
.section-more { font-size: .85rem; color: #6b7280; display: flex; align-items: center; gap: 4px; }
.section-more:hover { color: #2563eb; }
.section-more img { width: 14px; height: 14px; }

/* ===== Hero Banner (Featured) ===== */

/* ===== Banner ===== */
.banner {
  position: relative; width: 100%; height: 320px; overflow: hidden;
  background: url('../images/banner-bg.jpg') center/cover no-repeat;
}
.banner-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(15,23,42,.82), rgba(37,99,235,.65));
}
.banner-content {
  position: relative; z-index: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; height: 100%; text-align: center;
}
.banner-title {
  font-size: 2.4rem; font-weight: 800; color: #fff; margin-bottom: 12px;
  letter-spacing: 4px; text-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.banner-desc {
  font-size: 1.15rem; color: rgba(255,255,255,.92); margin-bottom: 6px; font-weight: 500;
}
.banner-sub {
  font-size: .88rem; color: rgba(255,255,255,.7); margin-bottom: 28px;
}
.banner-search {
  display: flex; max-width: 520px; width: 100%; border-radius: 12px; overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
}
.banner-search input {
  flex: 1; border: none; outline: none; padding: 14px 20px; font-size: 1rem;
  background: #fff; color: #333; min-width: 0;
}
.banner-search button {
  padding: 14px 32px; background: #2563eb; color: #fff; border: none;
  font-size: 1rem; font-weight: 600; cursor: pointer; transition: background .2s;
}
.banner-search button:hover { background: #1d4ed8; }
.banner-search .btn-icon { width: 16px; height: 16px; vertical-align: -2px; filter: brightness(0) invert(1); margin-right: 4px; }

/* ===== Featured Grid ===== */
.hero-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.hero-card {
  background: #fff; border-radius: 12px; padding: 24px 20px; text-align: center;
  border: 1px solid #e5e7eb; transition: all .3s; cursor: pointer; position: relative; overflow: hidden;
}
.hero-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0,0,0,.08); border-color: #c7d2fe; }
.hero-card .soft-icon {
  width: 64px; height: 64px; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; font-size: 1.4rem; font-weight: 700; color: #fff;
}
.hero-card .soft-name { font-size: 1.05rem; font-weight: 600; color: #1e293b; margin-bottom: 4px; }
.hero-card .soft-desc { font-size: .8rem; color: #94a3b8; line-height: 1.4; margin-bottom: 12px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-card .soft-meta { font-size: .75rem; color: #94a3b8; }
.hero-card .btn-download {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 12px; padding: 8px 20px; background: #2563eb; color: #fff; border-radius: 8px;
  font-size: .85rem; font-weight: 500; transition: all .2s; border: none; cursor: pointer;
}
.hero-card .btn-download:hover { background: #1d4ed8; color: #fff; }
.hero-card .btn-download img { width: 14px; height: 14px; filter: brightness(0) invert(1); }

/* ===== Essential Grid ===== */
.essential-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px;
}
.essential-item {
  display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 10px; padding: 14px;
  border: 1px solid #e5e7eb; transition: all .2s; cursor: pointer;
}
.essential-item:hover { border-color: #c7d2fe; box-shadow: 0 4px 12px rgba(0,0,0,.06); }
.essential-item .soft-icon {
  width: 44px; height: 44px; min-width: 44px; display: flex; align-items: center; justify-content: center;
  font-size: .9rem; font-weight: 700; color: #fff;
}
.essential-item .soft-info { flex: 1; min-width: 0; }
.essential-item .soft-name { font-size: .9rem; font-weight: 600; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.essential-item .soft-cat { font-size: .75rem; color: #94a3b8; }

/* ===== Software List ===== */
.soft-list { display: flex; flex-direction: column; gap: 1px; background: #e5e7eb; border-radius: 12px; overflow: hidden; border: 1px solid #e5e7eb; }
.soft-list-item {
  display: flex; align-items: center; padding: 16px 20px; background: #fff; gap: 16px; transition: background .2s;
}
.soft-list-item:hover { background: #f8fafc; }
.soft-list-item .soft-icon {
  width: 48px; height: 48px; min-width: 48px; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: #fff;
}
.soft-list-item .soft-info { flex: 1; min-width: 0; }
.soft-list-item .soft-name { font-size: 1rem; font-weight: 600; color: #1e293b; }
.soft-list-item .soft-name:hover { color: #2563eb !important; }
.soft-list-item .soft-desc { font-size: .8rem; color: #94a3b8; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soft-list-item .soft-meta-group { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.soft-list-item .meta-item { display: flex; align-items: center; gap: 4px; font-size: .8rem; color: #6b7280; white-space: nowrap; }
.soft-list-item .meta-item img { width: 14px; height: 14px; opacity: .5; }
.soft-list-item .btn-download {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 18px; background: #2563eb; color: #fff; border-radius: 7px;
  font-size: .82rem; font-weight: 500; transition: all .2s; border: none; cursor: pointer; white-space: nowrap;
}
.soft-list-item .btn-download:hover { background: #1d4ed8; color: #fff; }
.soft-list-item .btn-download img { width: 14px; height: 14px; filter: brightness(0) invert(1); }

/* ===== Sidebar ===== */
.page-layout { display: flex; gap: 24px; }
.page-main { flex: 1; min-width: 0; }
.page-sidebar { width: 260px; flex-shrink: 0; }
.sidebar-card {
  background: #fff; border-radius: 12px; border: 1px solid #e5e7eb; padding: 20px; margin-bottom: 16px;
}
.sidebar-card .card-title { font-size: 1rem; font-weight: 700; color: #1e293b; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid #f1f5f9; }
.sidebar-cat-list { display: flex; flex-direction: column; gap: 2px; }
.sidebar-cat-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  color: #4b5563; font-size: .9rem; transition: all .2s; cursor: pointer;
}
.sidebar-cat-item:hover, .sidebar-cat-item.active { background: #eff6ff; color: #2563eb; }
.sidebar-cat-item img { width: 18px; height: 18px; }
.sidebar-cat-item .cat-count { margin-left: auto; font-size: .75rem; color: #94a3b8; background: #f1f5f9; padding: 2px 8px; border-radius: 10px; }

/* ===== Detail Page ===== */
.detail-header {
  background: #fff; border-radius: 12px; border: 1px solid #e5e7eb; padding: 32px; margin-bottom: 24px;
  display: flex; gap: 28px;
}
.detail-icon {
  width: 96px; height: 96px; min-width: 96px; display: flex; align-items: center; justify-content: center;
  font-size: 2rem; font-weight: 700; color: #fff;
}
.detail-info { flex: 1; }
.detail-name { font-size: 1.6rem; font-weight: 700; color: #0f172a; margin-bottom: 8px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 12px; }
.detail-meta .meta-item { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: #6b7280; }
.detail-meta .meta-item img { width: 15px; height: 15px; opacity: .55; }
.detail-rating { display: flex; align-items: center; gap: 4px; margin-bottom: 16px; }
.detail-rating img { width: 18px; height: 18px; }
.detail-rating .rating-score { font-size: 1.1rem; font-weight: 700; color: #f59e0b; margin-left: 6px; }
.detail-desc { font-size: .9rem; color: #64748b; line-height: 1.7; }
.detail-actions { display: flex; gap: 12px; margin-top: 20px; }
.btn-download-lg {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 36px; background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; border-radius: 10px;
  font-size: 1rem; font-weight: 600; border: none; cursor: pointer; transition: all .2s;
  box-shadow: 0 4px 14px rgba(37,99,235,.3);
}
.btn-download-lg:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(37,99,235,.4); color: #fff; }
.btn-download-lg img { width: 18px; height: 18px; filter: brightness(0) invert(1); }
.btn-visit {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; background: #f1f5f9; color: #475569; border-radius: 10px;
  font-size: 1rem; font-weight: 500; border: 1px solid #e2e8f0; cursor: pointer; transition: all .2s;
}
.btn-visit:hover { background: #e2e8f0; color: #475569; }
.btn-visit img { width: 16px; height: 16px; }

.detail-content {
  background: #fff; border-radius: 12px; border: 1px solid #e5e7eb; padding: 32px;
}
.detail-content h3 { font-size: 1.15rem; font-weight: 700; color: #1e293b; margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px; }
.detail-content h3::before { content: ''; display: block; width: 4px; height: 18px; background: #2563eb; border-radius: 2px; }
.detail-body { font-size: .9rem; color: #475569; line-height: 2; white-space: pre-line; }

/* ===== Related Software ===== */
.related-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 20px;
}
.related-card {
  display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 10px; padding: 14px;
  border: 1px solid #e5e7eb; transition: all .2s; cursor: pointer;
}
.related-card:hover { border-color: #c7d2fe; box-shadow: 0 4px 12px rgba(0,0,0,.06); }
.related-card .soft-icon {
  width: 40px; height: 40px; min-width: 40px; display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: #fff;
}
.related-card .soft-name { font-size: .85rem; font-weight: 600; color: #1e293b; }
.related-card .soft-cat { font-size: .72rem; color: #94a3b8; }

/* ===== Breadcrumb ===== */
.breadcrumb { display: flex; align-items: center; gap: 6px; padding: 16px 0; font-size: .85rem; color: #94a3b8; }
.breadcrumb a { color: #6b7280; }
.breadcrumb a:hover { color: #2563eb; }
.breadcrumb .sep { margin: 0 2px; }

/* ===== Category Tags ===== */
.cat-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.cat-tag {
  padding: 6px 16px; border-radius: 20px; font-size: .85rem; color: #6b7280; background: #fff;
  border: 1px solid #e5e7eb; cursor: pointer; transition: all .2s;
}
.cat-tag:hover, .cat-tag.active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* ===== Footer ===== */
.footer {
  background: #1e293b; color: #94a3b8; padding: 32px 0; margin-top: 40px; text-align: center;
  font-size: .82rem; line-height: 1.8;
}
.footer a { color: #94a3b8; }
.footer a:hover { color: #e2e8f0; }
.footer a.btn-download-lg:hover { color: #fff; }
.footer .footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 20px; margin-bottom: 12px; }
.footer .footer-company { margin-top: 12px; }
.footer .footer-company p { margin: 2px 0; }

/* ===== Star Rating Colors ===== */
.star-gold { filter: sepia(1) saturate(5) hue-rotate(0deg) brightness(1.1); }
.star-gray { filter: grayscale(1) opacity(.3); }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: repeat(2, 1fr); }
  .essential-grid { grid-template-columns: repeat(3, 1fr); }
  .related-grid { grid-template-columns: repeat(2, 1fr); }
  .page-sidebar { width: 220px; }
}
@media (max-width: 768px) {
  .header .container { height: auto; padding: 8px 12px; gap: 8px; }
  .nav-links { display: none; }
  .logo { font-size: 1.2rem; gap: 4px; flex-shrink: 0; }
  .logo img { height: 26px; width: auto; }
  .search-box { display: none; }
  .mobile-search-btn { display: flex; }
  .search-page-box { padding: 6px 6px 6px 12px; }
  .search-page-box button { padding: 8px 16px; font-size: .85rem; }
  .banner { height: 260px; }
  .banner-title { font-size: 1.6rem; }
  .banner-desc { font-size: .95rem; }
  .banner-sub { font-size: .78rem; margin-bottom: 20px; }
  .banner-search button { padding: 12px 20px; font-size: .9rem; }
  .hero-grid { grid-template-columns: 1fr; }
  .essential-grid { grid-template-columns: repeat(2, 1fr); }
  .page-layout { flex-direction: column; }
  .page-sidebar { width: 100%; }
  .soft-list-item {
    flex-wrap: wrap; padding: 14px 16px; gap: 12px;
  }
  .soft-list-item .soft-icon { width: 40px; height: 40px; min-width: 40px; }
  .soft-list-item .soft-info { flex: 1; min-width: 0; }
  .soft-list-item .soft-name { font-size: .9rem; }
  .soft-list-item .soft-desc { font-size: .75rem; margin-top: 2px;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
    overflow: hidden; white-space: normal;
  }
  .soft-list-item .soft-meta-group {
    width: 100%; order: 3; display: flex; flex-wrap: wrap; gap: 10px;
    margin-top: 0; padding-top: 8px; border-top: 1px solid #f1f5f9;
  }
  .soft-list-item .meta-item { font-size: .75rem; }
  .soft-list-item .btn-download {
    order: 2; padding: 6px 14px; font-size: .78rem; align-self: center;
  }
  .detail-header { flex-direction: column; align-items: center; text-align: center; padding: 20px; }
  .detail-meta { justify-content: center; }
  .detail-actions { justify-content: center; flex-wrap: wrap; }
  .related-grid { grid-template-columns: 1fr; }
  .footer .footer-links { gap: 12px; }
  .btn-download-lg { padding: 10px 24px; font-size: .9rem; }
  .btn-visit { padding: 10px 20px; font-size: .9rem; }
  .pagination .page-num { display: none; }
  .pagination .page-ellipsis { display: none; }
  .pagination .page-mobile-info { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; height: 36px; }
}

/* ===== Pagination ===== */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 24px; padding: 20px 0;
}
.page-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px; border-radius: 8px;
  font-size: .9rem; color: #4b5563; background: #fff; border: 1px solid #e5e7eb;
  transition: all .2s; cursor: pointer;
}
.page-num:hover { border-color: #2563eb; color: #2563eb; }
.page-num.active {
  background: #2563eb; color: #fff; border-color: #2563eb;
  font-weight: 600; cursor: default; pointer-events: none;
}
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 16px; border-radius: 8px;
  font-size: .85rem; color: #4b5563; background: #fff; border: 1px solid #e5e7eb;
  transition: all .2s; cursor: pointer;
}
.page-btn:hover { border-color: #2563eb; color: #2563eb; }
.page-btn.disabled {
  color: #cbd5e1; cursor: default; pointer-events: none; background: #f9fafb;
}
.page-ellipsis {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 36px; font-size: .9rem; color: #94a3b8;
  letter-spacing: 2px;
}
.page-mobile-info {
  display: none; font-size: .9rem; font-weight: 600; color: #4b5563;
}
.page-info {
  text-align: center; font-size: .82rem; color: #94a3b8; margin-top: 12px;
}

/* ===== Utility ===== */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-12 { margin-bottom: 12px; }
.hidden { display: none !important; }
