/* 错误分析页面样式 - 提取自 errors.php */
.errors-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.errors-rank-table {
    width: 100%;
    border-collapse: collapse;
}
.errors-rank-table th,
.errors-rank-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}
@media (max-width: 768px) {
    .errors-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .errors-stats-grid .errors-stats-full {
        grid-column: span 2;
    }
    .errors-stats-grid .card {
        padding: 14px !important;
    }
    .errors-stats-grid .card > div:nth-child(2) {
        font-size: 22px !important;
    }

    /* 错误聚类卡片：移动端加宽，减少内外层 padding */
    body.page-errors .content {
        padding: 16px 10px !important;
    }
    body.page-errors .card {
        padding: 12px 10px !important;
    }
    body.page-errors .card-header {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 4px;
        padding-left: 2px !important;
        padding-right: 2px !important;
        margin-bottom: 14px !important;
    }
    body.page-errors .card-title {
        font-size: 16px;
        white-space: nowrap !important;
        flex-shrink: 0;
    }
    body.page-errors .card-header > div:nth-child(2) {
        width: 100%;
        white-space: normal;
        word-break: break-word;
        font-size: 11px;
        line-height: 1.4;
    }
    body.page-errors .cluster-card {
        padding: 12px 10px !important;
    }
    /* 错误类型排行表格：移动端改为卡片式 */
    .errors-rank-table thead {
        display: none;
    }
    .errors-rank-table tbody {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    .errors-rank-table tbody tr {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "rank name"
            "count devices"
            "time time";
        gap: 8px 12px;
        padding: 12px;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        background: #fafafa;
    }
    .errors-rank-table td {
        padding: 0;
        border-bottom: none;
        font-size: 13px;
    }
    .errors-rank-table td:nth-child(1) { grid-area: rank; }
    .errors-rank-table td:nth-child(2) { grid-area: name; font-weight: 600; }
    .errors-rank-table td:nth-child(3) { grid-area: count; }
    .errors-rank-table td:nth-child(4) { grid-area: devices; }
    .errors-rank-table td:nth-child(5) { grid-area: time; font-size: 11px; color: #888; }

    /* 错误列表卡片优化 */
    .errors-list-item {
        padding: 12px !important;
    }
    .errors-list-item > div:first-child {
        flex-direction: column !important;
        gap: 8px;
    }
    .errors-list-item > div:first-child > div:last-child {
        align-self: flex-end;
    }
    .errors-list-item .message {
        font-size: 13px !important;
    }
    .errors-list-item .device-info {
        flex-wrap: wrap;
        gap: 4px;
    }
}
