/* AppHub — iOS 内测分发。克制、类原生、无多余装饰。 */

:root {
  color-scheme: light dark;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --text: #1d1d1f;
  --text-2: #56565b;
  --text-3: #86868b;
  --hairline: #e6e6eb;
  --hairline-2: #d6d6db;
  --accent: #0068d6;
  --accent-press: #0053ab;
  --accent-weak: rgba(0, 104, 214, .10);
  --danger: #c0392b;
  --ok: #1a8f4a;
  --shadow-1: 0 .5px 1px rgba(0,0,0,.04), 0 2px 6px rgba(0,0,0,.05);
  --shadow-2: 0 1px 2px rgba(0,0,0,.05), 0 10px 34px rgba(0,0,0,.07);
  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 52px;
  --maxw: 800px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
          "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #161618;
    --text: #f5f5f7;
    --text-2: #aeaeb2;
    --text-3: #8a8a8e;
    --hairline: #2a2a2c;
    --hairline-2: #3a3a3c;
    --accent: #2f9bff;
    --accent-press: #57affd;
    --accent-weak: rgba(47, 155, 255, .16);
    --danger: #ff6b5e;
    --ok: #37c76b;
    --shadow-1: 0 .5px 1px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.35);
    --shadow-2: 0 1px 2px rgba(0,0,0,.55), 0 14px 40px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: none; }

/* ---------------- 顶栏 ---------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center;
  padding: 0 max(20px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}
.nav .wrap { width: 100%; max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: center; gap: 10px; }
.brand { display: inline-flex; align-items: center; gap: 9px;
  font-weight: 600; letter-spacing: -.014em; color: var(--text); font-size: 17px; }
.brand .mark { width: 22px; height: 22px; display: block; }
.brand .sub { color: var(--text-3); font-weight: 400; font-size: 13px;
  padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--hairline-2); }
.nav .spacer { flex: 1; }
.nav .back { display: inline-flex; align-items: center; gap: 4px;
  color: var(--accent); font-size: 15px; }
.nav .back svg { width: 17px; height: 17px; }

/* ---------------- 布局 ---------------- */
.container { max-width: var(--maxw); margin: 0 auto;
  padding: 0 20px calc(56px + env(safe-area-inset-bottom)); }

.page-head { padding: 40px 4px 22px; }
.page-head h1 { margin: 0; font-size: 30px; line-height: 1.15;
  font-weight: 650; letter-spacing: -.022em; }
.page-head p { margin: 8px 0 0; color: var(--text-2); font-size: 15.5px; max-width: 60ch; }
.count-pill { display: inline-block; margin-top: 14px; font-size: 13px; color: var(--text-3);
  font-variant-numeric: tabular-nums; }

/* ---------------- 分组列表（应用列表） ---------------- */
.list { background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; }
.row { display: flex; align-items: center; gap: 15px; padding: 15px 17px;
  position: relative; color: inherit; cursor: pointer;
  transition: background .15s ease; }
.row + .row { border-top: 1px solid var(--hairline); }
.row:hover { background: color-mix(in srgb, var(--text) 4%, transparent); }
.row:active { background: color-mix(in srgb, var(--text) 7%, transparent); }

.icon { flex: none; border-radius: 22.4%; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); object-fit: cover; }
@media (prefers-color-scheme: dark) { .icon { box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); } }
.icon--64 { width: 62px; height: 62px; }
.icon--112 { width: 108px; height: 108px; border-radius: 24px; }
.icon-mono { display: grid; place-items: center; color: #fff; font-weight: 600;
  letter-spacing: -.02em; }

