/* ============ AppCraft 商店样式 ============ */
:root {
  --bg: #0e1420;
  --bg-2: #141c2c;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(22, 30, 46, 0.82);
  --stroke: rgba(255, 255, 255, 0.14);
  --text: #eef3fb;
  --text-2: #9aa7bd;
  --accent: #4fc3f7;
  --accent-2: #7c4dff;
  --ok: #37d67a;
  --warn: #ffb74d;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

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

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* 背景光斑 */
.bg-decor { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .35; }
.blob-1 { width: 420px; height: 420px; background: #2356a8; top: -120px; left: -100px; }
.blob-2 { width: 380px; height: 380px; background: #5b2ea6; bottom: -140px; right: -80px; }
.blob-3 { width: 260px; height: 260px; background: #1d6f7a; top: 40%; left: 55%; }

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

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  border-left: 0; border-right: 0; border-top: 0;
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 20px 10px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-logo {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: .5px; }

.search-wrap {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.07); border: 1px solid var(--stroke);
  border-radius: 999px; padding: 9px 16px;
}
.search-icon { color: var(--text-2); flex: none; }
.search-wrap input {
  flex: 1; background: transparent; border: 0; outline: none;
  color: var(--text); font-size: 15px;
}
.search-wrap input::placeholder { color: var(--text-2); }

.top-actions { display: flex; gap: 10px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--stroke); background: rgba(255,255,255,.06);
  color: var(--text); border-radius: 12px; padding: 9px 14px;
  font-size: 14px; cursor: pointer; transition: all .18s ease;
  text-decoration: none;
}
.btn:hover { background: rgba(255,255,255,.12); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; font-weight: 600;
}
.btn.primary:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; }
.btn.big { padding: 12px 22px; font-size: 15px; border-radius: 14px; }

/* 平台切换条 */
.platform-bar {
  max-width: 1080px; margin: 0 auto;
  display: flex; gap: 8px; padding: 4px 20px 14px;
  overflow-x: auto; scrollbar-width: none;
}
.platform-bar::-webkit-scrollbar { display: none; }
.platform-tab {
  display: inline-flex; align-items: center; gap: 7px;
  background: transparent; border: 1px solid transparent; color: var(--text-2);
  border-radius: 999px; padding: 8px 16px; font-size: 14px; cursor: pointer;
  white-space: nowrap; transition: all .18s ease;
}
.platform-tab:hover { color: var(--text); }
.platform-tab.active {
  color: var(--text); background: rgba(255,255,255,.1);
  border-color: var(--stroke);
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-android { background: #37d67a; }
.dot-ios { background: #e8e8e8; }
.dot-ipados { background: #9be7ff; }
.dot-hmos { background: #ffb74d; }

/* ---------- 主体 ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: 22px 20px 60px; }

.hero {
  border-radius: var(--radius); padding: 26px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  margin-bottom: 22px;
}
.hero-text h1 { font-size: 26px; margin-bottom: 8px; }
.hero-text p { color: var(--text-2); font-size: 15px; max-width: 520px; }
.hero-stats { display: flex; gap: 22px; flex: none; }
.stat b { display: block; font-size: 22px; }
.stat span { color: var(--text-2); font-size: 13px; }

/* 分类 */
.category-row {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px;
}
.cat-chip {
  background: rgba(255,255,255,.06); border: 1px solid var(--stroke);
  color: var(--text-2); border-radius: 999px; padding: 7px 14px;
  font-size: 13px; cursor: pointer; transition: all .15s ease;
}
.cat-chip.active { color: var(--text); background: rgba(79,195,247,.18); border-color: rgba(79,195,247,.4); }

/* 应用列表（横向长方形行） */
.grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 14px 16px;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
  cursor: pointer;
}
.row:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.22); }
.row-icon {
  width: 48px; height: 48px; border-radius: 13px; flex: none;
  display: grid; place-items: center; font-size: 22px; font-weight: 700;
  color: #fff; overflow: hidden; position: relative;
}
.app-icon-img, .detail-icon-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block;
}
.row-main { flex: 1; min-width: 0; }
.app-title {
  font-size: 15px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.app-dev {
  font-size: 12px; color: var(--text-2); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px; color: var(--text-2);
  background: rgba(255,255,255,.07); border-radius: 8px; padding: 4px 9px;
}
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.downloads { font-size: 12px; color: var(--text-2); }
.btn-card { flex: none; padding: 8px 16px; font-size: 13px; border-radius: 10px; }
.btn-card.off { opacity: .55; cursor: not-allowed; }

/* 空状态 */
.empty { text-align: center; padding: 60px 20px; color: var(--text-2); }
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty p { margin-bottom: 18px; }
.hidden { display: none !important; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(6, 10, 18, 0.6); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 20px;
}
.modal {
  width: min(480px, 100%); border-radius: 22px; padding: 26px;
  position: relative; max-height: 86vh; overflow-y: auto;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06); color: var(--text); font-size: 20px; cursor: pointer;
}
.detail-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.detail-icon {
  width: 64px; height: 64px; border-radius: 18px; flex: none;
  display: grid; place-items: center; font-size: 30px; color: #fff; position: relative; overflow: hidden;
}
.detail-meta h2 { font-size: 20px; }
.dev { color: var(--text-2); font-size: 14px; margin: 4px 0 8px; }
.meta-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-desc { color: var(--text-2); font-size: 14px; line-height: 1.7; margin-bottom: 22px; }
.detail-actions { display: flex; gap: 10px; }

/* 表单 */
.form { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
.form input, .form select, .form textarea {
  background: rgba(255,255,255,.07); border: 1px solid var(--stroke);
  border-radius: 12px; padding: 11px 13px; color: var(--text); font-size: 14px; outline: none;
  font-family: inherit;
}
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--accent); }
.form-row { display: flex; gap: 12px; }
.form-row label { flex: 1; }
.form-tip { font-size: 12px; color: var(--text-2); line-height: 1.6; }
.form-tip code { background: rgba(255,255,255,.1); padding: 1px 5px; border-radius: 5px; }

/* 页脚 */
.footer {
  text-align: center; color: var(--text-2); font-size: 13px;
  padding: 30px 20px 40px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; }
  .search-wrap { order: 3; flex-basis: 100%; }
  .btn-text { display: none; }
  .hero { flex-direction: column; align-items: flex-start; }
  .hero-stats { width: 100%; justify-content: space-between; gap: 10px; }
  .stat { flex: 1; text-align: center; }
  .stat b { font-size: 18px; }
  .grid { gap: 10px; }
  .row { padding: 12px 14px; gap: 12px; }
  .row-icon { width: 42px; height: 42px; border-radius: 12px; }
  .btn-card { padding: 7px 13px; }
}
