/* 设备大类管理页面样式 */

/* 模态框显示 */
.modal.show {
    display: flex !important;
}

/* 模态框内容滚动 */
.modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.modal-footer {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    background: white;
    z-index: 10;
}

.modal-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.categories-container {
    padding: 20px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.category-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.category-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.category-card.inactive {
    opacity: 0.7;
    background: #f5f5f5;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.category-title {
    flex: 1;
}

.category-title h3 {
    margin: 0 0 5px 0;
    font-size: 20px;
    color: #333;
}

.category-code {
    display: inline-block;
    padding: 2px 8px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.category-badges {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-secondary {
    background: #e2e3e5;
    color: #383d41;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.category-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #1976d2;
}

.category-info {
    margin: 15px 0;
}

.info-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: #666;
    width: 100px;
    flex-shrink: 0;
}

.info-value {
    color: #333;
    flex: 1;
}

.category-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.category-actions .btn {
    flex: 1;
}

/* 详情模态框 */
.detail-section {
    margin-bottom: 15px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.detail-section h3 {
    margin: 0 0 8px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #1976d2;
    color: #1976d2;
    font-size: 15px;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.detail-table td {
    padding: 6px 0;
    font-size: 13px;
}

.detail-table td.label {
    width: 120px;
    font-weight: 500;
    color: #666;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.stat-card {
    background: #f8f9fa;
    padding: 12px 10px;
    border-radius: 8px;
    text-align: center;
}

.stat-card .stat-label {
    font-size: 11px;
    color: #666;
    margin-bottom: 5px;
    white-space: nowrap;
}

.stat-value-large {
    font-size: 22px;
    font-weight: bold;
    color: #1976d2;
    margin-top: 3px;
}

.keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-tag {
    display: inline-block;
    padding: 5px 10px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 4px;
    font-size: 13px;
}

.code-block {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 4px;
    border-left: 4px solid #1976d2;
    overflow-x: auto;
    max-height: 250px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group .required {
    color: #f44336;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.input, .textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.input:focus, .textarea:focus {
    outline: none;
    border-color: #1976d2;
}

.input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
}

.textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label span {
    font-weight: 500;
}

/* 模态框大小 */
.modal-large .modal-content {
    max-width: 1000px;
    width: 95%;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 20px;
}

/* 文本样式 */
.text-muted {
    color: #999;
    font-style: italic;
}

/* 徽章样式 */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #4caf50;
    color: white;
}

.badge-secondary {
    background: #9e9e9e;
    color: white;
}

.badge-info {
    background: #2196f3;
    color: white;
}

/* 警告提示 */
.alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* 响应式 */
@media (max-width: 1024px) {
    .modal-large .modal-content {
        max-width: 95%;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: 1fr;
    }

    .category-stats {
        grid-template-columns: repeat(3, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-large .modal-content {
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .category-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .category-actions {
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

