:root {
    --cm-blue: #007aff;
    --cm-red: #ff3b30;
    --cm-dark-bg: #000000;
    --cm-card-bg: rgba(28, 28, 30, 0.72);
    --cm-border: rgba(255, 255, 255, 0.08);
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.45);
    --glass-blur: blur(40px);
}

/* 极致适配手机端：禁止任何反弹抖动，固定占满全屏 */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif; 
    -webkit-tap-highlight-color: transparent; 
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed; /* 锁死移动端视口，防止网页橡皮筋上下滚动 */
}

body { 
    background-color: var(--cm-dark-bg); 
    color: var(--text-main); 
    display: flex; 
    justify-content: center; 
}

.ambient-bg {
    position: absolute; 
    top: -60%; 
    left: -60%; 
    width: 220%; 
    height: 220%;
    background: radial-gradient(circle at 35% 35%, #112542 0%, transparent 45%),
                radial-gradient(circle at 65% 65%, #0f2b30 0%, transparent 50%),
                radial-gradient(circle at 50% 30%, #150f2e 0%, transparent 45%);
    z-index: 1; 
    filter: blur(100px); 
    animation: drift 45s linear infinite;
    will-change: transform; 
    transform: translateZ(0);
}

@keyframes drift { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

.auth-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: #000; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 9999; 
}

.auth-overlay.hidden { 
    display: none !important; 
}

.auth-card { 
    background: #1c1c1e; 
    padding: 40px 30px; 
    border-radius: 24px; 
    text-align: center; 
    width: 90%; 
    max-width: 350px; 
    border: 1px solid var(--cm-border); 
}

.auth-card h2 { 
    font-size: 19px; 
    font-weight: 600; 
    margin-bottom: 24px; 
    color: #fff; 
}

.auth-card input { 
    width: 100%; 
    background: #2c2c2e; 
    border: none; 
    color: #fff; 
    padding: 14px; 
    border-radius: 12px; 
    font-size: 16px; 
    outline: none; 
    text-align: center; 
    margin-bottom: 18px; 
}

.auth-card button { 
    width: 100%; 
    background: var(--cm-blue); 
    color: #fff; 
    font-size: 16px; 
    font-weight: 600; 
    padding: 14px; 
    border-radius: 12px; 
    border: none; 
    cursor: pointer; 
}

/* 页面主容器适配 */
.main-stage { 
    display: none; 
    position: relative; 
    width: 100%; 
    max-width: 440px; 
    height: 100%; 
    flex-direction: column; 
    align-items: center; 
    justify-content: space-between; 
    padding: 20px 24px calc(24px + env(safe-area-inset-bottom)); /* 引入 iOS 底部安全距离 */
    z-index: 10; 
}

.main-stage.active { 
    display: flex !important; 
}

.display-container { 
    flex: 1; 
    width: 100%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    position: relative; 
}

.artwork-view { 
    width: 100%; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    transition: opacity 0.3s ease; 
}

/* 2. 优化黑胶唱片与唱针的大小比例 */
.player-deck { 
    position: relative; 
    width: 76vw; 
    height: 76vw; 
    max-width: 290px; 
    max-height: 290px; 
    margin-bottom: 35px; 
}

/* 唱针精细调校：旋转轴外移，初始偏转角调大，确保未播放时完全移出黑胶范围 */
.player-stylus {
    position: absolute; 
    top: -25px; 
    left: 55%; 
    width: 35px; 
    height: 95px; 
    z-index: 20;
    transform-origin: 17px 17px; 
    transform: rotate(-40deg); /* 暂停或无音乐时，优雅摆开至外档边界 */
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1); 
    pointer-events: none;
}

/* 播放时唱针搭在唱片盘面上 */
.player-stylus.on-record { 
    transform: rotate(-2deg); 
}

.vinyl-body { 
    width: 100%; 
    height: 100%; 
    border-radius: 50%; 
    background: #0d0d0f;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6); 
    border: 9px solid #1c1c1e;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    position: relative; 
    overflow: hidden;
}

.vinyl-body::before {
    content: ''; 
    position: absolute; 
    top: 0; left: 0; right: 0; bottom: 0; 
    border-radius: 50%;
    background: repeating-radial-gradient(circle, transparent, transparent 3px, rgba(255,255,255,0.015) 3px, rgba(255,255,255,0.015) 4px);
    z-index: 4;
    pointer-events: none;
}

/* 核心视口居中夹层 */
.inner-cover-viewport { 
    width: 61%; 
    height: 61%; 
    border-radius: 50%; 
    position: relative; 
    overflow: hidden; 
    z-index: 5; 
    border: 2px solid #000; 
    background: #111; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
}

/* 动效隔离层一：控制封面切歌时的左右滑动轨道 */
.vinyl-slide-wrapper {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.7s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.7s ease;
    will-change: transform, opacity;
}

.vinyl-slide-wrapper.slide-out-left { transform: translateX(-100%); opacity: 0; }
.vinyl-slide-wrapper.slide-out-right { transform: translateX(100%); opacity: 0; }
.vinyl-slide-wrapper.slide-in-from-right { transform: translateX(100%); opacity: 0; }
.vinyl-slide-wrapper.slide-in-from-left { transform: translateX(-100%); opacity: 0; }
.vinyl-slide-wrapper.slide-active { transform: translateX(0); opacity: 1; }

/* 动效隔离层二：封面纯粹负责播放状态的 360° 自转 */
.artwork-img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    border-radius: 50%; 
    display: block;
    animation: spin 22s linear infinite; 
    animation-play-state: paused;
    will-change: transform;
}

@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

.track-meta { 
    text-align: center; 
    width: 100%; 
    padding: 0 10px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    pointer-events: none; 
}

.track-title { 
    font-size: 20px; 
    font-weight: 700; 
    letter-spacing: -0.5px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    width: 100%; 
}

.track-artist { 
    font-size: 14px; 
    color: var(--text-muted); 
    font-weight: 500; 
    margin-top: 4px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    width: 100%; 
}

.meta-quality-container { 
    margin-top: 14px; 
    position: relative; 
    display: inline-flex; 
    align-items: center; 
    pointer-events: auto; 
    width: 100%; 
    max-width: 150px; 
}

.wide-quality-badge {
    position: relative; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center;
    background: rgba(255, 255, 255, 0.08); 
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 6px 24px 6px 14px; 
    border-radius: 10px; 
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px; 
    font-weight: 600; 
    cursor: pointer; 
    width: 100%;
}

.narrow-touch-select { 
    position: absolute; 
    top: 0; left: 0; width: 100%; height: 100%; 
    opacity: 0; cursor: pointer; font-size: 16px; 
}

.lyric-view { 
    position: absolute; 
    top: 0; left: 0; width: 100%; height: 85%; 
    display: none; opacity: 0; 
    flex-direction: column; text-align: center; cursor: pointer; 
    transition: opacity 0.4s ease;
    mask-image: linear-gradient(to bottom, transparent 0%, white 25%, white 75%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, white 25%, white 75%, transparent 100%);
}

.cm-lyrics-container { 
    width: 100%; 
    will-change: transform; 
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1); 
    padding-top: 50%; padding-bottom: 50%; 
}

