/* AI绘图（生图 / 生视频）页面样式 —— 与工具箱其它页面同一套视觉 */
.hero { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.hero .tt { font-size: 23px; font-weight: 800; color: #7c3aed; display: flex; align-items: center; gap: 8px; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero .tt { background: linear-gradient(135deg, #7c3aed, #2563eb); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
}
.hero .bd { font-size: 11px; color: #fff; font-weight: 600; background: linear-gradient(135deg, #7c3aed, #2563eb); padding: 3px 10px; border-radius: 99px; box-shadow: 0 2px 8px rgba(124, 58, 237, .3); }
.hero .st { font-size: 12px; color: var(--muted); }

.btn {
  cursor: pointer; border: 1px solid rgba(124, 58, 237, .25); background: #fff; color: var(--text);
  font-size: 13.5px; font-weight: 700; padding: 9px 15px; border-radius: 10px; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  transition: transform .15s, box-shadow .15s, background .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(124, 58, 237, .18); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary { background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff; border: none; box-shadow: 0 4px 12px rgba(124, 58, 237, .25); }
.btn.primary:disabled { background: #94a3b8; }
.btn.ghost { background: rgba(124, 58, 237, .08); border-color: transparent; color: #6d28d9; }
.btn.sm { font-size: 12px; padding: 6px 10px; border-radius: 8px; }

/* 通道状态条 */
.chan-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.chan-line .dot { font-size: 13px; line-height: 1; }
.chan-line .dot.ok { color: #16a34a; }
.chan-line .dot.bad { color: #dc2626; }
.chan-line .dot.wait { color: #d97706; }
.chan-line #chanText { flex: 1; min-width: 220px; color: var(--text); }
.chan-detail { margin-top: 10px; font-size: 12.5px; color: var(--muted); display: none; }
.chan-detail.on { display: block; }
.chan-detail .step { padding: 5px 0; border-top: 1px dashed var(--border); display: flex; gap: 8px; align-items: flex-start; }
.chan-detail .step:first-child { border-top: none; }
.chan-detail .step .ic { flex: 0 0 auto; font-weight: 800; }
.chan-detail .step .ic.ok { color: #16a34a; }
.chan-detail .step .ic.bad { color: #dc2626; }
.chan-detail .step .tx { flex: 1; }
.chan-detail .warn { margin-top: 8px; padding: 9px 11px; border-radius: 10px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; font-size: 12.5px; line-height: 1.7; }
.chan-detail .warn code { background: rgba(154, 52, 18, .1); padding: 1px 5px; border-radius: 5px; }

/* 选项卡 */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.tab {
  cursor: pointer; border: 1px solid transparent; background: rgba(124, 58, 237, .06); color: #6d28d9;
  font-size: 13.5px; font-weight: 700; padding: 8px 16px; border-radius: 10px; font-family: inherit;
}
.tab.on { background: linear-gradient(135deg, #7c3aed, #2563eb); color: #fff; box-shadow: 0 4px 12px rgba(124, 58, 237, .22); }

/* 输入 */
textarea {
  width: 100%; min-height: 108px; resize: vertical; padding: 12px 14px; font-size: 14px; line-height: 1.7;
  border: 1px solid var(--border); border-radius: 12px; background: #fff; color: var(--text); font-family: inherit; box-sizing: border-box;
}
textarea:focus { outline: none; border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, .12); }
.prompt-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 12px; }
.prompt-foot .hint { font-size: 12px; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.chip { cursor: pointer; font-size: 12px; padding: 4px 10px; border-radius: 99px; background: rgba(37, 99, 235, .08); color: #1d4ed8; border: 1px solid transparent; user-select: none; }
.chip:hover { border-color: rgba(37, 99, 235, .35); }

.ctl { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.ctl.adv { margin-top: 10px; }
.ctl .fld { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.ctl select, .ctl input, .setgrid input {
  padding: 9px 11px; font-size: 13.5px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; color: var(--text); font-family: inherit; height: 38px; box-sizing: border-box;
}
.ctl input[type=number] { width: 84px; }
.ctl input[type=text], .ctl input:not([type]) { width: 190px; }
.ctl select:focus, .ctl input:focus, .setgrid input:focus { outline: none; border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, .12); }
.hint { font-size: 12px; color: var(--muted); }

/* 状态 / 错误 */
.status { margin-top: 12px; font-size: 12.5px; color: var(--muted); min-height: 18px; }
.status b { color: var(--text); }
.err { margin-top: 12px; padding: 11px 13px; border-radius: 11px; background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; font-size: 12.5px; line-height: 1.75; word-break: break-word; }
.err .hd { font-weight: 800; margin-bottom: 4px; }
.err .raw { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; opacity: .85; word-break: break-all; }
.err .tip { margin-top: 6px; padding: 8px 10px; border-radius: 9px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; }
.ok-note { margin-top: 12px; padding: 10px 12px; border-radius: 11px; background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; font-size: 12.5px; }

/* 结果网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.imgcard { background: #fff; border: 1px solid var(--border); border-radius: 13px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.imgcard .ph { position: relative; background: #f1f5f9; display: flex; align-items: center; justify-content: center; min-height: 160px; }
.imgcard .ph img, .imgcard .ph video { width: 100%; height: auto; display: block; }
.imgcard .ph.sk { background: linear-gradient(100deg, #eef2f7 30%, #f8fafc 50%, #eef2f7 70%); background-size: 220% 100%; animation: sk 1.2s linear infinite; }
@keyframes sk { 0% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
.imgcard .mt { padding: 9px 11px; font-size: 11.5px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.imgcard .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.imgcard .rv { font-size: 11px; color: #6d28d9; word-break: break-word; }
.badge-src { position: absolute; top: 8px; left: 8px; font-size: 10.5px; font-weight: 700; color: #fff; background: rgba(15, 23, 42, .62); padding: 2px 7px; border-radius: 99px; }

/* 进度 */
.prog { margin-top: 12px; height: 8px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.prog .bar { height: 100%; width: 0; background: linear-gradient(90deg, #7c3aed, #2563eb); transition: width .4s; }
.prog.indet .bar { width: 40% !important; animation: indet 1.1s ease-in-out infinite alternate; }
@keyframes indet { from { margin-left: 0; } to { margin-left: 60%; } }

/* 历史 */
.hist { margin-top: 18px; border-top: 1px dashed var(--border); padding-top: 12px; }
.hist .ht { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12.5px; }
.hist .ht b { font-size: 13px; }
.hist .ht .btn { margin-left: auto; }
.hlist { display: flex; gap: 8px; flex-wrap: wrap; }
.hitem { cursor: pointer; font-size: 12px; padding: 6px 10px; border-radius: 9px; background: #f8fafc; border: 1px solid var(--border); max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hitem:hover { border-color: #7c3aed; color: #6d28d9; }

/* 接口设置 */
.setgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 6px; }
.setbox { border: 1px solid var(--border); border-radius: 12px; padding: 13px; background: #fcfdff; }
.setbox h3 { font-size: 13.5px; margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
.setbox .row { display: flex; flex-direction: column; gap: 5px; margin-bottom: 9px; }
.setbox .row label { font-size: 12px; color: var(--muted); }
.setbox .row input { width: 100%; }
.setbox .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.settings-note { margin-top: 14px; font-size: 12.5px; color: var(--muted); line-height: 1.85; }
.settings-note code { background: rgba(124, 58, 237, .08); padding: 1px 5px; border-radius: 5px; color: #6d28d9; }
.settings-note ol { margin: 6px 0 0; padding-left: 20px; }
.settings-note li { margin-bottom: 3px; }
.save-msg { font-size: 12px; margin-top: 8px; }

@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .ctl input[type=text], .ctl input:not([type]) { width: 150px; }
  .hero .tt { font-size: 20px; }
}
