/* 绘作图（内测） */
.ig { max-width: 1180px; margin: 0 auto; display: grid; gap: 16px; padding-bottom: 24px; }
.ig-tabs { display: inline-flex; justify-self: start; gap: 4px; padding: 4px; border-radius: 12px; background: var(--hover); border: 1px solid var(--line); }
.ig-tabs button { border: 0; background: none; height: 34px; padding: 0 16px; border-radius: 9px; font-size: 14.5px; font-weight: 600; color: var(--fg2);
  display: flex; align-items: center; gap: 6px; cursor: pointer; }
.ig-tabs button .i { width: 16px; height: 16px; }
.ig-tabs button.on { background: var(--panel); color: #c4521f; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.05); }
.ig-main { display: grid; grid-template-columns: minmax(360px, 460px) minmax(0, 1fr); gap: 16px; align-items: start; }

/* 左：表单 */
.ig-form { padding: 18px 20px; display: grid; gap: 14px; transition: box-shadow .15s; }
.ig-form.drop { box-shadow: 0 0 0 2px #ff7a45, var(--shadow); }
.ig-f { display: grid; gap: 7px; }
.ig-f > label { font-size: 13px; font-weight: 600; color: var(--fg2); display: flex; align-items: baseline; gap: 6px; }
.ig-f > label em { color: var(--c-red); font-style: normal; }
.ig-f > label .muted { font-weight: 400; font-size: 12px; }
.ig-f .chips button { height: 30px; padding: 0 12px; border-radius: 15px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.ig-f .chips button.on { background: #ff7a45; }
.ig-px { font-size: 12px; opacity: .7; font-variant-numeric: tabular-nums; }
.ig-ta { height: auto; min-height: 60px; padding: 8px 10px; line-height: 1.55; resize: vertical; }
.ig-row { display: grid; grid-template-columns: 1fr 120px; gap: 8px; }
.ig-wh { display: flex; align-items: center; gap: 8px; }
.ig-wh .inp { width: 110px; }
.ig-ck { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg2); cursor: pointer; justify-self: start; }
.ig-edit { display: grid; grid-template-columns: 1fr auto 1fr 22px; gap: 6px; align-items: center; margin-bottom: 6px; }
.ig-edit > span { color: var(--sub); }
.ig-tip { display: flex; gap: 6px; font-size: 13px; color: #6b4a1e; background: rgba(255,122,69,.08); border: 1px solid rgba(255,122,69,.22); border-radius: 10px; padding: 7px 10px; line-height: 1.6; }
.ig-tip .i { width: 15px; height: 15px; flex: none; margin-top: 3px; }
.ig-refs { display: flex; flex-wrap: wrap; gap: 8px; }
.ig-ref, .ig-add { width: 76px; height: 76px; border-radius: 10px; position: relative; flex: none; }
.ig-ref { overflow: hidden; border: 1px solid var(--line2); background: var(--bg2); }
.ig-ref img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ig-ref b { position: absolute; left: 4px; top: 4px; font-size: 11px; line-height: 16px; padding: 0 5px; border-radius: 8px; background: rgba(0,0,0,.55); color: #fff; }
.ig-ref .dc-x { position: absolute; right: 3px; top: 3px; background: rgba(0,0,0,.5); color: #fff; width: 20px; height: 20px; border-radius: 10px; }
.ig-ref .dc-x:hover { background: var(--c-red); color: #fff; }
.ig-add { border: 1.5px dashed var(--line2); display: grid; place-content: center; justify-items: center; gap: 2px; color: var(--sub); font-size: 12px; cursor: pointer; }
.ig-add:hover { border-color: #ff7a45; color: #c4521f; background: rgba(255,122,69,.05); }
.ig-add .i { width: 20px; height: 20px; }
.ig-go { display: grid; gap: 8px; padding-top: 2px; }
.ig-go .btn { height: 40px; font-size: 15px; justify-content: center; background: linear-gradient(135deg, #ff8a4c, #f0532a); border: 0; color: #fff; }
.ig-go .btn:disabled { opacity: .5; }
.ig-go .muted { font-size: 12.5px; line-height: 1.6; }

/* 右：当前这张 */
.ig-view { padding: 18px 20px; display: grid; gap: 12px; min-height: 420px; align-content: start; position: sticky; top: 0; }
.ig-empty { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 46px 10px; color: var(--sub); }
.ig-empty > .i { width: 40px; height: 40px; color: #ff7a45; stroke-width: 1.4; }
.ig-empty b { color: var(--fg); font-size: 16px; }
.ig-empty span { font-size: 13.5px; line-height: 1.7; }
.ig-empty ul { text-align: left; font-size: 13px; line-height: 1.9; margin: 8px 0 0; padding-left: 18px; }
.ig-vh { display: flex; align-items: flex-start; gap: 10px; }
.ig-vh > div { display: grid; min-width: 0; flex: 1; }
.ig-vh b { font-size: 15.5px; }
.ig-vh .muted { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-st { flex: none; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--hover); color: var(--sub); }
.ig-st.completed { background: rgba(21,135,74,.1); color: #15874a; }
.ig-st.failed { background: rgba(229,72,77,.1); color: #c9353a; }
.ig-st.processing, .ig-st.queued { background: rgba(255,122,69,.12); color: #c4521f; }
.ig-pic { border-radius: 12px; overflow: hidden; background:
  repeating-conic-gradient(var(--hover) 0 25%, transparent 0 50%) 0 0 / 16px 16px; display: grid; place-items: center; border: 1px solid var(--line); }
.ig-pic img { max-width: 100%; max-height: 62vh; display: block; }
.ig-meta { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ig-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.ig-acts .btn { height: 34px; }
.ig-fail { display: flex; gap: 8px; color: #b4502f; background: rgba(229,72,77,.07); border: 1px solid rgba(229,72,77,.2); border-radius: 10px; padding: 10px 12px; line-height: 1.6; font-size: 13.5px; }
.ig-fail .i { width: 16px; height: 16px; flex: none; margin-top: 3px; }
.ig-wait { display: grid; justify-items: center; gap: 10px; padding: 70px 10px; text-align: center; }
.ig-wait b { font-size: 16px; font-variant-numeric: tabular-nums; }
.ig-wait .muted { font-size: 13px; }
.ig-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,122,69,.2); border-top-color: #ff7a45; animation: igSpin .9s linear infinite; }
.ig-spin.sm { width: 16px; height: 16px; border-width: 2px; display: inline-block; }
@keyframes igSpin { to { transform: rotate(360deg); } }

/* 记录 */
.ig-hist { padding: 14px 16px 16px; }
.ig-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; margin-top: 10px; }
.ig-cell { border: 1px solid var(--line); background: var(--panel); border-radius: 12px; padding: 0; overflow: hidden; text-align: left; cursor: pointer; display: grid; transition: box-shadow .15s, border-color .15s; }
.ig-cell:hover { box-shadow: var(--shadow); }
.ig-cell.on { border-color: #ff7a45; box-shadow: 0 0 0 2px rgba(255,122,69,.25); }
.ig-th { aspect-ratio: 4 / 3; background: var(--bg2); display: grid; place-items: center; overflow: hidden; }
.ig-th img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ig-ph { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #c4521f; }
.ig-ph.fail { color: #c9353a; }
.ig-ph .i { width: 15px; height: 15px; }
.ig-ct { padding: 8px 10px 9px; display: grid; gap: 1px; min-width: 0; }
.ig-ct b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-ct span { font-size: 12px; color: var(--fg2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 1.2em; }
.ig-ct em { font-style: normal; font-size: 11.5px; color: var(--sub); font-variant-numeric: tabular-nums; }
.ig-more { display: flex; justify-content: center; margin-top: 12px; }

@media (max-width: 1100px) {
  .ig-main { grid-template-columns: 1fr; }
  .ig-view { position: static; min-height: 0; }
  .ig-tabs { justify-self: stretch; }
  .ig-tabs button { flex: 1; justify-content: center; padding: 0 8px; }
}

/* 模板库 */
.ig-tpl > label .btn { margin-left: auto; height: 26px; font-weight: 500; }
.ig-cats button { height: 26px !important; font-size: 12.5px; }
.ig-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); grid-auto-rows: max-content; gap: 8px; max-height: 300px; overflow-y: auto; padding: 2px; }
.ig-tc { position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--line2); background: var(--bg2); cursor: pointer; }
.ig-tc img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; display: block; } /* 高度靠图片撑：格子放在限高滚动区里时，容器上的 aspect-ratio 会被压扁 */
.ig-tc em { position: absolute; left: 0; right: 0; bottom: 0; font-style: normal; font-size: 11px; color: #fff; padding: 10px 6px 3px;
  background: linear-gradient(transparent, rgba(0,0,0,.6)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-tc .ig-tk { position: absolute; left: 5px; top: 5px; width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(0,0,0,.35); color: transparent; border: 1.5px solid rgba(255,255,255,.85); }
.ig-tc .ig-tk .i { width: 13px; height: 13px; stroke-width: 2.6; }
.ig-tc.on { border-color: #ff7a45; box-shadow: 0 0 0 2px #ff7a45; }
.ig-tc.on .ig-tk { background: #ff7a45; color: #fff; border-color: #ff7a45; }
.ig-tz { position: absolute; right: 4px; top: 4px; width: 22px; height: 22px; border-radius: 11px; border: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.45); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s; }
.ig-tz .i { width: 13px; height: 13px; }
.ig-tc:hover .ig-tz { opacity: 1; }
@media (hover: none) { .ig-tz { opacity: 1; } }
.ig-tnone { font-size: 12.5px; padding: 10px 12px; border-radius: 10px; background: var(--bg2); border: 1px dashed var(--line2); }
.ig-ref.tpl { border-color: #ff7a45; }
.ig-ref > i { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-style: normal; font-size: 10.5px; color: #fff; background: rgba(255,122,69,.85); line-height: 16px; }

.ig-up { padding: 14px 16px; display: grid; gap: 12px; }
.ig-up-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ig-up-h .muted { font-size: 12.5px; }
.ig-tm { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.ig-tm .fi { display: grid; gap: 5px; }
.ig-tm label { font-size: 12.5px; color: var(--sub); }
.ig-up-a { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ig-up-a .muted { font-size: 12.5px; }
.ig-mlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; margin-top: 8px; max-height: 46vh; overflow-y: auto; }
.ig-mi { display: grid; grid-template-columns: 56px 1fr auto auto; gap: 8px; align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: 10px; }
.ig-mi img { width: 56px; height: 56px; object-fit: cover; border-radius: 7px; }
.ig-mi > div { display: grid; min-width: 0; font-size: 12px; }
.ig-mi b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-mi span { color: var(--fg2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-mi em { font-style: normal; color: var(--sub); }
@media (max-width: 600px) { .ig-tm { grid-template-columns: 1fr; } }
.ig-ai { display: flex; gap: 6px; font-size: 12.5px; color: #5b4a8a; background: rgba(120,90,220,.07); border: 1px solid rgba(120,90,220,.18); border-radius: 10px; padding: 6px 10px; line-height: 1.6; }
.ig-ai .i { width: 14px; height: 14px; flex: none; margin-top: 3px; }

/* 插件设备（管理人员） */
.ig-dlist { display: grid; gap: 8px; margin-top: 12px; max-height: 56vh; overflow-y: auto; }
.ig-di { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(150px, 220px); gap: 12px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.ig-di > div { display: grid; min-width: 0; }
.ig-di b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-di span { font-size: 12px; color: var(--fg2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ig-di em { font-style: normal; font-size: 12.5px; color: var(--sub); font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .ig-di { grid-template-columns: 1fr; } }
