/* ====================================================================
   玻璃模糊导航网站 - 公共样式
   说明:所有模板共享此基础样式与玻璃模糊背景实现
   ==================================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: #f5f5fa;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

/* 背景层:固定全屏,铺满图片/颜色 */
.nav-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image .6s ease;
}
.nav-bg::after { /* 背景遮罩,提升玻璃内容可读性 */
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .25);
}

/* 玻璃模糊容器(核心:backdrop-filter) */
.glass {
    background: rgba(255, 255, 255, .08);
    backdrop-filter: blur(var(--glass-blur, 14px)) saturate(160%);
    -webkit-backdrop-filter: blur(var(--glass-blur, 14px)) saturate(160%);
    border: 1px solid rgba(255, 255, 255, .18);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .25);
    border-radius: 18px;
}
.glass-strong {
    background: rgba(255, 255, 255, .14);
    backdrop-filter: blur(calc(var(--glass-blur, 14px) + 6px)) saturate(180%);
    -webkit-backdrop-filter: blur(calc(var(--glass-blur, 14px) + 6px)) saturate(180%);
    border: 1px solid rgba(255, 255, 255, .25);
}

/* 顶部标题 */
.nav-header {
    text-align: center;
    padding: 40px 16px 24px;
}
.nav-header h1 {
    font-size: clamp(24px, 5vw, 42px);
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .45);
}

/* 拖拽手柄 */
.drag-handle {
    cursor: grab;
    touch-action: none; /* 关键:允许 pointer 事件自由拖拽,兼容移动端 */
    user-select: none;
}
.drag-handle:active { cursor: grabbing; }

/* 拖拽中的占位/虚影 */
.nav-dragging {
    opacity: .4 !important;
}
.nav-ghost {
    position: fixed !important;
    z-index: 9999;
    pointer-events: none;
    opacity: .92;
    transform: scale(1.04);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
    transition: transform .08s ease;
}
.nav-drop-target {
    outline: 2px dashed rgba(120, 180, 255, .9);
    outline-offset: -4px;
}

/* 链接项通用 */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    transition: transform .18s ease, background .18s ease;
}
.nav-item:hover { transform: translateY(-2px); }

.nav-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(255, 255, 255, .15);
    font-weight: 700;
    font-size: 18px;
}
.nav-icon img { width: 100%; height: 100%; object-fit: cover; }

.nav-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
}

/* 音乐播放按钮 */
.music-btn {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(120, 180, 255, .25);
    color: #cfe3ff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .18s ease, transform .18s ease;
}
.music-btn:hover { background: rgba(120, 180, 255, .45); transform: scale(1.08); }
.music-btn.playing { background: #5b9dff; color: #fff; }

/* 全局浮动音乐播放器 */
.nav-music-bar {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 1000;
    display: none;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border-radius: 999px;
    max-width: 92vw;
}
.nav-music-bar.show { display: flex; }
.nav-music-bar .mb-name {
    font-size: 13px;
    max-width: 40vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-music-bar audio { height: 32px; }

/* 响应式容器 */
.nav-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 60px;
}

/* 模板切换条(可选显示) */
.tpl-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 0 auto 24px;
    max-width: 1100px;
    padding: 0 16px;
}
.tpl-switch a {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    text-decoration: none;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    transition: background .18s ease;
}
.tpl-switch a:hover,
.tpl-switch a.active { background: rgba(91, 157, 255, .6); }

/* 滚动条美化 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.25); border-radius: 4px; }
