/* ==========================================================
   I-PLEX.STUDIO 廣告模板庫樣式表
   100% 統一主站黑底 + 橙色光暈 + 紫色發光 CTA 視覺語言
   ========================================================== */

:root {
  --bg: #000000;
  --surface: #0c0c10;
  --surface-2: #14141a;
  --border: rgba(255, 255, 255, 0.1);
  --border-orange: rgba(255, 138, 42, 0.45);
  --text: #ffffff;
  --text-soft: #d7dce5;
  --text-muted: #939aa8;
  --orange: #ff7b00;
  --orange-bright: #ff9a2e;
  --purple-1: #6723ff;
  --purple-2: #8c3eff;
  --max-w: 1280px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans TC", "PingFang TC", "Hiragino Sans CNS", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video {
  display: block;
  max-width: 100%;
}

/* =========================
   Top Navigation
   ========================= */
.tpl-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 5, 8, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tpl-nav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.tpl-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.tpl-brand__mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.tpl-brand__word {
  font-size: 1.18rem;
  letter-spacing: 0.07em;
  line-height: 1;
}

.tpl-brand__word .plex {
  font-weight: 900;
  color: #ffffff;
}

.tpl-brand__word .dot {
  color: var(--orange);
  font-weight: 900;
  margin: 0 2px;
}

.tpl-brand__word .studio {
  font-weight: 300;
  color: #e5e7eb;
}

.tpl-nav__links {
  display: flex;
  align-items: center;
  gap: 26px;
}

.tpl-nav__link {
  font-size: 0.94rem;
  font-weight: 500;
  color: #d1d5db;
  transition: color 0.18s ease;
}

.tpl-nav__link:hover,
.tpl-nav__link.is-active {
  color: var(--orange-bright);
}

.tpl-nav__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 22px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple-1) 0%, var(--purple-2) 100%);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 0 20px rgba(124, 58, 237, 0.45);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.tpl-nav__cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

/* =========================
   Hero Header
   ========================= */
.tpl-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(44px, 6vw, 76px) 24px 36px;
  background:
    radial-gradient(ellipse 65% 45% at 50% 0%, rgba(255, 118, 0, 0.22) 0%, transparent 72%),
    #000000;
}

.tpl-hero__inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.tpl-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 15px;
  border-radius: 999px;
  background: rgba(255, 123, 0, 0.14);
  border: 1px solid rgba(255, 138, 42, 0.45);
  color: var(--orange-bright);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.tpl-hero__title {
  margin: 16px 0 0;
  font-size: clamp(2.1rem, 4.4vw, 3.6rem);
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: 0.02em;
}

.tpl-hero__title .orange {
  color: var(--orange);
}

.tpl-hero__title .slant {
  display: inline-block;
  transform: skewX(-6deg);
}

.tpl-hero__desc {
  margin: 14px 0 0;
  max-width: 720px;
  font-size: clamp(0.98rem, 1.35vw, 1.16rem);
  color: var(--text-soft);
  line-height: 1.65;
}

.tpl-stats {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.tpl-stats strong {
  color: #ffffff;
  font-weight: 700;
}

/* =========================
   Filter Bar (Dual Filter + Search)
   ========================= */
.tpl-filters {
  position: sticky;
  top: 63px;
  z-index: 40;
  background: rgba(6, 6, 10, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.tpl-filters__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tpl-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.tpl-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
  max-width: 100%;
}

.tpl-chips::-webkit-scrollbar {
  display: none;
}

.tpl-chip-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  margin-right: 4px;
}

.tpl-chip {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--surface);
  color: #d7dce5;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.18s ease;
}

.tpl-chip:hover {
  border-color: rgba(255, 148, 38, 0.6);
  color: #ffffff;
}

.tpl-chip.is-active {
  background: linear-gradient(90deg, #ff5d14 0%, #ff851b 100%);
  border-color: rgba(255, 178, 102, 0.7);
  color: #ffffff;
  box-shadow: 0 3px 16px rgba(255, 118, 0, 0.4);
}

.tpl-chip--sub.is-active {
  background: linear-gradient(90deg, var(--purple-1) 0%, var(--purple-2) 100%);
  border-color: rgba(196, 155, 255, 0.7);
  box-shadow: 0 3px 16px rgba(124, 58, 237, 0.42);
}

.tpl-search-wrap {
  position: relative;
  min-width: 220px;
  flex: 0 1 280px;
}

.tpl-search {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--surface);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.18s ease;
}

.tpl-search:focus {
  border-color: var(--orange);
}

.tpl-search::placeholder {
  color: #7c8494;
}

.tpl-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #8b93a3;
  pointer-events: none;
}

/* =========================
   Template Card Grid
   ========================= */
.tpl-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.tpl-count {
  margin: 0 0 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.tpl-count strong {
  color: var(--orange-bright);
}

.tpl-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.tpl-card {
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  cursor: pointer;
}

.tpl-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 138, 42, 0.72);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.72), 0 0 28px rgba(255, 118, 0, 0.2);
}

.tpl-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 8;
  background: #060609;
  overflow: hidden;
}

.tpl-card__media img,
.tpl-card__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.tpl-card:hover .tpl-card__media img {
  transform: scale(1.03);
}

/* Before/After mini split thumbnail */
.tpl-ba-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  height: 100%;
}

.tpl-ba-split__half {
  position: relative;
  overflow: hidden;
}

