/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: 'Plus Jakarta Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #F8FAFC;
  color: #1E293B;
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

:root {
  --office: #3B82F6;
  --office-bg: #EFF6FF;
  --office-border: rgba(59,130,246,0.2);
  --chat: #10B981;
  --chat-bg: #ECFDF5;
  --chat-border: rgba(16,185,129,0.2);
  --tools: #F59E0B;
  --tools-bg: #FFFBEB;
  --tools-border: rgba(245,158,11,0.2);
  --bg: #F8FAFC;
  --bg-white: #FFFFFF;
  --bg-light: #F1F5F9;
  --border: #E2E8F0;
  --text-main: #1E293B;
  --text-sub: #475569;
  --text-muted: #94A3B8;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
}

/* ===== HEADER ===== */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.header-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center;
  padding: 0 24px; height: 64px; gap: 24px;
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  display: flex; align-items: center; justify-content: center;
}
.logo-icon.small { width: 28px; height: 28px; border-radius: 8px; }
.logo-icon svg { width: 18px; height: 18px; color: #fff; }
.logo-icon.small svg { width: 14px; height: 14px; }
.logo-text { display: flex; flex-direction: column; }
.logo-main {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem; font-weight: 800; color: var(--text-main); line-height: 1;
}
.logo-sub { font-size: 0.62rem; color: var(--text-muted); }

.nav { display: flex; gap: 4px; }
.nav-link {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px;
  font-size: 0.875rem; font-weight: 600; color: var(--text-sub);
  transition: all 0.2s; white-space: nowrap;
}
.nav-link svg { width: 15px; height: 15px; }
.nav-link:hover { color: #6366F1; background: rgba(99,102,241,0.08); }
.nav-link.active { color: #6366F1; background: rgba(99,102,241,0.1); }

.header-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-light); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 14px;
  transition: border-color 0.2s; min-width: 200px;
}
.search-box:focus-within { border-color: #6366F1; background: #fff; }
.search-box svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }
.search-box input {
  background: none; border: none; outline: none;
  font-size: 0.875rem; color: var(--text-main);
  font-family: inherit; width: 100%;
}
.search-box input::placeholder { color: var(--text-muted); }
.mobile-btn {
  display: none; background: none; border: none; cursor: pointer; padding: 6px;
}
.mobile-btn svg { width: 22px; height: 22px; color: var(--text-main); }

.mobile-nav {
  display: none; flex-direction: column;
  border-top: 1px solid var(--border);
  background: var(--bg-white);
}
.mobile-nav a {
  padding: 12px 24px; font-size: 0.9rem; font-weight: 600;
  color: var(--text-sub); border-bottom: 1px solid var(--border);
  transition: color 0.2s;
}
.mobile-nav a:hover { color: #6366F1; }
.mobile-nav.open { display: flex; }

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, #EEF2FF 0%, #F0FDF4 50%, #FFFBEB 100%);
  border-bottom: 1px solid var(--border);
  padding: 56px 24px 48px;
}
.hero-inner { max-width: 1280px; margin: 0 auto; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(99,102,241,0.1); color: #6366F1;
  font-size: 0.78rem; font-weight: 700; padding: 5px 14px;
  border-radius: 20px; margin-bottom: 20px;
  border: 1px solid rgba(99,102,241,0.2);
}
.hb-dot { width: 6px; height: 6px; border-radius: 50%; background: #6366F1; box-shadow: 0 0 6px #6366F1; }
.hero h1 {
  font-family: 'Space Grotesk', 'PingFang SC', sans-serif;
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800; line-height: 1.2;
  color: var(--text-main); margin-bottom: 12px;
}
.hero-highlight {
  background: linear-gradient(135deg, #6366F1, #8B5CF6, #EC4899);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-sub { font-size: 1rem; color: var(--text-sub); margin-bottom: 36px; }
.hero-cats { display: flex; gap: 16px; flex-wrap: wrap; }
.hc-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 20px;
  transition: all 0.2s; min-width: 180px;
  box-shadow: var(--shadow);
}
.hc-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.hci-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.hci-icon svg { width: 22px; height: 22px; }
.hci-icon.office { background: var(--office-bg); }
.hci-icon.office svg { stroke: var(--office); }
.hci-icon.chat { background: var(--chat-bg); }
.hci-icon.chat svg { stroke: var(--chat); }
.hci-icon.tools { background: var(--tools-bg); }
.hci-icon.tools svg { stroke: var(--tools); }
.hci-label { font-size: 0.95rem; font-weight: 700; color: var(--text-main); display: block; }
.hci-count { font-size: 0.75rem; color: var(--text-muted); display: block; }

/* ===== MAIN ===== */
.main { max-width: 1280px; margin: 0 auto; padding: 40px 24px 64px; display: flex; flex-direction: column; gap: 56px; }

/* ===== CATEGORY SECTION ===== */
.category-section {}
.cat-header {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.cat-icon-wrap {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cat-icon-wrap svg { width: 26px; height: 26px; }
.cat-icon-wrap.office { background: var(--office-bg); }
.cat-icon-wrap.office svg { stroke: var(--office); }
.cat-icon-wrap.chat { background: var(--chat-bg); }
.cat-icon-wrap.chat svg { stroke: var(--chat); }
.cat-icon-wrap.tools { background: var(--tools-bg); }
.cat-icon-wrap.tools svg { stroke: var(--tools); }

.cat-title {
  font-family: 'Space Grotesk', 'PingFang SC', sans-serif;
  font-size: 1.4rem; font-weight: 800; color: var(--text-main); margin-bottom: 2px;
}
.cat-desc { font-size: 0.875rem; color: var(--text-sub); }
.cat-count-badge {
  margin-left: auto; padding: 5px 14px; border-radius: 20px;
  font-size: 0.78rem; font-weight: 700;
}
.cat-count-badge.office { background: var(--office-bg); color: var(--office); border: 1px solid var(--office-border); }
.cat-count-badge.chat { background: var(--chat-bg); color: var(--chat); border: 1px solid var(--chat-border); }
.cat-count-badge.tools { background: var(--tools-bg); color: var(--tools); border: 1px solid var(--tools-border); }

/* ===== SUB TABS ===== */
.sub-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--bg-light);
  border-radius: 10px;
  width: fit-content;
}
.stab {
  padding: 6px 16px; border-radius: 7px;
  font-size: 0.82rem; font-weight: 600;
  background: none; border: none; cursor: pointer;
  color: var(--text-sub); font-family: inherit;
  transition: all 0.2s;
}
.stab:hover { color: var(--text-main); background: rgba(255,255,255,0.7); }
.stab.active { background: var(--bg-white); color: var(--text-main); box-shadow: var(--shadow); }

/* ===== APP GRID ===== */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}

/* ===== APP CARD ===== */
.app-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  transition: all 0.25s;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.app-card:hover {
  border-color: rgba(99,102,241,0.3);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.app-card.featured {
  border-color: rgba(99,102,241,0.4);
  background: linear-gradient(135deg, #FAFBFF, #FFFFFF);
}
.app-card.featured::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366F1, #8B5CF6, #EC4899);
}
.ac-featured-badge {
  position: absolute; top: 12px; right: 12px;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: #fff; font-size: 0.65rem; font-weight: 800;
  padding: 3px 10px; border-radius: 20px;
  letter-spacing: 0.5px; text-transform: uppercase;
}

/* 卡片内部：logo + info 横排 */
.app-card {
  display: flex; flex-direction: column; gap: 0;
}
.ac-logo {
  width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 0.78rem; text-align: center; line-height: 1.3;
  float: left; margin-right: 14px; margin-bottom: 4px;
}
.ac-info { overflow: hidden; }
.ac-header {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px;
}
.ac-name {
  font-family: 'Space Grotesk', 'PingFang SC', sans-serif;
  font-size: 0.95rem; font-weight: 700; color: var(--text-main);
}
.ac-tag {
  font-size: 0.65rem; font-weight: 700; padding: 2px 8px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.ac-tag.free { background: #ECFDF5; color: #059669; }
.ac-tag.paid { background: #FEF3C7; color: #D97706; }
.ac-tag.freemium { background: #EFF6FF; color: #3B82F6; }

.ac-desc { font-size: 0.82rem; color: var(--text-sub); line-height: 1.65; margin-bottom: 10px; }

.ac-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.acm-item {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.72rem; color: var(--text-muted);
}
.acm-item svg { width: 12px; height: 12px; flex-shrink: 0; }

.ac-platforms { display: flex; gap: 5px; flex-wrap: wrap; }
.acp {
  font-size: 0.65rem; font-weight: 600; padding: 2px 8px; border-radius: 4px;
}
.acp.win { background: #EFF6FF; color: #2563EB; }
.acp.mac { background: #F5F3FF; color: #7C3AED; }
.acp.linux { background: #FFF7ED; color: #C2410C; }
.acp.ios { background: #F0FDF4; color: #15803D; }
.acp.android { background: #ECFDF5; color: #059669; }
.acp.web { background: #FFF1F2; color: #BE123C; }

.ac-actions {
  display: flex; gap: 8px; padding-top: 12px;
  border-top: 1px solid var(--border); margin-top: auto;
}
.btn-dl {
  flex: 1; text-align: center; padding: 9px 14px;
  border-radius: 8px; font-size: 0.82rem; font-weight: 700;
  font-family: 'Space Grotesk', sans-serif;
  transition: all 0.2s;
}
.btn-dl.primary {
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: #fff;
}
.btn-dl.primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-dl.ghost {
  background: var(--bg-light); color: var(--text-sub);
  border: 1px solid var(--border);
}
.btn-dl.ghost:hover { border-color: #6366F1; color: #6366F1; background: rgba(99,102,241,0.05); }

/* 隐藏的卡片 */
.app-card.hidden { display: none; }

/* ===== FOOTER ===== */
.footer {
  background: var(--text-main);
  color: #E2E8F0;
  padding: 40px 24px;
}
.footer-inner { max-width: 1280px; margin: 0 auto; }
.footer-logo {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.footer-logo span {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem; font-weight: 800;
}
.footer-desc { font-size: 0.82rem; color: #94A3B8; margin-bottom: 16px; line-height: 1.7; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 16px; }
.footer-links a { font-size: 0.82rem; color: #94A3B8; transition: color 0.2s; }
.footer-links a:hover { color: #fff; }
.footer-copy { font-size: 0.75rem; color: #64748B; }

/* ===== BACK TO TOP ===== */
.back-top {
  position: fixed; bottom: 28px; right: 28px;
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(99,102,241,0.4);
  opacity: 0; transform: translateY(10px);
  transition: all 0.3s; pointer-events: none;
  z-index: 50;
}
.back-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-top:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99,102,241,0.5); }
.back-top svg { width: 20px; height: 20px; }

/* ===== REVEAL ANIMATION ===== */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ===== SEARCH HIGHLIGHT ===== */
.app-card.search-hidden { display: none; }
.no-results {
  grid-column: 1/-1; text-align: center; padding: 48px;
  color: var(--text-muted); font-size: 0.95rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .app-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}
@media (max-width: 768px) {
  .nav { display: none; }
  .mobile-btn { display: block; }
  .search-box { min-width: 160px; }
  .hero { padding: 36px 20px 32px; }
  .hero-cats { gap: 10px; }
  .hc-item { min-width: 140px; }
  .main { padding: 24px 16px 48px; gap: 40px; }
  .app-grid { grid-template-columns: 1fr; }
  .cat-header { gap: 12px; }
  .cat-count-badge { margin-left: 0; }
  .sub-tabs { width: 100%; }
}
@media (max-width: 480px) {
  .header-inner { padding: 0 16px; }
  .search-box { display: none; }
  .hero h1 { font-size: 1.7rem; }
}
