/* ============================================================
   STEAM 界面（steam）
   ------------------------------------------------------------
   左边：01 LINK —— 我的名片（头像/昵称/在线状态/正在玩）+ 云端与本机的连接灯
         + SteamID64 输入框。
   右边：02 FRIENDS —— 好友在线榜（搜索 / 只看在线 / 刷新）；
         03 LOCAL —— 本机 Steam（小助手给的：装了哪些、本地时长、占用）。
   跟日历同一套深色控制台语言，主色跟壁纸走（--accent / --accent-rgb）。
   ============================================================ */

html.is-steam { overflow: hidden; }

.stm {
  position: fixed;
  inset: 0;
  padding-top: 34px;
  z-index: 28;
  background:
    radial-gradient(120% 70% at 12% -10%, rgba(var(--accent-rgb, 143, 208, 255), .16), transparent 62%),
    #05070d;
  color: #e8eeff;
  overflow: hidden;
}
.stm[hidden] { display: none !important; }

.stm::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(135deg,
    rgba(var(--accent-rgb, 143, 208, 255), .055) 0 1px, transparent 1px 9px);
  mask-image: radial-gradient(120% 90% at 100% 0%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(120% 90% at 100% 0%, #000 10%, transparent 72%);
}

/* 进 STEAM 界面时把别的小窗收掉 */
html.is-steam .player,
html.is-steam #playerBall,
html.is-steam .l2d-pet,
html.is-steam .wlyr { display: none !important; }

.stm-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 27%) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}

/* ---------------- 通用零件 ---------------- */
.stm-kicker {
  flex: 0 0 auto;
  white-space: nowrap;
  font: 700 9.5px/1 ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: .3em;
  color: rgba(var(--accent-rgb, 143, 208, 255), .85);
}

.stm-close {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 15px/1 ui-monospace, monospace;
  color: #cfd8ee;
  background: transparent;
  border: 1px solid rgba(var(--accent-rgb, 143, 208, 255), .35);
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
  transition: color .15s, border-color .15s, background .15s;
}
.stm-close:hover { color: #05070d; background: rgb(var(--accent-rgb, 143, 208, 255)); border-color: transparent; }

/* ---------------- 左栏 ---------------- */
.stm-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
  padding: 16px 18px 14px;
  border-right: 1px solid rgba(var(--accent-rgb, 143, 208, 255), .22);
  background:
    repeating-linear-gradient(to bottom,
      rgba(var(--accent-rgb, 143, 208, 255), .045) 0 1px, transparent 1px 56px),
    linear-gradient(180deg, rgba(10, 14, 24, .86), rgba(5, 7, 13, .94));
  overflow-y: auto;
}

.stm-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(var(--accent-rgb, 143, 208, 255), .18);
}