.tpl-ba-split__half:first-child {
  border-right: 1.5px solid rgba(255, 148, 38, 0.85);
}

.tpl-ba-split__tag {
  position: absolute;
  bottom: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  color: #ffffff;
  background: rgba(15, 15, 20, 0.82);
}

.tpl-ba-split__half:last-child .tpl-ba-split__tag {
  background: var(--orange);
}

.tpl-card__badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.tpl-badge {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.tpl-badge--id {
  background: rgba(10, 10, 14, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.tpl-badge--svc-a {
  background: rgba(255, 123, 0, 0.9);
  color: #ffffff;
}

.tpl-badge--svc-b {
  background: rgba(124, 58, 237, 0.9);
  color: #ffffff;
}

.tpl-card__dur {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 3px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.76);
  color: #f3f4f6;
  font-size: 0.76rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tpl-card__body {
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tpl-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  color: var(--orange-bright);
  font-weight: 600;
}

.tpl-card__meta .sep {
  color: rgba(255, 255, 255, 0.25);
}

.tpl-card__title {
  margin: 8px 0 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.3;
}

.tpl-card__sub {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.tpl-card__shots-preview {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tpl-shot-pill {
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.76rem;
  color: #cbd5e1;
}

.tpl-card__foot {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tpl-card__link {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--orange-bright);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.tpl-card__btn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 0;
  background: linear-gradient(90deg, var(--purple-1) 0%, var(--purple-2) 100%);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.18s ease;
}

.tpl-card__btn:hover {
  filter: brightness(1.1);
}

.tpl-empty {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-muted);
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 20px;
}

/* =========================
   Detail Modal (Shot-by-Shot Breakdown + Script + Enquiry)
   ========================= */
.tpl-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tpl-modal.is-open {
  display: flex;
}

.tpl-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 980px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 24px;
  background: #0d0d12;
  border: 1.5px solid rgba(255, 140, 42, 0.45);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85), 0 0 40px rgba(255, 118, 0, 0.18);
  padding: 26px;
}

.tpl-modal__close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 5;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 15, 20, 0.92);
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.tpl-modal__close:hover {
  border-color: var(--orange);
  color: var(--orange-bright);
}

.tpl-modal__grid {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 28px;
  align-items: start;
}

.tpl-modal__preview {
  border-radius: 18px;
  overflow: hidden;
  background: #060609;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.tpl-modal__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px;
  background: #131318;
}

.tpl-modal__tab {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #09090c;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.tpl-modal__tab.is-active {
  background: linear-gradient(90deg, #ff5d14 0%, #ff851b 100%);
  color: #ffffff;
  border-color: transparent;
}

.tpl-modal__stage {
  width: 100%;
  aspect-ratio: 9 / 8;
  overflow: hidden;
  background: #050507;
}

.tpl-modal__stage img,
.tpl-modal__stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tpl-modal__title {
  margin: 10px 0 0;
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1.25;
}

.tpl-modal__summary {
  margin: 10px 0 0;
  font-size: 0.94rem;
  color: var(--text-soft);
  line-height: 1.65;
}

.tpl-modal__section-h {
  margin: 22px 0 10px;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--orange-bright);
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tpl-timeline {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tpl-step {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tpl-step__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.86rem;
  font-weight: 700;
}

.tpl-step__time {
  color: var(--orange-bright);
  font-variant-numeric: tabular-nums;
}

.tpl-step__visual {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: #e5e7eb;
  line-height: 1.5;
}

.tpl-step__tip {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tpl-script-box {
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 123, 0, 0.07);
  border: 1px solid rgba(255, 138, 42, 0.3);
  font-size: 0.9rem;
  color: #f3f4f6;
  line-height: 1.65;
}

.tpl-copy-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: #e5e7eb;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.tpl-copy-btn:hover {
  border-color: var(--orange);
  color: var(--orange-bright);
}

.tpl-modal__actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tpl-cta-primary {
  flex: 1;
  min-width: 220px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--purple-1) 0%, var(--purple-2) 100%);
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 700;
  box-shadow: 0 8px 28px rgba(124, 58, 237, 0.45);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.tpl-cta-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
}

.tpl-cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}

.tpl-cta-secondary:hover {
  border-color: var(--orange);
  color: var(--orange-bright);
}

/* Footer */
.tpl-footer {
  border-top: 1px solid rgba(255, 138, 42, 0.28);
  padding: 36px 24px 48px;
  background: #040406;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.tpl-footer__links {
  margin-bottom: 14px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px 24px;
}

.tpl-footer__links a:hover {
  color: var(--orange-bright);
}

/* =========================
   Responsive
   ========================= */
@media (max-width: 1024px) {
  .tpl-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tpl-modal__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .tpl-nav__links {
    display: none;
  }

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

  /* 手機窄屏釋放可視高度：取消雙層篩選列 sticky，只留頂部導覽固定 */
  .tpl-filters {
    position: static;
    top: auto;
  }

  .tpl-search-wrap {
    flex: 1 1 100%;
  }

  .tpl-modal {
    padding: 10px;
  }

  .tpl-modal__dialog {
    padding: 18px;
    max-height: 94vh;
  }
}

.tpl-chip:active,
.tpl-card__btn:active,
.tpl-cta-primary:active,
.tpl-nav__cta:active {
  transform: scale(0.97);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
