/* ============================================================
   FLMC FLMC TV 页面样式（tv.html）
   编辑精选：左大卡 + 右 2x2 矩阵 + 右侧悬浮助手
   ============================================================ */

/* ---------- 顶部导航用户头像 ---------- */
.tv-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #0e1519;
  background: var(--accent);
  border: 2px solid rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur);
}

.tv-avatar:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}

/* ---------- 主区 ---------- */
.tv-main {
  width: 100%;
  /* 截图实测：内容 x 30..1227 / 视口 1250，即全宽 + 30px 内边距 */
  max-width: none;
  margin: 0 auto;
  padding: clamp(1.75rem, 3vw, 3rem) 30px 56px; /* 截图实测：首个内容 y=82 */
}

.tv-title {
  text-align: center;
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

/* ---------- 左右分栏 ---------- */
.tv-layout {
  display: grid;
  /* 截图实测：左大卡 637.5、右侧 2×2 小卡 531，间距 28 */
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
  align-items: start;
}

/* ================= 左：主推荐卡片 ================= */
.tv-feature {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color var(--dur), box-shadow var(--dur);
}

.tv-feature:hover {
  border-color: var(--border-strong);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.tv-feature-poster {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.tv-feature-poster .dur {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 2;
  font-size: 12px;
  font-family: var(--font-mono);
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 9px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

.tv-feature-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  z-index: 2;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(232, 99, 43, 0.92);
  color: #0e1519;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  transition: transform var(--dur) var(--ease);
}

.tv-feature-play svg {
  width: 26px;
  height: 26px;
  margin-left: 3px;
}

.tv-feature:hover .tv-feature-play {
  transform: translate(-50%, -50%) scale(1);
}

.tv-feature-info {
  padding: 18px 20px 20px;
}

.tv-feature-info h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.tv-feature-author {
  font-size: 13px;
  color: var(--accent);
  margin-top: 2px;
}

.tv-feature-desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
  margin-top: 10px;
  max-width: 56ch;
}

.tv-feature-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.tv-feature-save {
  min-width: 84px;
}

/* ================= 我的收藏（2026-09-13） ================= */
.tv-saved-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tv-saved-hint {
  font-size: 12px;
  color: var(--text-faint);
}

/* 小卡片右上角的收藏星标 */
.tv-card-star {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background var(--dur), color var(--dur), border-color var(--dur);
}

.tv-card-star:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: var(--accent);
}

.tv-card-star.on {
  color: #ffcf6b;
  border-color: rgba(255, 207, 107, 0.6);
}

.tv-saved-empty {
  margin-top: 18px;
  padding: 22px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-faint);
  border: 1px dashed var(--border);
  border-radius: 12px;
}

/* ================= 右：2x2 小卡片矩阵 ================= */
.tv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 21px; /* 截图实测右侧两列间距 21.5 */
}

.tv-card {
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform var(--dur) var(--ease), border-color var(--dur), box-shadow var(--dur);
}

.tv-card:hover,
.tv-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  outline: none;
}

.tv-card-poster {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.tv-card-poster .dur {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 2;
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: #fff;
  background: rgba(0, 0, 0, 0.62);
  padding: 3px 7px;
  border-radius: 5px;
  backdrop-filter: blur(4px);
}

.tv-card-body {
  padding: 10px 12px 12px;
}

.tv-card-body h3 {
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tv-card-body p {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 1px;
}

/* ================= 右侧悬浮助手 ================= */
.tv-assist {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 90;
  width: 300px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.tv-assist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
}

.tv-assist-head h2 {
  font-size: 14px;
  font-weight: 700;
}

.tv-assist-head p {
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 1px;
}

.tv-assist-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 10px var(--ok);
  flex-shrink: 0;
}

.tv-assist-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 10px;
}

.tv-assist-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px 8px;
  min-height: 60px;
}

.tv-assist-msg {
  font-size: 12.5px;
  line-height: 1.6;
  padding: 8px 11px;
  border-radius: 10px;
  margin-bottom: 8px;
  max-width: 92%;
}

.tv-assist-msg.user {
  margin-left: auto;
  background: var(--accent);
  color: #0e1519;
}

.tv-assist-msg.bot {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}

.tv-assist-input {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--border);
}

.tv-assist-input textarea {
  flex: 1;
  resize: none;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 8px 10px;
  outline: none;
  max-height: 90px;
}

.tv-assist-input textarea:focus {
  border-color: var(--accent);
}

/* ================= 视频预览弹窗 ================= */
.tv-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.tv-modal.open {
  display: flex;
}

.tv-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(10px);
}

.tv-modal-box {
  position: relative;
  width: 100%;
  max-width: 620px;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: pop-in 0.3s var(--ease);
}

.tv-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 15px;
  display: grid;
  place-items: center;
  transition: background var(--dur);
}

.tv-modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
}

.tv-modal-art {
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
}

.tv-modal-info {
  padding: 18px 22px 22px;
}

.tv-modal-info h3 {
  font-size: 18px;
  font-weight: 800;
}

.tv-modal-meta {
  font-size: 13px;
  color: var(--accent);
  margin-top: 2px;
}

.tv-modal-desc {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-dim);
  margin-top: 10px;
}

.tv-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* ================= 响应式 ================= */
@media (max-width: 1080px) {
  .tv-assist {
    position: static;
    transform: none;
    width: auto;
    max-height: none;
    margin: 20px 24px 0;
  }
  .tv-layout {
    grid-template-columns: 1fr;
  }
  .tv-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 700px) {
  .tv-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
