/* ── 测试模块样式 ──────────────────────────────────────────────────────────── */
.test-module { display:flex; flex-direction:column; height:100%; background:#f5f6fa; }

.test-topbar {
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 20px; background:#fff; border-bottom:1px solid #e8eaf0; gap:12px; flex-shrink:0;
}
.test-nav-tabs { display:flex; gap:4px; }
.test-nav-btn {
  padding:6px 16px; border:none; background:transparent; border-radius:6px;
  font-size:14px; cursor:pointer; color:#666; transition:all .15s;
}
.test-nav-btn.active { background:#667eea; color:#fff; }
.test-nav-btn:hover:not(.active) { background:#f0f1ff; color:#667eea; }
.test-topbar-actions { display:flex; gap:8px; align-items:center; }

.test-content { flex:1; overflow-y:auto; padding:20px; }
.test-empty { text-align:center; padding:60px 20px; color:#aaa; }

/* ── 按钮 ── */
.test-btn {
  padding:7px 16px; border:1px solid #dde1eb; border-radius:6px;
  background:#fff; color:#444; font-size:13px; cursor:pointer; white-space:nowrap;
}
.test-btn:hover { border-color:#667eea; color:#667eea; }
.test-btn-primary {
  padding:7px 16px; border:none; border-radius:6px;
  background:#667eea; color:#fff; font-size:13px; cursor:pointer; white-space:nowrap;
}
.test-btn-primary:hover { background:#5a6fd6; }

/* ── 表单 ── */
.test-input {
  padding:7px 10px; border:1px solid #dde1eb; border-radius:6px;
  font-size:13px; outline:none; box-sizing:border-box;
}
.test-input:focus { border-color:#667eea; }
.test-select {
  padding:6px 10px; border:1px solid #dde1eb; border-radius:6px;
  font-size:13px; background:#fff; cursor:pointer;
}
.test-form-label { font-size:13px; color:#555; display:block; margin-bottom:4px; }

/* ── 计划卡片 ── */
.test-plans-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:16px; }
.test-plan-card {
  background:#fff; border-radius:10px; padding:16px; cursor:pointer;
  border:1px solid #e8eaf0; transition:box-shadow .15s, transform .15s;
}
.test-plan-card:hover { box-shadow:0 4px 16px rgba(102,126,234,.15); transform:translateY(-1px); }
.test-plan-card-header { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.test-plan-status-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.test-plan-title { font-size:15px; font-weight:600; color:#222; flex:1; }
.test-plan-status-label { font-size:12px; font-weight:500; }
.test-plan-desc { font-size:13px; color:#888; margin-bottom:8px; }
.test-plan-stats { display:flex; gap:12px; font-size:13px; margin-bottom:6px; }
.test-plan-meta { font-size:12px; color:#aaa; }
.stat-pass { color:#2ecc71; } .stat-fail { color:#e74c3c; }
.stat-pending { color:#f39c12; } .stat-total { color:#888; }

/* ── 计划详情 ── */
.test-plan-detail { max-width:900px; margin:0 auto; }
.test-plan-detail-header {
  display:flex; align-items:center; gap:16px; margin-bottom:20px;
  padding:16px; background:#fff; border-radius:10px; border:1px solid #e8eaf0;
}
.test-plan-detail-header > div:nth-child(2) { flex:1; }
.test-plan-detail-actions { display:flex; gap:8px; }
.test-back-btn { background:none; border:none; color:#667eea; cursor:pointer; font-size:14px; padding:4px 8px; }
.test-back-btn:hover { text-decoration:underline; }

.test-progress-bar-wrap { background:#fff; border-radius:8px; padding:14px 16px; margin-bottom:16px; border:1px solid #e8eaf0; }
.test-progress-stats { display:flex; gap:16px; font-size:13px; margin-bottom:8px; align-items:center; }
.test-progress-bar { height:8px; background:#eee; border-radius:4px; overflow:hidden; display:flex; }
.test-progress-pass { background:#2ecc71; transition:width .3s; }
.test-progress-fail { background:#e74c3c; transition:width .3s; }

/* ── 模块分组 ── */
.test-module-group { background:#fff; border-radius:10px; border:1px solid #e8eaf0; margin-bottom:12px; overflow:hidden; }
.test-module-group-header { padding:10px 16px; background:#f8f9ff; font-size:13px; font-weight:600; color:#444; border-bottom:1px solid #e8eaf0; }
.test-case-row { padding:12px 16px; border-bottom:1px solid #f0f2f8; transition:background .1s; }
.test-case-row:last-child { border-bottom:none; }
.test-case-row.pass { border-left:3px solid #2ecc71; }
.test-case-row.fail { border-left:3px solid #e74c3c; }
.test-case-row.skip { border-left:3px solid #95a5a6; opacity:.7; }
.test-case-row-main { display:flex; align-items:center; gap:8px; margin-bottom:4px; }
.test-case-no { font-size:12px; color:#aaa; min-width:50px; }
.test-case-title { font-size:14px; color:#222; flex:1; }
.test-case-expected { font-size:12px; color:#888; padding-left:58px; margin-top:2px; }
.test-case-steps { font-size:12px; color:#aaa; padding-left:58px; margin-top:2px; }
.test-case-priority { font-size:11px; padding:2px 6px; border-radius:4px; background:#fff3cd; color:#856404; }
.test-case-row-actions { display:flex; gap:6px; margin-top:8px; padding-left:50px; }
.test-result-btn {
  padding:4px 10px; border:1px solid #dde1eb; border-radius:5px;
  font-size:12px; cursor:pointer; background:#fff; color:#666; transition:all .1s;
}
.test-result-btn:hover { border-color:#667eea; }
.test-result-btn.active { background:#2ecc71; color:#fff; border-color:#2ecc71; }
.test-result-btn.fail.active { background:#e74c3c; border-color:#e74c3c; }
.test-result-btn.skip.active { background:#95a5a6; border-color:#95a5a6; }
.test-remove-btn { margin-left:auto; background:none; border:none; color:#ccc; cursor:pointer; font-size:14px; padding:2px 6px; }
.test-remove-btn:hover { color:#e74c3c; }

/* ── 用例库 ── */
.test-select-banner {
  display:flex; align-items:center; justify-content:space-between;
  background:#667eea; color:#fff; padding:10px 16px; border-radius:8px;
  margin-bottom:12px; font-size:14px;
}
.test-select-banner div { display:flex; gap:8px; }
.test-select-banner .test-btn { background:rgba(255,255,255,.15); color:#fff; border-color:rgba(255,255,255,.3); }
.test-select-banner .test-btn-primary { background:#fff; color:#667eea; }

.test-cases-toolbar {
  display:flex; align-items:center; gap:10px; margin-bottom:14px; flex-wrap:wrap;
  background:#fff; padding:12px 16px; border-radius:8px; border:1px solid #e8eaf0;
}
.tc-search { flex:1; min-width:140px; }
.test-upload-btn { cursor:pointer; display:inline-flex; align-items:center; gap:4px; }
.test-cases-list { display:flex; flex-direction:column; gap:8px; }
.test-case-item {
  background:#fff; border-radius:8px; padding:12px 16px;
  border:1px solid #e8eaf0; display:flex; align-items:flex-start; gap:10px;
}
.test-case-item.selectable { cursor:pointer; transition:border-color .1s; }
.test-case-item.selectable:hover { border-color:#667eea; }
.test-case-item.selected { border-color:#667eea; background:#f0f3ff; }
.test-case-checkbox { margin-top:3px; flex-shrink:0; width:16px; height:16px; cursor:pointer; }
.test-case-item-body { flex:1; min-width:0; }
.test-case-item-header { display:flex; align-items:center; gap:6px; margin-bottom:4px; flex-wrap:wrap; }
.test-case-item-title { font-size:14px; color:#222; }
.test-case-item-expected { font-size:12px; color:#888; margin-top:3px; }
.test-case-suite-tag { font-size:11px; padding:2px 6px; border-radius:4px; background:#e8f0ff; color:#667eea; }
.test-case-module-tag { font-size:11px; padding:2px 6px; border-radius:4px; background:#f0f2f8; color:#666; }
.test-case-module-tag.l2 { background:#fafafa; }

/* ── Modal ── */
.test-modal-overlay {
  position:fixed; inset:0; background:rgba(0,0,0,.45); z-index:3000;
  display:none; align-items:center; justify-content:center;
}
.test-modal-box {
  background:#fff; border-radius:12px; padding:24px; width:460px; max-width:90vw;
  box-shadow:0 8px 40px rgba(0,0,0,.2);
}