.lyric-line { 
    font-size: 18px; font-weight: 600; color: rgba(255, 255, 255, 0.2); 
    transition: color 0.25s, transform 0.25s; line-height: 1.6; padding: 12px 15px; 
    transform: scale(0.95); 
}

.lyric-line.current { 
    color: #ffffff; transform: scale(1.06); font-weight: 700; 
}

.control-dashboard { 
    width: 100%; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
}

.scrubber-box { 
    width: 100%; 
}

.scrubber-track-wrapper { 
    position: relative; width: 100%; height: 4px; 
    background: rgba(255, 255, 255, 0.15); border-radius: 2px; 
    cursor: pointer; margin-bottom: 6px; 
}

.scrubber-fill { 
    height: 100%; width: 0%; background: rgba(255,255,255,0.8); 
    border-radius: 2px; position: absolute; top: 0; left: 0; will-change: width; 
}

.scrubber-handle { 
    width: 10px; height: 10px; background: #fff; border-radius: 50%; 
    position: absolute; top: 50%; transform: translate(-50%, -50%); left: 0%; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.4); will-change: left; 
}

.time-stamps { 
    display: flex; justify-content: space-between; align-items: center; 
    font-size: 11px; color: var(--text-muted); font-weight: 500; 
}

.dock-buttons { 
    display: flex; justify-content: space-between; align-items: center; 
    width: 100%; max-width: 320px; margin: 0 auto; 
}

