:root {
  color-scheme: light;
  --bg: #f8f5ef;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --ink: #1f2933;
  --muted: #69737f;
  --line: rgba(31, 41, 51, 0.14);
  --teal: #0f766e;
  --rose: #a23e48;
  --gold: #a96718;
  --blue: #315f8c;
  --shadow: 0 18px 50px rgba(28, 35, 43, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.10), transparent 28rem),
    linear-gradient(180deg, var(--bg), #efe7db);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.88);
  backdrop-filter: blur(18px);
}

.brand,
.nav,
.hero-actions,
.filters {
  display: flex;
  align-items: center;
}

.brand {
  gap: 0.7rem;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 2.45rem;
  height: 2.45rem;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--teal);
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav {
  gap: 0.35rem;
}

.nav a {
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  color: var(--muted);
  text-decoration: none;
}

.nav a:hover {
  background: rgba(15, 118, 110, 0.08);
  color: var(--ink);
}

main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2.5rem);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 0.78fr);
  gap: clamp(1.3rem, 4vw, 4rem);
  align-items: center;
  min-height: calc(100vh - 5rem);
  padding: 1.2rem 0 3rem;
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 12ch;
  margin-bottom: 1rem;
  font-size: clamp(2.65rem, 7vw, 5.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 38rem;
  color: #4c5966;
  font-size: clamp(1.05rem, 2.4vw, 1.28rem);
  line-height: 1.8;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.6rem;
}

.button {
  display: inline-flex;
  min-height: 2.85rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.72rem 1rem;
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.feature-player {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.video-frame {
  aspect-ratio: 9 / 16;
  background: #111;
}

.video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.feature-meta {
  padding: 1rem;
}

.feature-meta span {
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
}

.feature-meta h2 {
  margin: 0.35rem 0 0.5rem;
  font-size: 1.25rem;
  line-height: 1.35;
}

.feature-meta p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.video-section {
  padding: 2.8rem 0 1rem;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

#resultCount {
  color: var(--muted);
  font-weight: 700;
}

.controls {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 0.8rem;
  align-items: end;
  margin-bottom: 1.1rem;
}

.search-label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
}

.search-label input {
  width: 100%;
  min-height: 2.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  background: var(--surface-strong);
  color: var(--ink);
}

.filters {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.filter {
  min-height: 2.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.78rem;
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.filter[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 1rem;
}

.card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.thumb {
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #ddd5c7;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.phase-badge {
  position: absolute;
  left: 0.65rem;
  bottom: 0.65rem;
  border-radius: 8px;
  padding: 0.38rem 0.55rem;
  background: rgba(31, 41, 51, 0.86);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}

.card-body {
  display: grid;
  gap: 0.75rem;
  padding: 0.95rem;
}

.card h3 {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.45;
}

.synopsis {
  display: -webkit-box;
  min-height: 4.9rem;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.card-actions a,
.card-actions button {
  min-height: 2.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.card-actions a,
.card-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.card-actions button {
  border-color: rgba(15, 118, 110, 0.32);
  color: var(--teal);
}

.empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 2rem;
  color: var(--muted);
  text-align: center;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 1.6rem clamp(1rem, 3vw, 2.5rem) 2.2rem;
  color: var(--muted);
}

footer p {
  margin-bottom: 0;
}

footer a {
  font-weight: 800;
  text-decoration: none;
}

@media (max-width: 820px) {
  .topbar {
    position: static;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 1.4rem;
  }

  h1 {
    max-width: 10ch;
  }

  .feature-player {
    max-width: 430px;
    margin: 0 auto;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .filters {
    justify-content: flex-start;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .card {
    grid-template-columns: minmax(118px, 34vw) 1fr;
  }

  .card-body {
    min-width: 0;
  }

  .synopsis {
    min-height: 0;
    -webkit-line-clamp: 2;
  }
}

@media (max-width: 520px) {
  .topbar,
  footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    width: 100%;
    justify-content: space-between;
  }

  .card {
    grid-template-columns: 1fr;
  }
}
