/* ================================================================
   security.htm + 子页共享工作台样式
   security / security_ssh / security_log / security_group / group_rules
   Accent: navy #1a3a5c + copper #9a6840
   ================================================================ */

.template.security-page {
  --sc-navy: #1a3a5c;
  --sc-copper: #9a6840;
  --sc-ink: #1a2332;
  --sc-muted: #6b7a8d;
  --sc-line: #e8ecf1;
  --sc-soft: #f5f7fa;
  --sc-card: #ffffff;
  --sc-radius: 12px;
  --sc-shadow: 0 1px 3px rgba(12, 29, 49, 0.04);
}

.template.security-page > .el-container {
  flex-direction: column;
}
.template.security-page > .el-container > .el-container {
  width: 100%;
  flex: 1;
  min-width: 0;
}

.template.security-page .el-main,
.template.security-page .el-container:nth-child(2) > .el-main {
  background: #f0f2f5 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: calc(var(--topnav-height, 56px) + 24px) 24px 24px 24px !important;
}

.template.security-page .main-card {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
}

/* ---------- 页头 ---------- */
.template.security-page .main-card-title {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px;
  margin: 0 0 16px !important;
  padding: 0 0 0 14px !important;
  position: relative;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  color: var(--sc-ink) !important;
  line-height: inherit !important;
}

.template.security-page .main-card-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(180deg, #9a6840, #c08a52);
}

.template.security-page .main-card-title .back,
.template.security-page .main-card-title .back-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--sc-line);
  background: #fff;
  cursor: pointer;
  box-sizing: border-box;
}

.template.security-page .main-card-title .back:hover,
.template.security-page .main-card-title .back-btn:hover {
  background: #f7f9fc;
  border-color: #c5d2e0;
}

.template.security-page .main-card-title .back path,
.template.security-page .main-card-title .back-btn path {
  fill: var(--sc-navy) !important;
}

.template.security-page .main-card-title .back {
  width: 16px !important;
  height: 16px !important;
  border: none;
  background: transparent;
  padding: 0;
}

.template.security-page .main-card-title .title-wrap {
  min-width: 0;
}

.template.security-page .main-card-title .title-text {
  margin: 0;
  font-size: 20px !important;
  font-weight: 700 !important;
  line-height: 1.3;
  color: var(--sc-ink) !important;
}

.template.security-page .main-card-title .title-desc {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--sc-muted);
  font-weight: 400;
}

/* ---------- 面板 ---------- */
.template.security-page .security-panel {
  background: var(--sc-card);
  border: 1px solid var(--sc-line);
  border-radius: var(--sc-radius);
  box-shadow: var(--sc-shadow);
  overflow: hidden;
}

/* ---------- 胶囊 Tab ---------- */
.template.security-page .el-tabs__header {
  margin: 0 !important;
  padding: 14px 18px 0;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
  border-bottom: 1px solid var(--sc-line);
}

.template.security-page .el-tabs__nav-wrap::after {
  display: none !important;
}

.template.security-page .el-tabs__active-bar {
  display: none !important;
}

.template.security-page .el-tabs__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template.security-page .el-tabs__item {
  height: auto !important;
  line-height: 1.2 !important;
  padding: 8px 16px !important;
  margin: 0 !important;
  border-radius: 999px !important;
  border: 1px solid #dce3ec !important;
  background: #fff !important;
  color: var(--sc-muted) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  transition: all 0.15s ease;
}

.template.security-page .el-tabs__item:hover {
  color: var(--sc-navy) !important;
  border-color: #b8c5d6 !important;
}

.template.security-page .el-tabs__item.is-active {
  color: #fff !important;
  font-weight: 700 !important;
  background: var(--sc-navy) !important;
  border-color: var(--sc-navy) !important;
  box-shadow: 0 2px 8px rgba(26, 58, 92, 0.2);
}

.template.security-page .el-tabs__content {
  padding: 0 18px 18px;
}

.template.security-page .top-text {
  margin: 14px 0 4px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f7f9fc;
  border: 1px solid var(--sc-line);
  color: var(--sc-muted);
  font-size: 13px;
  line-height: 1.5;
}

.template.security-page .top-text .top-link {
  color: var(--sc-copper);
  font-weight: 700;
  cursor: pointer;
}

/* ---------- 工具栏 / 主按钮 ---------- */
.template.security-page .content_searchbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 0;
}

.template.security-page .left-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: auto !important;
  width: auto !important;
  height: 36px !important;
  padding: 0 16px !important;
  border-radius: 8px !important;
  background: linear-gradient(135deg, #b07a4a, #9a6840) !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(154, 104, 64, 0.22);
  cursor: pointer;
  line-height: 1.2 !important;
}