.symbol-btn {
    position: relative;

    background: transparent;
    border: none;
    color: #ffffff;

    cursor: pointer;

    width: 52px;
    height: 52px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    transition:
        transform .15s ease,
        background-color .15s ease,
        box-shadow .15s ease;

    overflow: hidden;
}

.symbol-btn:hover {
    background: rgba(255,255,255,.05);
}

.symbol-btn:active {
    transform: scale(.92);
    background: rgba(255,255,255,.10);
}

.symbol-btn::after {
    content: "";

    position: absolute;
    inset: 0;

    border-radius: 50%;

    background: rgba(255,255,255,.14);

    opacity: 0;
    transform: scale(0);

    transition:
        transform .25s ease,
        opacity .25s ease;
}

.symbol-btn svg {
    width: 24px;
    height: 24px;
    pointer-events: none;
}

.symbol-btn.play-pause svg {
    width: 36px;
    height: 36px;
}

.sheet-backdrop-mask { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 90; display: none; background: transparent; 
}

.sheet-backdrop-mask.active { display: block; }

.bottom-sheet {
    position: fixed; bottom: 0; left: 50%; transform: translate(-50%, 100%); 
    width: 100%; max-width: 440px; height: 80vh;
    background: var(--cm-card-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--cm-border); border-radius: 24px 24px 0 0; z-index: 100;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1); display: flex; flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-sheet.pan-up { transform: translate(-50%, 0); }
.sheet-handle-bar { width: 100%; height: 22px; display: flex; justify-content: center; align-items: center; cursor: pointer; flex-shrink: 0; }
.sheet-handle-bar::after { content: ''; width: 36px; height: 5px; background: rgba(255,255,255,0.18); border-radius: 3px; }
.sheet-nav { display: flex; gap: 24px; padding: 5px 24px 15px 24px; border-bottom: 1px solid var(--cm-border); align-items: center; flex-shrink: 0; }
.sheet-tab { font-size: 16px; font-weight: 700; color: var(--text-muted); cursor: pointer; position: relative; padding-bottom: 4px; }
.sheet-tab.selected { color: #fff; }
.sheet-tab.selected::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 3px; background: var(--cm-blue); border-radius: 2px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 15px 16px; }

.config-hub-panel { 
    background: rgba(255,255,255,0.04); border: 1px solid var(--cm-border); padding: 12px; border-radius: 14px; margin-bottom: 16px; display: flex; flex-direction: column; gap: 10px; 
}

