:root {
  --bg: #f5f5f7;
  --text: #1d1d1f;
  --muted: #86868b;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --line: rgba(0, 0, 0, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html.is-intro .page-head,
html.is-intro .toolbar,
html.is-intro .app,
html.is-intro .note,
html.is-intro .site-footer { opacity: 0; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

a { color: inherit; }

button, input { font: inherit; }

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 48px;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
}

.nav-inner,
.wrap {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand img { width: 28px; height: 28px; display: block; }

.brand:hover { opacity: 0.8; }

.lang-switch {
  display: inline-flex;
  padding: 2px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.06);
}

.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: 7px;
  cursor: pointer;
}

.lang-switch button[aria-pressed="true"] {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wrap { padding: 40px 0 28px; }

.page-head {
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.page-head h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.page-head p {
  margin: 10px 0 0;
  max-width: 36rem;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 0;
}

.search {
  position: relative;
  flex: 1 1 240px;
  max-width: 420px;
}

.search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search input {
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 14px 8px 36px;
  font-size: 14px;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.search input::placeholder { color: var(--muted); }

.search input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2);
}

.filters {
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.04);
  overflow-x: auto;
}

.filters button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #6e6e73;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: 9px;
  cursor: pointer;
}

.filters button[aria-pressed="true"] {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.apps { display: flex; flex-direction: column; gap: 16px; }

.app {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.03), 0 1px 2px rgba(0, 0, 0, 0.02);
}

.app-id {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  min-width: 0;
}

.app-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.app h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.app p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.actions a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text);
}

.actions a:hover { background: rgba(0, 0, 0, 0.08); }

.actions a.primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 113, 227, 0.3);
}

.actions a.primary:hover { background: var(--blue-hover); }

.empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.note {
  margin-top: 28px;
  padding: 18px 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  font-size: 14px;
}

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

.note a {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}

.note a:hover { text-decoration: underline; }

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 36px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 0 28px;
  color: var(--muted);
  font-size: 12px;
}

.site-footer nav { display: flex; flex-wrap: wrap; gap: 16px; }

.site-footer a { color: var(--muted); text-decoration: none; }

.site-footer a:hover { color: var(--text); }

.site-footer strong { color: var(--text); font-weight: 600; }

[data-lang]:not(button) { display: none !important; }

html[lang="vi"] div[data-lang="vi"],
html[lang="en"] div[data-lang="en"],
html[lang="vi"] p[data-lang="vi"],
html[lang="en"] p[data-lang="en"] { display: block !important; }

html[lang="vi"] span[data-lang="vi"],
html[lang="en"] span[data-lang="en"] { display: inline !important; }

.app[hidden],
.empty[hidden] { display: none !important; }

@media (max-width: 720px) {
  .app-icon { width: 64px; height: 64px; border-radius: 18px; }
  .app h2 { font-size: 18px; }
}
