/* ============ SoftStore 前台样式 · 紧凑密度版 + H5 适配 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --primary: #6366f1;
  --primary2: #a855f7;
  --text: #1e293b;
  --text-sub: #64748b;
  --glass-bg: rgba(255, 255, 255, 0.62);
  --glass-border: rgba(255, 255, 255, 0.75);
  --shadow: 0 8px 32px rgba(31, 38, 135, 0.12);
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "HarmonyOS Sans SC", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #eef2ff 0%, #fdf2f8 45%, #ecfeff 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- 背景装饰光斑 ---------- */
.bg-decor { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; }
.b1 { width: 480px; height: 480px; background: #c7d2fe; top: -140px; left: -120px; }
.b2 { width: 420px; height: 420px; background: #fbcfe8; top: 30%; right: -150px; }
.b3 { width: 380px; height: 380px; background: #a5f3fc; bottom: -120px; left: 30%; }

.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}

/* ---------- 访问密码门 ---------- */
.gate-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.gate-card { width: 420px; max-width: 100%; border-radius: 24px; padding: 44px 36px; text-align: center; }
.gate-icon { font-size: 44px; margin-bottom: 12px; }
.gate-card h1 { font-size: 24px; margin-bottom: 6px; }
.gate-tip { color: var(--text-sub); font-size: 14px; margin-bottom: 22px; }
.gate-err { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-size: 13px;
  padding: 10px 14px; border-radius: 12px; margin-bottom: 16px; }
.gate-card input { width: 100%; padding: 14px 18px; border-radius: 14px; border: 1px solid #e2e8f0;
  font-size: 15px; outline: none; margin-bottom: 16px; background: rgba(255,255,255,.85); transition: .2s; }
.gate-card input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99,102,241,.15); }

/* ---------- 顶部 Hero（紧凑版，给列表让出更多空间） ---------- */
.hero { padding: 22px 16px 0; }
.hero-inner { max-width: 1400px; margin: 0 auto; border-radius: 22px; padding: 22px 26px 20px; text-align: center; }
.logo-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
.logo-badge {
  width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  font-size: 21px; color: #fff; font-weight: 700; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  box-shadow: 0 8px 20px rgba(99, 102, 241, .4);
}
.hero h1 {
  font-size: 24px; font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(90deg, #4f46e5, #9333ea, #db2777);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-desc { color: var(--text-sub); margin-top: 6px; font-size: 13.5px; }

/* ---------- 搜索框（紧凑） ---------- */
.search-bar {
  max-width: 520px; margin: 14px auto 0; display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .85); border: 1px solid #e2e8f0; border-radius: 999px;
  padding: 4px 4px 4px 16px; transition: .2s; height: 46px;
}
.search-bar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(99, 102, 241, .14); }
.search-ico { width: 17px; height: 17px; color: #94a3b8; flex-shrink: 0; }
.search-bar input { flex: 1; border: none; outline: none; background: transparent; font-size: 14.5px; color: var(--text); min-width: 0; }
.search-clear { color: #94a3b8; text-decoration: none; font-size: 14px; padding: 0 4px; }
.search-clear:hover { color: #ef4444; }
.search-bar button {
  border: none; cursor: pointer; padding: 0 20px; height: 38px; border-radius: 999px; color: #fff;
  font-size: 13.5px; font-weight: 600;
  background: linear-gradient(90deg, var(--primary), var(--primary2));
  box-shadow: 0 4px 14px rgba(99, 102, 241, .35); transition: .2s;
}
.search-bar button:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99, 102, 241, .45); }

/* ---------- 分类快捷导航（吸顶锚点，长页面快速跳转） ---------- */
.cat-nav {
  max-width: 1400px; margin: 14px auto 0; border-radius: 16px; padding: 10px 14px;
  display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none;
  position: sticky; top: 8px; z-index: 50; backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav a {
  display: inline-flex; align-items: center; gap: 7px; flex-shrink: 0;
  padding: 8px 15px; border-radius: 999px; text-decoration: none;
  font-size: 13.5px; font-weight: 600; color: #475569;
  background: rgba(255, 255, 255, .65); border: 1px solid #e2e8f0; transition: .18s; white-space: nowrap;
}
.cat-nav a:hover { border-color: var(--primary); color: var(--primary); background: rgba(99,102,241,.08); }
.cat-nav a i {
  font-style: normal; font-size: 11px; font-weight: 700; color: #fff; padding: 1px 7px;
  border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--primary2));
}

.cat-dot { width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary2)); flex-shrink: 0; }