.stm-me {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stm-avatar {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  object-fit: cover;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(var(--accent-rgb, 143, 208, 255), .45);
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.stm-me-text { min-width: 0; }

.stm-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stm-state {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 5px;
  font-size: 11.5px;
  color: rgba(214, 226, 255, .72);
  white-space: nowrap;
  overflow: hidden;
}

.stm-dot {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #6b7280;
  box-shadow: 0 0 0 2px rgba(107, 114, 128, .18);
}
.stm-dot.is-online { background: #6ee7a8; box-shadow: 0 0 0 2px rgba(110, 231, 168, .18); }
.stm-dot.is-playing { background: rgb(var(--accent-rgb, 143, 208, 255)); box-shadow: 0 0 8px rgba(var(--accent-rgb, 143, 208, 255), .7); }
.stm-dot.is-away { background: #ffd7a3; box-shadow: 0 0 0 2px rgba(255, 215, 163, .18); }

.stm-now {
  margin-top: 2px;
  font-size: 12px;
  color: rgba(var(--accent-rgb, 143, 208, 255), .95);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 连接灯：云端 / 本机 */
.stm-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, .07);
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.stm-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 600 11px/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: .06em;
  color: #7c8aab;
}
.stm-bar b { color: #cfd8ee; font-weight: 700; }
.stm-bar span { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* SteamID 输入 */
.stm-id {
  display: flex;
  gap: 8px;
}

.stm-id input {
  flex: 1 1 auto;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: #eef3ff;
  font: 600 12px/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: .04em;
}
.stm-id input::placeholder { color: #6d7a99; font-weight: 400; }
.stm-id input:focus { outline: none; border-color: rgba(var(--accent-rgb, 143, 208, 255), .55); background: rgba(255, 255, 255, .1); }

.stm-id button {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(var(--accent-rgb, 143, 208, 255), .45);
  background: rgba(var(--accent-rgb, 143, 208, 255), .14);
  color: #ffffff;
  font: 700 11.5px/1 inherit;
  letter-spacing: .06em;
  cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
  transition: background-color .15s, color .15s;
}
.stm-id button:hover { background: rgb(var(--accent-rgb, 143, 208, 255)); color: #05070d; }

.stm-note {
  font-size: 11.5px;
  line-height: 1.8;
  color: #7c8aab;
  word-break: break-word;
}
.stm-note code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .08);
  font: 600 11px/1 ui-monospace, monospace;
  color: #cfd8ee;
}
.stm-note.is-warn { color: #ffd7a3; }

/* ---------------- 右栏 ---------------- */
.stm-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 16px 22px 12px;
  gap: 14px;
}

.stm-sec {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}
.stm-sec--local { flex: 0 0 auto; max-height: 46%; }

.stm-sec-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 6px;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(var(--accent-rgb, 143, 208, 255), .2);
}

.stm-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.stm-tools input {
  width: 150px;
  height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 7px;
  background: rgba(255, 255, 255, .06);
  color: #eef3ff;
  font: 500 11.5px/1 inherit;
}
.stm-tools input::placeholder { color: #6d7a99; }
.stm-tools input:focus { outline: none; border-color: rgba(var(--accent-rgb, 143, 208, 255), .5); }

.stm-tools button {
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 7px;
  background: rgba(255, 255, 255, .06);
  color: #cfd8ee;
  font: 700 10.5px/1 ui-monospace, monospace;
  letter-spacing: .08em;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.stm-tools button:hover { background: rgba(255, 255, 255, .13); color: #fff; }
.stm-tools button[aria-pressed="true"] {
  border-color: rgba(var(--accent-rgb, 143, 208, 255), .5);
  background: rgba(var(--accent-rgb, 143, 208, 255), .16);
  color: #fff;
}

/* 好友列表 */
.stm-friends {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 2px 6px 0;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

.stm-friend {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px;
  border-radius: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
}
.stm-friend:hover { background: rgba(255, 255, 255, .05); }

.stm-friend img {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: 6px;
  background: rgba(255, 255, 255, .06);
}

.stm-friend-main { flex: 1 1 auto; min-width: 0; }

.stm-friend-name {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: #e6edfb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stm-friend-sub {
  margin-top: 3px;
  font-size: 11px;
  color: #6d7a99;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stm-friend.is-playing .stm-friend-sub { color: rgba(var(--accent-rgb, 143, 208, 255), .95); }
.stm-friend.is-offline { opacity: .55; }

.stm-friend-game {
  flex: 0 0 auto;
  max-width: 40%;
  font: 600 10.5px/1 ui-monospace, monospace;
  letter-spacing: .04em;
  color: rgba(var(--accent-rgb, 143, 208, 255), .85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 本机 */
.stm-local-meta {
  font: 700 10px/1 ui-monospace, monospace;
  letter-spacing: .12em;
  color: #6c7a99;
}

.stm-local {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-top: 6px;
  scrollbar-width: thin;
}

.stm-game {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px 92px 64px;
  align-items: center;
  gap: 10px;
  padding: 6px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  font-size: 12px;
  color: #cfd8ee;
}
.stm-game:hover { background: rgba(255, 255, 255, .05); }
.stm-game .nm { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.stm-game .v {
  font: 600 10.5px/1 ui-monospace, monospace;
  color: #7c8aab;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.stm-game .v--accent { color: rgba(var(--accent-rgb, 143, 208, 255), .8); }

.stm-empty {
  padding: 18px 6px;
  font-size: 12px;
  line-height: 1.9;
  color: #6d7a99;
  word-break: break-word;
}

.stm-profile a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 1px solid rgba(var(--accent-rgb, 143, 208, 255), .32);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  color: #cfd8ee;
  font-size: 11.5px;
  letter-spacing: .04em;
  text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
}
.stm-profile a:hover {
  background: rgba(var(--accent-rgb, 143, 208, 255), .16);
  border-color: rgba(var(--accent-rgb, 143, 208, 255), .55);
  color: #fff;
}
.stm-empty code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .08);
  font: 600 11px/1 ui-monospace, monospace;
  color: #cfd8ee;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 980px) {
  .stm-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .stm-tools { flex-wrap: wrap; row-gap: 6px; }
  .stm-proclist { max-height: 136px; }
  .stm-sort button { height: 24px; padding: 0 8px; font-size: 9.5px; }
  .stm-local-meta { flex: 1 1 100%; order: 2; text-align: left; white-space: normal; }
  .stm-side {
    border-right: 0;
    border-bottom: 1px solid rgba(var(--accent-rgb, 143, 208, 255), .22);
    padding: 12px 12px 10px;
    gap: 12px;
    max-height: 42vh;
  }
  .stm-avatar { width: 52px; height: 52px; }
  .stm-name { font-size: 15px; }
  .stm-main { padding: 12px 12px 8px; gap: 10px; }
  .stm-sec--local { max-height: 40%; }
  .stm-tools input { width: 110px; }
  .stm-game { grid-template-columns: minmax(0, 1fr) 62px 62px; }
  .stm-game .v--hide-sm { display: none; }
}

@media (max-height: 620px) and (min-width: 760px) {
  .stm-shell {
    grid-template-columns: minmax(240px, 28%) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }
  .stm-side { max-height: none; border-right: 1px solid rgba(var(--accent-rgb, 143, 208, 255), .22); border-bottom: 0; }
  .stm-main { padding: 10px 16px 8px; gap: 10px; }
  .stm-sec--local { max-height: 44%; }
}

@media (prefers-reduced-motion: reduce) {
  .stm-close, .stm-id button, .stm-tools button { transition: none; }
}

/* ============================================================
   动效 + 新零件（排序 / 选本地进程 / 运行中）
   ============================================================ */

/* 缓慢漂移的极光：只动 transform，别碰别的东西 */
.stm::after {
  content: "";
  position: absolute;
  inset: -30%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(38% 32% at 22% 26%, rgba(var(--accent-rgb, 143, 208, 255), .22), transparent 70%),
    radial-gradient(30% 26% at 78% 18%, rgba(var(--accent-rgb, 143, 208, 255), .12), transparent 72%);
  animation: stmDrift 26s ease-in-out infinite alternate;
}
.stm-shell { z-index: 1; }

@keyframes stmDrift {
  from { transform: translate3d(-3%, -2%, 0) scale(1); }
  to   { transform: translate3d(4%, 3%, 0) scale(1.08); }
}

/* 进场：整块淡入上浮，子块依次跟上 */
.stm.is-in .stm-side,
.stm.is-in .stm-sec { animation: stmIn .52s cubic-bezier(.22, .9, .24, 1) both; }
.stm.is-in .stm-sec:nth-of-type(2) { animation-delay: .07s; }
.stm.is-in .stm-sec--local { animation-delay: .14s; }

@keyframes stmIn {
  from { opacity: 0; transform: translate3d(0, 16px, 0); }
  to   { opacity: 1; transform: none; }
}

/* 好友行依次浮现 */
.stm.is-in .stm-friend { animation: stmRow .34s ease both; }
.stm.is-in .stm-friend:nth-child(2) { animation-delay: .04s; }
.stm.is-in .stm-friend:nth-child(3) { animation-delay: .08s; }
.stm.is-in .stm-friend:nth-child(4) { animation-delay: .12s; }
.stm.is-in .stm-friend:nth-child(5) { animation-delay: .16s; }
.stm.is-in .stm-friend:nth-child(6) { animation-delay: .2s; }
.stm.is-in .stm-friend:nth-child(7) { animation-delay: .24s; }
.stm.is-in .stm-friend:nth-child(8) { animation-delay: .28s; }
.stm.is-in .stm-friend:nth-child(9) { animation-delay: .32s; }
.stm.is-in .stm-friend:nth-child(10) { animation-delay: .36s; }

@keyframes stmRow {
  from { opacity: 0; transform: translate3d(-10px, 0, 0); }
  to   { opacity: 1; transform: none; }
}

/* 游戏行按 --i 错开 */
.stm.is-in .stm-game { animation: stmRow .3s ease both; animation-delay: calc(var(--i, 0) * 16ms); }

/* 在线 / 游戏中那颗点会呼吸 */
.stm-dot.is-playing { animation: stmPulse 2.4s ease-in-out infinite; }
.stm-dot.is-online { animation: stmPulse 3.6s ease-in-out infinite; }

@keyframes stmPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb, 143, 208, 255), .5); }
  50%      { box-shadow: 0 0 0 5px rgba(var(--accent-rgb, 143, 208, 255), 0); }
}

/* 悬停：整行轻轻右移 */
.stm-friend,
.stm-game { transition: background-color .16s ease, transform .16s ease; }
.stm-friend:hover,
.stm-game:hover { transform: translateX(4px); }

/* 正在本机运行的游戏 */
.stm-game.is-running {
  background: linear-gradient(90deg, rgba(var(--accent-rgb, 143, 208, 255), .16), transparent 72%);
}
.stm-run {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 7px;
  border-radius: 50%;
  background: #6ee7a8;
  box-shadow: 0 0 8px rgba(110, 231, 168, .8);
  animation: stmBlink 1.8s ease-in-out infinite;
}

@keyframes stmBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .45; transform: scale(.8); }
}

/* ---------- 排序按钮 ---------- */
.stm-sort {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 0 0 auto;
}

.stm-sort button {
  height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 7px;
  background: rgba(255, 255, 255, .06);
  color: #cfd8ee;
  font: 700 10px/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: .06em;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s, transform .12s;
}
.stm-sort button:hover { background: rgba(255, 255, 255, .13); color: #fff; }
.stm-sort button:active { transform: scale(.96); }
.stm-sort button[aria-pressed="true"] {
  border-color: rgba(var(--accent-rgb, 143, 208, 255), .55);
  background: rgba(var(--accent-rgb, 143, 208, 255), .18);
  color: #fff;
}

#stmProcBtn { color: rgba(var(--accent-rgb, 143, 208, 255), .95); }
#stmProcBtn[aria-expanded="true"] {
  border-color: rgba(var(--accent-rgb, 143, 208, 255), .55);
  background: rgba(var(--accent-rgb, 143, 208, 255), .2);
  color: #fff;
}

/* ---------- 选本地进程 ---------- */
.stm-procs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0 4px;
}
.stm-procs[hidden] { display: none; }

.stm-procs input {
  height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  color: #eef3ff;
  font: 500 12px/1 inherit;
}
.stm-procs input::placeholder { color: #6d7a99; }
.stm-procs input:focus { outline: none; border-color: rgba(var(--accent-rgb, 143, 208, 255), .5); }

.stm-proclist {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 210px;
  overflow-y: auto;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

.stm-proc {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: #cfd8ee;
  font: 500 11.5px/1.2 inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color .14s ease, color .14s ease;
}
.stm-proc:hover { background: rgba(255, 255, 255, .09); color: #fff; }

.stm-proc .pdot {
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
}
.stm-proc.is-game .pdot { background: rgba(var(--accent-rgb, 143, 208, 255), .9); }
.stm-proc.is-on { background: rgba(var(--accent-rgb, 143, 208, 255), .16); color: #fff; }
.stm-proc.is-on .pdot { background: #6ee7a8; box-shadow: 0 0 8px rgba(110, 231, 168, .8); }

.stm-proc .pex {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font: 600 11px/1.2 ui-monospace, "Cascadia Mono", monospace;
}

.stm-proc .pname {
  flex: 0 0 auto;
  max-width: 46%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 10.5px;
  color: rgba(var(--accent-rgb, 143, 208, 255), .9);
}

@media (prefers-reduced-motion: reduce) {
  .stm::after { animation: none; }
  .stm.is-in .stm-side,
  .stm.is-in .stm-sec,
  .stm.is-in .stm-friend,
  .stm.is-in .stm-game,
  .stm-dot.is-playing,
  .stm-dot.is-online,
  .stm-run { animation: none !important; }
  .stm-friend:hover,
  .stm-game:hover { transform: none; }
}

/* ============================================================
   02 / AUDIO —— 左栏迷你播放器
   元件是 .pl-pane（和设置栏、日历同一套），选歌面板复用 .cal-songs*
   ============================================================ */
.stm-audio {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 2px;
  padding-top: 14px;
  border-top: 1px solid rgba(var(--accent-rgb, 143, 208, 255), .18);
}

.stm-audio-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.stm-audio-hint {
  white-space: nowrap;
  font: 700 8.5px/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: .2em;
  color: rgba(214, 226, 255, .28);
}

.stm .pl-pane-fill {
  background: linear-gradient(90deg,
    rgba(var(--accent-rgb, 143, 208, 255), .45) 0%,
    rgb(var(--accent-rgb, 143, 208, 255)) 100%);
}
.stm .pl-pane-btn--play {
  color: #0a0d16;
  background: linear-gradient(160deg, #ffffff 0%, rgb(var(--accent-rgb, 143, 208, 255)) 130%);
}
.stm .pl-pane-progress:focus-visible {
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb, 143, 208, 255), .5);
}
.stm .pl-pane-title { font-size: 14px; }
.stm .pl-pane-sub { color: rgba(214, 226, 255, .55); }

.stm .pl-pane-mode {
  justify-content: flex-start;
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .14);
  color: rgba(226, 234, 255, .82);
}
.stm .pl-pane-mode:hover { background: rgba(255, 255, 255, .13); }
.stm .pl-pane-mode[data-mode="loop"],
.stm .pl-pane-mode[data-mode="shuffle"] {
  color: rgb(var(--accent-rgb, 143, 208, 255));
  border-color: rgba(var(--accent-rgb, 143, 208, 255), .45);
  background: rgba(var(--accent-rgb, 143, 208, 255), .12);
}

.stm .cal-songs-list { max-height: min(30vh, 260px); }
.stm .pl-pane-item .fav-btn { color: rgba(226, 234, 255, .3); }
.stm .pl-pane-item .fav-btn.is-on { color: rgb(var(--accent-rgb, 143, 208, 255)); }
.stm .pl-pane-item.is-current {
  background: rgba(var(--accent-rgb, 143, 208, 255), .18);
  color: #ffffff;
}
.stm .pl-pane-item.is-current .idx { color: rgb(var(--accent-rgb, 143, 208, 255)); }
.stm .pl-pane-empty { margin: 6px 2px; font-size: 12px; color: #6d7a99; }

.stm-lyric {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 4px 0 0 10px;
  border-left: 2px solid rgb(var(--accent-rgb, 143, 208, 255));
}

.stm-lyric-kicker {
  font: 700 8.5px/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: .34em;
  color: rgba(var(--accent-rgb, 143, 208, 255), .6);
}

.stm-lyric-line {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  min-height: 2.6em;
  font-size: 13.5px;
  line-height: 1.7;
  font-weight: 600;
  color: rgb(var(--lyric-color-rgb, 238, 243, 255));
  white-space: pre-line;
}
.stm-lyric-line.is-empty { color: #7d8aab; font-weight: 500; }

/* 选歌面板一展开就先收起歌词，左栏别太长 */
.stm-side.is-songs-open .stm-lyric { display: none; }

/* ============================================================
   动效 2.0：进场扫描线 / 头像 / 卡片光晕 / 小标题下划线
   ============================================================ */
html.is-stm-boot::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background-image: linear-gradient(180deg,
    transparent 0%,
    rgba(var(--accent-rgb, 143, 208, 255), .2) 44%,
    rgba(255, 255, 255, .5) 50%,
    rgba(var(--accent-rgb, 143, 208, 255), .2) 56%,
    transparent 100%);
  background-size: 100% 200%;
  background-repeat: no-repeat;
  animation: stm-boot-sweep .62s cubic-bezier(.35, 0, .2, 1) both;
}
@keyframes stm-boot-sweep {
  from { opacity: 0; background-position: 0 -110%; }
  35% { opacity: 1; }
  to { opacity: 0; background-position: 0 110%; }
}

.stm-kicker { position: relative; }
.stm-kicker::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0;
  height: 1px;
  background: rgba(var(--accent-rgb, 143, 208, 255), .75);
  transition: width .45s cubic-bezier(.2, .7, .2, 1);
}
.stm.is-in .stm-kicker::after { width: 16px; }

.stm-avatar { transition: transform .35s cubic-bezier(.2, .7, .2, 1), filter .35s; }
.stm-me:hover .stm-avatar { transform: scale(1.06) rotate(-1.5deg); filter: saturate(1.15); }
.stm-pane.is-playing .stm-audio-hint { color: rgba(var(--accent-rgb, 143, 208, 255), .8); }

.stm-friend img { transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.stm-friend:hover img { transform: scale(1.1); }

.stm-game { position: relative; overflow: hidden; }
.stm-game::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(120% 140% at 0% 50%,
    rgba(var(--accent-rgb, 143, 208, 255), .16), transparent 62%);
  transition: opacity .25s ease;
}
.stm-game:hover::after { opacity: 1; }

@media (max-width: 980px) {
  .stm-audio { gap: 8px; padding-top: 10px; }
  .stm-side.is-songs-open .stm-lyric { display: none; }
  .stm .cal-songs-list { max-height: 26vh; }
}

@media (prefers-reduced-motion: reduce) {
  html.is-stm-boot::after { animation: none; opacity: 0; }
  .stm-kicker::after { transition: none; }
  .stm-me:hover .stm-avatar,
  .stm-friend:hover img { transform: none; }
  .stm-game::after { transition: none; }
}

/* 窄屏收尾：排序条要能换行；左栏给高一点、砍掉那段长说明，播放器不用滚太远 */
@media (max-width: 980px) {
  .stm-sort { flex: 1 1 100%; }
  .stm-side { max-height: 54vh; }
  .stm-note { display: none; }
  .stm-audio { gap: 8px; padding-top: 10px; }
  .stm-audio-hint { display: none; }
  .stm .pl-pane { gap: 9px; }
  .stm-lyric { display: none; }
}

.stm-game .nm { display: flex; align-items: center; gap: 8px; }
.stm-game .nm .txt { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.stm-cover {
  flex: 0 0 auto;
  width: 58px;
  height: 27px;
  object-fit: cover;
  border-radius: 4px;
  background: rgba(255, 255, 255, .07);
  opacity: .92;
  transition: opacity .2s ease, transform .2s ease;
}
.stm-game:hover .stm-cover { opacity: 1; transform: scale(1.04); }
.stm-cover.is-broken { display: none; }

@media (max-width: 980px) {
  .stm-cover { width: 46px; height: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .stm-game:hover .stm-cover { transform: none; }
}

/* ============================================================
   时长周报 + 游戏详情抽屉
   ============================================================ */
.stm-week {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0 6px;
}
.stm-week[hidden] { display: none; }

.stm-week-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.stm-week-line {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11.5px;
  color: rgba(214, 226, 255, .72);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.stm-week-empty {
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px dashed rgba(255, 255, 255, .14);
  font-size: 11.5px;
  color: #6d7a99;
}

.stm-week-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 62px;
  padding: 0 2px;
}
.stm-week-bar {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
}
.stm-week-bar i {
  display: block;
  width: 100%;
  max-width: 34px;
  height: var(--h, 0%);
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg,
    rgb(var(--accent-rgb, 143, 208, 255)),
    rgba(var(--accent-rgb, 143, 208, 255), .28));
  transition: height .5s cubic-bezier(.2, .8, .2, 1);
}
.stm-week-bar b {
  font: 700 8.5px/1 ui-monospace, "Cascadia Mono", monospace;
  color: rgba(214, 226, 255, .5);
}

.stm-game { cursor: pointer; }
.stm-game:focus-visible {
  outline: 1px solid rgba(var(--accent-rgb, 143, 208, 255), .7);
  outline-offset: 1px;
}

.stm-drawer {
  display: flex;
  gap: 12px;
  margin: 4px 0 10px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(var(--accent-rgb, 143, 208, 255), .28);
  background: linear-gradient(180deg, rgba(var(--accent-rgb, 143, 208, 255), .1), rgba(255, 255, 255, .02));
  animation: stm-drawer-in .22s ease both;
}
@keyframes stm-drawer-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.stm-drawer-cover {
  flex: 0 0 auto;
  width: 150px;
  height: 70px;
  object-fit: cover;
  border-radius: 7px;
  background: rgba(255, 255, 255, .06);
}

.stm-drawer-main { flex: 1 1 auto; min-width: 0; }

.stm-drawer-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.stm-drawer-sub {
  margin-top: 3px;
  font: 600 10.5px/1.4 ui-monospace, "Cascadia Mono", monospace;
  color: rgba(214, 226, 255, .5);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.stm-drawer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 10px;
  margin-top: 9px;
}
.stm-drawer-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.stm-drawer-cell i {
  font-style: normal;
  font: 700 8px/1 ui-monospace, "Cascadia Mono", monospace;
  letter-spacing: .2em;
  color: rgba(var(--accent-rgb, 143, 208, 255), .6);
}
.stm-drawer-cell b {
  font-weight: 600;
  font-size: 11.5px;
  color: #dbe4f7;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.stm-drawer-path {
  margin-top: 8px;
  font: 500 10px/1.4 ui-monospace, "Cascadia Mono", monospace;
  color: rgba(214, 226, 255, .38);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  direction: rtl;
  text-align: left;
}

@media (max-width: 980px) {
  .stm-drawer { flex-direction: column; }
  .stm-drawer-cover { width: 100%; height: 96px; }
  .stm-week-chart { height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  .stm-drawer { animation: none; }
  .stm-week-bar i { transition: none; }
}
