.materials-host{background:#fff;min-height:calc(100vh - 68px)}
.materials-library{--ml-blue:#2563eb;--ml-text:#0f172a;--ml-sub:#334155;--ml-muted:#64748b;max-width:1520px;margin:0 auto;color:var(--ml-text);background:#fff;font-family:Inter,"PingFang SC","Microsoft YaHei",sans-serif;padding:8px 12px 36px;box-sizing:border-box}
.materials-library *{box-sizing:border-box}.materials-library button,.materials-library input,.materials-library select,.materials-library textarea{font:inherit}.materials-library svg{width:18px;height:18px;flex-shrink:0}.materials-library button{cursor:pointer}.materials-library button:disabled{cursor:not-allowed;opacity:.5}.materials-library button:focus-visible,.materials-library a:focus-visible{outline:2px solid #2563eb;outline-offset:2px}

.ml-button,.materials-library a.ml-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:38px;padding:7px 14px;background:#fff;border:1px solid #d5dde8;border-radius:8px;color:#1e293b;text-decoration:none;font-size:13px;font-weight:500;white-space:nowrap;transition:background .15s,border-color .15s}
.ml-button:hover{background:#f8fafc;border-color:#94a3b8}
.ml-button--primary{background:var(--ml-blue)!important;border-color:var(--ml-blue)!important;color:#fff!important}
.ml-button--primary:hover{background:#1d4ed8!important;border-color:#1d4ed8!important}
.ml-button--success{background:#059669!important;border-color:#059669!important;color:#fff!important}
.ml-button--danger{background:#fff!important;border-color:#fca5a5!important;color:#b91c1c!important}
.ml-icon-button{border:1px solid transparent;width:36px;height:36px;background:#fff;display:inline-flex;align-items:center;justify-content:center;color:#475569;border-radius:8px}
.ml-icon-button:hover{background:#eff6ff;color:#1d4ed8}

.ml-header-bar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:0 0 14px;border-bottom:1px solid #e2e8f0;margin-bottom:14px}
.ml-hospital-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.ml-hospital-select{height:38px;border:1px solid #cbd5e1;background:#fff;border-radius:8px;padding:0 12px;font-size:13px;font-weight:600;color:#0f172a;min-width:160px}
.ml-node-badge{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:500;background:#ecfdf5;color:#047857;border:1px solid #a7f3d0}
.ml-node-badge i{width:7px;height:7px;border-radius:50%;background:#10b981;display:inline-block}
.ml-node-badge--local{background:#eff6ff;color:#1d4ed8;border-color:#bfdbfe}
.ml-node-badge--local i{background:#2563eb}

.ml-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:0 0 14px}
.ml-search{display:flex;align-items:center;gap:8px;flex:1;max-width:460px;min-width:180px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;padding:0 12px;height:38px}
.ml-search svg{width:16px;color:#64748b}
.ml-search input{width:100%;height:36px;border:0!important;outline:none!important;box-shadow:none!important;background:#fff;font-size:13px;color:#0f172a;min-width:0}
.ml-search input::placeholder{color:#94a3b8}
.ml-search:focus-within{border-color:#2563eb;box-shadow:0 0 0 3px #2563eb18}
.ml-toolbar select{margin:0;height:38px;border:1px solid #cbd5e1;background:#fff;border-radius:8px;padding:0 10px;font-size:12.5px;color:#1e293b}
.ml-toolbar-actions{display:flex;align-items:center;gap:8px;margin-left:auto}

.ml-status-tabs{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-bottom:12px}
.ml-status-tab{border:1px solid #e2e8f0;background:#fff;color:#334155;border-radius:8px;padding:6px 12px;font-size:12.5px;font-weight:500;display:inline-flex;align-items:center;gap:6px}
.ml-status-tab:hover{border-color:#94a3b8}
.ml-status-tab.is-active{background:#eff6ff;border-color:#2563eb;color:#1d4ed8;font-weight:600}
.ml-status-tab b{font-size:11px;padding:1px 6px;border-radius:999px;background:#f1f5f9;color:#475569}
.ml-status-tab--pending b{background:#fef3c7;color:#b45309}
.ml-status-tab.is-active b{background:#dbeafe;color:#1d4ed8}

.ml-filters{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid #e2e8f0;margin-bottom:18px;padding-bottom:10px;flex-wrap:wrap}
.ml-filter-kinds,.ml-filter-utility{display:flex;align-items:center;gap:4px;flex-wrap:wrap}
.ml-category{border:0;background:#fff;display:flex;align-items:center;gap:6px;min-height:34px;padding:6px 10px;border-radius:7px;color:#475569;font-size:12.5px;white-space:nowrap}
.ml-category b{font-size:11px;font-weight:600;color:#64748b}
.ml-category:hover{background:#f8fafc;color:#0f172a}
.ml-category.is-active{color:#1d4ed8;background:#eff6ff;font-weight:600}

.ml-grid,.ml-skeletons{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}
.ml-card{border:1px solid #dce3ee;background:#fff;border-radius:10px;overflow:hidden;transition:box-shadow .16s,border-color .16s;min-width:0;display:flex;flex-direction:column}
.ml-card:hover{box-shadow:0 6px 18px #0f172a12;border-color:#93c5fd}
.ml-card-open{border:0;padding:0;background:#fff;display:flex;flex-direction:column;width:100%;height:100%;text-align:left;color:inherit}
.ml-card-preview{position:relative;width:100%;aspect-ratio:4/3;background:#fff;overflow:hidden;border-bottom:1px solid #eef2f7;display:flex;align-items:center;justify-content:center}
.ml-card-preview>img,.ml-card-preview>video{width:100%;height:100%;object-fit:cover;display:block}
.ml-badges-top{position:absolute;left:8px;right:8px;top:8px;display:flex;justify-content:space-between;gap:6px;pointer-events:none}
.ml-pill{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:6px;font-size:11px;font-weight:600;background:#fffffff2;color:#1e293b;border:1px solid #e2e8f0}
.ml-pill--hospital{background:#ecfdf5f5;color:#047857;border-color:#a7f3d0}
.ml-pill--agency{background:#eff6fff5;color:#1d4ed8;border-color:#bfdbfe}
.ml-pill--pending{background:#fffbebf5;color:#b45309;border-color:#fde68a}
.ml-pill--rejected{background:#fef2f2f5;color:#b91c1c;border-color:#fecaca}
.ml-spec-badge{position:absolute;right:8px;bottom:8px;background:#0f172acc;color:#fff;font-size:10.5px;padding:2px 7px;border-radius:5px;font-weight:500}
.ml-play{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:42px;height:42px;border-radius:50%;display:grid;place-items:center;color:#fff;background:#0f172a99;border:1.5px solid #fff}

.ml-card-info{padding:10px 12px 11px;display:flex;flex-direction:column;gap:6px;flex:1;background:#fff}
.ml-card-caption{font-size:12.5px;line-height:1.55;color:#1e293b;margin:0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;min-height:38px}
.ml-card-caption--muted{color:#64748b;font-style:italic}
.ml-card-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:11px;color:#64748b;padding-top:6px;border-top:1px solid #f1f5f9;margin-top:auto}
.ml-usage-chip{color:#1d4ed8;background:#eff6ff;padding:1px 7px;border-radius:999px;font-weight:600;font-size:11px}

.ml-file-art{width:100%;height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:6px;background:#fff;color:#475569}
.ml-file-art>svg{width:42px;height:42px;stroke-width:1.3;color:#2563eb}
.ml-file-art>span{font-size:11px;font-weight:600;color:#334155}

.ml-usages-table-wrap{border:1px solid #e2e8f0;border-radius:10px;overflow:auto;background:#fff}
.ml-usages-table{width:100%;border-collapse:collapse;background:#fff;font-size:13px}
.ml-usages-table th{text-align:left;padding:11px 14px;border-bottom:1px solid #e2e8f0;color:#334155;font-weight:600;background:#fff;white-space:nowrap}
.ml-usages-table td{padding:11px 14px;border-bottom:1px solid #f1f5f9;color:#0f172a;vertical-align:middle}
.ml-usages-table tr:last-child td{border-bottom:0}
.ml-usage-thumb{width:44px;height:34px;object-fit:cover;border-radius:5px;border:1px solid #e2e8f0;vertical-align:middle;margin-right:8px}
.ml-pos-tag{display:inline-block;padding:2px 8px;border-radius:6px;background:#eff6ff;color:#1d4ed8;font-size:12px;font-weight:500}

.ml-pagination{display:flex;justify-content:space-between;align-items:center;padding:22px 0 6px;font-size:12px;color:#475569}
.ml-pagination>div{display:flex;align-items:center;gap:10px}
.ml-empty{min-height:280px;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;border:1px dashed #cbd5e1;border-radius:12px;background:#fff;padding:32px}
.ml-empty-icon{display:grid;place-items:center;width:64px;height:64px;border:1px solid #dbeafe;background:#eff6ff;border-radius:18px;color:#2563eb;margin-bottom:14px}
.ml-empty h3{font-size:16px;font-weight:600;color:#0f172a;margin:4px 0 8px}
.ml-empty p{font-size:13px;color:#475569;line-height:1.7;margin:0 0 18px;max-width:400px}
.ml-notice{background:#eff6ff;color:#1e40af;border:1px solid #bfdbfe;padding:10px 14px;font-size:13px;border-radius:8px;margin-bottom:14px}
.ml-notice[hidden]{display:none}

.ml-skeleton{height:240px;background:#fff;border:1px solid #e2e8f0;border-radius:10px;overflow:hidden}
.ml-skeleton div{aspect-ratio:4/3;background:#f8fafc}
.ml-skeleton span{display:block;margin:12px 12px 0;width:70%;height:11px;background:#f1f5f9;border-radius:4px}

.ml-overlay{position:fixed;inset:0;z-index:1500;background:#0f172a40;display:flex;align-items:center;justify-content:center;padding:24px}
.ml-dialog{background:#fff;border-radius:14px;max-width:920px;width:100%;max-height:calc(100vh - 48px);overflow:auto;border:1px solid #e2e8f0;box-shadow:0 20px 60px #0f172a28}
.ml-dialog-header{display:flex;justify-content:space-between;align-items:flex-start;padding:20px 24px 16px;border-bottom:1px solid #e2e8f0;gap:16px;background:#fff}
.ml-dialog-header h2{font-size:18px;font-weight:600;color:#0f172a;margin:0 0 4px}
.ml-dialog-header p{margin:0;color:#475569;font-size:12.5px}
.ml-upload-body{display:grid;grid-template-columns:310px 1fr;min-height:440px;background:#fff}
.ml-upload-left{background:#fff;border-right:1px solid #e2e8f0;padding:20px;min-width:0}
.ml-drop{display:flex;align-items:center;justify-content:center;flex-direction:column;border:1.5px dashed #93c5fd;border-radius:10px;background:#fff;padding:20px 12px;text-align:center;cursor:pointer;color:#1d4ed8;position:relative}
.ml-drop.is-over{border-color:#2563eb;background:#eff6ff}
.ml-drop strong{font-size:13px;font-weight:600;color:#0f172a;margin-top:8px}
.ml-drop span{font-size:12px;margin:4px 0 6px;color:#475569}
.ml-drop small{font-size:11px;color:#64748b;line-height:1.6}
.ml-drop input{position:absolute;width:1px;height:1px;opacity:0}
.ml-upload-list{margin-top:14px;display:grid;gap:6px;max-height:260px;overflow:auto}
.ml-upload-row{padding:9px 10px;border:1px solid #e2e8f0;display:flex;align-items:center;gap:10px;background:#fff;border-radius:8px;text-align:left;min-width:0;color:#1e293b}
.ml-upload-row>span{font-size:11px;font-weight:600;color:#64748b}
.ml-upload-row>div{flex:1;min-width:0}
.ml-upload-row strong{display:block;font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ml-upload-row small{display:block;color:#64748b;font-size:11px;margin-top:3px}
.ml-upload-row.is-selected{border-color:#2563eb;background:#eff6ff}
.ml-upload-editor{padding:20px 24px;min-width:0;background:#fff}
.ml-upload-placeholder{height:100%;display:flex;align-items:center;justify-content:center;flex-direction:column;color:#64748b;text-align:center}
.ml-upload-preview{height:170px;margin:0 0 16px;border:1px solid #e2e8f0;border-radius:8px;overflow:hidden;background:#fff;display:flex;align-items:center;justify-content:center}
.ml-upload-preview>img,.ml-upload-preview>video{max-width:100%;max-height:100%;object-fit:contain}

.ml-file-form label,.ml-detail-form label,.ml-link-form label,.ml-usage-form label{display:flex;flex-direction:column;gap:6px;font-size:12.5px;font-weight:600;color:#1e293b;margin-bottom:14px}
.ml-file-form label>span,.ml-detail-form label>span{font-size:11px;font-weight:400;color:#64748b}
.ml-file-form input,.ml-file-form textarea,.ml-file-form select,.ml-detail-form input,.ml-detail-form textarea,.ml-detail-form select,.ml-link-form input,.ml-link-form textarea,.ml-link-form select,.ml-usage-form input,.ml-usage-form select{font-size:13px;font-weight:400;color:#0f172a;line-height:1.6;border:1px solid #cbd5e1;border-radius:8px;padding:8px 11px;width:100%;background:#fff;outline:none}
.ml-file-form input:focus,.ml-file-form textarea:focus,.ml-detail-form input:focus,.ml-detail-form textarea:focus,.ml-usage-form input:focus{border-color:#2563eb;box-shadow:0 0 0 3px #2563eb18}
.ml-dialog-footer{border-top:1px solid #e2e8f0;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 24px;color:#475569;font-size:12px;background:#fff}
.ml-dialog-footer>div{display:flex;gap:8px;align-items:center}

.ml-overlay--drawer{justify-content:flex-end;padding:0;background:#0f172a26}
.ml-drawer{width:580px;max-width:96vw;background:#fff;height:100%;overflow:auto;border-left:1px solid #e2e8f0;box-shadow:-16px 0 48px #0f172a1c}
.ml-detail-preview{height:290px;background:#fff;overflow:hidden;display:flex;align-items:center;justify-content:center;border-bottom:1px solid #e2e8f0}
.ml-detail-preview>img,.ml-detail-preview>video{max-width:100%;max-height:100%;object-fit:contain}
.ml-detail-preview>iframe{width:100%;height:100%;border:0}
.ml-detail-content{padding:18px 24px 32px;background:#fff}

.ml-review-box{border:1px solid #fde68a;background:#fffbeb;border-radius:10px;padding:14px 16px;margin-bottom:16px}
.ml-review-box--rejected{border-color:#fecaca;background:#fef2f2}
.ml-review-box strong{display:block;font-size:13px;color:#92400e;margin-bottom:6px}
.ml-review-box--rejected strong{color:#991b1b}
.ml-review-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:10px}
.ml-review-actions input{flex:1;min-width:180px;height:36px;border:1px solid #cbd5e1;border-radius:7px;padding:0 10px;font-size:12.5px;background:#fff}

.ml-ai-box{border:1px solid #dbeafe;background:#fff;border-radius:10px;padding:13px 15px;margin-bottom:16px}
.ml-ai-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:8px}
.ml-ai-head strong{font-size:12.5px;color:#1d4ed8}
.ml-ai-box p{margin:0;font-size:13px;line-height:1.7;color:#0f172a;white-space:pre-wrap}
.ml-ai-ocr{margin-top:8px;padding-top:8px;border-top:1px dashed #e2e8f0;font-size:12px;color:#334155}

.ml-usage-section{margin-top:22px;padding-top:18px;border-top:1px solid #e2e8f0}
.ml-usage-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.ml-usage-head h3{margin:0;font-size:14px;font-weight:600;color:#0f172a}
.ml-usage-list{display:grid;gap:8px}
.ml-usage-item{border:1px solid #e2e8f0;border-radius:8px;padding:10px 12px;background:#fff;font-size:12.5px}
.ml-usage-item-top{display:flex;justify-content:space-between;gap:8px;align-items:center;margin-bottom:4px}
.ml-usage-item a{color:#2563eb;font-weight:600;text-decoration:none;word-break:break-all}
.ml-usage-item a:hover{text-decoration:underline}
.ml-usage-form{border:1px solid #cbd5e1;border-radius:10px;padding:14px;margin-bottom:12px;background:#fff}
.ml-form-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}

.ml-inline-error{font-size:12px;color:#b91c1c;margin:8px 0}
.ml-detail-actions{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0}
.ml-detail-bottom{margin-top:20px;padding-top:16px;border-top:1px solid #e2e8f0;display:flex;align-items:center;justify-content:space-between}
.ml-text-button{border:0;background:#fff;color:#475569;font-size:12px;padding:6px 8px}
.ml-text-button:hover{color:#1d4ed8}

@media(max-width:1100px){.ml-grid,.ml-skeletons{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:800px){.ml-grid,.ml-skeletons{grid-template-columns:repeat(2,minmax(0,1fr))}.ml-upload-body{grid-template-columns:1fr}.ml-upload-left{border-right:0;border-bottom:1px solid #e2e8f0}}
@media(max-width:480px){.ml-grid,.ml-skeletons{grid-template-columns:1fr}}
