:root {
    --bg-dark: #07090f; --bg-panel: rgba(20, 22, 30, 0.7); --bg-card: rgba(255, 255, 255, 0.04);
    --text-main: #f0f0f0; --text-muted: #8b8b99;
    --linxy-brand: #22d3b6;
    --linxy-brand-rgb: 34, 211, 182;
    --accent-red: #ff2a5f;
    --accent-cyan: var(--linxy-brand);
    --safe-bottom: env(safe-area-inset-bottom, 20px);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body { 
    font-family: -apple-system, system-ui, BlinkMacSystemFont, sans-serif; 
    background-color: var(--bg-dark); 
    background-image: radial-gradient(circle at 50% 0%, rgba(var(--linxy-brand-rgb), 0.08) 0%, transparent 60%);
    color: var(--text-main); 
    min-height: 100vh; 
    overflow-x: hidden; 
}

.mobile-header { 
    position: sticky; top: 0;
    display: flex; justify-content: space-between; align-items: center; 
    background: var(--bg-panel); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); 
    padding: calc(env(safe-area-inset-top, 0px) + 15px) 15px 12px !important; 
    border-bottom: 1px solid rgba(255,255,255,0.05); z-index: 1000; 
}
.brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-img { width: 28px; height: 28px; filter: drop-shadow(0 0 6px rgba(var(--linxy-brand-rgb), 0.55)); }
.brand h1 { font-size: 18px; font-weight: 800; background: linear-gradient(90deg, #fff, var(--linxy-brand)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: 1px; }

.search-box { flex: 1; margin-left: 15px; display: flex; justify-content: flex-end; }
.search-box input { width: 100%; max-width: 220px; background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.1); color: #fff; padding: 8px 15px; border-radius: 20px; font-size: 13px; outline: none; transition: 0.3s; box-shadow: inset 0 2px 4px rgba(0,0,0,0.5); }
.search-box input:focus { border-color: var(--linxy-brand); box-shadow: 0 0 12px rgba(var(--linxy-brand-rgb), 0.22), inset 0 2px 4px rgba(0,0,0,0.5); background: rgba(var(--linxy-brand-rgb), 0.04); }

.ws-tabs { display: flex; overflow-x: auto; gap: 10px; padding: 12px 15px; background: transparent; border-bottom: 1px solid rgba(255,255,255,0.06); }
.ws-tabs::-webkit-scrollbar { display: none; }
.ws-tab-btn { flex-shrink: 0; padding: 6px 16px; border-radius: 20px; background: rgba(0,0,0,0.3); color: #aaa; font-size: 14px; font-weight: bold; cursor: pointer; border: 1px solid rgba(255,255,255,0.05); transition: 0.3s; }
.ws-tab-btn.active { color: var(--linxy-brand); border-color: var(--linxy-brand); background: rgba(var(--linxy-brand-rgb), 0.12); box-shadow: 0 4px 12px rgba(var(--linxy-brand-rgb), 0.18); }

.space-tabs { display: flex; overflow-x: auto; gap: 10px; padding: 12px 15px 15px; background: transparent; border-bottom: 1px solid rgba(255,255,255,0.04); }
.space-tabs::-webkit-scrollbar { display: none; }
.space-tab-btn { flex-shrink: 0; padding: 6px 14px; border-radius: 20px; background: rgba(0,0,0,0.3); color: #aaa; font-size: 13px; font-weight: 500; cursor: pointer; border: 1px solid rgba(255,255,255,0.05); transition: 0.3s; box-shadow: inset 0 2px 4px rgba(0,0,0,0.5); }
.space-tab-btn.active { background: rgba(var(--linxy-brand-rgb), 0.1); color: var(--linxy-brand); border-color: rgba(var(--linxy-brand-rgb), 0.35); }
.space-tab-btn { display: inline-flex; align-items: center; gap: 6px; }
.space-tab-icon { display: inline-flex; align-items: center; flex-shrink: 0; }
.space-tab-icon svg { width: 14px; height: 14px; vertical-align: middle; }

.mobile-main { 
    /* 给内容底部留出固定 90px，让最后一个文件夹绝对不会被固定在底部的菜单栏挡住 */
    padding: 15px 15px calc(90px + var(--safe-bottom)); 
}

.col-group { background: linear-gradient(180deg, rgba(30,30,40,0.8) 0%, rgba(20,20,30,0.6) 100%); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 16px; border: 1px solid rgba(255,255,255,0.08); margin-bottom: 16px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.col-header { padding: 16px; font-size: 15px; color: #fff; font-weight: 600; display: flex; align-items: center; cursor: pointer; background: rgba(255,255,255,0.02); border-bottom: 1px solid rgba(255,255,255,0.04); transition: 0.3s; }
.col-header.collapsed { border-bottom-color: transparent; }
.col-header::after { content: '▼'; font-size: 12px; color: #666; transition: transform 0.3s; margin-left: auto; }
.col-header.collapsed::after { transform: rotate(-90deg); }

.b-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 16px 12px 16px; transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease; transform-origin: top; max-height: 2000px; opacity: 1; }
.b-grid.collapsed { max-height: 0; padding-top: 0; padding-bottom: 0; opacity: 0; overflow: hidden; border-top-color: transparent; }

.fav-gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 5px 0 20px; }
.b-card-mini { display: flex; align-items: center; gap: 10px; background: rgba(0,0,0,0.4); padding: 12px; border-radius: 12px; text-decoration: none; border: 1px solid rgba(255,255,255,0.04); transition: 0.2s; overflow: hidden; box-shadow: inset 0 2px 4px rgba(255,255,255,0.02); }
.b-card-mini:active { transform: scale(0.95); border-color: var(--linxy-brand); background: rgba(var(--linxy-brand-rgb), 0.06); }
.b-icon-mini { width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0; object-fit: cover; box-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.b-title-mini { font-size: 12px; font-weight: 500; color: #ddd; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; letter-spacing: 0.5px; }

.manual-sync-box { display: flex; gap: 10px; margin-top: 30px; }
.manual-sync-box input { background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.1); color: var(--linxy-brand); padding: 12px 15px; border-radius: 12px; font-size: 16px; outline: none; text-transform: uppercase; width: 140px; text-align: center; font-weight: bold; letter-spacing: 1px; box-shadow: inset 0 2px 5px rgba(0,0,0,0.5); }
.manual-sync-box input:focus { border-color: var(--linxy-brand); box-shadow: 0 0 15px rgba(var(--linxy-brand-rgb), 0.25), inset 0 2px 5px rgba(0,0,0,0.5); }
.manual-sync-box button { background: linear-gradient(135deg, var(--linxy-brand), #14967f); color: #04120e; border: none; padding: 0 20px; border-radius: 12px; font-size: 15px; font-weight: 800; cursor: pointer; transition: 0.2s; box-shadow: 0 4px 15px rgba(var(--linxy-brand-rgb), 0.35); }
.manual-sync-box button:active { transform: scale(0.95); opacity: 0.8; box-shadow: 0 2px 8px rgba(var(--linxy-brand-rgb), 0.3); }

.sync-waiting-state { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 70vh; text-align: center; }
.radar-pulse { width: 64px; height: 64px; border-radius: 50%; background: rgba(var(--linxy-brand-rgb), 0.12); margin-bottom: 20px; position: relative; animation: pulse 2s infinite; border: 1px solid var(--linxy-brand); box-shadow: 0 0 20px rgba(var(--linxy-brand-rgb), 0.35); display: flex; align-items: center; justify-content: center; color: var(--linxy-brand); }
.radar-pulse svg { width: 28px; height: 28px; filter: drop-shadow(0 0 8px rgba(var(--linxy-brand-rgb), 0.6)); }
@keyframes pulse { 0% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(var(--linxy-brand-rgb), 0.4); } 70% { transform: scale(1); box-shadow: 0 0 0 25px rgba(var(--linxy-brand-rgb), 0); } 100% { transform: scale(0.9); box-shadow: 0 0 0 0 rgba(var(--linxy-brand-rgb), 0); } }
.col-header { gap: 8px; }
.col-header-icon { display: inline-flex; align-items: center; flex-shrink: 0; }
.col-header-icon svg { width: 18px; height: 18px; }

/* ========================================================= */
/* 🚀 4. 底部菜单栏：焊死在屏幕最底端！ */
/* ========================================================= */
.bottom-nav { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    width: 100%; 
    z-index: 1000; 
    background: rgba(10, 10, 15, 0.85); 
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); 
    display: flex; justify-content: space-around; 
    /* 核心高度逻辑：10px 的内边距 + 原生的系统安全区高度 */
    padding: 10px 10px calc(10px + var(--safe-bottom)); 
    border-top: 1px solid rgba(255,255,255,0.08); 
    box-shadow: 0 -10px 30px rgba(0,0,0,0.6); 
}
.nav-item { display: flex; flex-direction: column; align-items: center; gap: 4px; text-decoration: none; color: var(--text-muted); cursor: pointer; transition: 0.3s; width: 33.33%; }
.nav-icon { display: flex; align-items: center; justify-content: center; transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s, filter 0.3s; opacity: 0.55; }
.nav-icon svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav-text { font-size: 11px; font-weight: bold; letter-spacing: 1px; }
.nav-item.active .nav-icon { transform: translateY(-4px) scale(1.12); opacity: 1; filter: drop-shadow(0 0 6px rgba(var(--linxy-brand-rgb), 0.45)); }
.nav-item.active { color: var(--linxy-brand); }
.nav-item[data-type="fav"].active { color: var(--accent-red); }
.nav-item[data-type="fav"].active .nav-icon { filter: drop-shadow(0 0 6px rgba(255, 42, 95, 0.45)); }
.nav-item[data-type="sync"].active { color: var(--linxy-brand); }

/* ========================================================= */
/* 🚀 5. 教程横幅与弹窗样式 */
/* ========================================================= */
.pwa-install-banner { display: flex; justify-content: space-between; align-items: center; background: rgba(var(--linxy-brand-rgb), 0.08); border: 1px solid rgba(var(--linxy-brand-rgb), 0.22); border-radius: 12px; margin: 0 15px 15px; padding: 10px 15px; flex-shrink: 0; box-shadow: inset 0 2px 4px rgba(var(--linxy-brand-rgb), 0.05); }
.pwa-banner-text { font-size: 12px; color: var(--linxy-brand); font-weight: 500; letter-spacing: 0.5px; flex: 1; }
.pwa-banner-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.pwa-banner-btn { background: linear-gradient(135deg, var(--linxy-brand), #14967f); color: #04120e; padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 800; cursor: pointer; box-shadow: 0 2px 8px rgba(var(--linxy-brand-rgb), 0.3); transition: 0.2s; white-space: nowrap; height: 32px; display: flex; align-items: center; }
.pwa-banner-btn:active { transform: scale(0.95); }
.pwa-banner-close-box { background: crimson; color: #fff; width: 32px; height: 32px; border-radius: 8px; font-size: 22px; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; box-shadow: 0 2px 8px rgba(220,20,60,0.4); font-family: sans-serif; }
.pwa-banner-close-box:active { transform: scale(0.9); background: #a01030; box-shadow: 0 1px 4px rgba(220,20,60,0.4); }

/* ========================================================= */
/* 👑 独立 App 专属控制台 (绝对覆盖版) */
/* ========================================================= */
@media all and (display-mode: standalone), (display-mode: fullscreen) {
    /* 1. 隐藏教程横幅 */
    .pwa-install-banner { display: none !important; }
    
    /* 👑 【精细控制 A：APP 最顶部距离】 */
    .mobile-header {
        /* 用完整的 padding 写法：上(修改这里)、左右、下 */
        /* 如果你想缩小顶部空间，把 15px 改成 10px 甚至 5px */
        padding: calc(env(safe-area-inset-top, 0px) + 50px) 15px 12px !important;
    }

    /* 👑 【精细控制 B：APP 菜单栏最底部距离】 */
    .bottom-nav {
        /* 用完整的 padding 写法：上、左右、下(修改这里) */
        /* 如果你想缩小底部空间，把 8px 改成 3px 甚至 0px */
        padding: 10px 10px calc(env(safe-area-inset-bottom, 0px) + 50px) !important;
    }
}

.pwa-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); z-index: 9999; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: 0.3s; }
.pwa-modal.active { opacity: 1; pointer-events: auto; }
.pwa-modal-content { background: var(--bg-panel); border: 1px solid rgba(255,255,255,0.1); border-radius: 20px; width: 85%; max-width: 320px; box-shadow: 0 15px 35px rgba(0,0,0,0.5); transform: translateY(20px); transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); overflow: hidden; }
.pwa-modal.active .pwa-modal-content { transform: translateY(0); }
.pwa-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.05); background: rgba(0,0,0,0.2); }
.pwa-modal-header h3 { font-size: 16px; color: #fff; margin: 0; }
.pwa-close-btn { font-size: 24px; color: #888; cursor: pointer; line-height: 1; transition: 0.2s; }
.pwa-close-btn:active { color: var(--accent-red); transform: scale(0.9); }
.pwa-modal-body { padding: 20px; font-size: 13px; color: #ccc; line-height: 1.6; }
.pwa-step-box { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.05); border-radius: 12px; padding: 12px; margin-top: 15px; }
.pwa-step-box h4 { margin: 0 0 8px 0; color: #fff; font-size: 14px; }
.pwa-step-box ol { margin: 0; padding-left: 20px; color: var(--text-muted); }

.pwa-step-box li { margin-bottom: 6px; }
.pwa-step-box b { color: var(--linxy-brand); }

@media (prefers-reduced-motion: reduce) {
    .radar-pulse { animation: none !important; }
    .nav-item.active .nav-icon { transform: none !important; }
}
