:root {
  color-scheme: light dark;
  --bg: #fff8ec;
  --surface: #ffffff;
  --text: #33291f;
  --muted: #6f6152;
  --line: #f0e4d0;
  --pill: #f6eddd;
  --locked-bg: #ece6fa;
  --locked-text: #5438a8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1b16;
    --surface: #2b261f;
    --text: #f6efe3;
    --muted: #c4b8a6;
    --line: #40382d;
    --pill: #3a3329;
    --locked-bg: #3a3158;
    --locked-text: #d9cdfb;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: ui-rounded, 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, 'PingFang TC', 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
  line-height: 1.45;
}

.top,
main,
.foot {
  width: 100%;
  max-width: 1040px;
  margin-inline: auto;
  padding-inline: 16px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 24px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

h1 {
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 2.1rem);
  line-height: 1.15;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
}

.lang {
  flex: none;
  min-height: 44px;
  padding: 8px 16px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

main {
  flex: 1;
}

.apps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.apps li {
  display: flex;
}

.card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  border: 2px solid var(--line);
  border-top: 8px solid var(--accent);
  border-radius: 20px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgb(60 40 10 / 12%);
}

.card:focus-visible,
.lang:focus-visible {
  outline: 3px solid #2f6fed;
  outline-offset: 3px;
}

.card img {
  border-radius: 18px;
}

.body {
  flex: 1;
}

h2 {
  margin: 0 0 4px;
  font-size: 1.4rem;
}

.body p {
  margin: 0;
  color: var(--muted);
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pill {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--pill);
  font-size: 0.85rem;
  font-weight: 600;
}

.pill.locked {
  background: var(--locked-bg);
  color: var(--locked-text);
}

.action {
  display: block;
  padding: 12px;
  border-radius: 14px;
  background: var(--accent);
  color: #1d1a16;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
}

.card:has(.locked) .action {
  color: #fff;
}

.status {
  padding: 24px 0;
  color: var(--muted);
  text-align: center;
}

.foot {
  padding-block: 24px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none;
  }

  .card:hover {
    transform: none;
  }
}
