/* ==========================================================================
   导航自定义页面 - 参考图片UI重构
   ========================================================================== */

/* 主布局 - 左侧导航 + 右侧内容 */
.nav-custom-page.main-content {
    display: flex;
    flex-direction: row;
    align-items: center; /* 垂直居中sidebar */
    justify-content: center;
    min-height: calc(100vh - 64px);
    padding: 0;
    background: #f8f9fa;
    max-width: 1200px;
    position: relative;
}

/* 让侧边导航栏紧贴nav-content左侧，采用flex布局 */
.nav-custom-page {
    position: relative;
}
/* 让nav-sidebar漂浮且垂直居中，水平位置与内容区左侧对齐 */
.nav-sidebar {
    position: fixed !important;
    top: 50% !important;
    left: max(calc(50% - 640px), 0px) !important;
    transform: translateY(-50%);
    z-index: 200;
    width: 88px;
    min-width: 70px;
    max-width: 110px;
    background: rgba(255,255,255,0.92);
    border-radius: 18px;
    box-shadow: 0 6px 32px rgba(74,144,226,0.13), 0 1.5px 6px rgba(0,0,0,0.06);
    border: 1.5px solid #e3eaf3;
    padding: 10px 0 10px 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    transition: box-shadow 0.2s, left 0.2s, background 0.2s;
    backdrop-filter: blur(6px);
    gap: 0;
}
.nav-title {
    font-size: 15px;
    font-weight: 700;
    color: #4a90e2;
    margin: 0;
    letter-spacing: 1px;
}
.nav-categories {
    padding: 0;
    margin: 0;
}
.nav-category-item {
    display: block;
    padding: 7px 0 7px 0;
    color: #6b7280;
    text-align: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    margin: 0 8px 4px 8px;
    transition: background 0.16s, color 0.16s, font-weight 0.16s;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
}
.nav-category-item:hover,
.nav-category-item.active {
    background: #e8f4fd;
    color: #2976c5;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(74,144,226,0.08);
}

/* 右侧内容区域 */
.nav-content {
    flex: 1 1 0%;
    margin-left: 0 !important;
    max-width: calc(1200px - 120px);
    padding: 24px;
    margin-top: 100px;
}

/* 搜索框 */
.nav-search-container {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
}

.nav-search-form {
    position: relative;
    width: 100%;
    max-width: 600px;
}

.nav-search-input {
    width: 100%;
    padding: 12px 16px 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 4px;
    font-size: 16px;
    background: white;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.nav-search-input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-search-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: #4a90e2;
    border: none;
    border-radius: 2px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.nav-search-btn:hover {
    background: #357abd;
    transform: translateY(-50%) scale(1.05);
}

/* 网站分类内容 */
.nav-sections-container {
    position: relative;
}

.nav-section {
    display: block;
    margin-bottom: 32px;
    animation: fadeIn 0.3s ease;
}

.nav-section:last-child {
    margin-bottom: 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.nav-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #f1f3f4;
    position: relative;
}

.nav-section-title::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: #4a90e2;
}

