/* 公衆園首頁：精選／常用。結構與課堂門相同，色相改為紫霄。 */
button.app-icon,
button.tx-spotlight,
button.tx-familiar-app,
button.tx-page-dot,
button.tx-familiar-control {
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
}

button.app-icon {
  border: 0;
  background: transparent;
  padding: 0;
}

.tx-discovery {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(16rem, 0.9fr);
  align-items: stretch;
  gap: clamp(1.5rem, 3.5vw, 2.75rem);
  margin: 0 0.25rem 3.4rem;
}

.tx-spotlight-shell {
  position: relative;
  min-width: 0;
}

.tx-spotlight {
  position: relative;
  isolation: isolate;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 10.5rem;
  padding: 1.4rem 1.65rem;
  overflow: hidden;
  text-align: left;
  color: #3e3a48;
  background:
    radial-gradient(circle at 88% 15%, rgba(255, 255, 255, 0.72), transparent 34%),
    linear-gradient(128deg, rgba(247, 246, 251, 0.94), rgba(232, 228, 240, 0.82));
  border: 1px solid rgba(86, 74, 108, 0.13);
  border-radius: 1rem;
  box-shadow: 0 16px 38px -28px rgba(74, 70, 96, 0.58);
  cursor: pointer;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 260ms ease, border-color 260ms ease;
}

.tx-spotlight-scene {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr);
  align-items: center;
  gap: 1.4rem;
  min-height: 7.7rem;
  padding-right: 2.4rem;
}

.tx-spotlight::after {
  content: '';
  position: absolute;
  z-index: -1;
  width: 11rem;
  height: 11rem;
  right: -4.4rem;
  bottom: -6.2rem;
  border-radius: 50%;
  background: rgba(108, 100, 148, 0.1);
}

.tx-spotlight:hover {
  transform: translateY(-2px);
  border-color: rgba(86, 74, 108, 0.24);
  box-shadow: 0 22px 42px -28px rgba(74, 70, 96, 0.68);
}

.tx-spotlight:active {
  transform: translateY(0) scale(0.995);
}

.tx-spotlight-icon {
  width: 5.25rem;
  height: 5.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 1.15rem;
  box-shadow: 0 12px 26px -15px rgba(74, 70, 96, 0.7);
  filter: saturate(0.76) brightness(1.12) sepia(0.04);
}

.tx-spotlight-icon img {
  width: 4.7rem;
  height: 4.7rem;
  object-fit: cover;
  border-radius: 0.9rem;
}

.tx-spotlight-icon i,
.tx-spotlight-icon span {
  color: #f9f7ff;
  font-size: 2rem;
}

.tx-spotlight-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.tx-spotlight-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Noto Serif TC", "Source Han Serif", serif;
  font-size: clamp(1.32rem, 2.3vw, 1.72rem);
  font-weight: 700;
  letter-spacing: 0.055em;
  color: #3e3a48;
}

.tx-spotlight-mark {
  flex: 0 0 auto;
  padding: 0.22rem 0.48rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #4a4660;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(74, 70, 96, 0.15);
}

.tx-spotlight-description {
  display: -webkit-box;
  margin-top: 0.48rem;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 0.84rem;
  line-height: 1.65;
  color: #6c6676;
}

.tx-spotlight-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.7rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #4a4660;
}

.tx-spotlight-arrow {
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tx-spotlight:hover .tx-spotlight-arrow {
  transform: translateX(0.2rem);
}

.tx-spotlight-dots {
  position: absolute;
  z-index: 2;
  right: 1.1rem;
  bottom: 0.9rem;
  padding: 0.2rem;
}

.tx-familiar-control {
  display: grid;
  width: 1.65rem;
  height: 1.65rem;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: rgba(74, 70, 96, 0.72);
  background: transparent;
  cursor: pointer;
  transition: color 160ms ease, background-color 160ms ease, opacity 160ms ease;
}

.tx-familiar-control:hover {
  color: #4a4660;
  background: rgba(86, 74, 108, 0.09);
}

.tx-familiar-control i {
  font-size: 0.62rem;
}

.tx-page-dots {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0 0.18rem;
}

.tx-page-dot {
  width: 0.3rem;
  height: 0.3rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(86, 74, 108, 0.24);
  cursor: pointer;
  transition: width 220ms cubic-bezier(0.16, 1, 0.3, 1), background-color 180ms ease;
}

.tx-page-dot.is-active {
  width: 0.9rem;
  border-radius: 999px;
  background: rgba(74, 70, 96, 0.68);
}

.tx-familiar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0.2rem 0 0;
}

