/* ============================================================
   企业风格样式：简洁、稳重、低饱和，普通后台网站观感
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: #f5f6f8;
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 14px;
}

/* ---------- 顶部导航 ---------- */
.navbar {
  background: #2b3a4a;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 52px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.nav-brand-sub {
  font-size: 12px;
  font-weight: 400;
  color: #b8c4d0;
  margin-left: 8px;
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.nav-links a {
  color: #c6d0da;
  text-decoration: none;
  margin-left: 4px;
  padding: 6px 12px;
  font-size: 13px;
}

.nav-links a:hover { color: #fff; background: rgba(255,255,255,.1); }
.nav-links a.active { color: #fff; background: #3f5570; }

.nav-user {
  color: #fff;
  font-size: 13px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid #4a5c6e;
}

/* ---------- 布局 ---------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 40px;
  flex: 1;
}

.footer {
  text-align: center;
  padding: 14px;
  color: #8a94a0;
  font-size: 12px;
  background: #fff;
  border-top: 1px solid #e0e3e7;
  line-height: 1.8;
}

/* ---------- 提示消息 ---------- */
.flash {
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 13px;
  border: 1px solid;
}
.flash-error { background: #fdf0ef; border-color: #e8c4c0; color: #a33a30; }
.flash-success { background: #f0f7f0; border-color: #c4dcc4; color: #3a7a3a; }

/* ---------- 卡片 ---------- */
.card {
  background: #fff;
  border: 1px solid #e0e3e7;
  border-radius: 4px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.card h2 { font-size: 16px; margin-bottom: 12px; color: #2b3a4a; font-weight: 700; }

.page-title {
  font-size: 20px;
  color: #2b3a4a;
  margin-bottom: 14px;
  font-weight: 700;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 3px;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s;
  color: #fff;
}
.btn-primary { background: #337ab7; border-color: #2e6da4; }
.btn-primary:hover { background: #286090; }
.btn-success { background: #5cb85c; border-color: #4cae4c; }
.btn-success:hover { background: #449d44; }
.btn-secondary { background: #7b8794; border-color: #6e7a87; }
.btn-secondary:hover { background: #687482; }
.btn-danger { background: #d9534f; border-color: #d43f3a; }
.btn-danger:hover { background: #c9302c; }
.btn-sm { padding: 4px 9px; font-size: 12px; }
.btn-block { display: block; width: 100%; padding: 9px; font-size: 15px; }
form button { font-family: inherit; }

/* ---------- 输入框 ---------- */
.input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #c9ced4;
  border-radius: 3px;
  font-size: 14px;
  background: #fff;
}
.input:focus { outline: none; border-color: #337ab7; box-shadow: 0 0 3px rgba(51,122,183,.4); }

/* ---------- 状态徽章（保留功能性的风险色，弱化装饰） ---------- */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid;
}
.badge-critical { background: #fdf0ef; color: #b32d27; border-color: #e8c4c0; }
.badge-high { background: #fdf6ef; color: #b36a1e; border-color: #ecd7bc; }
.badge-medium { background: #fdfbf0; color: #9a8423; border-color: #e8dcae; }
.badge-low { background: #f0f4fa; color: #3a6ea5; border-color: #c4d4e4; }
.badge-info { background: #f4f5f6; color: #5a6570; border-color: #d5d9dd; }
.badge-running { background: #f0f4fa; color: #3a6ea5; border-color: #c4d4e4; }
.badge-completed { background: #f0f7f0; color: #3a7a3a; border-color: #c4dcc4; }
.badge-failed { background: #fdf0ef; color: #a33a30; border-color: #e8c4c0; }
.badge-interrupted { background: #f4f5f6; color: #5a6570; border-color: #d5d9dd; }
.badge-total { background: #f2f0f8; color: #4d4a8a; border-color: #d2cfe4; }
.badge-active { background: #f0f7f0; color: #3a7a3a; border-color: #c4dcc4; }
.badge-disabled { background: #f4f5f6; color: #5a6570; border-color: #d5d9dd; }

/* ---------- 统计卡片 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  background: #fff;
  border: 1px solid #e0e3e7;
  border-radius: 4px;
  padding: 14px 16px;
  text-align: center;
}
.stat-num { font-size: 26px; font-weight: 700; color: #2b3a4a; }
.stat-label { font-size: 12px; color: #6b7580; margin-top: 3px; }

/* ---------- 表格 ---------- */
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  border: 1px solid #e0e3e7;
}
table.data th {
  background: #f2f4f6;
  color: #333;
  border-bottom: 1px solid #d5d9dd;
  text-align: left;
  padding: 9px 10px;
  font-weight: 700;
  font-size: 13px;
}
table.data td {
  padding: 8px 10px;
  border-bottom: 1px solid #eef0f2;
  vertical-align: middle;
}
table.data tr:hover td { background: #f8f9fa; }

/* ---------- 表单 ---------- */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 5px; color: #444; font-size: 13px; }
.form-group textarea {
  width: 100%;
  min-height: 110px;
  padding: 10px;
  border: 1px solid #c9ced4;
  border-radius: 3px;
  font-size: 13px;
  font-family: Consolas, Monaco, "Courier New", monospace;
  resize: vertical;
}
.form-group textarea:focus { outline: none; border-color: #337ab7; }
.form-hint { font-size: 12px; color: #7a8490; margin-top: 5px; line-height: 1.7; }
.form-error {
  background: #fdf0ef;
  border: 1px solid #e8c4c0;
  color: #a33a30;
  padding: 9px 12px;
  margin-bottom: 14px;
  font-size: 13px;
}
.form-inline { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form-inline .form-group { margin-bottom: 0; }
.form-inline .form-group label { font-size: 12px; }
.form-inline .input { width: 180px; }

/* ---------- 登录页 ---------- */
.login-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 120px);
  padding: 20px;
}
.login-box {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border: 1px solid #e0e3e7;
  border-radius: 4px;
  padding: 32px 34px;
}
.login-title { font-size: 19px; font-weight: 700; color: #2b3a4a; text-align: center; margin-bottom: 4px; }
.login-sub { text-align: center; font-size: 13px; color: #6b7580; margin-bottom: 2px; }
.login-tag { text-align: center; font-size: 12px; color: #9aa3ac; margin-bottom: 22px; }
.login-foot { text-align: center; font-size: 12px; color: #9aa3ac; margin-top: 16px; }

/* ---------- 任务列表 ---------- */
.task-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: #fff;
  border: 1px solid #e0e3e7;
  border-radius: 4px;
  margin-bottom: 10px;
  border-left: 3px solid #337ab7;
}
.task-item.failed { border-left-color: #d9534f; }
.task-item.completed { border-left-color: #5cb85c; }
.task-meta { font-size: 12px; color: #7a8490; margin-top: 4px; }
.task-targets { font-weight: 700; font-size: 14px; }
.task-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; flex-wrap: wrap; }
.task-summary { display: flex; gap: 8px; margin-top: 7px; flex-wrap: wrap; }

/* ---------- 详情页 ---------- */
.meta-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.meta-table td { padding: 7px 10px; border-bottom: 1px solid #eef0f2; }
.meta-table td:first-child { width: 120px; font-weight: 600; color: #6b7580; }

.progress-bar {
  background: #e8ebee;
  border-radius: 3px;
  height: 8px;
  overflow: hidden;
  margin-top: 10px;
}
.progress-bar .fill {
  height: 100%;
  border-radius: 3px;
  background: #337ab7;
  transition: width .5s;
}

/* ---------- 漏洞详情 ---------- */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 14px 0; }
.detail-box {
  background: #f8f9fa;
  border: 1px solid #e0e3e7;
  border-radius: 3px;
  padding: 12px;
}
.detail-box .k { font-size: 12px; color: #7a8490; margin-bottom: 4px; }
.detail-box .v { font-size: 14px; font-weight: 600; word-break: break-all; }
.section-title { font-size: 15px; font-weight: 700; color: #2b3a4a; margin: 20px 0 10px; }
.text-block {
  background: #f8f9fa;
  border-left: 3px solid #337ab7;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-all;
}
.raw-json {
  background: #2b3a4a;
  color: #dbe2e8;
  padding: 12px;
  border-radius: 3px;
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 320px;
  overflow-y: auto;
}
.reference-links a {
  color: #337ab7;
  text-decoration: none;
  word-break: break-all;
  margin-right: 12px;
}
.reference-links a:hover { text-decoration: underline; }

.toolbar { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0; }

.export-group { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.export-group .label { font-size: 13px; color: #7a8490; margin-right: 2px; }

.text-muted { color: #9aa3ac; font-size: 13px; }
.text-success { color: #3a7a3a; }
.text-danger { color: #a33a30; }
.mt-8 { margin-top: 8px; }
.mb-12 { margin-bottom: 12px; }

/* ---------- 漏洞库状态 ---------- */
.vulndb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.vulndb-table td { padding: 6px 10px; border-bottom: 1px solid #eef0f2; }
.vulndb-table td:first-child { width: 150px; font-weight: 600; color: #6b7580; }
