#view-material-library .ml-panel { min-height: 650px; }
.ml-panel .panel-head { align-items: center; }
.ml-tabs { margin: 20px 0; }
.ml-toolbar,.ml-rule-scope,.ml-inline,.ml-dialog-actions { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.ml-toolbar { margin-bottom:18px; }
.ml-toolbar input { min-width:280px; flex:1; }
.ml-toolbar select { min-width:145px; }
.ml-toolbar .muted { margin-left:auto; }
.ml-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:16px; }
.ml-card { overflow:hidden; border:1px solid #dfe8e5; border-radius:12px; background:#fff; }
.ml-thumb { height:150px; display:grid; place-items:center; background:#eef4f1; }
.ml-thumb img,.ml-thumb video { width:100%; height:100%; object-fit:cover; }
.ml-card-content { padding:14px; }
.ml-card-title,.ml-card-bottom { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.ml-card-title strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ml-card-title span { flex:none; color:#0b766e; font-size:12px; }
.ml-card-content p { min-height:40px; margin:8px 0; color:#65736e; font-size:13px; overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.ml-card-content small,.ml-card-bottom span { color:#77847e; }
.ml-card-bottom { margin-top:12px; border-top:1px solid #edf1ef; padding-top:10px; }
.ml-rule-scope { margin-bottom:20px; }
.ml-rule-scope label,.ml-rule-form label,.ml-dialog label { display:grid; gap:7px; color:#43544e; font-weight:600; }
.ml-rule-scope select { min-width:240px; }
.ml-rule-form { max-width:740px; display:grid; gap:18px; padding:22px; border:1px solid #dfe8e5; border-radius:12px; }
.ml-rule-intro { display:grid; gap:5px; }
.ml-rule-intro span { color:#65736e; font-size:13px; }
.ml-rule-filters { display:grid; gap:12px; }
.ml-checks { display:flex; flex-wrap:wrap; gap:14px; }
.ml-checks label { display:flex; align-items:center; gap:5px; font-weight:400; }
.ml-rule-form input:not([type=checkbox]),.ml-rule-form select,.ml-dialog input:not([type=checkbox]),.ml-dialog select,.ml-dialog textarea { width:100%; }
.ml-organize { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
.ml-organize .panel { padding:20px; }
.ml-inline input { flex:1; min-width:160px; }
.ml-list { margin-top:15px; display:grid; gap:8px; }
.ml-list > div { display:flex; justify-content:space-between; gap:12px; padding:9px; border-bottom:1px solid #edf1ef; }
.ml-list small { color:#77847e; }
.ml-tag-list { display:flex; flex-wrap:wrap; gap:8px; margin-top:15px; }
.ml-tag-list span { padding:5px 10px; border-radius:18px; background:#eef6f3; color:#126f64; }
.ml-overlay { position:fixed; inset:0; z-index:3000; background:rgba(12,29,23,.46); display:grid; place-items:center; padding:20px; }
.ml-dialog { width:min(620px,100%); max-height:90vh; overflow:auto; display:grid; gap:15px; padding:24px; border-radius:14px; background:#fff; box-shadow:0 16px 50px #15251d35; }
.ml-dialog-head { display:flex; align-items:center; justify-content:space-between; }
.ml-dialog-head h2 { margin:0; }
.ml-dialog-actions { justify-content:flex-end; border-top:1px solid #edf1ef; padding-top:15px; }
.content-topic-material-preview { margin:12px 0; padding:10px 12px; background:#eef6f3; border:1px solid #d3e8df; border-radius:8px; color:#35685c; font-size:13px; }
@media(max-width:900px){.ml-organize{grid-template-columns:1fr}.ml-toolbar input{min-width:180px}}

/* Match the existing content-planning form controls. */
#view-material-library input:not([type="checkbox"]),
#view-material-library select,
.ml-dialog input:not([type="checkbox"]),
.ml-dialog select,
.ml-dialog textarea {
  min-height:40px;
  min-width:0;
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:8px;
  background:#fff;
  color:var(--ink);
  font:inherit;
  outline:none;
  box-shadow:inset 0 1px 0 rgba(23,32,28,.03);
}
#view-material-library input:not([type="checkbox"]):focus,
#view-material-library select:focus,
.ml-dialog input:not([type="checkbox"]):focus,
.ml-dialog select:focus,
.ml-dialog textarea:focus {
  border-color:var(--teal);
  box-shadow:0 0 0 3px rgba(11,122,117,.12);
}
.ml-dialog textarea { resize:vertical; }
.ml-sync-line { color:var(--muted, #65736e); font-size:13px; }

/* 取材规则：规则列表与规则编辑器 */
.ml-rules { display:grid; gap:12px; margin-top:14px; }
.ml-rule-card { padding:16px; border:1px solid #dfe8e5; border-radius:12px; background:#fff; }
.ml-rule-card.is-default { border-style:dashed; background:#fbfdfc; }
.ml-rule-card.is-off { background:#fafbfb; border-style:dashed; }
.ml-rule-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.ml-rule-head strong { font-size:15px; font-weight:600; }
.ml-rule-actions { margin-left:auto; display:flex; gap:6px; flex-wrap:wrap; }
.ml-badge { padding:2px 10px; border-radius:14px; background:#eef6f3; color:#126f64; font-size:12px; }
.ml-badge.warn { background:#fdf4e3; color:#8a6d1f; }
.ml-badge.off { background:#eef1ef; color:#77847e; }
.ml-rule-meta { display:flex; gap:8px 18px; flex-wrap:wrap; margin-top:10px; color:#4c5b56; font-size:13px; }
.ml-rule-meta .sep { color:#cbd6d2; }
.ml-rule-members { display:flex; gap:6px; flex-wrap:wrap; margin-top:10px; }
.ml-rule-members span { padding:3px 9px; border:1px solid #dfe8e5; border-radius:14px; color:#4c5b56; font-size:12px; }
.ml-rule-members span.more { border-style:dashed; color:#77847e; }
.ml-rule-confirm { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:10px; padding:10px 12px;
  border:1px solid #f3c7c2; border-radius:8px; background:#fdecea; color:#a13a2f; font-size:13px; }
.ml-rule-confirm .danger-btn, .ml-rule-confirm .secondary-btn { flex:none; }
.ml-rule-section { display:grid; gap:10px; padding:14px; border:1px solid #dfe8e5; border-radius:10px; }
.ml-rule-section h3 { margin:0; font-size:14px; font-weight:600; }
.ml-rule-strong { font-size:13px; color:#43544e; }
.ml-rule-section > div > .muted { margin:4px 0 0; }
.ml-rule-error { padding:9px 12px; border:1px solid #f3c7c2; border-radius:8px; background:#fdecea; color:#a13a2f; font-size:13px; }
.ml-acc-tools { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.ml-acc-tools input { flex:1; min-width:170px; }
.ml-acc-tools-end { flex:1; }
.ml-acc-plat-opt { display:flex; align-items:center; gap:5px; font-size:13px; font-weight:400; color:#43544e; }
.ml-acc-count { color:#77847e; font-size:13px; }
.ml-acc-list { border:1px solid #dfe8e5; border-radius:10px; max-height:260px; overflow:auto; }
.ml-acc-row { display:flex; align-items:center; gap:10px; padding:9px 12px; border-bottom:1px solid #edf1ef; font-size:13px; font-weight:400; }
.ml-acc-row:last-child { border-bottom:none; }
.ml-acc-row.is-taken { background:#fbfcfb; color:#8b968f; }
.ml-acc-who { flex:1; }
.ml-acc-plat { color:#77847e; font-size:12px; }
.ml-dialog.wide { width:min(780px,100%); }
@media(max-width:900px){
  .ml-rule-actions{margin-left:0}
  .ml-acc-tools-end{display:none}
}

/* The existing modal button display rules must respect step visibility. */
#contentTopicSubmitModal [hidden] { display:none !important; }

.ml-task-picker { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.ml-task-picker p { margin: 8px 0; overflow-wrap: anywhere; }
.ml-task-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ml-task-picker summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
.ml-task-enable { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.ml-task-collections { display: grid; gap: 6px; max-height: 240px; overflow: auto; }
.ml-task-collections label { display: flex; gap: 8px; align-items: flex-start; padding: 8px; border: 1px solid var(--line); border-radius: 6px; }
.ml-task-collections small { display: block; margin-top: 4px; }
.ml-task-tags { display: grid; gap: 6px; margin-top: 12px; }
.ml-task-tags input { width: 100%; }
.ml-task-warning { color: #a15c00; }
.ml-task-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