.tx-familiar-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.65rem;
}

.tx-familiar-title {
  flex: 0 0 auto;
  font-family: "Noto Serif TC", "Source Han Serif", serif;
  font-size: 1.03rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #4a4660;
}

.tx-familiar-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(86, 74, 108, 0.24), transparent);
}

.tx-familiar-nav {
  display: flex;
  align-items: center;
  gap: 0.12rem;
}

.tx-familiar-control:disabled {
  cursor: default;
  opacity: 0.24;
  background: transparent;
}

.tx-familiar-viewport {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
}

.tx-familiar-viewport::-webkit-scrollbar {
  display: none;
}

.tx-familiar-track {
  display: flex;
  min-width: 100%;
}

.tx-familiar-page {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.tx-familiar-app {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  align-items: center;
  gap: 0.7rem;
  min-height: 4.2rem;
  padding: 0.5rem 0.55rem;
  text-align: left;
  color: #3e3a48;
  border: 0;
  border-bottom: 1px solid rgba(86, 74, 108, 0.12);
  background: transparent;
  cursor: pointer;
  transition: color 200ms ease, background-color 200ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.tx-familiar-page .tx-familiar-app:nth-last-child(-n + 2) {
  border-bottom-color: transparent;
}

.tx-familiar-page[data-count="3"] .tx-familiar-app:nth-child(2) {
  border-bottom-color: rgba(86, 74, 108, 0.12);
}

.tx-familiar-app:hover {
  color: #2c3648;
  background: rgba(247, 246, 251, 0.48);
  transform: translateX(0.16rem);
}

.tx-familiar-app:active {
  transform: translateX(0) scale(0.985);
}

.tx-familiar-icon {
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.72rem;
  box-shadow: 0 7px 16px -10px rgba(74, 70, 96, 0.72);
  filter: saturate(0.74) brightness(1.1) sepia(0.04);
}

.tx-familiar-icon img {
  width: 2.45rem;
  height: 2.45rem;
  object-fit: cover;
  border-radius: 0.58rem;
}

.tx-familiar-icon i,
.tx-familiar-icon span {
  color: #f9f7ff;
  font-size: 1.05rem;
}

.tx-familiar-name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 0.77rem;
  font-weight: 600;
  line-height: 1.42;
}

.app-icon .tx-tile {
  position: relative;
}

.tx-app-badge {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  z-index: 2;
  padding: 0.12rem 0.38rem;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  background: #f59e0b;
  box-shadow: 0 2px 6px rgba(86, 74, 108, 0.25);
}

.tx-app-badge.is-new {
  background: #ef4444;
}

@media (max-width: 640px) {
  .tx-discovery {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.35rem;
    margin-bottom: 2.7rem;
  }
  .tx-spotlight {
    min-height: 8.4rem;
    padding: 1rem 1.05rem;
  }
  .tx-spotlight-scene {
    grid-template-columns: 4rem minmax(0, 1fr);
    gap: 1rem;
    min-height: 6.35rem;
    padding-right: 0;
    padding-bottom: 1.35rem;
  }
  .tx-spotlight-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 0.9rem;
  }
  .tx-spotlight-icon img {
    width: 3.55rem;
    height: 3.55rem;
    border-radius: 0.72rem;
  }
  .tx-spotlight-icon i,
  .tx-spotlight-icon span {
    font-size: 1.6rem;
  }
  .tx-spotlight-title {
    font-size: 1.18rem;
  }
  .tx-spotlight-description {
    margin-top: 0.35rem;
    font-size: 0.76rem;
    line-height: 1.52;
  }
  .tx-spotlight-action {
    margin-top: 0.45rem;
  }
  .tx-familiar-header {
    margin-bottom: 0.55rem;
  }
  .tx-familiar-page {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.35rem;
  }
  .tx-familiar-nav {
    gap: 0.05rem;
  }
  .tx-familiar-app {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.45rem;
    min-height: 5.6rem;
    padding: 0.25rem 0.1rem;
    text-align: center;
    border-bottom: 0;
  }
  .tx-familiar-app:hover {
    transform: none;
    background: transparent;
  }
  .tx-familiar-icon {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 auto;
  }
  .tx-familiar-name {
    font-size: 0.68rem;
  }
}
