/* /apps 页面 — 类 App Store 卡片风
   设计基准：iOS 17 设置/App Store 视觉语言 */

:root {
  --bg: #f2f2f7;
  --card-bg: #ffffff;
  --text-primary: #000000;
  --text-secondary: #8e8e93;
  --text-tertiary: #c7c7cc;
  --divider: rgba(60, 60, 67, 0.12);
  --accent: #007aff;
  --accent-pressed: #0062cc;
  --radius-card: 14px;
  --radius-icon: 13.5px;
  --radius-button: 999px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card-bg: #1c1c1e;
    --text-primary: #ffffff;
    --text-secondary: #8e8e93;
    --text-tertiary: #48484a;
    --divider: rgba(84, 84, 88, 0.35);
  }
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
               "PingFang SC", "Hiragino Sans GB", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum";
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.apps-page {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* ── 页头 ── */
.apps-header {
  padding: 24px 4px 28px;
}
.apps-back {
  display: inline-block;
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 14px;
  transition: opacity 0.15s;
}
.apps-back:active { opacity: 0.6; }
.apps-title {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.4px;
  margin: 0 0 6px;
  line-height: 1.1;
}
.apps-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.4;
}

/* ── 非 iOS 提示 ── */
.non-ios-notice {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  padding: 28px 24px;
  margin-bottom: 32px;
  text-align: center;
}
.non-ios-notice h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 12px;
}
.non-ios-notice p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 10px;
  line-height: 1.5;
}
.non-ios-notice .qr-hint {
  margin-top: 20px;
}
.qr-wrap {
  display: inline-block;
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  margin: 12px 0 8px;
}
.qr-wrap svg, .qr-wrap canvas {
  display: block;
  width: 180px;
  height: 180px;
}
.qr-url {
  font-size: 12px;
  color: var(--text-tertiary);
  word-break: break-all;
}

/* ── 应用卡片 ── */
.app-list {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-bottom: 32px;
}

.app-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  position: relative;
}

.app-card:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 90px;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--divider);
}

.app-card-icon {
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  border-radius: var(--radius-icon);
  overflow: hidden;
  background: var(--bg);
  display: block;
  /* 极淡的内边框，模拟 App Store 图标分隔感 */
  box-shadow: inset 0 0 0 0.5px rgba(0,0,0,0.1);
}
.app-card-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.app-card-meta {
  flex: 1 1 auto;
  min-width: 0;
}
.app-card-name {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 2px;
  line-height: 1.25;
  letter-spacing: -0.2px;
}
.app-card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 2px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.app-card-url {
  font-size: 11px;
  color: var(--text-tertiary);
  margin: 0;
  line-height: 1.3;
  font-feature-settings: "tnum";
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-card-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  height: 30px;
  padding: 0 18px;
  border-radius: var(--radius-button);
  background: rgba(120, 120, 128, 0.16);
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: -0.1px;
  transition: background-color 0.15s, transform 0.1s;
}
.app-card-button:active {
  background: rgba(120, 120, 128, 0.28);
  transform: scale(0.96);
}

@media (prefers-color-scheme: dark) {
  .app-card-button {
    background: rgba(120, 120, 128, 0.24);
  }
  .app-card-button:active {
    background: rgba(120, 120, 128, 0.36);
  }
}

/* ── 安装步骤 ── */
.install-steps {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  padding: 20px 22px 22px;
  margin-bottom: 28px;
}
.install-steps-title {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 14px;
  letter-spacing: -0.2px;
}
.install-steps-list {
  margin: 0;
  padding: 0 0 0 22px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-primary);
}
.install-steps-list li {
  margin-bottom: 6px;
}
.install-steps-list strong {
  font-weight: 600;
}

/* ── 页脚 ── */
.apps-footer {
  text-align: center;
  padding: 16px 0;
  font-size: 11px;
  color: var(--text-tertiary);
}
.apps-footer p {
  margin: 0;
}

/* ── 平板/桌面 ── */
@media (min-width: 768px) {
  .apps-page {
    padding-top: 48px;
  }
  .apps-title {
    font-size: 40px;
  }
}
