/* 电视直播. On a wide screen the page is one screen tall: a slim title, the picture taking all the
   room it can with what is on under it, and the channels beside it in a panel of the same height.
   On narrower screens the picture comes first and the list follows. */
.live-main { --live-gap: clamp(12px, 1.2vw, 20px); max-width: 1880px; margin: 0 auto; padding: 14px var(--mh-gutter) 20px; }
.live-heading { display: flex; align-items: baseline; gap: 6px 14px; min-width: 0; margin: 0 0 12px; }
.live-heading h1 { flex: none; margin: 0; font-size: 20px; font-weight: 750; letter-spacing: -.01em; }
.live-welcome { min-width: 0; margin: 0; overflow: hidden; color: var(--muted); font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }

.live-layout { --live-top: calc(var(--mh-head-height) + 14px); display: grid; grid-template-columns: minmax(0, 1fr) clamp(320px, 24vw, 400px); gap: var(--live-gap);
  height: calc(100svh - var(--mh-head-height) - 14px - 12px - 28px - 24px); min-height: 540px; }

/* ---- player ---- */
.live-view { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-radius: 18px; overflow: hidden; background: #000; border: 1px solid var(--line); box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .9); }
.live-stage { position: relative; flex: 1; min-height: 0; background: #000; }
.live-stage video, .live-stage .live-embed { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; background: #000; object-fit: contain; }
.live-page:not([data-state]) .live-stage video { display: none; }

/* Before anything is on: a greeting, the channel last watched and a few to start with. */
.live-start { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: clamp(24px, 5vw, 80px); overflow: auto;
  background: radial-gradient(70% 80% at 12% 8%, rgba(99, 102, 241, .26), transparent 70%), radial-gradient(55% 60% at 95% 100%, rgba(45, 212, 191, .13), transparent 70%), #070a14; }
.live-start p { margin: 0; }
.live-start-hello { font-size: clamp(28px, 3.2vw, 46px); font-weight: 750; letter-spacing: -.025em; color: #fff; }
.live-resume { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.live-resume-note { color: var(--muted-2); font-size: 14px; }
.live-start-title { margin-top: 10px !important; color: var(--muted-2); font-size: 14px; }
.live-picks-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 860px; }
.live-start-note { margin-top: 8px !important; color: var(--muted); font-size: 12px; }

/* A channel on a button: to start, to resume and to suggest another. */
.live-chip { display: inline-flex; align-items: center; gap: 12px; min-width: 0; min-height: 56px; padding: 7px 16px 7px 7px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .08); background: rgba(255, 255, 255, .045); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; transition: background .18s, border-color .18s, transform .18s; }
.live-chip > span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.live-chip:hover { background: rgba(255, 255, 255, .09); border-color: rgba(255, 255, 255, .18); transform: translateY(-1px); }
.live-chip:active { transform: translateY(0) scale(.985); }
.live-chip-main { min-height: 52px; padding-right: 22px; background: #fff; border-color: #fff; color: #0a0a19; box-shadow: 0 10px 30px -12px rgba(255, 255, 255, .45); }
.live-chip-main:hover { background: #eef0fa; border-color: #eef0fa; }
.live-chip-main:not(:has(.live-mark)) { padding: 0 24px; }

/* While a channel comes, and when it will not: said over the picture, with somewhere to go next. */
.live-veil { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 12px; padding: 24px; text-align: center; background: rgba(5, 7, 15, .84); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.live-veil p { margin: 0; }
.live-veil .live-mark { --mark: 68px; margin-bottom: 4px; }
.live-page[data-state="connecting"] .live-veil .live-mark { animation: live-breathe 1.8s ease-in-out infinite; }
@keyframes live-breathe { 50% { transform: scale(.95); opacity: .75; } }
.live-veil-title { color: #fff; font-size: clamp(16px, 1.5vw, 21px); font-weight: 700; }
.live-veil-text { max-width: 32em; color: var(--muted-2); font-size: 13.5px; line-height: 1.7; }
.live-veil-text:empty { display: none; }
.live-veil-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; max-width: 720px; margin-top: 8px; }
.live-veil-actions:empty { display: none; }
.live-veil-or { flex-basis: 100%; margin-top: 10px; color: var(--muted); font-size: 12px; }

.live-toast { position: absolute; top: 16px; left: 16px; z-index: 4; margin: 0; padding: 8px 14px; border-radius: 12px; background: rgba(5, 7, 15, .78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; font-size: 15px; font-weight: 650; pointer-events: none; transition: opacity .4s; }
.live-toast-out { opacity: 0; }

/* What is on, under the picture. */
.live-page:not([data-state]) .live-now { display: none; }
.live-now { flex: none; display: flex; align-items: center; gap: 14px; padding: 12px clamp(14px, 1.4vw, 20px); background: linear-gradient(180deg, #0d1222, #0a0e1b); border-top: 1px solid var(--line); }
.live-now .live-mark { --mark: 50px; }
.live-now-copy { flex: 1; min-width: 0; }
.live-now-copy p, .live-now-copy h2 { margin: 0; }
.live-now-kicker { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.live-now-copy h2 { margin-top: 3px; overflow: hidden; font-size: clamp(17px, 1.3vw, 20px); font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
#live-status { margin-top: 2px; color: var(--muted-2); font-size: 12.5px; }
.live-page[data-state="error"] #live-status { color: #fca5a5; }
.live-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px 2px 6px; border-radius: 5px; background: #e11d48; color: #fff; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .12em; line-height: 1.5; }
.live-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #fff; animation: live-pulse 1.6s ease-in-out infinite; }
.live-page[data-state="connecting"] .live-badge { background: rgba(255, 255, 255, .14); color: var(--muted-2); }
.live-page[data-state="connecting"] .live-badge::before { background: var(--accent); }
@keyframes live-pulse { 50% { opacity: .25; } }

.live-keys { display: flex; gap: 14px; margin: 0; color: var(--muted); font-size: 12px; white-space: nowrap; }
.live-keys span { display: inline-flex; align-items: center; gap: 3px; }
.live-keys kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; border: 1px solid rgba(255, 255, 255, .14); border-bottom-width: 2px; background: rgba(255, 255, 255, .04); color: var(--muted-2); font: inherit; font-size: 11px; line-height: 1; }
@media (hover: none), (max-width: 1280px) { .live-keys { display: none; } }

.live-controls { flex: none; display: flex; gap: 8px; }
.live-action { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 16px 0 13px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .05); color: var(--text); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .18s, border-color .18s, color .18s; }
.live-action:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); }
.live-action svg, .live-star svg { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#live-edge svg circle { fill: #f43f5e; stroke: none; }
.live-fav[aria-pressed="true"] { color: #fcd34d; background: rgba(252, 211, 77, .1); border-color: rgba(252, 211, 77, .35); }
.live-fav[aria-pressed="true"] svg, .live-star[aria-pressed="true"] svg { fill: currentColor; }
.live-chip:focus-visible, .live-star:focus-visible, .live-action:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---- a channel's mark: its own logo, or its initials on a tile of its colour ---- */
.live-mark { --mark: 42px; --tint: var(--accent); position: relative; flex: none; display: grid; place-items: center; width: calc(var(--mark) * 1.42); height: var(--mark); border-radius: calc(var(--mark) * .24); overflow: hidden;
  color: #fff; font-weight: 800; letter-spacing: -.02em; line-height: 1; white-space: nowrap; font-size: calc(var(--mark) * .42);
  background: linear-gradient(145deg, color-mix(in srgb, var(--tint) 62%, #0b1020), color-mix(in srgb, var(--tint) 22%, #0b1020));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 0 0 1px rgba(255, 255, 255, .08); text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.live-mark[data-size="mid"] { font-size: calc(var(--mark) * .32); }
.live-mark[data-size="long"] { font-size: calc(var(--mark) * .24); letter-spacing: 0; }
.live-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.live-mark[data-logo] { padding: calc(var(--mark) * .1) calc(var(--mark) * .14); background: #f5f6fa; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6); }
.live-mark[data-logo][data-tone="dark"] { background: linear-gradient(145deg, #232a40, #151a2b); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); }
.live-mark[data-logo][data-tone="full"] { padding: 2px; background: #fff; }
.live-chip .live-mark { --mark: 38px; }

/* ---- channel list ---- */
.live-list { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-radius: 18px; border: 1px solid var(--line); background: rgba(13, 17, 31, .82); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); overflow: hidden; }
.live-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 16px 16px 0; }
.live-list-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
#live-count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.live-filters { display: grid; gap: 8px; padding: 12px 16px 14px; border-bottom: 1px solid var(--line); }
.live-tabs { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); }
.live-tabs button { height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--muted-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: color .2s, background .2s; }
.live-tabs button:hover { color: #fff; }
.live-tabs button[aria-pressed="true"] { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12); }
.live-find { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); transition: border-color .2s, box-shadow .2s; }
.live-find:focus-within { border-color: rgba(129, 140, 248, .8); box-shadow: 0 0 0 3px rgba(129, 140, 248, .18); }
.live-find svg { flex: none; width: 15px; height: 15px; color: var(--muted); }
.live-find input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; }
.live-find input::placeholder { color: var(--muted); }
.live-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.live-picks select { min-width: 0; height: 36px; padding: 0 28px 0 11px; border-radius: 11px; border: 1px solid var(--line); color: var(--muted-2); font: inherit; font-size: 13px; cursor: pointer; -webkit-appearance: none; appearance: none;
  background: rgba(255, 255, 255, .04) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%23b7bdd6' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 9px center / 12px; }
.live-picks select:hover { border-color: var(--line-strong); color: #fff; }
.live-picks option { background: #0f1424; color: var(--text); }
.live-note { margin: 0; color: var(--muted); font-size: 12px; }
.live-note:empty { display: none; }
.live-empty { margin: 0; padding: 32px 16px; color: var(--muted); font-size: 13px; line-height: 1.7; text-align: center; }
.live-more { padding: 14px; color: var(--muted); font-size: 12px; text-align: center; }
.live-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 8px 12px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .16) transparent; overscroll-behavior: contain; }
.live-group h3 { position: sticky; top: 0; z-index: 1; display: flex; align-items: baseline; gap: 6px; margin: 0; padding: 12px 8px 6px; font-size: 12px; font-weight: 650; color: var(--muted-2); background: linear-gradient(180deg, rgb(13, 17, 31) 75%, rgba(13, 17, 31, 0)); }
.live-group h3 small { color: var(--muted); font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }

.live-row { position: relative; }
.live-channel { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; min-height: 60px; padding: 8px 44px 8px 8px; border: 0; border-radius: 13px; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background .15s; }
.live-channel .live-mark { --mark: 42px; }
.live-channel:hover { background: rgba(255, 255, 255, .055); }
.live-channel:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.live-channel[aria-pressed="true"] { background: linear-gradient(90deg, rgba(129, 140, 248, .2), rgba(129, 140, 248, .08)); box-shadow: inset 0 0 0 1px rgba(129, 140, 248, .4); }
.live-channel strong, .live-channel small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.live-channel strong { font-size: 14px; font-weight: 600; line-height: 1.35; }
.live-channel small { margin-top: 2px; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.live-channel[aria-pressed="true"] strong { color: #fff; }
.live-channel-side { display: flex; align-items: center; }
.live-channel-tag { padding: 2px 6px; border-radius: 6px; background: rgba(255, 255, 255, .06); color: var(--muted); font-size: 10px; }
.live-channel-on { display: none; align-items: flex-end; gap: 2px; height: 14px; }
.live-channel-on i { width: 3px; border-radius: 1px; background: var(--accent); animation: live-bars 1s ease-in-out infinite; }
.live-channel-on i:nth-child(1) { height: 60%; } .live-channel-on i:nth-child(2) { height: 100%; animation-delay: -.3s; } .live-channel-on i:nth-child(3) { height: 40%; animation-delay: -.6s; }
@keyframes live-bars { 50% { transform: scaleY(.35); } }
.live-channel[aria-pressed="true"] .live-channel-on { display: flex; }
.live-channel[aria-pressed="true"] .live-channel-tag { display: none; }
.live-channel[data-down]:not([aria-pressed="true"]) { opacity: .5; }
.live-channel[data-down] .live-channel-tag { background: rgba(248, 113, 113, .12); color: #fca5a5; }
.live-page[data-state="connecting"] .live-channel-on i, .live-page[data-state="error"] .live-channel-on i { animation-play-state: paused; opacity: .5; }
.live-star { position: absolute; top: 50%; right: 6px; display: grid; place-items: center; width: 34px; height: 34px; margin-top: -17px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .15s, color .15s, background .15s; }
.live-row:hover .live-star, .live-star:focus-visible, .live-star[aria-pressed="true"] { opacity: 1; }
.live-star:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.live-star[aria-pressed="true"] { color: #fcd34d; }
@media (hover: none) { .live-star { opacity: .55; } }

[hidden] { display: none !important; }

/* ---- narrower screens: the picture on top at full width, the list under it ---- */
@media (max-width: 1100px) {
  .live-picks-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .live-main { padding-top: 12px; }
  .live-layout { display: block; height: auto; min-height: 0; }
  .live-view { position: sticky; top: var(--mh-head-height); z-index: 5; margin-bottom: 16px; }
  .live-stage { flex: none; aspect-ratio: 16 / 9; }
  /* Nothing to keep in view until a channel is on, nor when it will not come. */
  .live-page:not([data-state]) .live-view, .live-page[data-state="error"] .live-view { position: relative; top: 0; }
  .live-page:not([data-state]) .live-stage { aspect-ratio: auto; }
  .live-page:not([data-state]) .live-start { position: relative; }
  .live-list { overflow: visible; background: transparent; border: 0; border-radius: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .live-list-head { padding: 6px 0 0; }
  .live-filters { margin: 0 calc(0px - var(--mh-gutter)); padding: 12px var(--mh-gutter); grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .live-filters .live-find, .live-filters .live-note { grid-column: 1 / -1; }
  .live-scroll { overflow: visible; padding: 0; margin: 0 -8px; }
  .live-group h3 { position: static; background: none; padding-top: 18px; }
  .live-scroll .live-group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2px 8px; }
}
@media (max-width: 700px) {
  .live-heading { margin-bottom: 10px; }
  .live-heading h1 { font-size: 18px; }
  .live-welcome { display: none; }
  /* On a phone the picture runs edge to edge right under the header. */
  .live-view { margin: 0 calc(0px - var(--mh-gutter)) 14px; border-radius: 0; border-inline: 0; box-shadow: 0 16px 30px -18px #000; }
  .live-start { gap: 12px; padding: 22px var(--mh-gutter) 20px; }
  .live-start-hello { font-size: 26px; }
  .live-picks-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .live-chip { min-height: 50px; font-size: 13.5px; }
  .live-chip .live-mark { --mark: 32px; }
  .live-now { gap: 10px; padding: 10px var(--mh-gutter); }
  .live-now .live-mark { --mark: 38px; }
  .live-now-copy h2 { font-size: 16px; margin-top: 1px; }
  #live-status { font-size: 12px; }
  .live-action { width: 40px; padding: 0; justify-content: center; }
  .live-action span { display: none; }
  .live-filters { grid-template-columns: minmax(0, 1fr); }
  .live-tabs button { height: 36px; }
  .live-picks select, .live-find { height: 42px; }
  .live-find input { font-size: 16px; }
  .live-channel { min-height: 62px; }
  .live-veil-actions .live-chip:not(.live-chip-main) { flex: 1 1 140px; }
  /* What went wrong and where to go next can be taller than the picture: the screen grows. */
  .live-page[data-state="error"] .live-stage { aspect-ratio: auto; min-height: 56.25vw; }
  .live-page[data-state="error"] .live-stage video { display: none; }
  .live-page[data-state="error"] .live-veil { position: relative; padding: 24px var(--mh-gutter); }
  .live-veil .live-mark { --mark: 56px; }
  .live-veil-text { font-size: 12.5px; }
}
@media (prefers-reduced-motion: reduce) { .live-badge::before, .live-channel-on i, .live-veil .live-mark { animation: none !important; } .live-chip, .live-toast { transition: none; } }

/* Under the player: what the channel or place is, and others to try. */
.live-about { max-width: 1100px; margin: 36px 0 12px; color: var(--muted-2); font-size: 14px; line-height: 1.75; }
.live-about h2 { margin: 28px 0 10px; color: var(--text, #f3f6ff); font-size: 16px; font-weight: 700; }
.live-about h2:first-child { margin-top: 0; }
.live-about p { margin: 0 0 10px; max-width: 46em; }
.live-about a { color: inherit; text-decoration: none; }
.live-about a:hover, .live-about a:focus-visible { color: var(--text, #f3f6ff); text-decoration: underline; text-underline-offset: 3px; }
.live-about-list, .live-about-places { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 18px; margin: 0; padding: 0; list-style: none; }
.live-about-places { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.live-about li { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.live-about small { margin-left: 6px; color: var(--muted); font-size: 12px; }
