/* 虚拟流量插件前端样式 */

/* 访客显示框样式 */
.visitors-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.visitors-title {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 10px;
    text-align: center;
}

.visitors-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    max-width: 100%;
}

.visitor-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: calc(20% - 8px);
    min-width: 60px;
    max-width: 80px;
}

.visitor-avatar {
    display: block;
    margin-bottom: 5px;
    border-radius: 50%;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.visitor-avatar:hover {
    transform: scale(1.1);
}

.visitor-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.visitor-name {
    font-size: 12px;
    color: #495057;
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.visitor-more .visitor-avatar {
    background: #007cba;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    text-decoration: none;
}

.more-avatar {
    background: #007cba !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    border-radius: 50% !important;
    font-size: 12px !important;
    font-weight: bold !important;
    text-decoration: none !important;
}

.visitor-more-btn {
    text-decoration: none;
    color: inherit;
}

.visitor-more-btn:hover {
    text-decoration: none;
}

/* 弹窗样式 */
.visitors-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.all-visitors-modal {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.modal-close {
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.visitors-stats {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: #666;
}

.visitors-stats .ml15 {
    margin-left: 15px;
}

.all-visitors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.visitor-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: box-shadow 0.2s ease;
}

.visitor-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.visitor-link {
    text-decoration: none;
    color: inherit;
}

.visitor-link:hover {
    text-decoration: none;
}

.visitor-avatar-large img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 8px;
}

.visitor-name-large {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.visitor-time {
    font-size: 12px;
    color: #999;
}

.no-visitors {
    text-align: center;
    color: #999;
    padding: 40px 20px;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .visitor-item {
        width: calc(20% - 8px);
    }
    
    .all-visitors-modal {
        width: 95%;
        margin: 20px;
    }
    
    .all-visitors-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .modal-body {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .visitor-item {
        width: calc(16.666% - 8px);
    }
    
    .visitor-avatar img {
        width: 35px;
        height: 35px;
    }
    
    .visitor-name {
        font-size: 11px;
    }
    
    .more-avatar {
        width: 35px !important;
        height: 35px !important;
        font-size: 11px !important;
    }
}

/* 暗黑模式适配 */
@media (prefers-color-scheme: dark) {
    .visitors-box {
        background: #2c2c2c;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .visitors-title {
        color: #b0b0b0;
    }
    
    .visitor-name {
        color: #d0d0d0;
    }
    
    .all-visitors-modal {
        background: #2c2c2c;
        color: #e0e0e0;
    }
    
    .modal-header {
        border-bottom-color: #444;
    }
    
    .modal-header h3 {
        color: #e0e0e0;
    }
    
    .modal-close {
        color: #b0b0b0;
    }
    
    .modal-close:hover {
        color: #e0e0e0;
    }
    
    .visitors-stats {
        border-bottom-color: #444;
        color: #b0b0b0;
    }
    
    .visitor-card {
        background: #333;
        border-color: #555;
        color: #e0e0e0;
    }
    
    .visitor-card:hover {
        box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
    }
    
    .visitor-name-large {
        color: #d0d0d0;
    }
    
    .visitor-time {
        color: #999;
    }
}

/* 子比主题暗黑模式适配 - 使用更高优先级 */
.dark .visitors-box,
body.dark .visitors-box,
html.dark .visitors-box,
[data-theme="dark"] .visitors-box,
.theme-dark .visitors-box {
    background: #2c2c2c !important;
    border-color: #444 !important;
    color: #e0e0e0 !important;
}

.dark .visitors-title,
body.dark .visitors-title,
html.dark .visitors-title,
[data-theme="dark"] .visitors-title,
.theme-dark .visitors-title {
    color: #b0b0b0 !important;
}

.dark .visitor-name,
body.dark .visitor-name,
html.dark .visitor-name,
[data-theme="dark"] .visitor-name,
.theme-dark .visitor-name {
    color: #d0d0d0 !important;
}

.dark .all-visitors-modal,
body.dark .all-visitors-modal,
html.dark .all-visitors-modal,
[data-theme="dark"] .all-visitors-modal,
.theme-dark .all-visitors-modal {
    background: #2c2c2c !important;
    color: #e0e0e0 !important;
}

.dark .modal-header,
body.dark .modal-header,
html.dark .modal-header,
[data-theme="dark"] .modal-header,
.theme-dark .modal-header {
    border-bottom-color: #444 !important;
}

.dark .modal-header h3,
body.dark .modal-header h3,
html.dark .modal-header h3,
[data-theme="dark"] .modal-header h3,
.theme-dark .modal-header h3 {
    color: #e0e0e0 !important;
}

.dark .modal-close,
body.dark .modal-close,
html.dark .modal-close,
[data-theme="dark"] .modal-close,
.theme-dark .modal-close {
    color: #b0b0b0 !important;
}

.dark .modal-close:hover,
body.dark .modal-close:hover,
html.dark .modal-close:hover,
[data-theme="dark"] .modal-close:hover,
.theme-dark .modal-close:hover {
    color: #e0e0e0 !important;
}

.dark .visitors-stats,
body.dark .visitors-stats,
html.dark .visitors-stats,
[data-theme="dark"] .visitors-stats,
.theme-dark .visitors-stats {
    border-bottom-color: #444 !important;
    color: #b0b0b0 !important;
}

.dark .visitor-card,
body.dark .visitor-card,
html.dark .visitor-card,
[data-theme="dark"] .visitor-card,
.theme-dark .visitor-card {
    background: #333 !important;
    border-color: #555 !important;
    color: #e0e0e0 !important;
}

.dark .visitor-card:hover,
body.dark .visitor-card:hover,
html.dark .visitor-card:hover,
[data-theme="dark"] .visitor-card:hover,
.theme-dark .visitor-card:hover {
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1) !important;
}

.dark .visitor-name-large,
body.dark .visitor-name-large,
html.dark .visitor-name-large,
[data-theme="dark"] .visitor-name-large,
.theme-dark .visitor-name-large {
    color: #d0d0d0 !important;
}

.dark .visitor-time,
body.dark .visitor-time,
html.dark .visitor-time,
[data-theme="dark"] .visitor-time,
.theme-dark .visitor-time {
    color: #999 !important;
}