.search-engine-box { display: flex; gap: 8px; align-items: center; }
.search-engine-box select { flex: 0 0 90px; }
.search-engine-box input { flex: 1; min-width: 0; }
.search-engine-box input, .custom-select-ui { background: rgba(255,255,255,0.07); border: 1px solid var(--cm-border); color: #fff; padding: 10px 12px; border-radius: 10px; outline: none; font-size: 14px; }
.custom-select-ui { -webkit-appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }

.icon-btn {
    background: rgba(255, 255, 255, 0.08); border: none; color: #fff; width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; transition: background 0.2s, transform 0.1s, color 0.2s; flex-shrink: 0;
}
.icon-btn:active { transform: scale(0.9); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* 优化清除按钮的二次确认样式：圆形背景变红，垃圾桶变白 */
.icon-btn.danger-action.confirm-state { 
    background: var(--cm-red) !important; 
    color: #ffffff !important; 
}

.batch-action-bar { display: flex; justify-content: space-between; align-items: center; background: rgba(255,255,255,0.05); padding: 10px 12px; border-radius: 12px; margin-bottom: 14px; border: 1px solid var(--cm-border); }
.batch-btn { background: var(--cm-blue); color: white; border: none; padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 600; cursor: pointer; }
.scroll-container { list-style: none; }
.music-item-node {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 8px 6px;

    border-radius: 10px;

    margin-bottom: 5px;

    transition:
        background .2s ease,
        transform .15s ease;
}

.music-item-node:hover {
    background: rgba(255,255,255,.04);
}

.music-item-node:active {
    transform: scale(.985);
    background: rgba(255,255,255,.08);
}
.track-checkbox { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.3); border-radius: 6px; cursor: pointer; position: relative; display: inline-block; background: transparent; transition: background 0.2s, border-color 0.2s; flex-shrink: 0; }
.track-checkbox:checked { background: #34c759; border-color: #34c759; }
.track-checkbox:checked::after { content: ''; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px; border: solid white; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.node-left { display: flex; align-items: center; gap: 12px; overflow: hidden; flex: 1; cursor: pointer; }
.node-cover-wrapper {
    width: 48px;
    height: 48px;

    border-radius: 12px;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        rgba(255,255,255,.05);

    border:
        1px solid rgba(255,255,255,.06);

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.node-cover-wrapper span {
    color: rgba(255,255,255,.65);
    font-size: 18px;
}
.apple-music-icon {
    width: 18px;
    height: 18px;

    color:
      rgba(255,255,255,.65);
}
.node-info { overflow: hidden; flex: 1; }
.node-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.node-artist { font-size: 12px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.node-actions-cluster { display: flex; align-items: center; gap: 8px; }
.load-more-container { text-align: center; padding: 15px 0 5px 0; }
.load-more-btn { background: rgba(255,255,255,0.08); border: 1px solid var(--cm-border); color: #fff; font-size: 13px; font-weight: 600; padding: 8px 24px; border-radius: 18px; cursor: pointer; }

.apple-alert-mask { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.2); z-index: 10000; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.apple-alert-mask.active { opacity: 1; }
.apple-alert-box { background: rgba(30, 30, 30, 0.85); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px); border-radius: 16px; width: 220px; text-align: center; border: 1px solid rgba(255, 255, 255, 0.14); transform: scale(0.9); transition: transform 0.25s; }
.apple-alert-mask.active .apple-alert-box { transform: scale(1); }
.apple-alert-content { padding: 20px; }
.apple-alert-title { font-size: 15px; font-weight: 600; color: #fff; }
.apple-alert-msg { font-size: 12px; color: rgba(255,255,255,0.7); margin-top: 4px; }
.play-pause {
    background:
        radial-gradient(
            circle,
            rgba(255,255,255,.08),
            transparent
        );
}
/* ===== 当前播放高亮 ===== */
.music-item-node.playing {
    background: rgba(0, 122, 255, 0.18);
    border: 1px solid rgba(0, 122, 255, 0.35);
    transform: scale(1.01);
}

.music-item-node.playing .node-title {
    color: #ffffff;
    font-weight: 700;
}

.music-item-node.playing .node-artist {
    color: rgba(255,255,255,0.7);
}

/* 左侧蓝色指示条 */
.music-item-node.playing::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10%;
    height: 80%;
    width: 3px;
    background: #007aff;
    border-radius: 2px;
}

/* 保证定位正确 */
.music-item-node {
    position: relative;
}

/* 平滑滚动优化 */
.scroll-container {
    scroll-behavior: smooth;
}
