/* 爬虫检测服务样式 */

/* 安全状态指示器 */
.security-status {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 10000;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.security-status.safe {
    background: rgba(46, 204, 113, 0.9);
    color: white;
    border: 2px solid #27ae60;
}

.security-status.warning {
    background: rgba(241, 196, 15, 0.9);
    color: white;
    border: 2px solid #f39c12;
    animation: pulse 2s infinite;
}

.security-status.danger {
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: 2px solid #c0392b;
    animation: alert 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes alert {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 爬虫检测面板 */
.crawler-detection-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #3498db;
    border-radius: 12px;
    padding: 15px;
    max-width: 300px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    z-index: 9999;
    font-size: 12px;
    display: none;
}

.crawler-detection-panel.visible {
    display: block;
    animation: slideInUp 0.3s ease;
}

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

.crawler-detection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    border-bottom: 1px solid #ecf0f1;
    padding-bottom: 8px;
}

.crawler-detection-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.crawler-detection-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.crawler-detection-close:hover {
    color: #e74c3c;
}

.crawler-detection-stats {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    color: #7f8c8d;
    font-size: 11px;
}

.stat-value {
    font-weight: 600;
    color: #2c3e50;
    font-size: 11px;
}

.stat-value.high {
    color: #e74c3c;
}

.stat-value.medium {
    color: #f39c12;
}

.stat-value.low {
    color: #27ae60;
}

/* 频率限制提示 */
.rate-limit-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(231, 76, 60, 0.95);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    z-index: 10001;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    display: none;
}

.rate-limit-notification.visible {
    display: block;
    animation: fadeIn 0.5s ease;
}

.rate-limit-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.rate-limit-message {
    font-size: 16px;
    margin-bottom: 15px;
    line-height: 1.4;
}

.rate-limit-timer {
    font-size: 14px;
    opacity: 0.8;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* 安全日志面板 */
.security-logs-panel {
    position: fixed;
    top: 50px;
    right: 20px;
    background: rgba(255, 255, 255, 0.98);
    border: 2px solid #34495e;
    border-radius: 12px;
    padding: 15px;
    max-width: 400px;
    max-height: 500px;
    overflow-y: auto;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(15px);
    z-index: 9998;
    display: none;
    font-size: 11px;
}

.security-logs-panel.visible {
    display: block;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.security-logs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #bdc3c7;
    padding-bottom: 10px;
}

.security-logs-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.security-logs-clear {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
}

.security-logs-clear:hover {
    background: #c0392b;
}

.security-log-item {
    padding: 8px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 4px solid #bdc3c7;
    background: #f8f9fa;
}

.security-log-item.critical {
    border-left-color: #e74c3c;
    background: #ffeaea;
}

.security-log-item.high {
    border-left-color: #f39c12;
    background: #fff4e6;
}

.security-log-item.medium {
    border-left-color: #f1c40f;
    background: #fffde7;
}

.security-log-item.low {
    border-left-color: #27ae60;
    background: #e8f6ef;
}

.log-timestamp {
    font-size: 9px;
    color: #7f8c8d;
    margin-bottom: 4px;
}

.log-message {
    font-size: 10px;
    color: #2c3e50;
    line-height: 1.3;
}

/* 调试模式样式 */
.debug-mode .security-status {
    display: block !important;
}

.debug-mode .crawler-detection-panel {
    display: block !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .crawler-detection-panel {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .security-logs-panel {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .rate-limit-notification {
        margin: 20px;
        max-width: calc(100% - 40px);
    }
}

/* 暗色主题支持 */
@media (prefers-color-scheme: dark) {
    .crawler-detection-panel {
        background: rgba(44, 62, 80, 0.95);
        color: #ecf0f1;
        border-color: #3498db;
    }
    
    .crawler-detection-title {
        color: #ecf0f1;
    }
    
    .stat-label {
        color: #bdc3c7;
    }
    
    .stat-value {
        color: #ecf0f1;
    }
    
    .security-logs-panel {
        background: rgba(44, 62, 80, 0.98);
        color: #ecf0f1;
        border-color: #34495e;
    }
    
    .security-log-item {
        background: rgba(52, 73, 94, 0.6);
    }
    
    .security-log-item.critical {
        background: rgba(231, 76, 60, 0.2);
    }
    
    .security-log-item.high {
        background: rgba(243, 156, 18, 0.2);
    }
    
    .security-log-item.medium {
        background: rgba(241, 196, 15, 0.2);
    }
    
    .security-log-item.low {
        background: rgba(39, 174, 96, 0.2);
    }
}

/* 无障碍支持 */
.security-status:focus,
.crawler-detection-close:focus,
.security-logs-clear:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* 打印样式 */
@media print {
    .security-status,
    .crawler-detection-panel,
    .rate-limit-notification,
    .security-logs-panel {
        display: none !important;
    }
}