/*  ============== 耗材表单弹窗样式 - TDesign 规范 ==================== */

/* 弹窗遮罩层 - 统一规范 */
.consumable-form-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease-out;
}

/* 弹窗容器 - 统一规范 */
.consumable-form-modal-container {
    width: 95%;
    max-width: 800px;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    max-height: 95vh;
    animation: slideUp 0.3s ease-out;
    border: 1px solid #f0f0f0;
}

/* 弹窗头部 - 统一规范 */
.consumable-form-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 10;
}

.consumable-form-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #1d2129;
    display: flex;
    align-items: center;
    line-height: 1.5;
    gap: 8px;
}

.consumable-form-modal-title i {
    color: #0052d9;
    font-size: 18px;
}

.consumable-form-modal-close {
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #86909c;
    transition: all 0.2s ease;
    font-size: 18px;
}

.consumable-form-modal-close:hover {
    background: #f5f7fa;
    color: #4e5969;
}

.consumable-form-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: #ffffff;
}

/* 耗材表单设计 - 统一前缀 */
.consumable-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.consumable-form-section {
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
    transition: all 0.2s ease;
}

.consumable-form-section:hover {
    border-color: #e7e7e7;
}

.consumable-form-section-title {
    background: #fafbfc;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #1d2129;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.consumable-form-section-title::before {
    content: "";
    width: 3px;
    height: 14px;
    background: #0052d9;
    border-radius: 2px;
}

.consumable-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 20px;
}

.consumable-form-item {
   
    flex-direction: column;
    gap: 8px;
}

.consumable-form-item.required .consumable-form-label::after {
    content: "*";
    color: #e34d59;
    margin-left: 4px;
    font-weight: 600;
}

.consumable-form-label {
    font-size: 14px;
    font-weight: 500;
    color: #1d2129;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.consumable-form-label i {
    color: #86909c;
    font-size: 14px;
}

.consumable-form-control {
    position: relative;
}

/* 表单容器样式 - 确保表单有正确的布局 */
.consumable-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 树形选择器相关样式补充 */
.consumable-form-tree-content {
    padding: 8px;
}

.consumable-form-tree-item {
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin: 2px 0;
    font-size: 14px;
}

.consumable-form-tree-item:hover {
    background: #f5f7fa;
}

.consumable-form-tree-item.selected {
    background: #ecf2fe;
    color: #0052d9;
}

.consumable-form-tree-group {
    margin-top: 8px;
}

.consumable-form-tree-header {
    padding: 6px 12px;
    font-size: 12px;
    color: #86909c;
    font-weight: 500;
}

.consumable-form-tree-children {
    margin-left: 12px;
}

.consumable-form-tree-search {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.consumable-form-tree-search-input {
    width: 100%;
    height: 32px;
    padding: 0 12px;
    border: 1px solid #c9cdd4;
    border-radius: 4px;
    font-size: 14px;
}

/* 限用范围下拉箭头样式 - 专门针对耗材表单弹窗的限用范围组件 */
.consumable-form-tree-select .dropdown-arrow {
    position: absolute;
    right: 12px;  /* 正确位置，距离右侧12px */
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #86909c;
    pointer-events: none;
    transition: color 0.2s ease;
}

.consumable-form-tree-select .consumable-form-tree-select-trigger:hover .dropdown-arrow {
    color: #0052d9;
}

.consumable-form-tree-select .consumable-form-tree-select-trigger:focus-within .dropdown-arrow {
    color: #0052d9;
}

.consumable-form-tree-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #c9cdd4;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
}

.consumable-form-tree-select {
    position: relative;
}

.consumable-form-tree-select-trigger {
    position: relative;
    cursor: pointer;
}

.consumable-form-tree-select-trigger .consumable-form-input {
    cursor: pointer;
    background: #ffffff;
}

.consumable-form-input {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #c9cdd4;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #ffffff;
    font-family: inherit;
    color: #1d2129;
}

