/* ==================== 设备异常监控专属样式 ==================== */
/* 此文件由 equipment.html 加载，补充 viewer.css 中未定义的样式 */

/* 门店编号标签 */
.store-id-tag {
    display: inline-block;
    padding: 1px 6px;
    background: #e9ecef;
    color: #6c757d;
    border-radius: 3px;
    font-size: 11px;
    font-weight: normal;
    vertical-align: middle;
    margin-left: 3px;
}

/* ==================== 历史查询按钮 ==================== */

.history-query-btn {
    padding: 10px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
}

.history-query-btn:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

/* ==================== 审计链接区域 ==================== */

.audit-links {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #ecf0f1;
    flex-wrap: wrap;
}

.audit-link-btn {
    padding: 7px 16px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #495057;
    transition: all 0.2s;
    font-weight: 500;
}

.audit-link-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

/* ==================== 审计表格 ==================== */

.audit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 4px;
}

.audit-table th,
.audit-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    vertical-align: middle;
}

.audit-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 12px;
    white-space: nowrap;
    border-bottom: 2px solid #dee2e6;
}

.audit-table tr:last-child td {
    border-bottom: none;
}

.audit-table tbody tr:hover td {
    background: #f8f9fa;
}

/* ==================== 历史查询弹窗内容 ==================== */

.history-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.history-search-bar .form-control {
    flex: 1;
}

/* 单个门店历史块 */
.history-store-block {
    margin-bottom: 16px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.history-store-block:last-child {
    margin-bottom: 0;
}

.history-store-header {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #f8f9fa 0%, #f1f3f5 100%);
    padding: 10px 14px;
    flex-wrap: wrap;
    border-bottom: 1px solid #e9ecef;
}

.history-store-name {
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
}

.history-store-meta {
    font-size: 12px;
    color: #868e96;
    flex: 1;
}

.history-count-badge {
    font-size: 12px;
    font-weight: 700;
    margin-left: auto;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(0,0,0,0.05);
}

/* 无记录行 */
.history-empty-row {
    padding: 12px 14px;
    font-size: 13px;
    color: #28a745;
    background: #f8fff9;
}

/* 空状态提示 */
.history-empty {
    text-align: center;
    padding: 24px 20px;
    color: #adb5bd;
    font-size: 14px;
}

/* 历史记录表格 */
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.history-table th,
.history-table td {
    padding: 8px 14px;
    border-top: 1px solid #f0f0f0;
    text-align: left;
    vertical-align: top;
}

.history-table th {
    background: #fafafa;
    font-weight: 600;
    color: #6c757d;
    font-size: 12px;
    border-top: none;
    border-bottom: 1px solid #e9ecef;
}

.history-table tbody tr:hover td {
    background: #fafbfc;
}

/* 时间段徽章 */
.history-time-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.history-time-badge.am {
    background: #fff8e1;
    color: #f57f17;
    border: 1px solid #ffe082;
}

.history-time-badge.pm {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

/* 处理情况 */
.history-unhandled {
    color: #adb5bd;
    font-size: 12px;
    font-style: italic;
}

.history-action {
    display: block;
    font-size: 12px;
    margin-bottom: 3px;
    padding: 2px 0;
    line-height: 1.4;
}

.history-action:last-child {
    margin-bottom: 0;
}

.history-action.recovered {
    color: #28a745;
}

.history-action.not-recovered {
    color: #dc3545;
}

/* ==================== 移动端适配 ==================== */

@media (max-width: 768px) {
    .audit-links {
        gap: 8px;
        margin-top: 10px;
        padding-top: 10px;
    }

    .audit-link-btn {
        flex: 1;
        text-align: center;
        padding: 8px 10px;
        font-size: 12px;
    }

    .history-store-header {
        padding: 8px 12px;
        gap: 6px;
    }

    .history-store-name {
        font-size: 13px;
    }

    .history-store-meta {
        font-size: 11px;
        width: 100%;
        flex: none;
    }

    .history-count-badge {
        margin-left: 0;
        font-size: 11px;
    }

    .history-table th,
    .history-table td {
        padding: 7px 10px;
        font-size: 12px;
    }

    .audit-table th,
    .audit-table td {
        padding: 7px 10px;
        font-size: 12px;
    }

    .history-query-btn {
        width: 100%;
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* ==================== 卡片内历史记录展开面板 ==================== */

/* 历史按钮（卡片内） */
.btn-history-inline {
    padding: 5px 12px;
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    color: #495057;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
    align-self: flex-start;
}

.btn-history-inline:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-history-inline.active {
    background: #e3f2fd;
    border-color: #90caf9;
    color: #1565c0;
}

.btn-history-inline:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 展开面板容器 */
/* 卡片模式：横跨整行 */
.store-card-horizontal .store-history-panel {
    width: 100%;
    flex: 0 0 100%;
    order: 99;
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
    margin-top: 4px;
}

/* 列表模式：正常块级 */
.store-list-item .store-history-panel {
    margin-top: 8px;
    border-top: 1px solid #f0f0f0;
    padding-top: 8px;
}

.history-inline-loading {
    padding: 10px 0;
    font-size: 13px;
    color: #adb5bd;
    text-align: center;
}

.history-inline-empty {
    padding: 8px 0;
    font-size: 13px;
    color: #28a745;
}

.history-inline-header {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 6px;
}

@media (max-width: 768px) {
    .btn-history-inline {
        width: 100%;
        text-align: center;
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* 警告单导出按钮 */
.export-btn-warning {
    background: #e67e22 !important;
}

.export-btn-warning:hover {
    background: #d35400 !important;
}