.row .info { flex: 1; min-width: 0; }
.row .title { font-size: 16.5px; font-weight: 590; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .bundle { font-family: var(--mono); font-size: 11.5px; color: var(--text-3);
  margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { color: var(--text-2); font-size: 13px; margin-top: 5px;
  font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.row .meta .dot { color: var(--hairline-2); }

.row .right { flex: none; display: flex; align-items: center; gap: 7px; }
.chev { width: 17px; height: 17px; color: var(--text-3); flex: none; }

/* ---------------- 按钮 ---------------- */
.btn { -webkit-appearance: none; appearance: none; border: 0; cursor: pointer;
  font-family: inherit; font-weight: 590; font-size: 15px; letter-spacing: -.01em;
  border-radius: 980px; padding: 8px 18px; line-height: 1.2;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s ease, transform .06s ease, opacity .15s ease; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-press); }
.btn-ghost { background: var(--accent-weak); color: var(--accent); }
.btn-ghost:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.btn-sm { font-size: 14px; padding: 6.5px 15px; }
.btn svg { width: 15px; height: 15px; }
.btn-block { width: 100%; padding: 13px 18px; font-size: 16px; }

/* ---------------- 空状态 ---------------- */
.empty { text-align: center; padding: 64px 20px; color: var(--text-3); }
.empty svg { width: 46px; height: 46px; opacity: .5; margin-bottom: 14px; }
.empty h2 { margin: 0 0 6px; font-size: 18px; font-weight: 600; color: var(--text-2); }
.empty p { margin: 0; font-size: 14px; }

/* ---------------- 详情页 ---------------- */
.hero { display: flex; gap: 20px; align-items: center; padding: 36px 4px 26px; }
.hero .h-info { min-width: 0; flex: 1; }
.hero h1 { margin: 0; font-size: 27px; font-weight: 650; letter-spacing: -.022em;
  line-height: 1.15; }
.hero .h-bundle { font-family: var(--mono); font-size: 12px; color: var(--text-3); margin-top: 6px;
  word-break: break-all; }
.hero .h-sum { color: var(--text-2); font-size: 15px; margin-top: 10px; }
.hero-actions { display: flex; gap: 10px; align-items: center; margin-top: 16px; flex-wrap: wrap; }

.section { margin-top: 34px; }
.section > h2 { font-size: 13px; font-weight: 600; color: var(--text-3);
  text-transform: none; letter-spacing: .01em; margin: 0 4px 10px; }

.builds { background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; }
.build { padding: 16px 17px; }
.build + .build { border-top: 1px solid var(--hairline); }
.build-top { display: flex; align-items: center; gap: 10px; }
.ver { font-weight: 600; font-size: 15.5px; font-variant-numeric: tabular-nums; }
.badge { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px;
  background: var(--accent-weak); color: var(--accent); letter-spacing: .01em; }
.build .b-meta { color: var(--text-2); font-size: 13px; margin-top: 6px;
  font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.build .b-meta .dot { color: var(--hairline-2); }
.build .changelog { color: var(--text-2); font-size: 14px; margin-top: 10px;
  white-space: pre-wrap; }
.build .b-actions { margin-top: 14px; }

/* 说明卡 */
.note { background: var(--surface); border: 1px solid var(--hairline);
  border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 4px 18px; }
.steps { counter-reset: s; list-style: none; margin: 0; padding: 14px 0; }
.steps li { counter-increment: s; position: relative; padding: 9px 0 9px 38px;
  color: var(--text-2); font-size: 14.5px; }
.steps li + li { border-top: 1px solid var(--hairline); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 8px;
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent-weak);
  color: var(--accent); font-size: 12.5px; font-weight: 600;
  display: grid; place-items: center; }
.steps li b { color: var(--text); font-weight: 600; }
.callout { display: flex; gap: 10px; padding: 12px 14px; margin: 14px 0 4px;
  background: var(--surface-2); border: 1px solid var(--hairline); border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13.5px; }
.callout svg { width: 18px; height: 18px; flex: none; color: var(--text-3); margin-top: 1px; }

/* ---------------- 页脚 ---------------- */
.foot { max-width: var(--maxw); margin: 0 auto; padding: 30px 24px 46px;
  color: var(--text-3); font-size: 12.5px; display: flex; gap: 8px 16px;
  flex-wrap: wrap; align-items: center; border-top: 1px solid var(--hairline); margin-top: 40px; }
.foot .spacer { flex: 1; }
.foot code { font-family: var(--mono); font-size: 12px; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 560px) {
  .page-head { padding: 28px 2px 18px; }
  .page-head h1 { font-size: 26px; }
  .row { padding: 13px 14px; gap: 13px; }
  .icon--64 { width: 56px; height: 56px; }
  .row .right .btn { display: none; }         /* 手机上整行点进详情再安装 */
  .hero { flex-direction: column; align-items: flex-start; gap: 16px; padding-top: 26px; }
  .icon--112 { width: 88px; height: 88px; border-radius: 20px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