.consumable-form-input:focus {
    outline: none;
    border-color: #0052d9;
    box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

.consumable-form-input.consumable-form-input-error {
    border-color: #e34d59;
    box-shadow: 0 0 0 2px rgba(227, 77, 89, 0.1);
}

.consumable-form-select {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #c9cdd4;
    border-radius: 4px;
    font-size: 14px;
    background: #ffffff;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6L8 10L12 6' stroke='%2386909c' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
    color: #1d2129;
}

.consumable-form-select:focus {
    outline: none;
    border-color: #0052d9;
    box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

.consumable-form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #c9cdd4;
    border-radius: 4px;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    line-height: 1.5;
    color: #1d2129;
}

.consumable-form-textarea:focus {
    outline: none;
    border-color: #0052d9;
    box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

.consumable-form-field-error {
    color: #e34d59;
    font-size: 12px;
    margin-top: 4px;
    font-weight: 400;
}

/* 表单底部按钮 - 耗材表单规范 */
.consumable-form-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
    background: #ffffff;
}

.consumable-form-btn {
    height: 32px;
    padding: 0 16px;
    border: 1px solid;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
    min-width: 80px;
}

.consumable-form-btn-default {
    background: #ffffff;
    border-color: #c9cdd4;
    color: #1d2129;
}

.consumable-form-btn-default:hover {
    background: #f5f7fa;
    border-color: #a6adb9;
}

.consumable-form-btn-primary {
    background: #0052d9;
    border-color: #0052d9;
    color: #ffffff;
}

.consumable-form-btn-primary:hover {
    background: #0046c4;
    border-color: #0046c4;
}

/* 确保所有表单元素都使用统一的样式类 */
.consumable-form-input,
.consumable-form-select,
.consumable-form-textarea {
    width: 100%;
    border: 1px solid #c9cdd4;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    color: #1d2129;
    background: #ffffff;
    transition: all 0.2s ease;
}

.consumable-form-input:focus,
.consumable-form-select:focus,
.consumable-form-textarea:focus {
    outline: none;
    border-color: #0052d9;
    box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

.consumable-form-input.consumable-form-input-error,
.consumable-form-select.consumable-form-input-error,
.consumable-form-textarea.consumable-form-input-error {
    border-color: #e34d59;
    box-shadow: 0 0 0 2px rgba(227, 77, 89, 0.1);
}

/* 树形选择器样式统一 */
.consumable-form-tree-select-trigger .consumable-form-input,
.consumable-form-tree-select-trigger input {
    cursor: pointer;
    background-color: #ffffff;
    transition: all 0.2s ease;
}

.consumable-form-tree-select-trigger .consumable-form-input:focus,
.consumable-form-tree-select-trigger input:focus {
    border-color: #0052d9;
    box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

.consumable-form-tree-select-trigger:hover .consumable-form-input,
.consumable-form-tree-select-trigger:hover input {
    background-color: #f0f4ff;
    border-color: #0052d9;
}

/* 增强表单验证状态 */
.consumable-form-input:focus {
    border-color: #0052d9 !important;
    box-shadow: 0 0 0 3px rgba(0, 82, 217, 0.1) !important;
}

.consumable-form-input.consumable-form-input-error:focus {
    border-color: #e34d59 !important;
    box-shadow: 0 0 0 3px rgba(227, 77, 89, 0.1) !important;
}

/* 必填字段标识增强 */
.consumable-form-item.required .consumable-form-label {
    font-weight: 600;
    color: #1d2129;
}

.consumable-form-item.required .consumable-form-label::after {
    content: "*";
    color: #e34d59;
    margin-left: 4px;
    font-weight: 600;
}



.consumable-form-item:hover .consumable-form-input:not(:focus):not(.consumable-form-input-error) {
    border-color: #a6adb9;
}

/* 只读字段样式优化 */
.consumable-form-input[readonly] {
    background-color: #f8f9fa;
    color: #86909c;
    cursor: not-allowed;
}

/* 树形选择器输入框特殊处理 - 即使可点击也不应显示为只读状态 */
.consumable-form-tree-select-trigger .consumable-form-input[readonly] {
    cursor: pointer;
    background-color: #ffffff;
    color: #1d2129;
}

.consumable-form-input[readonly]:focus {
    border-color: #c9cdd4;
    box-shadow: none;
}



/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .consumable-form-modal-container {
        width: 95vw;
        margin: 12px;
    }
    
    .consumable-form-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .consumable-form-modal-body {
        padding: 16px;
    }
    
    .consumable-form-modal-header,
    .consumable-form-modal-footer {
        padding: 12px 16px;
    }
}

@media (max-width: 768px) {
    .consumable-form-modal-container {
        width: 100vw;
        height: 100vh;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .consumable-form-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 10px;
    }
    
    .consumable-form-modal-body {
        padding: 10px;
    }
    
    .consumable-form-modal-header,
    .consumable-form-modal-footer {
        padding: 10px 12px;
    }
    
    .consumable-form-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* 单选按钮组样式 - TDesign 规范 */
.consumable-form-radio-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.consumable-form-radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.consumable-form-radio-label:hover {
    background: #f5f7fa;
}

.consumable-form-radio-label input[type="radio"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.consumable-form-radio-text {
    font-size: 14px;
    color: #1d2129;
    font-weight: 400;
}

/* 移动端单选按钮组适配 */
@media (max-width: 768px) {
    .consumable-form-radio-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .consumable-form-radio-label {
        width: 100%;
        justify-content: flex-start;
    }
}