/**
 * APKPure Clone CMS - Core Base Styles
 */

:root {
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.25s ease-in-out;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Header & Navigation */
.site-header {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 68px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--brand-color);
  letter-spacing: -0.5px;
}

.site-brand span.highlight {
  color: var(--primary);
}

.site-brand .brand-badge {
  background: var(--primary);
  color: #ffffff;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Search bar with autocomplete */
.header-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.search-form {
  position: relative;
  width: 100%;
}

.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.75rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-main);
  font-size: 0.92rem;
  outline: none;
  transition: all var(--transition-fast);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background-color: var(--bg-card);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.5rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 420px;
  overflow-y: auto;
  z-index: 1050;
  display: none;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-fast);
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background-color: var(--bg-hover);
}

.autocomplete-thumb {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.autocomplete-info {
  flex: 1;
  min-width: 0;
}

.autocomplete-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.autocomplete-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Nav Menu */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background-color: var(--bg-hover);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-main);
  cursor: pointer;
}

/* Subnav / Category Bar */
.category-subbar {
  background-color: var(--bg-subbar);
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 0;
  overflow-x: auto;
  white-space: nowrap;
}

.category-subbar-list {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  list-style: none;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.85rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.cat-pill:hover, .cat-pill.active {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* Main Content Wrapper */
.main-wrapper {
  flex: 1;
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

/* Layout Grid */
.layout-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
}

.full-layout {
  grid-template-columns: 1fr;
}

/* Sections */
.section-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.section-title i {
  color: var(--primary);
}

.view-all-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.view-all-link:hover {
  text-decoration: underline;
}

/* App Cards Grids */
.apps-grid, .apps-grid-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1.25rem 0.75rem;
  justify-items: center;
}

/* Inside two-column layout grid (.layout-grid .apps-grid) */
.layout-grid .apps-grid {
  grid-template-columns: repeat(4, 1fr);
  gap: 1.15rem 0.65rem;
}

.app-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0.6rem 0.35rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  position: relative;
  text-decoration: none;
  width: 100%;
  max-width: 140px;
}

.app-card:hover {
  transform: translateY(-4px);
  background-color: var(--bg-hover);
}

.app-card-thumb-wrap {
  width: 88px;
  height: 88px;
  margin-bottom: 0.5rem;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  background: var(--bg-body);
}

.app-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
}

.app-card-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0,0,0,0.68);
  backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
}

.app-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 0.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  word-break: break-word;
}

.app-card-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 100%;
}

.app-card-rating {
  color: #f59e0b;
  display: flex;
  align-items: center;
  gap: 2px;
  font-weight: 600;
}

/* Horizontal / List App Cards */
.apps-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.app-list-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.app-list-item:hover {
  background-color: var(--bg-hover);
  border-color: var(--primary);
  transform: translateX(4px);
}

.app-list-rank {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-muted);
  width: 28px;
  text-align: center;
}

