/**
 * twigspike UI components — cover_h / vod_list / icon
 * .ts-nav* 仅供 components/nav.twig（设计系统预览）；线上 layout/base 使用 .hd
 * 设计依据：design-system/MASTER.md + components/*.md
 */

/* ========== Icon (SVG via CSS mask → currentColor) ========== */
.ts-icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask: var(--ts-icon) center / contain no-repeat;
  mask: var(--ts-icon) center / contain no-repeat;
  vertical-align: -0.125em;
  pointer-events: none;
}

/* ========== Nav — Modern Dark Cinema (glass) ========== */
.ts-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(10, 10, 15, 0.88) 0%, rgba(5, 5, 6, 0.82) 100%);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.ts-nav__inner {
  padding-top: 10px;
  padding-bottom: 10px;
}
.ts-nav__bar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 52px;
  flex-wrap: nowrap;
}
.ts-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 200px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: opacity var(--dur) var(--ease);
}
.ts-nav__brand:hover {
  opacity: 0.9;
}
.ts-nav__brand:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: 8px;
}
.ts-nav__brand-ico {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background-color: transparent;
  background-image:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.35), transparent 45%),
    linear-gradient(135deg, var(--accent) 0%, #9f1239 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 0 18px rgba(225, 29, 72, 0.35);
  -webkit-mask: none;
  mask: none;
}
.ts-nav__brand-ico::after {
  content: "";
  position: absolute;
  inset: 7px;
  background-color: #fff;
  -webkit-mask: var(--ts-icon) center / contain no-repeat;
  mask: var(--ts-icon) center / contain no-repeat;
}
.ts-nav__brand-text {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ts-nav__primary {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  mask-image: linear-gradient(90deg, #000 0%, #000 calc(100% - 24px), transparent 100%);
}
.ts-nav__primary::-webkit-scrollbar {
  display: none;
}
.ts-nav__pill {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition:
    color var(--dur) var(--ease),
    background var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.ts-nav__pill:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}
.ts-nav__pill:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.ts-nav__pill.is-on,
.ts-nav__pill[aria-current="page"] {
  color: #fff;
  background: rgba(225, 29, 72, 0.18);
  border-color: rgba(225, 29, 72, 0.45);
  box-shadow: 0 0 20px rgba(225, 29, 72, 0.15);
}
.ts-nav__tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  margin-left: auto;
}
.ts-nav__search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.ts-nav__search-ico {
  position: absolute;
  left: 12px;
  z-index: 1;
  width: 14px;
  height: 14px;
  color: #6b7280;
  pointer-events: none;
}
.ts-nav__search {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  min-height: 40px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.ts-nav__search:focus-within {
  border-color: rgba(225, 29, 72, 0.55);
  box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.15);
}
.ts-nav__search input {
  background: none;
  border: 0;
  color: var(--text);
  padding: 8px 14px 8px 34px;
  width: 168px;
  outline: none;
  font: inherit;
  font-size: 13px;
}
.ts-nav__search input::placeholder {
  color: #6b7280;
}
.ts-nav__search button,
.ts-nav__search-btn {
  background: var(--accent);
  border: 0;
  color: #fff;
  padding: 0 14px;
  min-height: 40px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  transition: filter var(--dur) var(--ease);
}
.ts-nav__search button:hover,
.ts-nav__search-btn:hover {
  filter: brightness(1.1);
}
.ts-nav__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
.ts-nav__lang {
  color: var(--muted);
  padding: 6px 4px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  transition: color var(--dur) var(--ease);
}
.ts-nav__lang:hover,
.ts-nav__lang:focus-visible {
  color: var(--text);
  outline: none;
}
.ts-nav__user {
  color: var(--muted);
  padding: 0 10px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  cursor: pointer;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.ts-nav__user-ico {
  width: 14px;
  height: 14px;
}
.ts-nav__user:hover,
.ts-nav__user:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}
.ts-nav__user--cta {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-weight: 600;
}
.ts-nav__user--cta:hover {
  border-color: rgba(225, 29, 72, 0.5);
  background: rgba(225, 29, 72, 0.2);
  color: #fff;
}

/* 二级频道：芯片轨道 */
.ts-nav__rail {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.ts-nav__rail::-webkit-scrollbar {
  display: none;
}
.ts-nav__rail a {
  flex: 0 0 auto;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition:
    color var(--dur) var(--ease),
    background var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}
.ts-nav__rail-ico {
  width: 12px;
  height: 12px;
}
.ts-nav__rail a:hover,
.ts-nav__rail a:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  outline: none;
}

@media (max-width: 900px) {
  .ts-nav__bar {
    flex-wrap: wrap;
    gap: 10px;
  }
  .ts-nav__brand {
    max-width: calc(100% - 120px);
  }
  .ts-nav__primary {
    order: 3;
    width: 100%;
    mask-image: none;
  }
  .ts-nav__tools {
    margin-left: 0;
  }
  .ts-nav__search input {
    width: 120px;
  }
  .ts-nav__meta {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ts-nav__pill,
  .ts-nav__search,
  .ts-nav__rail a,
  .ts-nav__user {
    transition: none;
  }
}

/* ========== Cover（竖版 2:3，文件名仍 cover_h） ========== */
.ts-cover-h {
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  overflow: visible;
  position: relative;
  transition: transform var(--dur) var(--ease);
}
.ts-cover-h:hover {
  border-color: transparent;
}
.ts-cover-h__media {
  display: block;
  position: relative;
  aspect-ratio: var(--cover-ratio, var(--cover-h-ratio));
  background: var(--surface2);
  overflow: hidden;
  cursor: pointer;
  border-radius: var(--radius);
}
.ts-cover-h__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--dur) var(--ease);
}
.ts-cover-h:hover .ts-cover-h__media img {
  transform: scale(1.02);
}
.ts-cover-h__rank {
  position: absolute;
  left: 0;
  top: 0;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 0 0 var(--radius-sm) 0;
}
.ts-cover-h__badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ts-cover-h__play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.ts-cover-h:hover .ts-cover-h__play {
  opacity: 1;
  transform: scale(1);
}
.ts-cover-h__play-ico {
  width: 16px;
  height: 16px;
  margin-left: 2px;
}
.ts-cover-h__score {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-right: 6px;
  color: #fbbf24;
  font-weight: 600;
}
.ts-cover-h__star {
  width: 11px;
  height: 11px;
}
.ts-cover-h__body {
  padding: 10px 12px 12px;
}
.ts-cover-h__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ts-cover-h__title a {
  color: var(--text);
  cursor: pointer;
}
.ts-cover-h__title a:hover,
.ts-cover-h__title a:focus-visible {
  color: var(--accent);
  outline: none;
}
.ts-cover-h__meta {
  margin: 4px 0 8px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ts-cover-h .mac_ulog {
  margin: 0;
}

/* ========== Vod list ========== */
.ts-list {
  margin-bottom: var(--space-6);
}
.ts-list__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 var(--space-3);
  padding-left: 11px;
  border-left: 3px solid var(--accent);
}
.ts-list__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}
.ts-list__more {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  transition: color var(--dur) var(--ease);
}
.ts-list__more-ico {
  width: 14px;
  height: 14px;
}
.ts-list__more:hover,
.ts-list__more:focus-visible {
  color: var(--accent);
  outline: none;
}
.ts-list__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
}
@media (max-width: 560px) {
  .ts-list__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }
}
