/* components.css —— 公共组件的自有样式（P16-T09）。
   仅覆盖不依赖 Element Plus 的自研组件（图片预览、加载遮罩、富文本容器、上传拖拽区）。 */

/* 图片预览遮罩 */
.veei-preview {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(0, 0, 0, .8);
  display: flex; align-items: center; justify-content: center;
}
.veei-preview.dim { background: rgba(0, 0, 0, .45); }
.veei-preview img { max-width: 90vw; max-height: 88vh; border-radius: 4px; box-shadow: 0 8px 40px rgba(0, 0, 0, .5); }
.veei-preview .close {
  position: absolute; top: 20px; right: 28px; color: #fff; font-size: 30px; cursor: pointer; line-height: 1;
}
.veei-preview .nav {
  position: absolute; top: 50%; transform: translateY(-50%); color: #fff; font-size: 40px; cursor: pointer; user-select: none; padding: 0 16px;
}
.veei-preview .nav.prev { left: 8px; }
.veei-preview .nav.next { right: 8px; }
.veei-preview .idx { position: absolute; bottom: 24px; color: #c9cdd4; font-size: 13px; }

/* 全屏/局部加载遮罩 */
.veei-loading-mask {
  position: absolute; inset: 0; background: rgba(255, 255, 255, .72);
  display: flex; align-items: center; justify-content: center; z-index: 2000;
}
.veei-loading-mask.fixed { position: fixed; }
.veei-spinner {
  width: 34px; height: 34px; border: 3px solid var(--veei-primary-soft); border-top-color: var(--veei-primary);
  border-radius: 50%; animation: veei-spin .8s linear infinite;
}
.veei-loading-text { margin-top: 10px; color: var(--veei-text-sub); font-size: 13px; text-align: center; }
@keyframes veei-spin { to { transform: rotate(360deg); } }

/* 富文本容器（wangEditor） */
.veei-richeditor { border: 1px solid var(--veei-border-strong); border-radius: var(--veei-radius-sm); overflow: hidden; background: var(--veei-bg-card); }
.veei-richeditor .veei-richeditor-toolbar { border-bottom: 1px solid var(--veei-border); background: var(--veei-bg); }
.veei-richeditor .veei-richeditor-text { min-height: 240px; background: var(--veei-bg-card); }

/* 上传拖拽区 */
.veei-upload { border: 1px dashed var(--veei-border-strong); border-radius: var(--veei-radius-sm); padding: 18px; text-align: center; background: var(--veei-bg); cursor: pointer; transition: border-color .15s, background .15s; }
.veei-upload:hover, .veei-upload.dragover { border-color: var(--veei-primary); background: var(--veei-primary-soft); }
.veei-upload .tip { color: var(--veei-text-muted); font-size: 13px; margin-top: 6px; }
.veei-upload-list { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.veei-upload-item { position: relative; width: 96px; }
.veei-upload-item img { width: 96px; height: 96px; object-fit: cover; border-radius: 6px; border: 1px solid var(--veei-border); display: block; }
.veei-upload-item .name { font-size: 12px; color: var(--veei-text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.veei-upload-item .rm { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; line-height: 16px; text-align: center; background: var(--veei-danger); color: #fff; border-radius: 50%; cursor: pointer; font-size: 12px; }
.veei-upload-item .bar { height: 3px; background: var(--veei-primary); width: 0; transition: width .2s; margin-top: 4px; }

/* 数据表格工具条与操作列（配合 el-table） */
.veei-datatable .op-col a { margin-right: 10px; }
.veei-datatable .pager { margin-top: 14px; display: flex; justify-content: flex-end; }

/* 系统设置页共享样式（P15 迁移 Vue） */
.veei-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.veei-nav a { padding: 6px 14px; border-radius: var(--veei-radius-pill); font-size: 13px; color: var(--veei-text-sub); text-decoration: none; }
.veei-nav a:hover { background: var(--veei-primary-soft); color: var(--veei-primary); }
.veei-nav a.active { background: var(--veei-primary); color: var(--veei-on-primary); }
/* el-form-item__content 是 flex 容器，备注需独占一行，否则与控件/载入文件链接并排。 */
.veei-hint { font-size: 12px; color: var(--veei-text-muted); margin-top: 4px; width: 100%; }
.veei-actions { margin-top: 8px; display: flex; align-items: center; gap: 12px; }

/* VIconPicker 图标选择组件 */
.veei-icon-picker-trigger { display: inline-flex; align-items: center; gap: 8px; min-width: 130px; padding: 4px 10px; border: 1px solid var(--el-border-color, #dcdfe6); border-radius: var(--veei-radius-sm); cursor: pointer; background: var(--el-bg-color, #fff); }
.veei-icon-picker-trigger:hover { border-color: var(--veei-primary); }
.veei-icon-picker-name { flex: 1; font-size: 13px; color: var(--veei-text); }
.veei-icon-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; max-height: 360px; overflow: auto; }
.veei-icon-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 1px solid var(--veei-border); border-radius: var(--veei-radius); cursor: pointer; font-size: 11px; color: var(--veei-text-muted); }
.veei-icon-cell:hover { border-color: var(--veei-primary); color: var(--veei-primary); }
.veei-icon-cell.active { border-color: var(--veei-primary); background: var(--veei-primary-soft); color: var(--veei-primary); }

/* 代理端右上角消息铃铛（未读徽标） */
.veei-msg-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--veei-radius-pill); color: var(--veei-text-sub); text-decoration: none; margin-right: 4px; }
.veei-msg-bell:hover { background: var(--veei-primary-soft); color: var(--veei-primary); }
.veei-msg-badge { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--veei-danger); color: var(--veei-on-primary); font-size: 11px; line-height: 16px; text-align: center; }

/* 自研确认弹窗与轻提示：跟随主题令牌，暗色下不会白底刺眼 */
.veei-dialog-card {
  background: var(--veei-bg-card); color: var(--veei-text);
  border: 1px solid var(--veei-border); border-radius: var(--veei-radius);
  width: 380px; max-width: 90vw; padding: 22px 24px; box-shadow: 0 8px 40px rgba(0, 0, 0, .25);
}
.veei-dialog-card .msg { color: var(--veei-text-sub); font-size: 14px; margin-bottom: 20px; }
.veei-toast {
  background: var(--veei-bg-card); color: var(--veei-text);
  border-left: 4px solid var(--veei-primary); border-radius: var(--veei-radius-sm);
  box-shadow: var(--veei-shadow-hover); font-size: 14px; max-width: 80vw; padding: 10px 16px;
}
.veei-toast.success { border-left-color: var(--veei-success); }
.veei-toast.error { border-left-color: var(--veei-danger); }
.veei-toast.warning { border-left-color: var(--veei-warning); }

/* ---- 暗色（黑金）下的自研组件补色 ---- */html.dark .veei-loading-mask { background: rgba(19, 18, 16, .72); }
html.dark .veei-preview img { border-radius: var(--veei-radius-sm); }
html.dark .veei-upload-item img { background: var(--veei-bg-card); }
html.dark .veei-msg-badge { color: #fff; }
html.dark .veei-icon-picker-trigger { background: var(--veei-bg-card); }
