* {
  box-sizing: border-box;
}

a:hover {
  opacity: 1;
}

body {
  margin: 0;
  font-family: 'Noto Sans TC', system-ui, sans-serif;
  color: #111;
}

img.ia-icon {
  width: 100px;
  margin: 48px auto 32px;
}

/* ===== Breadcrumb ===== */

.breadcrumb {
  font-size: 12px;
  color: #9d9da0;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 16px;
}

.breadcrumb li {
  display: flex;
  align-items: center;
}

.breadcrumb li + li::before {
  content: '>';
  margin: 0 8px;
  color: #9d9da0;
}

.breadcrumb a {
  color: #9d9da0;
  text-decoration: none;
}

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

.breadcrumb li[aria-current='page'] {
  color: #111;
  font-weight: 500;
}

.case-section {
  max-width: 1024px;
  margin: 0 auto;
  padding: 48px 24px 0px 24px;
}

/* ===== Header ===== */
.case-header {
  text-align: center;
  margin-bottom: 40px;
}

.case-header .icon {
  font-size: 12px;
  color: #999;
}

.case-header h1 {
  font-size: 28px;
  margin: 12px 0;
}

.case-header p {
  font-size: 14px;
  color: #666;
  line-height: 1.8;
}

/* ===== Tabs ===== */
.case-tabs {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 32px;

  /* position: sticky;
  top: 0;
  background: #fff;
  z-index: 20;
  padding: 12px 0; */
}
.case-tabs .tab {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding-bottom: 6px;
  border-bottom: 2px solid transparent;
}

.case-tabs .tab.active {
  border-color: #000;
  font-weight: 600;
}

.case-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.case-link:hover h3 {
  text-decoration: underline;
}

/* ===== Case List ===== */
.case-list-wrapper {
  position: relative;
  min-height: 640px;
}

.case-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 20px;
  list-style: none;
  padding: 0;
  margin: 0;
  transition: opacity 0.35s ease;
}

.case-list.fade-out {
  opacity: 0;
}

.case-list.fade-in {
  opacity: 1;
}

/* 【新增】圖片初始狀態：避免閃爍 */
.case-item img {
  width: 100%;
  opacity: 0;
  transition: transform 0.35s ease, filter 0.35s ease;
  overflow: hidden;
}

/* 圖片載入完成後 */
.case-item img.loaded {
  opacity: 1;
}

/* hover 效果（桌機） */
@media (hover: hover) {
  .case-link:hover img {
    transform: scale(1.03);
    filter: brightness(1.05);
  }

  .case-link:hover h3 {
    color: #000;
  }
}

.case-item h3 {
  transition: color 0.25s ease;
  font-size: 18px;
  margin-top: 8px;
}

/* ===== Loading ===== */
.loading {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 10;
}

.loading.show {
  opacity: 1;
  pointer-events: auto;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid #ccc;
  border-top-color: #111;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 8px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 48px;
}

.pagination button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  border-bottom: 2px solid transparent;
}

.pagination button.active {
  font-weight: 700;
  color: #000;
  border-bottom: 2px solid #000;
}

/* ===== RWD ===== */
@media (max-width: 768px) {
  .case-list {
    grid-template-columns: 1fr;
  }
}
