:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #1a2332;
  --muted: #5a6b7d;
  --primary: #4293E1;
  --primary-soft: rgba(66, 147, 225, 0.12);
  --border: #d8e0ea;
  --shadow: 0 8px 24px rgba(26, 35, 50, 0.06);
  --ok: #128a4b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
}

.app-top {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.app-top-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.brand strong { display: block; font-size: 0.95rem; line-height: 1.15; }
.brand small { color: var(--muted); font-size: 0.8rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-ghost { background: transparent; }
.btn-wa {
  background: #25D366;
  border-color: #25D366;
  color: #fff;
}

.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 14px calc(96px + env(safe-area-inset-bottom));
}

.page-intro {
  margin: 0 0 18px;
}
.page-intro h1 {
  margin: 0 0 8px;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.page-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
  max-width: 40rem;
}

.sys-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 700px) {
  .sys-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
@media (min-width: 980px) {
  .sys-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.sys-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  text-align: left;
  cursor: pointer;
  padding: 0;
  font: inherit;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sys-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(66, 147, 225, 0.14);
}
.sys-card-cover {
  aspect-ratio: 16 / 10;
  background: #e8f0f8 center/cover no-repeat;
  border-bottom: 1px solid var(--border);
}
.sys-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.sys-card-body h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.25;
}
.sys-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sys-card-foot {
  margin-top: auto;
  padding-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sys-chip {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 4px 10px;
}
.sys-more {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
}

.loading, .empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
}

.detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 35, 0.45);
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.detail-overlay.open { display: flex; }
.detail-sheet {
  background: #fff;
  width: 100%;
  max-width: 720px;
  max-height: min(92vh, 900px);
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
}
@media (min-width: 760px) {
  .detail-overlay {
    align-items: center;
    padding: 24px;
  }
  .detail-sheet {
    border-radius: 18px;
    max-height: min(88vh, 860px);
  }
}
.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.detail-head h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.25;
}
.detail-body {
  overflow: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}
.detail-audience {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}
.detail-tagline {
  margin: 0 0 16px;
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.4;
}

.gallery {
  position: relative;
  margin: 0 0 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #eef3f8;
}
.gallery-main {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  background: #e8f0f8;
}
.gallery-caption {
  margin: 0;
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  border-top: 1px solid var(--border);
  background: #fff;
}
.gallery-nav {
  position: absolute;
  top: 42%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 1.3rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.gallery-prev { left: 8px; }
.gallery-next { right: 8px; }
.gallery-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 14px;
}
.gallery-thumbs button {
  flex: 0 0 72px;
  width: 72px;
  height: 48px;
  border-radius: 8px;
  border: 2px solid transparent;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: #e8f0f8;
}
.gallery-thumbs button.active { border-color: var(--primary); }
.gallery-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.feature-list {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.feature-list li {
  position: relative;
  padding: 10px 12px 10px 34px;
  background: #f7fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: var(--primary);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, #fff 70%, rgba(255,255,255,0));
  padding-top: 10px;
}
.detail-actions .btn { flex: 1 1 160px; }

.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.bottom-nav a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 800;
  font-size: 0.88rem;
}
.bottom-nav .foot-copy {
  margin: 0;
  max-width: 960px;
  text-align: center;
  color: var(--muted);
  font-size: 0.58rem;
  line-height: 1.25;
}
.bottom-nav .foot-copy a {
  display: inline;
  font-weight: 700;
  font-size: inherit;
}

body.detail-open { overflow: hidden; }
