/* ── 基础重置 ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif; background: #f5f6fa; color: #2d3436; }

/* ── 顶栏 ── */
.topbar { background: #2c3e50; color: #fff; padding: 0 24px; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.topbar h1 { font-size: 18px; font-weight: 600; }
.topbar .nav { display: flex; gap: 8px; }
.topbar .nav a { color: #bdc3c7; text-decoration: none; padding: 8px 16px; border-radius: 4px; font-size: 14px; transition: all .2s; }
.topbar .nav a:hover { color: #fff; background: rgba(255,255,255,.1); }
.topbar .nav a.active { color: #fff; background: #3498db; }

/* ── 布局 ── */
.container { max-width: 1400px; margin: 0 auto; padding: 24px; }

/* ── 卡片网格 ── */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card .label { font-size: 13px; color: #95a5a6; margin-bottom: 8px; }
.card .value { font-size: 28px; font-weight: 700; color: #2c3e50; }
.card .sub { font-size: 12px; color: #95a5a6; margin-top: 4px; }
.card .value.green { color: #27ae60; }
.card .value.red { color: #e74c3c; }
.card .value.orange { color: #f39c12; }
.card .value.blue { color: #3498db; }

/* ── 区块标题 ── */
.section { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.08); margin-bottom: 24px; overflow: hidden; }
.section-header { padding: 16px 20px; border-bottom: 1px solid #eee; display: flex; align-items: center; justify-content: space-between; }
.section-header h2 { font-size: 16px; font-weight: 600; }
.section-header .actions { display: flex; gap: 8px; }
.section-body { padding: 0; }

/* ── 表格 ── */
table { width: 100%; border-collapse: collapse; }
th { background: #f8f9fa; padding: 10px 16px; text-align: left; font-size: 12px; color: #95a5a6; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
td { padding: 10px 16px; border-top: 1px solid #f0f0f0; font-size: 14px; }
tr:hover { background: #f8f9fa; }

/* ── 状态标签 ── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600; }
.badge-running { background: #e3f2fd; color: #1976d2; }
.badge-pending { background: #fff3e0; color: #f57c00; }
.badge-completed { background: #e8f5e9; color: #388e3c; }
.badge-failed { background: #ffebee; color: #d32f2f; }
.badge-canceled { background: #f5f5f5; color: #9e9e9e; }
.badge-active { background: #e8f5e9; color: #388e3c; }
.badge-inactive { background: #ffebee; color: #d32f2f; }

/* ── 比分列居中对齐（表头 + 单元格），并整体稍向右微移 4px 对齐视觉中线 ── */
#live-matches-body td:nth-child(6),
#live-matches-head th:nth-child(6) { text-align: center; padding-left: 4px; }

/* ── 比分单元格：固定宽度三栏，比分居中，两侧固定宽度占位，红牌不推动比分 ── */
.score-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 92px;
  height: 20px;
  vertical-align: middle;
}
.score-cell .score-value {
  flex: 0 0 44px;
  text-align: center;
  white-space: nowrap;
}
.score-cell .score-side {
  flex: 0 0 24px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.score-cell .score-home { justify-content: flex-end; }
.score-cell .score-away { justify-content: flex-start; }

/* ── 红牌内联图标（live 滚球表格比分旁） ── */
.red-cards { display: inline-flex; gap: 2px; vertical-align: middle; }
.red-card { display: inline-block; width: 9px; height: 13px; background: #e53935; border: 1px solid #b71c1c; border-radius: 2px; box-sizing: border-box; }

/* ── 按钮 ── */
.btn { padding: 6px 14px; border: none; border-radius: 4px; font-size: 13px; cursor: pointer; transition: all .2s; }
.btn-primary { background: #3498db; color: #fff; }
.btn-primary:hover { background: #2980b9; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-danger:hover { background: #c0392b; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── 筛选栏 ── */
.filter-bar { display: flex; gap: 12px; align-items: center; padding: 16px 20px; border-bottom: 1px solid #eee; flex-wrap: wrap; }
.filter-bar select, .filter-bar input { padding: 6px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px; }

/* ── 服务状态行 ── */
.service-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid #f0f0f0; }
.service-row:first-child { border-top: none; }
.service-info { display: flex; align-items: center; gap: 12px; }
.service-info .name { font-weight: 600; font-size: 14px; }
.service-info .desc { font-size: 12px; color: #95a5a6; }

/* ── 空状态 ── */
.empty { padding: 40px; text-align: center; color: #bbb; font-size: 14px; }

/* ── 自动刷新指示 ── */
.refresh-indicator { font-size: 12px; color: #95a5a6; }
.refresh-indicator .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #27ae60; margin-right: 6px; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ── 可点击 ID ── */
.link-id { color: #3498db; text-decoration: none; font-weight: 600; }
.link-id:hover { text-decoration: underline; }

/* ── 分页栏 ── */
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 20px; border-top: 1px solid #f0f0f0; }
.pagination .page-info { font-size: 12px; color: #95a5a6; margin-right: auto; }
.pagination .page-num { font-size: 13px; color: #2d3436; font-weight: 600; }

/* ── 任务详情弹窗 ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal { background: #fff; border-radius: 8px; width: 90%; max-width: 720px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 8px 32px rgba(0,0,0,.2); }
.modal-header { padding: 16px 20px; border-bottom: 1px solid #eee; display: flex; align-items: center; justify-content: space-between; }
.modal-header h2 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 24px; color: #95a5a6; cursor: pointer; line-height: 1; padding: 0 4px; }
.modal-close:hover { color: #2d3436; }
.modal-body { padding: 20px; overflow-y: auto; }

/* ── 按钮组 ── */
.btn-group { display: inline-flex; gap: 0; }
.btn-group .btn { border-radius: 0; margin: 0; }
.btn-group .btn:first-child { border-radius: 4px 0 0 4px; }
.btn-group .btn:last-child { border-radius: 0 4px 4px 0; }
.btn-group .btn.active { background: #3498db; color: #fff; border-color: #3498db; }

/* ── 直播筛选按钮 ── */
.live-filter-btn { background: #fff; color: #555; border: 1px solid #ddd; }
.live-filter-btn.active { background: #3498db; color: #fff; border-color: #3498db; }

/* ── 状态概览 chips ── */
.status-overview { display: flex; gap: 12px; padding: 12px 16px; flex-wrap: wrap; border-bottom: 1px solid #f0f0f0; }
.status-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 16px; background: #f8f9fa; font-size: 13px; color: #555; cursor: pointer; user-select: none; transition: all 0.15s; }
.status-chip:hover { background: #e9ecef; }
.status-chip.active { background: #3498db; color: #fff; }
.status-chip b { font-weight: 700; }
.status-chip.alert { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.status-chip.alert:hover { background: #ffeaa7; }
.status-chip.alert.active { background: #e74c3c; color: #fff; border-color: #e74c3c; }

/* ── 详情表格 ── */
.detail-table { width: 100%; border-collapse: collapse; }
.detail-table th { background: transparent; padding: 8px 12px; text-align: left; font-size: 13px; color: #95a5a6; font-weight: 600; text-transform: none; letter-spacing: 0; width: 160px; vertical-align: top; }
.detail-table td { padding: 8px 12px; border-top: 1px solid #f0f0f0; font-size: 13px; word-break: break-all; }
.detail-section-title { margin-top: 16px; padding: 8px 12px; background: #f8f9fa; font-size: 12px; color: #95a5a6; font-weight: 600; border-radius: 4px; }
.detail-pre { margin-top: 8px; padding: 12px; background: #f8f9fa; border-radius: 4px; font-size: 12px; font-family: "Consolas", "Monaco", monospace; white-space: pre-wrap; word-break: break-all; max-height: 240px; overflow-y: auto; }
