/**
 * 子比小黑屋 - 前端样式
 */

/* 主容器 */
.zbr-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 深色模式 */
.zbr-container.zbr-dark {
    color: #e0e0e0;
}

.zbr-container.zbr-dark .zbr-user-card {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

.zbr-container.zbr-dark .zbr-stat-card {
    background: #2a2a2a;
}

/* 头部 */
.zbr-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: #fff;
}

.zbr-header h1 {
    margin: 0 0 10px;
    font-size: 28px;
}

.zbr-header p {
    margin: 0;
    opacity: 0.9;
}

.zbr-current-time {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 10px;
}

/* 统计卡片 */
.zbr-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.zbr-stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.zbr-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.zbr-stat-card .zbr-stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #4a90d9;
    line-height: 1;
}

.zbr-stat-card .zbr-stat-label {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
}

.zbr-stat-card.zbr-stat-blackroom .zbr-stat-value {
    color: #f5a623;
}

.zbr-stat-card.zbr-stat-banned .zbr-stat-value {
    color: #e74c3c;
}

/* 筛选器 */
.zbr-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.zbr-filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.zbr-filter-item label {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.zbr-filter-item input,
.zbr-filter-item select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    min-width: 150px;
}

.zbr-filter-item input:focus,
.zbr-filter-item select:focus {
    outline: none;
    border-color: #4a90d9;
}

/* 用户列表 */
.zbr-users-list {
    margin-bottom: 20px;
}

.zbr-user-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.zbr-user-card {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eee;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.zbr-user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.zbr-user-header {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
}

.zbr-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.zbr-user-info {
    flex: 1;
    min-width: 0;
}

.zbr-username {
    font-weight: 600;
    font-size: 16px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zbr-user-login {
    font-size: 13px;
    color: #999;
}

.zbr-ban-type {
    flex-shrink: 0;
}

.zbr-user-body {
    padding: 16px;
}

.zbr-reason,
.zbr-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    line-height: 1.5;
}

.zbr-reason strong,
.zbr-desc strong {
    color: #333;
}

.zbr-time-info {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: #888;
}

.zbr-time-item {
    padding: 4px 8px;
    background: #f5f5f5;
    border-radius: 4px;
}

/* 徽章 */
.zbr-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.zbr-badge-blackroom {
    background: #fff3cd;
    color: #856404;
}

.zbr-badge-banned {
    background: #f8d7da;
    color: #721c24;
}

.zbr-badge-success {
    background: #d4edda;
    color: #155724;
}

.zbr-badge-warning {
    background: #fff3cd;
    color: #856404;
}

.zbr-badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* 分页 */
.zbr-pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.zbr-pagination-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.zbr-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.zbr-page-link:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.zbr-page-link.active {
    background: #4a90d9;
    border-color: #4a90d9;
    color: #fff;
}

.zbr-page-dots {
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    color: #999;
}

/* 信誉查询 */
.zbr-credit-query {
    margin-bottom: 20px;
}

#zbr-credit-query-btn {
    padding: 10px 20px;
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

#zbr-credit-query-btn:hover {
    background: #357abd;
}

/* 弹窗 */
.zbr-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.zbr-modal.active {
    display: block;
}

.zbr-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.zbr-modal-content {
    position: relative;
    max-width: 500px;
    margin: 100px auto;
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.zbr-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    transition: background 0.2s;
}

.zbr-modal-close:hover {
    background: #e0e0e0;
}

.zbr-modal h3 {
    margin: 0 0 20px;
    font-size: 20px;
    color: #333;
}

.zbr-modal input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 15px;
    box-sizing: border-box;
}

.zbr-modal button {
    padding: 10px 20px;
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

/* 信誉结果 */
.zbr-credit-result {
    margin-top: 20px;
}

.zbr-credit-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.zbr-credit-header .zbr-avatar {
    width: 64px;
    height: 64px;
}

.zbr-credit-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.zbr-credit-id {
    font-size: 13px;
    color: #999;
}

.zbr-credit-score {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 20px;
}

.zbr-score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.zbr-score-value {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.zbr-score-level {
    margin-bottom: 8px;
}

.zbr-score-desc {
    font-size: 14px;
    color: #666;
}

.zbr-credit-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
}

.zbr-credit-stat {
    text-align: center;
}

.zbr-credit-stat .zbr-stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.zbr-credit-stat .zbr-stat-label {
    font-size: 13px;
    color: #666;
}

.zbr-current-ban {
    padding: 15px;
    background: #fff3cd;
    border-radius: 8px;
    margin-bottom: 20px;
}

.zbr-ban-history h4 {
    margin: 0 0 12px;
    font-size: 15px;
    color: #333;
}

.zbr-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.zbr-history-list li {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.zbr-history-list li:last-child {
    border-bottom: none;
}

.zbr-history-time {
    color: #999;
}

/* 图表区域 */
.zbr-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.zbr-chart-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.zbr-chart-card h4 {
    margin: 0 0 15px;
    font-size: 16px;
    color: #333;
}

#zbr-trend-chart {
    height: 200px;
}

/* 原因词云 */
.zbr-reasons-cloud {
    line-height: 2;
}

.zbr-reason-tag {
    display: inline-block;
    margin: 4px;
    padding: 4px 12px;
    background: #f0f4f8;
    border-radius: 20px;
    color: #4a90d9;
    cursor: default;
    transition: background 0.2s;
}

.zbr-reason-tag:hover {
    background: #e0e7ef;
}

/* 加载状态 */
.zbr-loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.zbr-loading-text {
    color: #4a90d9;
}

.zbr-empty {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 16px;
}

.zbr-error {
    text-align: center;
    padding: 20px;
    color: #e74c3c;
    background: #fdf2f2;
    border-radius: 8px;
}

/* 规则卡片 */
.zbr-rules-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.zbr-rules-card h4 {
    margin: 0 0 15px;
    font-size: 18px;
    color: #333;
}

.zbr-rules-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.zbr-rules-list li {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.zbr-rules-list li:last-child {
    border-bottom: none;
}

.zbr-rule-icon {
    width: 32px;
    height: 32px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.zbr-rule-content {
    flex: 1;
}

.zbr-rule-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.zbr-rule-desc {
    font-size: 13px;
    color: #666;
}

/* 响应式 */
@media (max-width: 768px) {
    .zbr-container {
        padding: 15px;
    }
    
    .zbr-header {
        padding: 20px 15px;
    }
    
    .zbr-header h1 {
        font-size: 22px;
    }
    
    .zbr-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .zbr-filters {
        flex-direction: column;
    }
    
    .zbr-filter-item {
        width: 100%;
    }
    
    .zbr-filter-item input,
    .zbr-filter-item select {
        flex: 1;
    }
    
    .zbr-user-grid {
        grid-template-columns: 1fr;
    }
    
    .zbr-charts {
        grid-template-columns: 1fr;
    }
    
    .zbr-credit-score {
        flex-direction: column;
        text-align: center;
    }
    
    .zbr-credit-stats {
        justify-content: center;
    }
}
