/**
 * AI 图片卡片组件样式（配合 /admin/js/ai-gallery.js）
 * 同时提供图片类列表页的通用外壳样式：.ai-page / .ai-page-filters / .ai-page-body / .ai-page-pager
 */

/* ---------- 页面外壳 ---------- */
.content.ai-page { display: flex; flex-direction: column; padding: 0 !important; background: #f0f2f5; }
.ai-page-filters { flex: 0 0 auto; background: #fff; margin: 12px 12px 0; padding: 12px 14px 0; border-radius: 8px; box-shadow: 0 1px 3px rgba(0, 0, 0, .05); }
.ai-page-filters .el-form-item { margin-bottom: 12px; }
.ai-page-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px; }
.ai-page-pager { flex: 0 0 auto; background: #fff; margin: 0 12px 12px; padding: 8px 14px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0, 0, 0, .05); text-align: right; }

/* ---------- 卡片网格 ---------- */
.ai-g-root { min-height: 100%; }
.ai-g-wrap { min-height: 240px; }
.ai-g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px; }
.ai-g-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, .06); transition: box-shadow .2s, transform .2s; }
.ai-g-card:hover { box-shadow: 0 8px 22px rgba(0, 0, 0, .14); transform: translateY(-2px); }
.ai-g-cover { position: relative; padding-top: 133.33%; background: #eef1f6; cursor: pointer; overflow: hidden; }
.ai-g-cover > img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ai-g-cover-empty { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #b3bac7; font-size: 13px; }
.ai-g-cover-empty i { font-size: 30px; margin-bottom: 8px; }
.ai-g-cover-mask { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .35); color: #fff; font-size: 13px; opacity: 0; transition: opacity .2s; }
.ai-g-cover-mask i { margin-right: 6px; font-size: 16px; }
.ai-g-cover:hover .ai-g-cover-mask { opacity: 1; }
.ai-g-badge { position: absolute; top: 8px; left: 8px; padding: 1px 7px; border-radius: 4px; font-size: 11px; line-height: 18px; color: #fff; background: #909399; }
.ai-g-badge.running { background: #409eff; }
.ai-g-badge.danger { background: #f56c6c; }
.ai-g-badge.info { background: #909399; }
.ai-g-badge.featured { background: linear-gradient(135deg, #ffb020, #f08c00); }
.ai-g-badge.count { left: auto; right: 8px; background: rgba(0, 0, 0, .55); }
.ai-g-body { padding: 10px 12px 12px; }
.ai-g-title { color: #303133; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-g-line { display: flex; justify-content: space-between; align-items: center; color: #909399; font-size: 12px; margin-top: 4px; }
.ai-g-chips { display: flex; flex-wrap: wrap; align-items: center; margin: 6px 0 2px; }
.ai-g-chip { background: #f4f6fa; color: #5e6b82; border-radius: 3px; padding: 0 6px; font-size: 12px; line-height: 20px; margin: 0 4px 4px 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-g-chip.primary { background: #ecf5ff; color: #409eff; }
.ai-g-time { color: #909399; font-size: 12px; display: flex; align-items: center; }
.ai-g-time i { margin-right: 4px; }
.ai-g-ops { display: flex; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px dashed #ebeef5; }
.ai-g-op { width: 28px; height: 28px; margin-right: 8px; padding: 0; border-radius: 50%; border: 1px solid #e4e7ed; background: #fff; color: #606266; font-size: 14px; cursor: pointer; outline: none; display: inline-flex; align-items: center; justify-content: center; transition: all .15s; }
.ai-g-op:hover { color: #409eff; border-color: #409eff; }
.ai-g-op:disabled { color: #c0c4cc; border-color: #ebeef5; cursor: not-allowed; }
.ai-g-op.danger { margin-left: auto; margin-right: 0; color: #f56c6c; border-color: #fbc4c4; }
.ai-g-op.danger:hover { color: #fff; background: #f56c6c; border-color: #f56c6c; }
.ai-g-empty { padding: 90px 0; text-align: center; color: #b3bac7; font-size: 14px; }

/* ---------- 大图查看 ---------- */
.ai-g-viewer { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 3000; background: #fff; display: flex; flex-direction: column; }
.ai-g-viewer-toolbar { flex: 0 0 auto; height: 54px; padding: 0 16px; border-bottom: 1px solid #ebeef5; display: flex; align-items: center; justify-content: space-between; }
.ai-g-viewer-title { display: flex; align-items: center; color: #303133; font-size: 14px; min-width: 0; }
.ai-g-viewer-title .name { font-weight: 600; margin-right: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 460px; }
.ai-g-viewer-title .sub { color: #909399; font-size: 12px; margin-left: 12px; white-space: nowrap; }
.ai-g-viewer-tools { flex: 0 0 auto; display: flex; align-items: center; }
.ai-g-viewer-tools .el-button { margin-left: 8px; }
.ai-g-viewer-body { flex: 1; min-height: 0; position: relative; display: flex; }
.ai-g-viewer-canvas { flex: 1; min-width: 0; min-height: 0; overflow: auto; background: #f6f7f9; }
.ai-g-viewer-stage { width: max-content; min-width: 100%; min-height: 100%; box-sizing: border-box; display: grid; place-items: center; padding: 20px; }
.ai-g-viewer-stage img { display: block; max-width: calc(100vw - 180px); max-height: calc(100vh - 340px); border-radius: 4px; box-shadow: 0 8px 28px rgba(0, 0, 0, .18); cursor: zoom-in; }
.ai-g-viewer-empty { color: #b3bac7; font-size: 14px; }
.ai-g-viewer-arrow { position: absolute; top: 50%; margin-top: -21px; width: 42px; height: 42px; border-radius: 50%; background: rgba(0, 0, 0, .35); color: #fff; font-size: 18px; z-index: 2; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.ai-g-viewer-arrow:hover { background: rgba(0, 0, 0, .55); }
.ai-g-viewer-arrow.left { left: 16px; }
.ai-g-viewer-arrow.right { right: 16px; }
.ai-g-viewer-arrow.disabled { opacity: .25; cursor: not-allowed; }
.ai-g-viewer-strip { flex: 0 0 auto; border-top: 1px solid #ebeef5; padding: 10px 16px 4px; background: #fff; display: flex; align-items: flex-start; overflow-x: auto; }
.ai-g-viewer-strip .thumb { width: 74px; margin-right: 10px; flex: 0 0 auto; text-align: center; cursor: pointer; }
.ai-g-viewer-strip .thumb img { width: 74px; height: 74px; object-fit: cover; border-radius: 6px; border: 2px solid transparent; box-sizing: border-box; background: #f5f7fa; }
.ai-g-viewer-strip .thumb.active img { border-color: #409eff; }
.ai-g-viewer-strip .thumb span { display: block; margin-top: 4px; font-size: 12px; color: #909399; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-g-viewer-strip .thumb.active span { color: #409eff; }
.ai-g-viewer-meta { flex: 0 0 auto; border-top: 1px solid #ebeef5; padding: 10px 16px 12px; background: #fff; font-size: 13px; color: #606266; max-height: 24vh; overflow-y: auto; }
.ai-g-viewer-meta .meta-row { display: flex; flex-wrap: wrap; }
.ai-g-viewer-meta .meta-item { margin: 0 22px 6px 0; }
.ai-g-viewer-meta .meta-item .label { color: #909399; }
.ai-g-viewer-meta .meta-error { color: #f56c6c; margin-bottom: 6px; word-break: break-all; }
.ai-g-viewer-meta .meta-prompt { display: flex; align-items: flex-start; background: #f7f9fc; border-radius: 6px; padding: 8px 10px; margin-top: 2px; }
.ai-g-viewer-meta .meta-prompt + .meta-prompt { margin-top: 6px; }
.ai-g-viewer-meta .meta-prompt .label { flex: 0 0 auto; color: #909399; margin-right: 8px; }
.ai-g-viewer-meta .meta-prompt .value { flex: 1; color: #303133; line-height: 20px; word-break: break-all; margin-right: 10px; }
