/* 软件管理 · 苹果风下载导航 */

:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --bg-glow: rgba(255, 255, 255, 0.92);
  --surface: #ffffff;
  --surface-2: #f7f7f9;
  --ink: #1d1d1f;
  --ink-2: #3a3a3c;
  --muted: #6e6e73;
  --muted-2: #a1a1a6;
  --line: rgba(0, 0, 0, 0.08);
  --accent: #0071e3;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 34px rgba(0, 0, 0, 0.06);
  --kicker: #0071e3;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
    sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --bg-glow: rgba(38, 38, 42, 0.55);
  --surface: #1c1c1e;
  --surface-2: #242426;
  --ink: #f5f5f7;
  --ink-2: #d1d1d6;
  --muted: #a1a1a6;
  --muted-2: #6e6e73;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #0a84ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 16px 40px rgba(0, 0, 0, 0.38);
  --kicker: #64d2ff;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(900px 420px at 50% -160px, var(--bg-glow), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  transition: background-color 0.25s ease, color 0.25s ease;
}

button,
input,
a {
  font: inherit;
}

a {
  color: var(--accent);
}

button {
  cursor: pointer;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.icon--sm {
  width: 16px;
  height: 16px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app {
  width: min(100%, 840px);
  margin: 0 auto;
  padding: 18px 20px calc(38px + env(safe-area-inset-bottom));
}

/* ---------- 顶栏 ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 6px 10px 6px 5px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.16s ease;
}

.back:hover {
  background: var(--surface-2);
}

.theme-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  transition: background 0.16s ease, transform 0.12s ease;
}

.theme-btn:hover {
  background: var(--surface-2);
}

.theme-btn:active {
  transform: scale(0.94);
}

.theme-icon--moon {
  display: none;
}

html[data-theme="dark"] .theme-icon--sun {
  display: none;
}

html[data-theme="dark"] .theme-icon--moon {
  display: block;
}

/* ---------- 标题 ---------- */

.hero {
  margin: 38px 2px 26px;
}

.hero-kicker {
  margin: 0 0 9px;
  color: var(--kicker);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.hero h1 {
  margin: 0;
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.hero-sub {
  max-width: 560px;
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.55;
}

/* ---------- App 卡片 ---------- */

.app-list {
  display: grid;
  gap: 16px;
}

.app-card {
  --brand: #0071e3;
  --brand-soft: rgba(0, 113, 227, 0.09);
  --btn-ink: #fff;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.app-card[data-app="kaihuo"] {
  --brand: #11514b;
  --brand-soft: rgba(17, 81, 75, 0.09);
}

html[data-theme="dark"] .app-card[data-app="kaihuo"] {
  --brand: #7fc6b8;
  --brand-soft: rgba(127, 198, 184, 0.13);
}

.app-card[data-app="ios"] {
  --brand: #1d1d1f;
  --brand-soft: rgba(0, 0, 0, 0.06);
}

.app-card[data-app="aiwenyun"] {
  --brand: #1a7a4c;
  --brand-soft: rgba(26, 122, 76, 0.1);
}

html[data-theme="dark"] .app-card[data-app="aiwenyun"] {
  --brand: #5ed99a;
  --brand-soft: rgba(94, 217, 154, 0.13);
}

html[data-theme="dark"] .app-card[data-app="ios"] {
  --brand: #f5f5f7;
  --brand-soft: rgba(255, 255, 255, 0.1);
  --btn-ink: #1d1d1f;
}

.app-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 18px 42px rgba(0, 0, 0, 0.09);
}

.app-icon {
  width: 64px;
  height: 64px;
  flex: none;
  overflow: hidden;
  border-radius: 16px;
  background: var(--surface-2);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.app-icon img {
  display: block;
  width: 100%;
  height: 100%;
}

.app-main {
  flex: 1;
  min-width: 0;
}

.app-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}

.app-head h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.app-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 10.5px;
  font-weight: 700;
}

.app-desc {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.app-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.meta-dot {
  color: var(--muted-2);
}

.notes {
  display: grid;
  gap: 4px;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.5;
}

.notes:empty {
  display: none;
}

.notes li {
  position: relative;
  padding-left: 13px;
}

.notes li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 1px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand);
  opacity: 0.7;
}

.app-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 17px;
}

.btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: background 0.16s ease, transform 0.12s ease, opacity 0.16s ease;
}

.btn--primary {
  background: var(--brand);
  color: var(--btn-ink, #fff);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn--primary:hover {
  opacity: 0.9;
}

.btn:active {
  transform: scale(0.98);
}

.app-source {
  color: var(--muted-2);
  font-size: 11px;
}

/* ---------- 页脚 ---------- */

.foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 30px;
  color: var(--muted-2);
  font-size: 11px;
  text-align: center;
}

.foot a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.foot a:hover {
  color: var(--accent);
}

.foot-dot {
  opacity: 0.6;
}

/* ---------- 响应式 ---------- */

@media (max-width: 560px) {
  .app {
    padding: 12px 14px calc(30px + env(safe-area-inset-bottom));
  }

  .hero {
    margin: 28px 2px 21px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .hero-sub {
    font-size: 13.5px;
  }

  .app-card {
    gap: 14px;
    padding: 18px;
    border-radius: 19px;
  }

  .app-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
  }

  .app-head h2 {
    font-size: 19px;
  }

  .app-actions {
    margin-top: 15px;
  }

  .btn {
    min-height: 38px;
  }
}

@media (max-width: 380px) {
  .back span {
    display: none;
  }

  .app-card {
    gap: 12px;
    padding: 16px;
  }

  .app-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }

  .app-head h2 {
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