.template.security-page .left-btn:hover {
  background: linear-gradient(135deg, #c08a52, #a87348) !important;
}

.template.security-page .left-btn.add {
  background: #eef3f8 !important;
  color: var(--sc-navy) !important;
  border: 1px solid #c5d2e0 !important;
  box-shadow: none !important;
}

.template.security-page .left-btn.add:hover {
  background: var(--sc-navy) !important;
  color: #fff !important;
  border-color: var(--sc-navy) !important;
}

.template.security-page .left-btn.del {
  background: #fdeceb !important;
  color: #c0392b !important;
  border: 1px solid #f0b0a8 !important;
  box-shadow: none !important;
}

.template.security-page .left-btn.del:hover {
  background: #c0392b !important;
  color: #fff !important;
  border-color: #c0392b !important;
}

.template.security-page .searchbar .el-input__inner {
  border: 1px solid #d5dde8 !important;
  border-radius: 8px !important;
  height: 36px !important;
  font-size: 13px !important;
  background: #fafbfc !important;
}

.template.security-page .searchbar .el-input__inner:focus {
  border-color: var(--sc-navy) !important;
  box-shadow: 0 0 0 3px rgba(26, 58, 92, 0.1) !important;
}

/* ---------- 表格 ---------- */
.template.security-page .el-table {
  border: 1px solid var(--sc-line) !important;
  border-radius: 10px !important;
  overflow: hidden !important;
}

.template.security-page .el-table::before,
.template.security-page .el-table--border::after {
  display: none !important;
}

.template.security-page .el-table th.el-table__cell {
  background: var(--sc-soft) !important;
  color: var(--sc-muted) !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  border-bottom: 1px solid var(--sc-line) !important;
}

.template.security-page .el-table td.el-table__cell {
  color: var(--sc-ink) !important;
  font-size: 13px !important;
  border-bottom: 1px solid #f0f3f7 !important;
}

.template.security-page .el-table .el-table__body tr:hover > td.el-table__cell {
  background: #f7f9fc !important;
}

.template.security-page .link,
.template.security-page a.link {
  color: var(--sc-navy) !important;
  font-weight: 700;
  text-decoration: none;
}

.template.security-page .link:hover,
.template.security-page a.link:hover {
  color: var(--sc-copper) !important;
}

/* 白名单状态 */
.template.security-page .open-show {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px;
  flex-wrap: nowrap;
}

.template.security-page .open-show .open,
.template.security-page .open-show .un-open {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
  min-height: 24px;
  padding: 3px 10px !important;
  border-radius: 6px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  border: 1px solid transparent;
  box-sizing: border-box;
}

.template.security-page .open-show .open {
  color: #1f7a4d !important;
  background: #e6f6ee !important;
  border-color: #8fd0ad !important;
}

.template.security-page .open-show .un-open {
  color: var(--sc-muted) !important;
  background: #f0f2f5 !important;
  border-color: #d5dde8 !important;
}

.template.security-page .open-show .setting {
  margin-left: 0 !important;
  font-size: 13px !important;
  color: var(--sc-navy) !important;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.template.security-page .open-show .setting:hover {
  color: var(--sc-copper) !important;
}

/* 操作按钮直出 */
.template.security-page .table-ops {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.template.security-page .table-ops .op-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  background: #fff;
  text-decoration: none;
  box-sizing: border-box;
}

.template.security-page .table-ops .op-btn.op-edit,
.template.security-page .table-ops .op-btn.op-view {
  color: var(--sc-navy);
  background: #eef3f8;
  border-color: #c5d2e0;
}

.template.security-page .table-ops .op-btn.op-edit:hover,
.template.security-page .table-ops .op-btn.op-view:hover {
  color: #fff;
  background: var(--sc-navy);
  border-color: var(--sc-navy);
}

.template.security-page .table-ops .op-btn.op-del {
  color: #c0392b;
  background: #fdeceb;
  border-color: #f0b0a8;
}

.template.security-page .table-ops .op-btn.op-del:hover {
  color: #fff;
  background: #c0392b;
  border-color: #c0392b;
}

.template.security-page .el-pagination .el-pager li.active {
  background: var(--sc-navy) !important;
  color: #fff !important;
}

.template.security-page .el-button--primary,
.template.security-page .dialog-footer .el-button--primary,
.template.security-page .save-btn {
  background: linear-gradient(135deg, #b07a4a, #9a6840) !important;
  border: none !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
}

.template.security-page .el-dialog {
  border-radius: 14px !important;
  overflow: hidden;
}

.template.security-page .dialog-title {
  font-weight: 700 !important;
  color: var(--sc-ink) !important;
}

@media screen and (max-width: 900px) {
  .template.security-page .el-container:nth-child(2) > .el-main {
    padding: calc(var(--topnav-height, 56px) + 14px) 12px 16px 12px !important;
  }

  .template.security-page .el-tabs__content {
    padding: 0 12px 14px;
  }

  .template.security-page .content_searchbar {
    flex-direction: column;
    align-items: stretch;
  }
}
