/* 附件上传插件 */
.attachment-block{
  margin:20px 0 0;padding:15px;
  border:1px solid var(--line,#e6eef0);border-radius:14px;background:transparent;box-shadow:none;
}
.attachment-head{display:flex;align-items:center;gap:8px;margin-bottom:12px}
.attachment-head i{font-size:18px;color:var(--accent,#246384)}
.attachment-head strong{font-size:15px;font-weight:750}
.attachment-head span{margin-left:auto;font-size:12px;color:var(--muted,#6b7785)}
.attachment-list{display:flex;flex-direction:column;gap:10px}
.attachment-item{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  gap:12px;
  align-items:center;
  padding:15px 14px;
  border-radius:14px;
  background:var(--chip,#f4f7f8);
  border:0;
}
.attachment-item-icon{
  grid-column:1;
  align-self:stretch;
  width:auto;
  height:100%;
  min-width:50px;
  min-height:50px;
  aspect-ratio:1;
  border-radius:12px;
  display:grid;
  place-items:center;
  background:#fff;
  border:1px solid var(--line,#e6eef0);
  flex:0 0 auto;
  font-size:22px;
  color:#246384;
  box-sizing:border-box;
}
.attachment-item-main{grid-column:2;min-width:0}
.attachment-item-main strong{display:block;font-size:16px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.attachment-item-main span,.attachment-item-hint{display:block;margin-top:5px;font-size:12px;color:var(--muted,#6b7785);line-height:1.45}
.attachment-item-actions{grid-column:3;display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.attachment-item-actions .btn{white-space:nowrap}
.attachment-item.is-locked .attachment-item-main strong{opacity:.9}

.attachment-editor{
  margin:0;
  background:transparent;
  padding:16px;
  border:1px solid var(--line, var(--lyear-field-border, #e6eef0));
  border-radius:14px;
}
.attachment-editor.is-admin{
  margin:0 0 16px;padding:16px;
  border:1px solid var(--lyear-field-border, #e5e7eb);
  border-radius:8px;
  background:var(--lyear-field-bg, transparent);
}
.attachment-editor.is-admin .attachment-editor-title{color:inherit}
.attachment-editor.is-admin .attachment-editor-title i{color:inherit;opacity:.85}
.attachment-editor.is-admin .attachment-editor-tip{color:var(--lyear-muted, #6b7785)}
.attachment-editor.is-admin .attachment-ed-row,
.attachment-editor.is-admin .attachment-editor-empty{
  background:var(--lyear-field-bg, rgba(0,0,0,.03));
  border:1px solid var(--lyear-field-border, #e5e7eb);
}
.attachment-editor-head{display:flex;flex-direction:column;gap:4px;margin:0 0 12px}
.attachment-editor-title{
  display:flex;align-items:center;gap:8px;min-width:0;
}
.attachment-editor-title i{font-size:18px;line-height:1;color:var(--accent,#246384);flex:0 0 auto}
.attachment-editor-title strong{font-size:15px;font-weight:750;line-height:1.3}
.attachment-editor-tip{margin:0;font-size:12px;line-height:1.5;color:var(--muted, var(--lyear-muted, #6b7785))}
.attachment-editor-actions{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px;align-items:center}
/* 盖过 Bootstrap input[type=file]{display:block}，彻底隐藏原生选择框 */
.attachment-editor input[type=file],
.attachment-editor .ae-native-file,
#attachment-file-input{
  position:absolute!important;left:-9999px!important;top:0!important;
  width:1px!important;height:1px!important;margin:0!important;padding:0!important;
  overflow:hidden!important;clip:rect(0,0,0,0)!important;clip-path:inset(50%)!important;
  border:0!important;opacity:0!important;visibility:hidden!important;
  pointer-events:none!important;display:none!important;
}
.attachment-editor.is-admin .attachment-editor-actions .btn-line{
  background:var(--lyear-field-bg, #fff)!important;
  border:1px solid var(--lyear-btn-line-border, #8b95a5)!important;
  color:inherit!important;
}
.attachment-editor-actions .btn i{margin-right:4px}
.attachment-editor-list{display:flex;flex-direction:column;gap:8px}
.attachment-editor-empty{
  padding:18px 12px;border-radius:12px;border:1px dashed var(--line, var(--lyear-field-border, #e6eef0));
  background:var(--chip, var(--lyear-field-bg, #f4f7f8));text-align:center;font-size:12px;
  color:var(--muted, var(--lyear-muted, #6b7785));line-height:1.5;
}
.attachment-ed-row{
  display:grid;
  grid-template-columns:40px minmax(0,1.4fr) minmax(72px,.7fr) minmax(72px,.7fr) auto;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  border-radius:12px;
  background:var(--chip, var(--lyear-field-bg, #f4f7f8));
  border:0;
}
.attachment-ed-icon{
  width:40px;height:40px;border-radius:10px;display:grid;place-items:center;
  background:#fff;border:1px solid var(--line,#e6eef0);color:#246384;font-size:18px;
}
.attachment-ed-main{min-width:0}
.attachment-ed-main strong{
  display:block;font-size:13px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.attachment-ed-main span{
  display:block;margin-top:3px;font-size:11px;color:var(--muted, var(--lyear-muted, #6b7785));
}
.attachment-ed-row input,.attachment-ed-row select{
  width:100%;height:34px;padding:0 8px;box-sizing:border-box;
  border:1px solid var(--lyear-field-border, #dce4e8);border-radius:8px;font-size:12px;
  background:var(--lyear-field-bg, #fff);color:inherit;
}
.attachment-editor.is-admin .attachment-ed-row input,
.attachment-editor.is-admin .attachment-ed-row select,
.attachment-editor.is-admin .form-control{
  border:1px solid var(--lyear-field-border, #d0d7de) !important;
  background:var(--lyear-field-bg, #fff) !important;
  color:inherit !important;
  border-radius:8px !important;
  box-shadow:none !important;
}
.attachment-ed-progress{
  height:4px;border-radius:999px;background:color-mix(in srgb, var(--line,#e6eef0) 80%, #94a3b8);
  overflow:hidden;margin-top:6px;
}
.attachment-ed-progress > i{
  display:block;height:100%;width:0;background:var(--accent,#246384);border-radius:inherit;
  transition:width .15s ease;
}
.attachment-ed-row.is-uploading{opacity:.85}
.attachment-ed-row.is-error .attachment-ed-main span{color:#c0392b}
.attachment-ed-del{height:32px;padding:0 12px;white-space:nowrap}
@media (max-width:900px){
  .attachment-item{
    grid-template-columns:auto minmax(0,1fr);
    grid-template-areas:
      "icon main"
      "action action";
    gap:10px 12px;
    align-items:start;
  }
  .attachment-item-icon{grid-area:icon}
  .attachment-item-main{grid-area:main;width:auto;min-width:0}
  .attachment-item-actions{
    grid-area:action;
    width:100%;
    margin-top:0;
    justify-content:stretch;
  }
  .attachment-item-actions .btn{
    flex:1 1 100%;
    width:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    min-height:38px;
    box-sizing:border-box;
  }
}
@media (max-width:720px){
  .attachment-ed-row{grid-template-columns:40px minmax(0,1fr); }
  .attachment-ed-row select,
  .attachment-ed-row input[data-k="price"],
  .attachment-ed-del{grid-column:1 / -1}
}
