/* Website Navigation Custom Styles */

/* Common Styles */
.center-block { float: none; margin-left: auto; margin-right: auto; }
.qq-mobile-categories.no-arrow::after { display: none !important; }
.page-h1 { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }
.breadcrumb-item + .breadcrumb-item::before { content: "›"; font-family: system-ui; }

/* Detail Page Styles */
.nav-detail-card { background: #fff; border-radius: 12px; padding: 30px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.nav-breadcrumb { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid #f1f5f9; }

body.dark-mode .nav-detail-card { background: #1a1a1a; box-shadow: 0 4px 20px rgba(0,0,0,0.2); }
body.dark-mode .nav-detail-title { color: #f1f5f9; }
body.dark-mode .nav-detail-header, 
body.dark-mode .nav-breadcrumb { border-bottom-color: #334155 !important; }
body.dark-mode .nav-detail-section-title { color: #e2e8f0; }
body.dark-mode .nav-detail-desc, body.dark-mode .evaluation-text { color: #94a3b8; }
body.dark-mode .nav-detail-tag { background: #334155; color: #94a3b8; }
body.dark-mode .nav-detail-icon, body.dark-mode .nav-preview-box { background: #2d3748; border-color: #4a5568; }
body.dark-mode .related-nav-item { background: #2d3748; border-color: #4a5568; }
body.dark-mode .related-nav-item-name { color: #f1f5f9; }
body.dark-mode .related-nav-item:hover { background: #1a1a1a; border-color: #3b82f6; }
body.dark-mode .evaluation-link { color: #60a5fa; }
body.dark-mode .evaluation-link:hover { color: #93c5fd; }
body.dark-mode .nav-detail-btn-secondary { background: #2d3748; color: #94a3b8; }
body.dark-mode .nav-detail-meta-item { color: #94a3b8; }
body.dark-mode .nav-detail-meta-item a { color: #94a3b8; }
body.dark-mode .nav-detail-meta-item a:hover { color: #60a5fa; }

.nav-detail-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #f1f5f9; gap: 20px; }
.nav-detail-header-left { display: flex; align-items: flex-start; flex: 1; }
.nav-detail-icon { width: 48px; height: 48px; border-radius: 10px; margin-right: 16px; display: flex; align-items: center; justify-content: center; background: #f8f9fa; flex-shrink: 0; border: 1px solid #f1f5f9; }
.nav-detail-icon img { width: 100%; height: 100%; border-radius: 10px; }
.nav-detail-info { flex: 1; }
.nav-detail-title { font-size: 1.15rem; font-weight: 600; margin-bottom: 4px; color: #1e293b; line-height: 1.2; }
.nav-detail-url { color: #64748b; font-size: 0.85rem; margin-bottom: 8px; word-break: break-all; display: block; }

.nav-detail-meta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.nav-detail-meta-item { display: inline-flex; align-items: center; gap: 4px; font-size: 0.8rem; color: #64748b; }
.nav-detail-meta-item a:hover { color: #3b82f6; }
.nav-detail-hot-badge { font-weight: 600; }

.nav-detail-section { margin-bottom: 15px; }
.nav-detail-section-title { font-size: 0.95rem; font-weight: 600; color: #334155; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.nav-detail-section-title::before { content: ""; width: 3px; height: 14px; background: #3b82f6; border-radius: 2px; }
.nav-detail-desc { color: #475569; line-height: 1.7; font-size: 0.925rem; }

.nav-detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.nav-detail-tag { display: inline-flex; align-items: center; padding: 2px 10px; background: #f1f5f9; color: #64748b; border-radius: 4px; font-size: 0.75rem; font-weight: 500; }

.nav-detail-btn { padding: 8px 20px; border-radius: 8px; font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; transition: all 0.2s; outline: none !important; border: none !important; }
.nav-detail-btn:focus { outline: none !important; border: none !important; }
.nav-detail-btn-primary { background: #3b82f6; color: #fff; }
.nav-detail-btn-primary:hover { background: #2563eb; color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2); }
.nav-detail-btn-secondary { background: #f1f5f9; color: #64748b; }
.nav-detail-btn-secondary:hover { background: #e2e8f0; color: #1e293b; }
.nav-detail-btn-secondary:active { transform: translateY(0); }
.nav-detail-header-right { display: flex; gap: 8px; flex-wrap: wrap; }

.nav-detail-actions { display: flex; gap: 8px; }
.nav-detail-actions-desktop { display: flex; }
.nav-detail-actions-mobile { display: none; }

@media (max-width: 768px) {
    .nav-detail-actions-desktop { display: none; }
    .nav-detail-actions-mobile { display: flex; }
    .nav-detail-header-right {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .nav-detail-header-right .nav-detail-btn-primary {
        width: 100%;
        flex: 0 0 100%;
    }
    .nav-detail-header-right .nav-detail-btn-secondary {
        width: calc(50% - 4px);
        flex: 0 0 calc(50% - 4px);
    }
}

.nav-preview-box { margin-bottom: 24px; border-radius: 12px; overflow: hidden; border: 1px solid #f1f5f9; background: #f8f9fa; position: relative; box-shadow: 0 2px 10px rgba(0,0,0,0.02); width: 100%; max-width: 800px; margin-left: auto; margin-right: auto; }
.nav-preview-box img { width: 100%; height: auto; max-height: 450px; object-fit: cover; object-position: top; display: block; }

.evaluation-text { color: #475569; font-size: 0.925rem; line-height: 1.8; }
.evaluation-text strong { font-weight: 600; }

.related-nav-section { margin-top: 15px; padding-top: 15px; border-top: 1px solid #f1f5f9; }
.related-nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 16px; }

.related-nav-item { background: #f8f9fa; border-radius: 10px; padding: 12px; border: 1px solid #f1f5f9; transition: all 0.2s; display: flex; align-items: center; gap: 12px; text-decoration: none !important; position: relative; overflow: hidden; }
.related-nav-item:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); border-color: #3b82f6; }

.related-nav-item-icon { width: 32px; height: 32px; border-radius: 6px; flex-shrink: 0; overflow: hidden; }
.related-nav-item-icon img { width: 100%; height: 100%; object-fit: cover; }
.related-nav-item-info { flex: 1; min-width: 0; }
.related-nav-item-name { font-size: 0.875rem; font-weight: 600; color: #1e293b; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.related-nav-item-desc { font-size: 0.75rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Index Page Styles */
.qq-tool-views-badge {
    position: absolute; top: 0; right: 0;
    background: rgba(241, 245, 249, 0.8);
    color: #64748b; font-size: 0.7rem;
    padding: 2px 8px; border-bottom-left-radius: 10px;
    display: flex; align-items: center;
    backdrop-filter: blur(4px); z-index: 1;
    border-left: 1px solid rgba(226, 232, 240, 0.5);
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}
body.dark-mode .qq-tool-views-badge {
    background: rgba(30, 41, 59, 0.8); color: #94a3b8;
    border-left-color: rgba(51, 65, 85, 0.5);
    border-bottom-color: rgba(51, 65, 85, 0.5);
}
.qq-tool-views-badge i { font-size: 0.8rem; margin-right: 3px; }

/* Stars Page Styles */
.qq-nav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.qq-nav-card { background: #f8f9fa; border-radius: 12px; padding: 16px; border: 1px solid #f1f5f9; transition: all 0.2s; display: flex; align-items: center; gap: 12px; text-decoration: none !important; position: relative; overflow: hidden; }
.qq-nav-card:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); border-color: #3b82f6; }
body.dark-mode .qq-nav-card { background: #2d3748; border-color: #4a5568; }
body.dark-mode .qq-nav-card:hover { background: #1a1a1a; border-color: #3b82f6; }
.qq-nav-icon-wrapper { width: 48px; height: 48px; border-radius: 10px; flex-shrink: 0; overflow: hidden; background: #e2e8f0; display: flex; align-items: center; justify-content: center; }
body.dark-mode .qq-nav-icon-wrapper { background: #4a5568; }
.qq-nav-icon { width: 100%; height: 100%; object-fit: cover; }
.qq-nav-info { flex: 1; min-width: 0; }
.qq-nav-title { font-size: 0.95rem; font-weight: 600; color: #1e293b; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.dark-mode .qq-nav-title { color: #f1f5f9; }
.qq-nav-desc { font-size: 0.8rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 6px; }
body.dark-mode .qq-nav-desc { color: #94a3b8; }
.qq-nav-meta { display: flex; gap: 8px; align-items: center; font-size: 0.7rem; color: #64748b; }
body.dark-mode .qq-nav-meta { color: #94a3b8; }
.qq-nav-category, .qq-nav-views { display: inline-flex; align-items: center; gap: 3px; }
@media (max-width: 768px) {
    .qq-nav-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
    .qq-nav-card { padding: 12px; }
    .qq-nav-icon-wrapper { width: 32px; height: 32px; }
    .qq-nav-title { font-size: 0.875rem; }
    .qq-nav-desc { font-size: 0.75rem; }
    .qq-nav-meta { font-size: 0.65rem; }
}

/* Go Page Styles */
.go-actions { display: flex; gap: 12px; justify-content: center; align-items: center; max-width: 280px; margin: 0 auto; }
.go-btn-main { flex: 1; border-radius: 8px; padding: 8px 12px; font-weight: 500; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; background-color: #3b82f6; border-color: #3b82f6; color: #fff; }
.go-btn-main:hover { background-color: #2563eb; border-color: #2563eb; color: #fff; }
.go-btn-back { flex: 1; border-radius: 8px; padding: 8px 12px; font-weight: 500; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; background: #f1f5f9; border: 1px solid #e2e8f0; color: #64748b; }
.go-btn-back:hover { background: #e2e8f0; color: #1e293b; }

body.dark-mode .card { background: #1e293b; }
body.dark-mode .nk-block-title { color: #f1f5f9 !important; }
body.dark-mode .bg-light { background: #0f172a !important; border-color: #334155 !important; }
body.dark-mode .text-soft { color: #94a3b8 !important; }
body.dark-mode .alert-warning { background-color: rgba(255, 180, 0, 0.1) !important; border-color: rgba(255, 180, 0, 0.2) !important; color: #ffb400 !important; }
body.dark-mode .go-btn-back { background: #334155; border-color: #475569; color: #cbd5e1; }
body.dark-mode .go-btn-back:hover { background: #475569; color: #f1f5f9; }

/* Responsive Styles */
@media (max-width: 1400px) { 
    .related-nav-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); } 
}

@media (max-width: 768px) {
    .nav-detail-card { padding: 12px; }
    .container-fluid.detail-container { padding: 8px !important; }
    .nav-preview-box { max-width: 100%; }

    .qq-tool-views-badge {
        font-size: 0.6rem; padding: 1px 5px;
        border-bottom-left-radius: 6px;
        background: rgba(241, 245, 249, 0.6);
    }
    .qq-tool-views-badge i { font-size: 0.7rem; margin-right: 2px; }
    .qq-tool-info { padding-right: 35px; }
    body.dark-mode .qq-tool-views-badge { background: rgba(30, 41, 59, 0.6); }
}

@media (max-width: 576px) {
    .nav-detail-header { flex-direction: column; align-items: flex-start; }
    .nav-detail-header-right { width: 100%; flex-direction: row; flex-wrap: wrap; }
    .nav-detail-btn-primary { width: 100%; justify-content: center; }
    .nav-detail-header-right .nav-detail-btn-secondary { width: calc(50% - 4px); justify-content: center; }
    .nav-detail-meta { gap: 8px; }
    .nav-detail-meta-item { font-size: 0.75rem; }

    .go-actions { gap: 8px; padding: 0 10px; }
    .go-btn-main, .go-btn-back { padding: 8px 10px; font-size: 0.85rem; }
}

/* Icon Loading Styles */
.qq-tool-icon-wrapper { position: relative; }
.qq-tool-icon { 
    transition: opacity 0.3s ease;
    width: 100%; 
    height: 100%; 
    object-fit: cover;
}
.qq-tool-icon.lazy-icon {
    opacity: 0.5;
    filter: blur(2px);
}
.qq-tool-icon.lazy-icon.loaded {
    opacity: 1;
    filter: blur(0);
}
.qq-tool-icon.icon-failed {
    opacity: 0.7;
}
.qq-tool-icon-wrapper.loading::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
    z-index: 0;
}
.qq-tool-icon-wrapper .qq-tool-icon,
.qq-tool-icon-wrapper .tool-font-icon {
    position: relative;
    z-index: 1;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

body.dark-mode .qq-tool-icon-wrapper.loading::before {
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 200% 100%;
}
