/* ============================================================
   hezi-music.css — 盒子主题 侧栏黑胶播放器（自定义控件）
   黑胶常转、居中；hover 黑胶弹出自定玻璃播放器；音频走同域 /stream 代理。
   ============================================================ */

.hezi-music {
    position: relative;
    width: 100%;
}

/* 黑胶唱片（50x50，无阴影，侧栏内居中） */
.hezi-music__stage {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 62px; box-sizing: border-box;   /* 固定高度：黑胶 50/40 都居中于此，折叠不撑高容器 */
}
.vinyl {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--cover, linear-gradient(135deg, #7b2ff7, #f107a3));
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: hezi-spin 4s linear infinite;
}
.vinyl::before {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: repeating-radial-gradient(circle at center, rgba(255, 255, 255, .12) 0 1px, transparent 1px 4px);
    pointer-events: none;
}
.vinyl .hole {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #0a0717;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: #fff;
    font-weight: 700;
}
@keyframes hezi-spin { to { transform: rotate(360deg); } }

/* 弹出层：默认在侧栏内上浮，覆盖上方快捷按钮 */
.hezi-music__pop {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    margin-bottom: 0;
    z-index: 1060;
    opacity: 0;
    transform: translateY(8px) scale(.96);
    pointer-events: none;
    transition: opacity .25s, transform .25s;
}
/* 仅 hover 整个播放器区域（黑胶+弹层同体）才显示；移开即隐藏 */
.hezi-music.hezi-pop-open .hezi-music__pop,
.hezi-music.is-open .hezi-music__pop {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* 玻璃卡片（高度自适应内容；翻面 3D 容器） */
.hezi-music__card {
    background: rgba(255, 255, 255, .62);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .35);
    box-shadow: 0 8px 30px rgba(31, 38, 135, .28);
    padding: 12px;
    color: #2b2b2b;
    perspective: 900px;
}
.hezi-music__card .card-inner {
    position: relative;
    transform-style: preserve-3d;
    transition: transform .55s cubic-bezier(.4, .2, .2, 1);
}
.hezi-music__card.flipped .card-inner { transform: rotateY(180deg); }
/* 正面：正常文档流撑开卡片高度（修复翻转容器高度塌陷导致内容溢出错位） */
.hezi-music__card .face.front {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}
/* 背面：absolute 覆盖于正面之上，随父级翻转回到正面朝向显示 */
.hezi-music__card .face.back {
    position: absolute;
    inset: 0;
    transform: rotateY(180deg);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.hezi-music__name {
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, .3);
}
.hezi-music__cover {
    width: 100%;
    height: 92px;
    border-radius: 10px;
    background: linear-gradient(135deg, #7b2ff7, #f107a3) center/cover;
    background-size: cover;
    background-position: center;
    margin-bottom: 8px;
}
.hezi-music__text { min-width: 0; text-align: center; }
.hezi-music__track {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hezi-music__artist {
    font-size: 11px;
    color: #777;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hezi-music__bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 6px;
}
.hezi-music__time {
    font-size: 10px;
    color: #777;
    flex: 0 0 auto;
    width: 30px;
    text-align: center;
}
.hezi-music__bar input[type="range"] {
    flex: 1 1 auto;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 4px;
    background: rgba(0, 0, 0, .15);
    outline: none;
}
.hezi-music__bar input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--hezi-accent);
    cursor: pointer;
}
.hezi-music__bar input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 50%;
    background: var(--hezi-accent);
    cursor: pointer;
}
.hezi-music__ctrls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin: 4px 0;
}
.hezi-music__ctrls button {
    background: none;
    border: 0;
    cursor: pointer;
    font-size: 16px;
    color: #444;
    line-height: 1;
    padding: 4px;
}
.hezi-music__ctrls .hezi-music__play {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--hezi-accent);
    color: #fff;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hezi-music__sub {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 4px;
}
.hezi-music__sub button {
    background: none;
    border: 0;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    padding: 4px;
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color .2s, background .2s;
}
.hezi-music__sub button.active { color: var(--hezi-accent); background: rgba(240, 68, 148, .14); }
.hezi-music__sub button .fa { font-size: 13px; }
.hezi-music__list-head {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 2px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, .3);
    margin-bottom: 4px;
}
.hezi-music__back { color: var(--hezi-accent); cursor: pointer; font-weight: 400; }
.hezi-music__list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 260px;
    overflow-y: auto;
}
.hezi-music__list li {
    font-size: 12px;
    padding: 7px 6px;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #444;
}
.hezi-music__list li:hover { background: rgba(0, 0, 0, .06); }
.hezi-music__list li.playing { color: var(--hezi-accent); font-weight: 600; background: rgba(240, 68, 148, .12); }
.hezi-music__list li.playing:hover { background: rgba(240, 68, 148, .18); }
.hezi-music__msg {
    font-size: 11px;
    color: #c0392b;
    text-align: center;
    min-height: 0;
    margin-top: 6px;
}

/* ============================================================
   折叠态（侧栏 64px）：弹出面板完全对齐高级子菜单 flyout
   （.hezi-senior-panel / .hezi-senior-multi-column-links 的视觉规范）
   —— 纯淡入淡出、无位移动画、无阴影、同一套底色/描边/圆角/层级
   ============================================================ */
