/* ===== 全局重置与基础 ===== */
body {
    background: #f0f2f5;
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    color: #333;
}

.container-fluid {
    padding: 20px 30px;
}

/* ===== 头部 ===== */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 30px;
    border-radius: 16px;
    color: #fff;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.page-header h1 {
    font-weight: 300;
    font-size: 28px;
    margin: 0;
}
.page-header h1 i {
    margin-right: 12px;
}
.page-header .header-actions a {
    color: #fff;
    background: rgba(255,255,255,0.2);
    padding: 8px 18px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}
.page-header .header-actions a:hover {
    background: rgba(255,255,255,0.35);
}

/* ===== 卡片通用 ===== */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.15s, box-shadow 0.15s;
    background: #fff;
    margin-bottom: 24px;
}
.card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.card-header {
    background: transparent;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    font-size: 16px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.card-body {
    padding: 20px;
}

/* ===== 统计卡片（总访问量等） ===== */
.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: 0.2s;
    height: 100%;
}
.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.stat-card .stat-icon {
    font-size: 32px;
    color: #667eea;
    margin-bottom: 8px;
}
.stat-card .stat-number {
    font-size: 32px;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.2;
}
.stat-card .stat-label {
    color: #718096;
    font-size: 14px;
    font-weight: 500;
    margin-top: 6px;
}

/* ===== 站点列表（侧边栏） ===== */
.site-list .list-group-item {
    border: none;
    border-radius: 10px !important;
    margin-bottom: 4px;
    padding: 12px 16px;
    background: transparent;
    transition: background 0.15s;
}
.site-list .list-group-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}
.site-list .list-group-item.active a {
    color: #fff !important;
}
.site-list .list-group-item a {
    color: #2d3748;
    font-weight: 500;
    display: block;
    text-decoration: none;
}
.site-list .list-group-item .badge {
    background: #edf2f7;
    color: #2d3748;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
}
.site-list .list-group-item.active .badge {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

/* ===== 表格 ===== */
.table-container {
    max-height: 500px;
    overflow-y: auto;
}
.table {
    font-size: 14px;
    margin-bottom: 0;
}
.table th {
    background: #f7fafc;
    font-weight: 600;
    color: #4a5568;
    border-top: none;
    position: sticky;
    top: 0;
    z-index: 10;
}
.table td {
    vertical-align: middle;
}
.table a {
    color: #667eea;
    text-decoration: none;
}
.table a:hover {
    text-decoration: underline;
}

/* ===== 标签/关键词 ===== */
.keyword-tag {
    display: inline-block;
    background: #edf2f7;
    padding: 4px 14px;
    border-radius: 30px;
    font-size: 13px;
    margin: 3px 5px 3px 0;
    color: #2d3748;
    transition: background 0.15s;
}
.keyword-tag:hover {
    background: #e2e8f0;
}
.keyword-tag .count {
    background: #cbd5e0;
    border-radius: 30px;
    padding: 0 8px;
    margin-left: 6px;
    font-size: 11px;
    color: #2d3748;
}

/* ===== 在线状态 ===== */
.status-online {
    color: #38a169;
    font-weight: 600;

}
.status-online::before {
    content: "●";
    margin-right: 6px;
    font-size: 12px;
}
.status-offline {
    color: #718096;
}

/* ===== 表单控件 ===== */
.form-select-sm, .form-control-sm {
    border-radius: 30px;
    border: 1px solid #e2e8f0;
    background: #f7fafc;
    padding: 6px 16px;
}
.btn {
    border-radius: 30px;
    padding: 6px 20px;
    font-weight: 500;
    transition: 0.15s;
}
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}
.btn-success {
    background: #48bb78;
    border: none;
}
.btn-success:hover {
    background: #38a169;
    transform: translateY(-2px);
}
.btn-danger {
    background: #fc8181;
    border: none;
}
.btn-danger:hover {
    background: #f56565;
}
.btn-outline-primary {
    border-color: #667eea;
    color: #667eea;
}
.btn-outline-primary:hover {
    background: #667eea;
    color: #fff;
}

/* ===== 来源分布徽章 ===== */
.badge-dist {
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 30px;
    margin-right: 8px;
    background: #ebf4ff;
    color: #2b6cb0;
}

/* ===== 响应式微调 ===== */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}