:root {
  --title-h: clamp(60px, 14vw, 131px);
}

html, body {
  height: 100%;
  margin: 0;
}

/* header 浮動，不影響 main 高度 */
header {
  position: absolute;
  top: 3vh;
  z-index: 10;
}

main {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  box-sizing: border-box;
}

/* 標題 */
.title-banner {
  width: 100%;
  margin: 0 auto;
}

.title-banner h1 {
  margin: 0;
  width: 100%;
  height: var(--title-h);
  background-image: url("../img/home_tiitle.png");
  background-repeat: no-repeat;
  background-position: 12%;
  background-size: contain;
  color: transparent;
  text-indent: -9999px;
}

/* 首頁背景 */
.page-home {
  width: 100%;
  min-height: 100vh;
  background: url("../img/bg_pattern.png") repeat center center,
              linear-gradient(180deg,#e8ecf8,#fdfdfd);
  background-size: auto, cover;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: calc(var(--title-h) + 6vh);
  box-sizing: border-box;
  overflow: hidden; /* 預設桌機不出 scroll bar */
}

/* 卡片容器 */
.card-container {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 1980px;
}

/* 卡片 */
.card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  flex: 1 1 450px;
  max-width: 384px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-6px); }
.card img {
  width: 100%;
  border-radius: 10px;
}

/* 響應式 */
@media (max-width: 768px) {
  .page-home {
    padding-top: calc(var(--title-h) + 4vh);
    overflow: auto; /* 手機版可以正常滾動 */
  }
  .card-container {
    flex-direction: column;
    align-items: center;
    margin-top: 1rem;
  }
  .card {
    width: 80%;
    /* max-width: 360px; */
    flex: auto;
  }
}

@media (min-width: 967px) {
  .card .mobile{
    display: none;
  }
}

@media (max-width: 967px) {
  .card .pc{
    display: none;
  }

  .page-home{
    background: url("../img/bg_pattern_m.png") repeat center center,
              linear-gradient(180deg,#e8ecf8,#fdfdfd);
  }
}