.app-list-rank.top-1 { color: #f59e0b; }
.app-list-rank.top-2 { color: #94a3b8; }
.app-list-rank.top-3 { color: #d97706; }

.app-list-thumb {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.app-list-info {
  flex: 1;
  min-width: 0;
}

.app-list-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-list-category {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.app-list-action {
  flex-shrink: 0;
}

/* Hero Carousel / Featured Banner */
.featured-hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.hero-main-card {
  background: var(--hero-gradient);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
  min-height: 280px;
  box-shadow: var(--shadow-md);
}

.hero-badge {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(8px);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-app-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1rem;
}

.hero-icon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
  object-fit: cover;
}

.hero-title {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
}

.hero-desc {
  font-size: 0.95rem;
  opacity: 0.9;
  margin-bottom: 1.25rem;
  max-width: 520px;
}

.hero-side-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* App Details Page */
.app-detail-header {
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-color);
}

.app-detail-icon-wrap {
  width: 125px;
  height: 125px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  flex-shrink: 0;
  background: var(--bg-hover);
}

.app-detail-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-detail-info {
  flex: 1;
}

.app-detail-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 0.35rem;
}

.app-detail-developer {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.app-detail-developer a {
  font-weight: 600;
}

.app-badges-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.app-tag-badge {
  background-color: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.app-tag-badge.verified {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #059669;
}

/* Action Buttons (Direct APK Download & Google Play Store) */
.action-buttons-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

/* Primary Direct Download Button */
.btn-direct-download {
  background: var(--btn-download-bg);
  color: #ffffff !important;
  box-shadow: 0 4px 12px var(--primary-glow);
  padding: 0.85rem 1.85rem;
  font-size: 1.05rem;
}

.btn-direct-download:hover {
  background: var(--btn-download-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--primary-glow);
}

.btn-direct-download .btn-subtext {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.9;
  margin-left: 0.35rem;
}

/* Official Google Play Store Button */
.btn-playstore {
  background-color: var(--btn-playstore-bg);
  border: 1px solid var(--btn-playstore-border);
  color: var(--btn-playstore-color) !important;
  padding: 0.8rem 1.5rem;
}

.btn-playstore:hover {
  background-color: var(--btn-playstore-hover);
  border-color: var(--btn-playstore-hover);
  transform: translateY(-2px);
  color: #ffffff !important;
}

.btn-playstore i {
  color: #00875a;
}

.btn-playstore:hover i {
  color: #ffffff;
}

/* Secondary Button */
.btn-secondary {
  background-color: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-main) !important;
}

.btn-secondary:hover {
  background-color: var(--border-color);
}

/* Screenshots Gallery */
.screenshots-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin: 1.5rem 0;
}

.screenshot-thumb-item {
  flex-shrink: 0;
  width: 180px;
  height: 320px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-hover);
}

.screenshot-thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.screenshot-thumb-item:hover img {
  transform: scale(1.04);
}

/* Tech Info Table */
.tech-spec-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}

.tech-spec-table tr {
  border-bottom: 1px solid var(--border-color);
}

.tech-spec-table th {
  text-align: left;
  padding: 0.75rem 0;
  color: var(--text-muted);
  font-weight: 500;
  width: 35%;
}

.tech-spec-table td {
  padding: 0.75rem 0;
  font-weight: 600;
  color: var(--text-main);
}

/* Download Gateway Page */
.download-gateway-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  max-width: 680px;
  margin: 1rem auto 2.5rem auto;
  box-shadow: var(--shadow-md);
}

.countdown-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 4px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  margin: 1.5rem auto;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

.safety-check-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #059669;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  margin: 1rem 0;
}

/* Monetization Banner Containers */
.commercial-banner-wrap {
  margin: 1.5rem 0;
  text-align: center;
  overflow: hidden;
  clear: both;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.breadcrumbs a {
  color: var(--text-secondary);
}

.breadcrumbs i {
  font-size: 0.75rem;
}

/* Footer */
.site-footer {
  background-color: var(--bg-footer);
  border-top: 1px solid var(--border-color);
  color: var(--text-footer);
  padding: 3rem 0 1.5rem 0;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.footer-col h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1.25rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.88rem;
}

.footer-links a {
  color: var(--text-footer-link);
}

.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Footer Social Share Buttons */
.footer-social-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.footer-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  font-size: 1rem;
  transition: all 0.25s ease;
  text-decoration: none;
}

.footer-social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.footer-social-btn.social-twitter:hover {
  background: #1da1f2;
  color: #ffffff;
  border-color: #1da1f2;
}

.footer-social-btn.social-facebook:hover {
  background: #1877f2;
  color: #ffffff;
  border-color: #1877f2;
}

.footer-social-btn.social-telegram:hover {
  background: #229ed9;
  color: #ffffff;
  border-color: #229ed9;
}

.footer-social-btn.social-whatsapp:hover {
  background: #25d366;
  color: #ffffff;
  border-color: #25d366;
}

.footer-social-btn.social-reddit:hover {
  background: #ff4500;
  color: #ffffff;
  border-color: #ff4500;
}

.footer-social-btn.social-youtube:hover {
  background: #ff0000;
  color: #ffffff;
  border-color: #ff0000;
}

.footer-social-btn.social-rss:hover {
  background: #f59e0b;
  color: #ffffff;
  border-color: #f59e0b;
}

/* Responsive Breakpoints & Mobile Friendly Overhaul */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

@media (min-width: 1025px) {
  .apps-grid, .apps-grid-6 {
    grid-template-columns: repeat(6, 1fr) !important;
  }
  .layout-grid .apps-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
}

