/* 專案整合樣式：補上真實資料卡片、分頁、詳情頁與無障礙焦點狀態。 */
a.movie-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

button,
select,
input,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 3px;
}

.status {
  min-height: 20px;
  margin: 15px 2px 0;
  color: var(--muted);
  font-size: 12px;
}

.status[data-state="error"] {
  color: #ff9eae;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.card-tags .tag {
  margin-top: 9px;
}

.card-desc {
  display: -webkit-box;
  margin: 10px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.card-link {
  display: inline-block;
  margin-top: 12px;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 700;
}

.pager {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
}

.pager button {
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(7, 25, 51, .72);
  color: var(--muted);
  cursor: pointer;
}

.pager button.active {
  border-color: var(--cyan);
  background: rgba(0, 217, 255, .15);
  color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 217, 255, .22);
}

.drawer-note {
  margin-top: 34px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.soft-mode {
  --bg: #091426;
  --panel: rgba(15, 37, 64, .9);
  --text: #f5fbff;
  --muted: #abc0cf;
  --line: rgba(108, 211, 255, .42);
}

.detail-topbar {
  gap: 14px;
}

.detail-topbar .brand {
  margin-right: auto;
}

.back-button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--cyan);
  font-size: 11px;
  text-decoration: none;
}

.detail-main {
  padding: 30px 2px 20px;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(150px, 200px) minmax(0, 1fr);
  gap: 22px;
  padding: 16px;
  border: 1px solid rgba(0, 217, 255, .22);
  border-radius: var(--radius);
  background: linear-gradient(155deg, rgba(10, 34, 66, .93), rgba(3, 12, 27, .95));
  box-shadow: var(--shadow);
}

.detail-poster {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 12px;
  background: #06162b;
}

.detail-poster-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-copy h1 {
  margin: 0 0 15px;
  font-size: clamp(25px, 6vw, 38px);
  line-height: 1.2;
}

.detail-meta {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, .09);
}

.detail-meta dt,
.detail-meta dd {
  margin: 0;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.detail-meta dt {
  color: var(--cyan);
}

.detail-meta dd {
  color: var(--muted);
}

.detail-description,
.detail-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.detail-panel {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(139, 92, 255, .3);
  border-radius: var(--radius);
  background: rgba(4, 19, 40, .72);
  box-shadow: var(--shadow);
}

.detail-panel-heading h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

.source-group + .source-group {
  margin-top: 18px;
}

.source-title {
  margin-bottom: 9px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.source-title span {
  color: var(--muted);
  font-weight: 400;
}

.episodes {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.episode-button {
  border: 1px solid rgba(0, 217, 255, .24);
  border-radius: 8px;
  background: #061a34;
  color: var(--muted);
  padding: 8px 10px;
  cursor: pointer;
  font-size: 11px;
}

.episode-button:hover,
.episode-button.active {
  border-color: var(--cyan);
  color: var(--cyan);
  box-shadow: 0 0 12px rgba(0, 217, 255, .18);
}

.empty-inline,
.error-state,
.loading {
  padding: 20px;
  border-radius: 12px;
  color: var(--muted);
  line-height: 1.8;
}

.empty-inline {
  border: 1px dashed var(--line);
}

.error-state {
  border: 1px solid rgba(255, 62, 219, .45);
  background: rgba(65, 13, 47, .35);
  color: #ffb2d9;
}

.player {
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid rgba(0, 217, 255, .18);
  border-radius: 13px;
  background: #01050d;
}

.player video {
  display: block;
  width: 100%;
  max-height: 620px;
  background: #000;
}

.playerbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #071426;
}

.playerbar .current {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.open {
  flex: 0 0 auto;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--cyan);
  font-size: 10px;
  text-decoration: none;
}

@media (max-width: 600px) {
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .detail-poster {
    width: min(100%, 280px);
    margin: auto;
  }

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

@media (max-width: 360px) {
  .app-shell {
    padding-inline: 10px;
  }

  .brand {
    font-size: 12px;
    letter-spacing: 1px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .movie-grid {
    gap: 8px;
  }

  .movie-card h3 {
    font-size: 12px;
  }
}
