/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-lg {
  padding: 8px 24px;
  font-size: 14px;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--color-primary-dark);
  color: #ffffff;
  border-color: var(--color-primary-dark);
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-default {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-subtle);
}

.btn-default:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.btn-danger {
  background: var(--color-danger);
  color: #ffffff;
  border-color: var(--color-danger);
}

.btn-danger:hover {
  filter: brightness(1.1);
}

.btn-link {
  background: none;
  border: none;
  color: var(--color-primary);
  padding: 0;
  cursor: pointer;
}

.btn-link:hover {
  text-decoration: underline;
}

/* === 卡片 === */
.scrm-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}

.scrm-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.scrm-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.scrm-card-body {
  /* 留空 */
}

/* === 表格 === */
.scrm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.scrm-table thead {
  background: var(--bg-table-header);
}

.scrm-table th {
  padding: 10px 16px;
  text-align: left;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 12px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.scrm-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.scrm-table tbody tr:nth-child(even) {
  background: var(--bg-table-alt);
}

.scrm-table tbody tr:hover {
  background: var(--bg-hover);
}

/* === 标签 (Tag) === */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 12px;
  line-height: 1.4;
}

.tag-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tag-info {
  background: #1f6feb20;
  color: var(--chart-1);
}

.tag-success {
  background: #23863620;
  color: var(--chart-2);
}

.tag-warning {
  background: #9e6a0320;
  color: var(--chart-3);
}

.tag-danger {
  background: #da363320;
  color: var(--chart-4);
}

.tag-muted {
  background: #8b949e20;
  color: var(--text-secondary);
}

.tag-value {
  background: #8957e820;
  color: var(--chart-5);
}

/* === 状态标识 === */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}

.status-dot.active { background: var(--color-success); }
.status-dot.running { background: var(--color-warning); }
.status-dot.failed { background: var(--color-danger); }
.status-dot.muted { background: var(--text-muted); }

/* === 模态弹窗 === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  width: 480px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid var(--border-color);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  line-height: 1;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
  color: var(--text-primary);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
}

/* === 引导弹窗 === */
.guide-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.guide-modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 420px;
  border: 1px solid var(--border-color);
}

.guide-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.guide-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.guide-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.guide-step {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.guide-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-primary-dim);
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 600;
}

.guide-actions {
  display: flex;
  gap: 12px;
}

/* === Tab 标签页 === */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.tab-item {
  padding: 8px 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  margin-bottom: -1px;
}

.tab-item:hover {
  color: var(--text-primary);
}

.tab-item.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 500;
}

.tab-content {
  /* 动态内容 */
}

/* === 输入/选择组件 === */
.form-input,
.form-select,
.filter-select {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  cursor: text;
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.form-input:focus,
.form-select:focus,
.filter-select:focus {
  border-color: var(--color-primary);
}

.form-select {
  cursor: pointer;
}

.form-textarea {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  outline: none;
  transition: var(--transition);
  width: 100%;
  resize: vertical;
}

.form-textarea:focus {
  border-color: var(--color-primary);
}

/* === 筛选器 === */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-select {
  width: auto;
}

.filter-buttons {
  display: inline-flex;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.filter-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  border-right: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.filter-btn:last-child {
  border-right: none;
}

.filter-btn:hover {
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--color-primary-dark);
  color: #fff;
}

/* === 指标卡 === */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.metric-card-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.metric-card-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.metric-card-change {
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* === 双列网格 === */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

/* === 三列网格 === */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
