/* 安全管理页面专用样式 */

.security-page {
  padding: 10px;
  background: #f9fafb;
  min-height: 500px;
}

.security-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 10px;
  overflow-x: auto;
}

.sec-tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.sec-tab:hover {
  background: #f3f4f6;
  color: #111827;
}

.sec-tab.active {
  background: #2563eb;
  color: #ffffff;
}

/* 仪表盘统计卡片 */
.security-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid #f3f4f6;
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: #6b7280;
  margin-top: 4px;
}

/* 攻击分布条 */
.attack-details {
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 24px;
  border: 1px solid #f3f4f6;
}

.attack-bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.attack-bar-item span:first-child {
  width: 80px;
  font-size: 13px;
  color: #4b5563;
}

.attack-bar {
  flex: 1;
  height: 8px;
  background: #f3f4f6;
  border-radius: 4px;
  overflow: hidden;
}

.attack-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s ease-out;
}

/* 事件列表 */
.event-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.event-item {
  background: #ffffff;
  padding: 12px 16px;
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #f3f4f6;
}

.event-type {
  font-weight: 500;
  color: #374151;
  font-size: 14px;
}

.event-ip {
  font-family: monospace;
  color: #6b7280;
  background: #f9fafb;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.event-time {
  font-size: 12px;
  color: #9ca3af;
}

/* 威胁卡片网格 */
.threat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.threat-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px;
  border-left: 4px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.threat-critical { border-left-color: #dc2626; background: #fffafb; }
.threat-warning { border-left-color: #d97706; background: #fffcf5; }

.threat-type { font-weight: 600; color: #111827; margin-bottom: 8px; }
.threat-count { font-size: 28px; font-weight: 700; margin-bottom: 4px; }
.threat-level { font-size: 11px; font-weight: 700; color: #6b7280; text-transform: uppercase; }
.threat-last { font-size: 12px; color: #9ca3af; margin-top: 8px; }

/* 表格优化 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 12px;
  background: #f9fafb;
  color: #4b5563;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid #f3f4f6;
  color: #111827;
}

.data-table tr:hover {
  background: #fcfcfd;
}

/* 标签样式 */
.badge {
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
}

.badge-danger { background: #fee2e2; color: #dc2626; }
.badge-warning { background: #fef3c7; color: #d97706; }
.badge-success { background: #dcfce7; color: #16a34a; }

/* 审计日志筛选器 */
.audit-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  background: #ffffff;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #f3f4f6;
}

.event-type-tag {
  background: #eff6ff;
  color: #2563eb;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

/* 设置组 */
.settings-group {
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #f3f4f6;
  margin-bottom: 20px;
}

.settings-group h4 {
  margin: 0 0 16px 0;
  color: #111827;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 8px;
}

.setting-item {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.setting-item label {
  width: 150px;
  font-size: 14px;
  color: #374151;
}

.setting-hint {
  font-size: 12px;
  color: #9ca3af;
}

/* 响应式调整 */
@media (max-width: 640px) {
  .security-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .setting-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .setting-item label {
    width: 100%;
  }
}
