/* 附件上传插件 */
.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:18px;
  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:flex;align-items:center;gap:20px;font-size:16px;font-weight:600;overflow:hidden}
.attachment-item-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.attachment-item-hint{display:block;margin-top:5px;font-size:12px;color:var(--muted,#6b7785);line-height:1.45}
.attachment-item-badge{flex:none;display:inline-flex;align-items:center;gap:2px;padding:0 7px;border-radius:4px;font-size:11px;font-weight:600;line-height:1.7;color:#fff;background:linear-gradient(135deg,#f7b733,#b8860b)}
.attachment-item-badge i{font-size:12px}
.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}，彻底隐藏原生选择框（保留可被 label for 触发） */
.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;
  border:0!important;opacity:0!important;
  pointer-events: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;
  transition:background .15s ease;
}
.attachment-ed-row:hover{background:color-mix(in srgb, var(--chip,#f4f7f8) 85%, #dfe7ea)}
.attachment-ed-row .attachment-ed-icon{grid-column:1}
.attachment-ed-row .attachment-ed-main{grid-column:2}
.attachment-ed-row .ae-currency{grid-column:3}
.attachment-ed-row input[data-k="price"]{grid-column:4}
.attachment-ed-row .attachment-ed-del{grid-column:5;display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0;border-radius:8px;font-size:15px;line-height:1;color:var(--muted,#6b7785);background:transparent;border:0;cursor:pointer}
.attachment-ed-row .attachment-ed-del:hover{color:#c0392b;background:rgba(192,57,43,.08)}
.ae-currency{position:relative;display:inline-block;width:100%;min-width:0}
.ae-currency-btn{
  width:100%;height:34px;display:flex;align-items:center;justify-content:space-between;gap:4px;
  padding:0 8px;box-sizing:border-box;
  border:1px solid var(--lyear-field-border, #dce4e8);border-radius:8px;
  background:var(--lyear-field-bg, #fff);font-size:12px;color:inherit;cursor:pointer;
  transition:border-color .15s ease, box-shadow .15s ease;
}
.ae-currency-btn:hover{border-color:#b9c6cc}
.ae-currency.is-open .ae-currency-btn{border-color:var(--accent,#246384);box-shadow:0 0 0 2px rgba(36,99,132,.12)}
.ae-currency-btn i{font-size:14px;color:var(--muted,#6b7785);flex:0 0 auto}
.ae-currency-menu{
  position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:60;display:none;
  margin:0;padding:4px;list-style:none;
  background:#fff;border:1px solid var(--line,#e6eef0);border-radius:10px;
  box-shadow:0 6px 20px rgba(0,0,0,.12);
}
.ae-currency.is-open .ae-currency-menu{display:block}
.ae-currency-menu li{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:8px 10px;border-radius:6px;font-size:13px;color:#333;cursor:pointer;
}
.ae-currency-menu li:hover{background:#f4f7f8}
.ae-currency-menu li.is-active{background:#e8f1f7;color:#246384;font-weight:600}
.ae-currency-menu li.is-active::after{content:"✓";font-weight:700}
.ae-currency-menu li[data-cur="vip"]{color:#b8860b}
.ae-currency-menu li[data-cur="vip"].is-active{background:#fdf3dc;color:#b8860b}
.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{
    display:flex;
    flex-wrap:wrap;
    gap:8px 10px;
    align-items:center;
    padding:10px 12px;
  }
  .attachment-ed-row .attachment-ed-icon{flex:0 0 40px}
  .attachment-ed-row .attachment-ed-main{flex:1 1 180px;min-width:0}
  .attachment-ed-row .ae-currency{flex:0 1 96px;min-width:72px}
  .attachment-ed-row input[data-k="price"]{flex:1 1 84px;min-width:72px}
  .attachment-ed-row .attachment-ed-del{flex:0 0 32px}
}
