/* Element Plus + Font Awesome 共用主题（PHP 页面） */
:root {
  --page-bg: #f5f7fa;
  --page-ink: #303133;
  --page-muted: #909399;
  --page-border: #e4e7ed;
  --page-card: #ffffff;
  --el-color-primary: #409eff;
}

* { box-sizing: border-box; }

body.el-page {
  margin: 0;
  min-height: 100vh;
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  color: var(--page-ink);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
}

.el-page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.el-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.el-page-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  color: #303133;
  line-height: 1.35;
}

.el-page-header .sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--page-muted);
}

.el-page-header .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* 面包屑微调 */
.el-breadcrumb {
  margin-bottom: 16px;
  font-size: 14px;
}
.el-breadcrumb a { color: var(--el-color-primary); text-decoration: none; }
.el-breadcrumb a:hover { color: #66b1ff; }
.el-breadcrumb__item:last-child .el-breadcrumb__inner,
.el-breadcrumb .is-current { color: #606266; font-weight: 500; }

/* 卡片面板 */
.el-page .el-card {
  border: 1px solid var(--page-border);
  border-radius: 4px;
  background: var(--page-card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  margin-bottom: 16px;
  overflow: hidden;
}
.el-page .el-card__header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--page-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
}
.el-page .el-card__body { padding: 16px; }
.el-page .el-card > .el-toolbar {
  padding: 12px 16px 0;
}
.el-page .el-card > .el-batch-bar {
  padding-left: 16px;
  padding-right: 16px;
}
.el-page .el-card > #foldersContainer .el-folder-grid,
.el-page .el-card > .el-project-grid,
.el-page .el-card > .el-table-wrap {
  padding: 0 16px 16px;
}
.el-page .el-card > .el-card__header + .el-folder-grid,
.el-page .el-card > .el-card__header + .el-project-grid,
.el-page .el-card > .el-card__header + .el-table-wrap {
  padding-top: 0;
}
.el-card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #303133;
}
.el-card-extra { color: var(--page-muted); font-size: 13px; }

/* 工具条 */
.el-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.el-toolbar-left,
.el-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* 让 <a> 也能像 el-button */
a.el-button {
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.el-button i.fas,
.el-button i.far,
.el-button i.fab {
  margin-right: 6px;
  font-size: 14px;
}
.el-button--small i.fas,
.el-button--small i.far {
  margin-right: 4px;
  font-size: 12px;
}
.el-button.is-circle i.fas,
.el-button.is-circle i {
  margin-right: 0;
}

/* Element Plus 圆形小按钮 + FA 居中 */
.el-button.is-circle {
  padding: 8px;
}
.el-button--small.is-circle {
  padding: 7px;
  min-height: 24px;
  min-width: 24px;
}

/* 表格：贴近 Element Plus */
.el-page .el-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.el-page table.el-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  font-size: 14px;
  color: #606266;
}
.el-page table.el-table thead th {
  background: #f5f7fa;
  color: #909399;
  font-weight: 600;
  font-size: 13px;
  padding: 12px 12px;
  border-bottom: 1px solid #ebeef5;
  text-align: left;
  white-space: nowrap;
}
.el-page table.el-table tbody td {
  padding: 12px;
  border-bottom: 1px solid #ebeef5;
  vertical-align: middle;
  background: #fff;
}
.el-page table.el-table tbody tr:hover > td {
  background: #f5f7fa;
}
.el-page table.el-table .cell-name {
  font-weight: 600;
  color: #303133;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.el-page table.el-table .cell-desc {
  color: #909399;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.el-page .action-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* 进度条 */
.el-progress-line {
  width: 100%;
  min-width: 160px;
}
.el-progress-bar-outer {
  height: 8px;
  background: #ebeef5;
  border-radius: 100px;
  overflow: hidden;
  display: flex;
}
.el-progress-bar-inner {
  height: 100%;
  transition: width 0.3s ease;
}
.el-progress-bar-inner.is-success { background: #67c23a; }
.el-progress-bar-inner.is-exception { background: #f56c6c; }
.el-progress-bar-inner.is-warning { background: #e6a23c; }
.el-progress-bar-inner.is-info { background: #909399; }
.el-progress-text {
  margin-top: 6px;
  font-size: 12px;
  color: #909399;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.el-progress-text .ok { color: #67c23a; }
.el-progress-text .bad { color: #f56c6c; }

/* 文件夹网格 */
.el-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.el-folder-item {
  position: relative;
  cursor: pointer;
  border: 1px solid #e4e7ed;
  border-radius: 4px;
  padding: 14px;
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.el-folder-item:hover {
  border-color: #c6e2ff;
  box-shadow: 0 2px 12px rgba(64, 158, 255, 0.12);
  transform: translateY(-2px);
}
.el-folder-item .folder-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #fdf6ec;
  color: #e6a23c;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  font-size: 16px;
}
.el-folder-item .card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #303133;
}
.el-folder-item .card-text {
  margin: 6px 0 0;
  font-size: 12px;
  color: #909399;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}
.el-folder-item .folder-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.el-folder-item:hover .folder-actions { opacity: 1; }

.el-project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.el-project-grid .el-card {
  margin-bottom: 0;
  transition: transform 0.2s, box-shadow 0.2s;
}
.el-project-grid .el-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.el-project-grid .el-card__body { padding: 14px; }
.el-project-grid .card-title {
  margin: 8px 0 6px;
  font-size: 15px;
  font-weight: 600;
}
.el-project-grid .card-text {
  color: #909399;
  font-size: 13px;
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.el-empty-hint {
  padding: 28px 16px;
  text-align: center;
  color: #909399;
  border: 1px dashed #dcdfe6;
  border-radius: 4px;
  background: #fafafa;
}
.el-empty-hint i { margin-right: 6px; }

.el-batch-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 0 14px;
  border-bottom: 1px solid #ebeef5;
  margin-bottom: 14px;
}
.el-batch-bar label {
  margin: 0;
  font-size: 14px;
  color: #606266;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Bootstrap modal → Element Dialog 外观 */
.modal-content {
  border: none;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e4e7ed;
  background: #fff;
}
.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #303133;
}
.modal-body { padding: 20px; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid #e4e7ed;
  background: #fff;
}
.modal-header .close {
  font-size: 20px;
  font-weight: 400;
  opacity: 0.6;
}
.modal-header .close:hover { opacity: 1; }

.el-page .form-control,
.el-page .custom-select,
.el-page select.form-control,
.el-page textarea.form-control {
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  color: #606266;
  font-size: 14px;
  transition: border-color 0.2s;
}
.el-page .form-control:focus {
  border-color: #409eff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}
.el-page .form-group label {
  font-size: 14px;
  color: #606266;
  font-weight: 500;
  margin-bottom: 6px;
}

/* 用例树 */
.case-tree-card .el-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.tree-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.case-tree-body {
  padding: 12px 16px 16px !important;
  background: #fafbfc;
}
.case-tree {
  list-style: none;
  margin: 0;
  padding: 0;
}
.case-tree-root,
.case-tree ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.case-tree li.case-node {
  position: relative;
  margin: 0 0 8px;
  border: 1px solid #e4e7ed;
  border-radius: 6px;
  background: #fff;
  padding: 10px 12px 8px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.case-tree li.case-node:hover {
  border-color: #c6e2ff;
  box-shadow: 0 2px 10px rgba(64, 158, 255, 0.08);
}
.case-tree li.case-node.is-success {
  border-left: 3px solid #67c23a;
}
.case-tree li.case-node.is-failure {
  border-left: 3px solid #f56c6c;
}
.case-tree li.case-node.is-pending {
  border-left: 3px solid #dcdfe6;
}
.case-node-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.case-node-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding-top: 2px;
}
.case-node-controls .case-checkbox {
  margin: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.case-node-content {
  flex: 1;
  min-width: 0;
}
.case-node-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  line-height: 1.45;
}
.case-order-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  background: #f0f2f5;
  color: #606266;
  font-size: 12px;
  font-weight: 600;
  font-family: Consolas, "Courier New", monospace;
}
.case-hierarchy {
  color: #909399;
  font-size: 13px;
  font-weight: 500;
}
.case-sep {
  color: #c0c4cc;
  font-size: 12px;
}
.case-name {
  color: #303133;
  font-size: 14px;
  font-weight: 600;
}
.case-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid transparent;
}
.case-status-tag.is-success {
  background: #f0f9eb;
  border-color: #e1f3d8;
  color: #67c23a;
}
.case-status-tag.is-failure {
  background: #fef0f0;
  border-color: #fde2e2;
  color: #f56c6c;
}
.case-status-tag.is-pending {
  background: #f4f4f5;
  border-color: #e9e9eb;
  color: #909399;
}
.case-node-meta {
  margin-top: 6px;
}
.case-steps-preview {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  color: #909399;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.case-steps-preview i {
  color: #c0c4cc;
  font-size: 12px;
}
.case-steps-preview:hover {
  color: #409eff;
  background: #ecf5ff;
}
.case-steps-preview:hover i { color: #409eff; }

.case-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #ebeef5;
}
.case-action-buttons .el-button {
  margin: 0;
}
.case-action-buttons .el-button--small {
  padding: 5px 9px;
}
.case-action-buttons .btn-label {
  margin-left: 2px;
}
@media (max-width: 1100px) {
  .case-action-buttons .btn-label { display: none; }
  .case-action-buttons .el-button i.fas { margin-right: 0; }
}

.case-tree .child-cases {
  display: none;
  margin: 10px 0 0 14px;
  padding: 0 0 0 14px;
  border-left: 2px solid #e4e7ed;
  list-style: none;
}
.case-tree .child-cases > .case-node {
  margin-bottom: 8px;
}
.case-tree .child-cases > .case-node:last-child {
  margin-bottom: 0;
}
.case-node.is-expanded > .child-cases {
  display: block;
}

.collapse-btn {
  cursor: pointer;
  color: #909399;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 4px;
  background: transparent;
  padding: 0;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.collapse-btn:hover {
  color: #409eff;
  background: #ecf5ff;
}
.collapse-btn.is-expanded {
  color: #409eff;
}
.collapse-btn.is-expanded i {
  transform: none;
}
.collapse-btn i {
  transition: color 0.15s ease;
  font-size: 14px;
}

.el-loading-mask-lite {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 16px 22px;
  border-radius: 6px;
  z-index: 9999;
  font-size: 14px;
}
.el-toast-lite {
  position: fixed;
  top: 20px;
  right: 20px;
  color: #fff;
  padding: 12px 16px;
  border-radius: 4px;
  z-index: 9999;
  font-size: 14px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.case-tree li.case-node.drop-hover {
  border-color: #409eff;
  background: #ecf5ff;
}
.case-tree li.case-node.dragging {
  opacity: 0.45;
}
.collapse-btn.is-leaf-spacer {
  visibility: hidden;
  pointer-events: none;
  cursor: default;
}
.drag-handle {
  cursor: grab;
  color: #c0c4cc;
  width: 18px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.drag-handle:active { cursor: grabbing; }
.drag-handle:hover { color: #909399; }

.case-sort-placeholder {
  display: block !important;
  height: 48px !important;
  margin: 0 0 8px;
  border: 2px dashed #409eff !important;
  background: #ecf5ff !important;
  border-radius: 6px;
  visibility: visible !important;
  list-style: none;
  box-sizing: border-box;
  pointer-events: none;
  color: #409eff;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}
/* 拖动中原节点半透明，绝不 display:none，避免松手后消失 */
.case-tree.is-dragging li.case-node.case-drag-source {
  opacity: 0.35;
}
.case-tree li.case-node.case-drop-flash {
  outline: 2px solid #67c23a;
  background: #f0f9eb !important;
  transition: background 0.8s ease;
}
body.case-dnd-active {
  cursor: grabbing !important;
  user-select: none !important;
}
body.case-dnd-active * {
  cursor: grabbing !important;
}
.case-tree li.case-node.drop-inside {
  background: #ecf5ff !important;
  border-color: #409eff;
  outline: 2px dashed #409eff;
}
.case-drag-helper {
  z-index: 2147483646 !important;
}

.result-icon.success,
span[id^="result-icon-"].ok { color: #67c23a; font-weight: 700; }
.result-icon.failure { color: #f56c6c; font-weight: 700; }

.settings-fab {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #409eff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(64, 158, 255, 0.4);
  z-index: 1000;
  transition: background 0.2s, transform 0.2s;
  font-size: 18px;
}
.settings-fab:hover {
  background: #66b1ff;
  transform: scale(1.06);
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.settings-section {
  border-bottom: 1px solid #ebeef5;
  padding-bottom: 16px;
  margin-bottom: 16px;
}
.settings-section h5 {
  margin-bottom: 12px;
  color: #303133;
  font-size: 15px;
  font-weight: 600;
}
.settings-section h5 i { color: #409eff; margin-right: 6px; }

/* 兼容旧 btn 类：映射为 Element Plus 外观（给残留 Bootstrap 类兜底） */
.el-page .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid #dcdfe6;
  background: #fff;
  color: #606266;
  border-radius: 4px;
  padding: 8px 15px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  transition: 0.1s;
  outline: none;
  text-decoration: none !important;
}
.el-page .btn:hover {
  color: #409eff;
  border-color: #c6e2ff;
  background: #ecf5ff;
}
.el-page .btn-primary { background: #409eff; border-color: #409eff; color: #fff; }
.el-page .btn-primary:hover { background: #66b1ff; border-color: #66b1ff; color: #fff; }
.el-page .btn-success { background: #67c23a; border-color: #67c23a; color: #fff; }
.el-page .btn-success:hover { background: #85ce61; border-color: #85ce61; color: #fff; }
.el-page .btn-warning { background: #e6a23c; border-color: #e6a23c; color: #fff; }
.el-page .btn-warning:hover { background: #ebb563; border-color: #ebb563; color: #fff; }
.el-page .btn-danger { background: #f56c6c; border-color: #f56c6c; color: #fff; }
.el-page .btn-danger:hover { background: #f78989; border-color: #f78989; color: #fff; }
.el-page .btn-info { background: #909399; border-color: #909399; color: #fff; }
.el-page .btn-info:hover { background: #a6a9ad; border-color: #a6a9ad; color: #fff; }
.el-page .btn-secondary { background: #fff; border-color: #dcdfe6; color: #606266; }
.el-page .btn-sm,
.el-page .btn-small {
  padding: 5px 11px;
  font-size: 12px;
  border-radius: 3px;
}
.el-page .btn-outline-secondary,
.el-page .btn-outline-primary,
.el-page .btn-outline-danger {
  background: #fff;
}
.el-page .btn-outline-primary { color: #409eff; border-color: #409eff; }
.el-page .btn-outline-danger { color: #f56c6c; border-color: #f56c6c; }
.el-page .btn-outline-secondary { color: #606266; border-color: #dcdfe6; }

.el-tag-inline {
  display: inline-block;
  padding: 0 8px;
  height: 22px;
  line-height: 20px;
  font-size: 12px;
  border-radius: 4px;
  border: 1px solid #d9ecff;
  background: #ecf5ff;
  color: #409eff;
}

/* 批量页共用（新增/更新/递归/JSON） */
.el-page-shell.batch-shell {
  max-width: 96%;
}
.el-batch-card {
  margin-bottom: 16px;
}
.el-batch-card .el-card__header {
  padding: 12px 16px;
}
.el-batch-card .el-card__body {
  padding: 16px;
}
.el-batch-card .el-card__body.p-0 {
  padding: 0;
}
.el-page .copy-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 5px;
  padding: 0 !important;
  min-height: 38px;
}
.el-page .move-up,
.el-page .move-down {
  padding: 2px 8px;
  font-size: 12px;
  margin: 1px 0;
  min-height: auto;
}
.el-page .batchTestCaseItem:hover {
  background-color: #f5f7fa;
}
.el-page .expand-btn {
  font-size: 12px;
  color: #409eff;
  cursor: pointer;
  margin-top: 5px;
}
.el-page .input-group-append .el-button {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.el-page .form-control:focus {
  border-color: #409eff;
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.15);
}

@media (max-width: 768px) {
  .el-page-shell { padding: 16px 12px 40px; }
  .el-page-shell.batch-shell { max-width: 100%; }
  .case-node-row { flex-wrap: wrap; }
  .case-action-buttons { width: 100%; }
  .case-action-buttons .btn-label { display: none; }
  .case-action-buttons .el-button i.fas { margin-right: 0; }
  .tree-header-actions { width: 100%; }
  .tree-header-actions .el-button { flex: 1; justify-content: center; }
}