/* 网站卡片网格 */
.nav-sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.nav-site-card {
    display: block;
    padding: 16px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-site-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-site-info {
    width: 100%;
}

.nav-site-title {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 2px 0;
    line-height: 1.2;
}

.nav-site-desc {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 空状态 */
.nav-empty {
    text-align: center;
    padding: 60px 40px;
    background: white;
    border: 2px dashed #e9ecef;
    border-radius: 4px;
    color: #6b7280;
    font-size: 16px;
}

.nav-empty h3 {
    color: #2c3e50;
    margin: 0 0 16px 0;
    font-size: 20px;
}

.nav-empty p {
    margin: 8px 0;
    line-height: 1.6;
}

.nav-empty strong {
    color: #4a90e2;
}

/* 侧边栏空状态 */
.nav-empty-sidebar {
    padding: 20px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

/* 移动端菜单按钮 */
.nav-mobile-toggle {
    display: none;
    position: fixed;
    top: 80px;
    left: 20px;
    z-index: 1001;
    width: 48px;
    height: 48px;
    background: #4a90e2;
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 实时搜索结果 */
.nav-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.nav-search-results.active {
    display: block;
}

.nav-search-result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.nav-search-result-item:last-child {
    border-bottom: none;
}

.nav-search-result-item:hover {
    background: #f8f9fa;
}

.nav-search-result-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 4px;
}

.nav-search-result-desc {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.nav-search-no-results {
    padding: 20px;
    text-align: center;
    color: #6b7280;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .nav-custom-page.main-content {
        max-width: 100%;
    }
    .nav-sidebar {
        left: 0 !important;
        width: 70px;
        min-width: 54px;
        border-radius: 12px;
        box-shadow: 0 2px 12px rgba(74,144,226,0.10);
        padding: 6px 0;
    }
    .nav-content {
        max-width: 100%;
        padding: 20px;
    }
    
    .nav-sites-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .nav-sidebar {
        display: none;
    }
    .nav-content {
        padding: 12px;
    }
    
    .nav-search-input {
        padding: 10px 14px;
        font-size: 15px;
    }
    
    .nav-sites-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .nav-site-card {
        padding: 10px;
    }
    
    .nav-section-title {
        font-size: 18px;
    }
}

@media (min-width: 1200px) {
    .nav-sites-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* ================================
   后台导航网址管理美化样式
   ================================ */
.vpsba-admin-site-row {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 16px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    transition: box-shadow 0.2s;
}
.vpsba-admin-site-row:hover {
    box-shadow: 0 4px 16px rgba(74,144,226,0.08);
    border-color: #4a90e2;
}
.vpsba-admin-site-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    cursor: pointer;
    background: #f8fafd;
    border-bottom: 1px solid #f1f3f4;
    border-radius: 6px 6px 0 0;
    transition: background 0.2s;
}
.vpsba-admin-site-row-header:hover {
    background: #e8f4fd;
}
.vpsba-admin-site-row .site-row-title {
    font-weight: 600;
    font-size: 15px;
    color: #2c3e50;
}
.vpsba-admin-site-row .site-row-url {
    color: #888;
    font-size: 12px;
    margin-left: 8px;
}
.vpsba-admin-site-row .toggle-site-row {
    background: #4a90e2;
    color: #fff;
    border-radius: 4px;
    border: none;
    padding: 4px 14px;
    font-size: 13px;
    margin-left: 8px;
    transition: background 0.2s;
}
.vpsba-admin-site-row .toggle-site-row:hover {
    background: #357abd;
}
.vpsba-admin-site-row .remove-site-btn {
    color: #f56c6c;
    background: #fff0f0;
    border-radius: 4px;
    border: none;
    padding: 4px 10px;
    font-size: 13px;
    margin-left: 8px;
    transition: background 0.2s, color 0.2s;
}
.vpsba-admin-site-row .remove-site-btn:hover {
    background: #f56c6c;
    color: #fff;
}
.vpsba-admin-site-row-body {
    padding: 16px 24px 8px 24px;
    background: #fff;
    border-radius: 0 0 6px 6px;
}
.vpsba-admin-site-row .form-label {
    font-weight: 500;
    color: #4a90e2;
    margin-right: 8px;
}
.vpsba-admin-site-row .form-input {
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
    margin-right: 8px;
    background: #f8fafd;
    transition: border 0.2s;
}
.vpsba-admin-site-row .form-input:focus {
    border-color: #4a90e2;
    background: #fff;
    outline: none;
}
@media (max-width: 600px) {
    .vpsba-admin-site-row-body {
        padding: 12px 8px 8px 8px;
    }
    .vpsba-admin-site-row-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* ================================
   后台导航分类行美化样式
   ================================ */
.category-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    background: #f8fafd;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 8px 12px;
    transition: box-shadow 0.2s;
}
.category-row:hover {
    box-shadow: 0 2px 8px rgba(74,144,226,0.08);
    border-color: #4a90e2;
}
.category-input-container {
    display: flex;
    align-items: center;
    width: 100%;
}
.category-label {
    font-weight: 500;
    color: #4a90e2;
    margin-right: 8px;
}
.category-input {
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 14px;
    margin-right: 8px;
    background: #fff;
    transition: border 0.2s;
}
.category-input:focus {
    border-color: #4a90e2;
    outline: none;
}
.remove-category-btn {
    color: #f56c6c;
    background: #fff0f0;
    border-radius: 4px;
    border: none;
    padding: 4px 10px;
    font-size: 13px;
    margin-left: 8px;
    transition: background 0.2s, color 0.2s;
}
.remove-category-btn:hover {
    background: #f56c6c;
    color: #fff;
}
