/* 模板中心 (/templates): the look of 阿杜导演's template center, on the site's tokens (base.css). */
/* The site's generic preview status box stays out of these cards (hover previews here are silent and quick). */
.tcx-card > .preview-state, .tcx-slide > .preview-state { display: none !important; }
.tcx-hero { position: relative; overflow: hidden; padding: 56px 0 40px; border-bottom: 1px solid var(--border-muted);
  background: radial-gradient(60% 90% at 85% 10%, rgba(163,113,247,.14), transparent 60%), radial-gradient(50% 80% at 10% 0, rgba(88,166,255,.1), transparent 60%); }
.tcx-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; align-items: center; }
.tcx-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); font-size: 13px; background: rgba(1,4,9,.45); }
.tcx-live, .tcx-show-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: tcx-pulse 2.4s var(--ease) infinite; }
@keyframes tcx-pulse { 0% { box-shadow: 0 0 0 0 rgba(63,185,80,.5); } 70% { box-shadow: 0 0 0 8px rgba(63,185,80,0); } 100% { box-shadow: 0 0 0 0 rgba(63,185,80,0); } }
.tcx-hero h1 { margin: 18px 0 14px; font-size: clamp(40px, 4.6vw, 72px); line-height: 1.04; font-weight: 800; letter-spacing: -.02em; }
.tcx-hero-copy > p { max-width: 36em; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.75; }
.tcx-stats { display: flex; gap: 0; margin: 28px 0 0; }
.tcx-stats div { display: flex; flex-direction: column-reverse; padding: 0 28px; border-left: 1px solid var(--border-muted); }
.tcx-stats div:first-child { padding-left: 0; border-left: 0; }
.tcx-stats dd { margin: 0; font: 700 34px/1.1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.tcx-stats dt { margin-top: 6px; color: var(--muted); font-size: 13px; }

.tcx-show { position: relative; aspect-ratio: 16 / 10; border-radius: 18px; overflow: hidden; border: 1px solid var(--border); background: #0d1117; box-shadow: 0 30px 80px -40px rgba(163,113,247,.55); }
.tcx-show-live { position: absolute; z-index: 3; top: 14px; left: 14px; display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: rgba(1,4,9,.66); backdrop-filter: blur(8px); font-size: 13px; }
.tcx-show-live i { background: #f85149; animation-name: tcx-pulse-red; }
@keyframes tcx-pulse-red { 0% { box-shadow: 0 0 0 0 rgba(248,81,73,.5); } 70% { box-shadow: 0 0 0 8px rgba(248,81,73,0); } 100% { box-shadow: 0 0 0 0 rgba(248,81,73,0); } }
.tcx-slide { position: absolute; inset: 0; margin: 0; opacity: 0; transform: scale(1.03); transition: opacity .9s var(--ease), transform 1.6s var(--ease); pointer-events: none; }
.tcx-slide.is-on { opacity: 1; transform: none; pointer-events: auto; }
.tcx-slide img, .tcx-slide video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tcx-slide video { opacity: 0; transition: opacity .6s var(--ease); }
.tcx-slide.is-playing video { opacity: 1; }
.tcx-slide figcaption { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px 16px; padding: 60px 20px 18px;
  background: linear-gradient(180deg, transparent, rgba(1,4,9,.78) 55%, rgba(1,4,9,.92)); }
.tcx-show-meta { grid-column: 1; color: rgba(240,246,252,.75); font-size: 13px; }
.tcx-slide figcaption b { grid-column: 1; font-size: clamp(18px, 1.4vw + 8px, 26px); line-height: 1.25; }
.tcx-slide figcaption .btn { grid-column: 2; grid-row: 1 / span 2; }
.tcx-show-dots { position: absolute; z-index: 3; top: 18px; right: 16px; display: flex; gap: 6px; }
.tcx-show-dots button { width: 26px; height: 4px; padding: 0; border: 0; border-radius: 4px; background: rgba(240,246,252,.25); overflow: hidden; cursor: pointer; }
.tcx-show-dots button i { display: block; width: 0; height: 100%; background: #fff; }
.tcx-show-dots button.is-on i { animation: tcx-progress var(--tcx-slide, 6s) linear forwards; }
@keyframes tcx-progress { to { width: 100%; } }

.tcx-bar { position: sticky; top: 64px; z-index: 20; padding: 14px 0 12px; background: rgba(1,4,9,.86); backdrop-filter: blur(14px) saturate(1.2); border-bottom: 1px solid var(--border-muted); }
.tcx-bar-in { display: grid; gap: 12px; }
.tcx-bar-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
.tcx-seg { display: inline-flex; flex: 0 0 auto; padding: 3px; border-radius: 999px; border: 1px solid var(--border-muted); background: rgba(240,246,252,.03); }
.tcx-seg a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; color: var(--muted); font-size: 14px; white-space: nowrap; transition: color .2s, background .2s; }
.tcx-seg a:hover { color: var(--fg); }
.tcx-seg a.is-on { color: var(--fg); background: rgba(240,246,252,.1); }
.tcx-zones { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tcx-claim { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 7px 14px; border-radius: 999px; border: 1px dashed var(--border); color: var(--muted); font-size: 14px; white-space: nowrap; transition: color .2s, border-color .2s; }
.tcx-claim:hover { color: var(--fg); border-color: rgba(163,113,247,.6); }
.tcx-seg small, .tcx-chips small, .tcx-claim small { color: var(--subtle); font: 500 12px var(--mono); font-variant-numeric: tabular-nums; }
.tcx-search { position: relative; flex: 0 1 380px; }
.tcx-search svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--muted); }
.tcx-search input { width: 100%; height: 38px; padding: 0 14px 0 36px; border-radius: 999px; border: 1px solid var(--border); background: rgba(240,246,252,.03); color: var(--fg); font: inherit; font-size: 14px; }
.tcx-search input:focus { outline: none; border-color: rgba(163,113,247,.6); box-shadow: 0 0 0 3px rgba(163,113,247,.15); }
.tcx-chips { display: flex; gap: 8px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tcx-chips::-webkit-scrollbar { display: none; }
.tcx-chips a { display: inline-flex; align-items: center; gap: 7px; flex: 0 0 auto; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border-muted); color: var(--muted); font-size: 14px; transition: color .2s, border-color .2s, background .2s; }
.tcx-chips a:hover { color: var(--fg); border-color: var(--border); }
.tcx-chips a.is-on { color: #0b0d12; background: var(--fg); border-color: var(--fg); }
.tcx-chips a.is-on small { color: rgba(11,13,18,.6); }
.tcx-tools { display: flex; gap: 10px; flex: 0 0 auto; }

.tcx-body { padding-top: 12px; padding-bottom: 72px; }
.tcx-section { padding-top: 40px; container-type: inline-size; }
.tcx-section-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.tcx-section-head h2 { margin: 0; font-size: clamp(22px, 1.2vw + 14px, 30px); font-weight: 700; }
.tcx-count { color: var(--muted); font: 500 14px var(--mono); }
.tcx-only { margin-left: auto; color: var(--muted); font-size: 14px; display: inline-flex; gap: 4px; transition: color .2s; }
.tcx-only:hover { color: var(--fg); }
.tcx-empty { padding: 48px 0; color: var(--muted); text-align: center; }
.tcx-more { display: flex; justify-content: center; margin-top: 28px; }

/* Shape grid: the column count follows the section width (container query), and one row is a third of a 9:16 card in
   one column. Landscape cards take 2×2 cells (≈16:9), portrait 1×3 (9:16, half again as tall), square-ish 2×3. */
.tcx-grid { --g: 12px; --cols: 2; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-auto-flow: row dense; gap: var(--g);
  grid-auto-rows: 96px; grid-auto-rows: calc(((100cqi - (var(--cols) - 1) * var(--g)) / var(--cols) * 16 / 9 - 2 * var(--g)) / 3); }
/* Even counts only, so rows of landscape cards (two columns each) always close. */
@container (min-width: 640px) { .tcx-grid { --cols: 4; } }
@container (min-width: 960px) { .tcx-grid { --cols: 6; } }
@container (min-width: 1200px) { .tcx-grid { --cols: 8; } }
@container (min-width: 1640px) { .tcx-grid { --cols: 10; } }
@supports not (width: 1cqi) { .tcx-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: 90px; } }
.tcx-card { position: relative; grid-column: span 2; grid-row: span 2; min-width: 0; overflow: hidden; border-radius: 14px; border: 1px solid var(--border-muted);
  background: linear-gradient(100deg, #0d1117 30%, #161b22 50%, #0d1117 70%) 0 0 / 220% 100%; animation: tcx-shimmer 1.6s linear infinite;
  transition: transform .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease); }
.tcx-card.is-portrait { grid-column: span 1; grid-row: span 3; }
.tcx-card.is-square { grid-column: span 2; grid-row: span 3; }
.tcx-card.is-loaded { animation: none; background: #0d1117; }
/* A shape that does not fill its cells (3:4, 1:1, 4:3) shows whole, over a blurred copy of its own cover. */
.tcx-card.is-fit::before { content: ""; position: absolute; inset: -24px; background: var(--cover) center / cover no-repeat; filter: blur(22px) brightness(.55) saturate(1.2); opacity: 0; transition: opacity .45s var(--ease); }
.tcx-card.is-fit.is-loaded::before { opacity: 1; }
.tcx-card.is-fit .tcx-cover, .tcx-card.is-fit video { object-fit: contain; }
@keyframes tcx-shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.tcx-card:hover, .tcx-card:focus-within { transform: translateY(-3px); border-color: rgba(163,113,247,.5); box-shadow: 0 20px 44px -24px rgba(163,113,247,.6); }
.tcx-hit { position: absolute; inset: 0; z-index: 4; border-radius: inherit; }
.tcx-hit:focus-visible { outline: 2px solid #79c0ff; outline-offset: -2px; }
.tcx-cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .45s var(--ease), transform .7s var(--ease); }
.tcx-card.is-loaded .tcx-cover { opacity: 1; }
.tcx-card:hover .tcx-cover { transform: scale(1.04); }
.tcx-cover-empty { opacity: 1; background: radial-gradient(120% 120% at 20% 10%, rgba(163,113,247,.25), transparent 60%), #0d1117; }
.tcx-card video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s var(--ease); pointer-events: none; }
.tcx-card.is-playing video { opacity: 1; }
.tcx-top { position: absolute; z-index: 3; top: 10px; left: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.tcx-top > span { padding: 2px 8px; border-radius: 7px; font-size: 12px; line-height: 1.6; background: rgba(1,4,9,.62); backdrop-filter: blur(6px); color: rgba(240,246,252,.9); }
.tcx-top .tcx-new { color: #0b0d12; background: var(--grad); font: 700 11px/1.7 var(--mono); letter-spacing: .1em; }
.tcx-top .tcx-zone { color: #e2c5ff; background: rgba(110,64,201,.55); }
.tcx-top .tcx-soon { color: #ffd8a8; background: rgba(158,106,3,.6); }
.tcx-embed .tcx-section { padding-top: 8px; }
.tcx-top .tcx-ratio { margin-left: auto; }
.tcx-bottom { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; display: grid; gap: 3px; padding: 44px 14px 12px; background: linear-gradient(180deg, transparent, rgba(1,4,9,.72) 45%, rgba(1,4,9,.9)); pointer-events: none; }
.tcx-meta { display: flex; gap: 6px; color: rgba(240,246,252,.72); font-size: 12px; white-space: nowrap; overflow: hidden; }
.tcx-title { overflow: hidden; font-size: 16px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.tcx-author { z-index: 5; display: inline-flex; align-items: center; gap: 6px; justify-self: start; max-width: 100%; color: rgba(240,246,252,.75); font-size: 12px; pointer-events: auto; transition: color .2s; }
.tcx-author:hover { color: #fff; }
.tcx-author .avatar { width: 18px; height: 18px; font-size: 9px; flex: 0 0 auto; }
.tcx-author span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tcx-card.is-portrait .tcx-title { font-size: 14px; }
/* Cards rise in one after another as each grid enters the view. */
.tcx-page.has-js .tcx-grid:not(.is-in) .tcx-card { opacity: 0; transform: translateY(16px); }
.tcx-grid.is-in .tcx-card { transition: opacity .6s var(--ease) calc(var(--i, 0) * 45ms), transform .6s var(--ease) calc(var(--i, 0) * 45ms), border-color .35s var(--ease), box-shadow .35s var(--ease); }

.tcx-card.tcx-enter { animation: tcx-rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes tcx-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (max-width: 960px) {
  .tcx-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .tcx-bar-row { flex-wrap: wrap; }
  .tcx-search { flex: 1 1 100%; order: 2; }
  .tcx-tools { width: 100%; overflow-x: auto; scrollbar-width: none; }
}
@media (max-width: 720px) {
  .tcx-hero { padding: 32px 0 28px; }
  .tcx-stats div { padding: 0 16px; }
  .tcx-stats dd { font-size: 26px; }
  .tcx-bar { position: static; }
  .tcx-grid { --g: 8px; }
  .tcx-zones { flex-wrap: wrap; }
  .tcx-slide figcaption { grid-template-columns: 1fr; }
  .tcx-slide figcaption .btn { grid-column: 1; grid-row: auto; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  .tcx-live, .tcx-show-live i, .tcx-card, .tcx-show-dots button.is-on i { animation: none; }
  .tcx-slide, .tcx-card, .tcx-cover { transition: opacity .2s; transform: none !important; }
  .tcx-page.has-js .tcx-grid:not(.is-in) .tcx-card { opacity: 1; transform: none; }
}