body.hezi-sb-collapsed .hezi-music .vinyl { width: 28px; height: 28px; }
body.hezi-sb-collapsed .hezi-music__stage { height: 32px; }
body.hezi-sb-collapsed .hezi-music .vinyl .hole { width: 8px; height: 8px; font-size: 6px; }
body.hezi-sb-collapsed .hezi-music__pop {
    position: absolute;
    left: 100%;
    right: auto;
    top: auto;
    bottom: 0;
    width: 288px;
    box-sizing: border-box;
    margin-left: 12px;                         /* 抵消 .hezi-aside__player 右内边距，左缘紧贴侧栏右缘（与 flyout 对齐） */
    /* ↓↓ 与 .hezi-side-menu .hezi-senior-panel 完全同源 ↓↓ */
    padding: 20px 24px;
    background: var(--main-bg-color, #fff);
    border: 1px solid var(--main-border-color, rgba(50, 50, 50, .1));
    border-radius: 0 12px 12px 0;              /* 同 .hezi-senior-multi-column-links */
    box-shadow: none;                          /* flyout 无阴影 */
    transform: none;                           /* flyout 无位移，纯淡入 */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .26s ease, visibility .26s;
    z-index: 1080;                             /* 与 flyout 同层 */
}
body.hezi-sb-collapsed .hezi-music.hezi-pop-open .hezi-music__pop,
body.hezi-sb-collapsed .hezi-music.is-open .hezi-music__pop {
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
/* hover 模式（后台开启「默认折叠」）下鼠标要跨过黑胶与面板之间的 12px 间隙，
   用一条透明伪元素搭桥，避免中途触发 mouseleave 导致面板闪退 */
body.hezi-sb-collapsed .hezi-music__pop::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 0;
    width: 14px;
    height: 100%;
}
/* 折叠态：外层 pop 已承担底色/描边/圆角/内边距，内层卡片彻底裸化，避免双层框 */
body.hezi-sb-collapsed .hezi-music__card {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
}
body.dark-theme.hezi-sb-collapsed .hezi-music__pop {
    background: var(--main-bg-color, #323335);
    border-color: rgba(255, 255, 255, .08);
}
body.dark-theme.hezi-sb-collapsed .hezi-music__card { background: transparent; border: 0; box-shadow: none; }
/* 折叠态是实色底，卡片内那两条为玻璃底设计的白色分隔线会隐形 → 换成 flyout 同款描边色 */
body.hezi-sb-collapsed .hezi-music__name,
body.hezi-sb-collapsed .hezi-music__list-head {
    border-bottom-color: var(--main-border-color, rgba(50, 50, 50, .1));
}
body.dark-theme.hezi-sb-collapsed .hezi-music__name,
body.dark-theme.hezi-sb-collapsed .hezi-music__list-head {
    border-bottom-color: rgba(255, 255, 255, .12);
}

/* ---------- 暗色模式：播放器深灰卡片（比背景略深，区分） ---------- */
body.dark-theme .hezi-music__card {
    background: #303236;
    border-color: rgba(255, 255, 255, .08);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
    color: #e6e6e6;
}
body.dark-theme .hezi-music__name { border-bottom-color: rgba(255, 255, 255, .12); }
body.dark-theme .hezi-music__text { color: #cfcfcf; }
body.dark-theme .hezi-music__track { color: #f0f0f0; }
body.dark-theme .hezi-music__artist { color: #9a9a9a; }
body.dark-theme .hezi-music__time { color: #9a9a9a; }
body.dark-theme .hezi-music__bar input[type="range"] { background: rgba(255, 255, 255, .18); }
body.dark-theme .hezi-music__ctrls button { color: #cfcfcf; }
body.dark-theme .hezi-music__sub button { color: #aaa; }
body.dark-theme .hezi-music__list li { color: #cfcfcf; }
body.dark-theme .hezi-music__list li:hover { background: rgba(255, 255, 255, .08); }
body.dark-theme .hezi-music__list li.playing { background: rgba(240, 68, 148, .20); }
body.dark-theme .hezi-music__list li.playing:hover { background: rgba(240, 68, 148, .28); }
body.dark-theme .hezi-music__list-head { border-bottom-color: rgba(255, 255, 255, .12); }
body.dark-theme .hezi-music__msg { color: #ff8a80; }
body.dark-theme .hezi-music__list { scrollbar-color: rgba(255, 255, 255, .2) transparent; }
body.dark-theme .hezi-music__list::-webkit-scrollbar { width: 6px; }
body.dark-theme .hezi-music__list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .2); }

/* ---------- 独立窗口播放按钮 + 弹窗静态布局 + 侧栏镜像态 ---------- */
.hezi-music__popout { color: var(--main-color, #666); opacity: .65; }
.hezi-music__popout:hover { opacity: 1; }
/* 侧栏：当音乐实际在独立窗口播放时，黑胶区显示「窗口播放中」提示（黑胶照常转） */
.hezi-music.is-remote .hezi-music__name::after {
    content: " · 窗口播放中";
    font-size: 11px;
    font-weight: 400;
    opacity: .7;
}
/* 独立窗口页面：卡片静态居中显示，不依赖 hover */
body.hezi-music-popup .hezi-music__pop {
    position: relative !important;
    left: auto; right: auto; bottom: auto; top: auto;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
    margin-top: 14px;
}
body.hezi-music-popup .hezi-music__stage { margin-bottom: 0; }