@media (max-width: 1024px) {
  .layout-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .featured-hero {
    grid-template-columns: 1fr;
  }
  .apps-grid, .apps-grid-6, .layout-grid .apps-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 1.15rem 0.65rem;
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 0.85rem;
  }
  .site-header {
    position: relative;
    padding: 0.65rem 0;
  }
  .header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
  }
  .site-brand {
    order: 1;
    font-size: 1.25rem;
  }
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    order: 2;
    margin-left: auto;
    width: 42px;
    height: 42px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
  }
  .mobile-menu-toggle:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
  }
  .header-search {
    order: 3;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0.2rem 0 0 0;
  }
  .header-search .search-form {
    width: 100%;
  }
  .header-search .search-input {
    width: 100%;
    height: 42px;
    font-size: 0.9rem;
    border-radius: var(--radius-full);
  }
  .search-autocomplete-dropdown {
    width: 100%;
    top: 48px;
    left: 0;
    right: 0;
    z-index: 9999;
  }
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 2px solid var(--primary);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    padding: 1rem 1.25rem;
    gap: 0.6rem;
    z-index: 1000;
  }
  .nav-menu.is-open {
    display: flex !important;
  }
  .nav-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.75rem;
    font-size: 0.95rem;
    border-radius: var(--radius-md);
    color: var(--text-main);
  }
  .nav-link:hover, .nav-link.active {
    background: var(--bg-hover);
    color: var(--primary);
  }
  .category-subbar {
    padding: 0.5rem 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .category-subbar::-webkit-scrollbar {
    display: none;
  }
  .cat-pill {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
  }
  .apps-grid, .apps-grid-6, .layout-grid .apps-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1rem 0.45rem;
  }
  .app-card {
    max-width: 100%;
    padding: 0.45rem 0.2rem;
  }
  .app-card-thumb-wrap {
    width: 76px;
    height: 76px;
    border-radius: 18px;
  }
  .app-card-thumb {
    border-radius: 18px;
  }
  .app-card-title {
    font-size: 0.8rem;
    line-height: 1.25;
  }
  .app-card-meta {
    font-size: 0.72rem;
    gap: 0.3rem;
  }
  .section-box {
    padding: 1.15rem 0.85rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-md);
  }
  .section-header {
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
  }
  .section-title {
    font-size: 1.1rem;
  }
  .hero-main-card {
    padding: 1.35rem 1rem;
    min-height: auto;
  }
  .hero-app-header {
    gap: 0.85rem;
    margin-bottom: 1rem;
  }
  .hero-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }
  .hero-title {
    font-size: 1.35rem;
    line-height: 1.25;
  }
  .hero-desc {
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
  }
  .action-buttons-row {
    flex-direction: column;
    width: 100%;
    gap: 0.65rem;
  }
  .action-buttons-row .btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem 1rem;
    font-size: 0.92rem;
  }
  .hero-side-card {
    padding: 1.25rem 1rem;
  }
  .app-detail-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
  }
  .app-detail-icon-wrap {
    width: 96px;
    height: 96px;
  }
  .app-detail-icon {
    width: 96px;
    height: 96px;
    border-radius: 22px;
  }
  .app-detail-title {
    font-size: 1.45rem;
  }
  .app-badges-row {
    justify-content: center;
  }
  .tech-spec-table {
    table-layout: fixed;
  }
  .tech-spec-table th {
    width: 40%;
  }
  .tech-spec-table th, .tech-spec-table td {
    padding: 0.6rem 0.35rem;
    font-size: 0.82rem;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .tech-spec-table td code {
    word-break: break-all;
    white-space: normal;
  }
  .download-gateway-card {
    padding: 1.5rem 1rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.65rem;
  }
  .apps-grid, .apps-grid-6, .layout-grid .apps-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.85rem 0.35rem;
  }
  .app-card-thumb-wrap {
    width: 66px;
    height: 66px;
    border-radius: 16px;
  }
  .app-card-thumb {
    border-radius: 16px;
  }
  .hero-icon {
    width: 62px;
    height: 62px;
    border-radius: 16px;
  }
  .hero-title {
    font-size: 1.2rem;
  }
  .app-tag-badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }
}

@media (max-width: 350px) {
  .apps-grid, .apps-grid-6, .layout-grid .apps-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.85rem 0.5rem;
  }
  .app-card-thumb-wrap {
    width: 74px;
    height: 74px;
  }
}