/* ---------- 主体容器 ---------- */
.container { max-width: 1400px; margin: 0 auto; padding: 20px 16px 40px; }
.cat-section { margin-bottom: 22px; scroll-margin-top: 76px; }
.cat-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 10px; flex-wrap: wrap; gap: 6px; }
.cat-head h2 { font-size: 16.5px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.cat-head .cat-dot { width: 9px; height: 9px; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.cat-count { color: var(--text-sub); font-size: 12.5px; }

/* ---------- 资源网格：桌面一排 6 个，单页塞下更多链接 ---------- */
.item-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

/* ---------- 资源条目（竖排紧凑卡片：名称 / 大小 / 按钮） ---------- */
.item {
  display: flex; flex-direction: column; align-items: stretch; justify-content: space-between;
  gap: 8px; border-radius: 14px;
  padding: 12px 12px 11px; transition: .2s; min-width: 0;
}
.item:hover { transform: translateY(-2px); box-shadow: 0 14px 40px rgba(31, 38, 135, .18); background: rgba(255, 255, 255, .8); }

.item-left { flex-shrink: 0; }
.ext-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 44px; padding: 0 8px; border-radius: 12px;
  font-size: 11px; font-weight: 800; color: #fff; letter-spacing: .5px;
}
.b-exe   { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.b-apk   { background: linear-gradient(135deg, #22c55e, #16a34a); }
.b-ios   { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.b-zip   { background: linear-gradient(135deg, #f59e0b, #d97706); }
.b-mac   { background: linear-gradient(135deg, #64748b, #475569); }
.b-link  { background: linear-gradient(135deg, #ec4899, #db2777); }
.b-other { background: linear-gradient(135deg, #64748b, #475569); }

.item-body { min-width: 0; }
.item-name {
  display: block; font-size: 13.5px; font-weight: 700; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item-size { display: block; color: #94a3b8; font-size: 11.5px; font-weight: 500; margin-top: 3px; }

.chip {
  font-size: 10.5px; font-weight: 600; color: #4f46e5; background: rgba(99, 102, 241, .12);
  padding: 1.5px 8px; border-radius: 999px; flex-shrink: 0;
}
.chip-pin { color: #d97706; background: rgba(245, 158, 11, .14); }

.item-action { flex-shrink: 0; }
.btn-dl {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; text-decoration: none;
  padding: 0 8px; height: 32px; width: 100%; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: #fff;
  background: linear-gradient(90deg, var(--primary), var(--primary2));
  box-shadow: 0 5px 14px rgba(99, 102, 241, .35); transition: .2s; white-space: nowrap;
}
.btn-dl svg { width: 13px; height: 13px; }
.btn-dl:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(99, 102, 241, .5); }
.btn-link { background: linear-gradient(90deg, #ec4899, #db2777); box-shadow: 0 5px 14px rgba(236, 72, 153, .35); }
.btn-link:hover { box-shadow: 0 10px 26px rgba(236, 72, 153, .5); }

/* ---------- 中屏按 5 / 4 / 3 列递减 ---------- */
@media (max-width: 1360px) { .item-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1120px) { .item-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 880px)  { .item-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 50px 20px; border-radius: 20px; color: var(--text-sub); font-size: 15px; }

/* ---------- 页脚 ---------- */
.site-footer { text-align: center; color: #94a3b8; font-size: 12px; padding: 6px 20px calc(30px + env(safe-area-inset-bottom)); }

/* ================= H5 移动端适配 ================= */
@media (max-width: 700px) {
  .hero { padding-top: 14px; }
  .hero-inner { padding: 18px 16px 16px; border-radius: 18px; }
  .hero h1 { font-size: 20px; }
  .logo-badge { width: 36px; height: 36px; font-size: 18px; }
  .hero-desc { font-size: 12.5px; }
  .search-bar { height: 44px; }

  /* 吸顶分类导航：横向滑动 */
  .cat-nav { top: 6px; padding: 8px 10px; border-radius: 14px; margin-top: 12px; }
  .cat-nav a { padding: 7px 12px; font-size: 12.5px; }

  /* 单列网格，行式布局 + 右侧按钮，一屏显示更多条目 */
  .item-grid { grid-template-columns: 1fr; gap: 8px; }
  .item { flex-direction: row; align-items: center; padding: 11px 12px; gap: 10px; border-radius: 14px; }
  .item-body { flex: 1; min-width: 0; }
  .item-name { display: inline; font-size: 14px; white-space: normal; word-break: break-all; }
  .item-size { display: inline; margin-top: 0; margin-left: 6px; }
  .btn-dl { width: auto; height: 38px; padding: 0 13px; font-size: 12.5px; border-radius: 11px; }
  .btn-dl svg { width: 14px; height: 14px; }

  /* 触控优化 */
  .cat-nav a, .btn-dl, .search-bar button { touch-action: manipulation; }
  .container { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
}

/* 超窄屏（≤360px）微调 */
@media (max-width: 360px) {
  .btn-dl { padding: 0 11px; }
  .hero h1 { font-size: 18px; }
  .item-size { display: none; }
}
