/* The First Listen · 双头像背景（正式版，对应试做时的“方案 7 · 淡白剪影”）
   两张只有一种颜色的剪影图，极淡地浮在机型库页的背景两侧，相向。只在机型库页显示，首页和详情页不显示。
   用法：在 index.html 的 <head> 里、tfl-theme.css 那一行后面加一行
     <link rel="stylesheet" href="./tfl-avatars/tfl-avatars.css?v=1">
   并把 tfl-avatars 文件夹（本文件 + avatar-left.png + avatar-right.png）放到 index.html 旁边。
   不改网页已有的任何样式；占用的是 body 的 ::before / ::after（网页原来没有用到）。需要浏览器支持 :has()。 */

:root {
  --tfl-av-opacity: .085;              /* 浓淡：越大越亮。试做时用户看过并选中的是 .085 */
  --tfl-av-height: min(600px, 64vh);   /* 网页端头像高度 */
  --tfl-av-out: 10%;                   /* 往屏幕外推出去多少（占自身宽度） */
  --tfl-av-bottom: 0px;                /* 离屏幕底边多高 */
}

body:has(#view-devices.active)::before,
body:has(#view-devices.active)::after {
  content: "";
  position: fixed;
  bottom: var(--tfl-av-bottom);
  z-index: 3;
  width: calc(var(--tfl-av-height) * .82);
  height: var(--tfl-av-height);
  background-repeat: no-repeat;
  background-size: auto 100%;
  opacity: var(--tfl-av-opacity);
  pointer-events: none;                /* 不挡点击 */
  -webkit-mask-image: linear-gradient(to top, transparent 0, #000 22%);
          mask-image: linear-gradient(to top, transparent 0, #000 22%);
}

/* 左：短发眼镜，脸朝右 */
body:has(#view-devices.active)::before {
  left: 0;
  background-image: url(./avatar-left.png);
  background-position: left bottom;
  transform: translateX(calc(var(--tfl-av-out) * -1));
}

/* 右：长发发饰，脸朝左 */
body:has(#view-devices.active)::after {
  right: 0;
  background-image: url(./avatar-right.png);
  background-position: right bottom;
  transform: translateX(var(--tfl-av-out));
}

/* 手机端：不再用大幅背景头像，改为标题栏左右微缩头像 */
.hud-mini-avatar {
  display: none;
}
.hud-brand-en {
  display: none;
}

@media (max-width: 768px) {
  :root {
    --tfl-av-height: min(340px, 42vh);
    --tfl-av-opacity: .04;
    --tfl-av-out: 38%;
    --tfl-av-bottom: 8vh;
  }
  body:has(#view-devices.active)::before,
  body:has(#view-devices.active)::after {
    display: none;
  }
  #view-devices .top-hud {
    position: relative;
    justify-content: center;
    padding: 0 56px;
  }
  #view-devices .hud-logo {
    display: none;
  }
  #view-devices .hud-brand {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    letter-spacing: .24em;
  }
  .hud-brand-en {
    display: block;
    width: 68px;
    height: 14px;
    flex: none;
    background-color: currentColor;
    -webkit-mask-image: url("./brand-mini.png");
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    mask-image: url("./brand-mini.png");
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
  }
  .hud-mini-avatar {
    display: block;
    position: absolute;
    top: 50%;
    width: 30px;
    height: 30px;
    transform: translateY(-50%);
    opacity: .95;
    pointer-events: none;
  }
  .hud-mini-left { left: 12px; }
  .hud-mini-right { right: 12px; }
  /* 手机端卡片更实，避免任何背景干扰文字 */
  body:has(#view-devices.active) .device-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 96px), #121416 !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  body:has(#view-devices.active) .device-card.active,
  body:has(#view-devices.active) .device-card:hover {
    background: linear-gradient(180deg, rgba(255, 230, 0, .06), transparent 110px), #15171a !important;
  }
}

/* 打印时不要 */
@media print {
  body:has(#view-devices.active)::before,
  body:has(#view-devices.active)::after { display: none; }
}
