/* 位置追踪 + 预警设置 · 样式（复用主题变量） */

.hidden { display: none !important; }

/* ===== 标签导航 ===== */
.tabs {
  display: flex;
  gap: 8px;
  padding: 0 22px;
  margin: 14px 0 4px;
  flex-wrap: wrap;
}
.tab {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: all .18s cubic-bezier(.16,1,.3,1);
}
.tab:hover { color: var(--text); border-color: var(--accent); transform: translateY(-1px); }
.tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 70%, #000));
  border-color: transparent;
  box-shadow: 0 6px 18px -8px var(--accent);
}

/* ===== 通用栅格 ===== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.inline.checkbox { cursor: pointer; }
.inline input { width: auto; }

/* ===== 位置看板 ===== */
td.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; font-weight: 600; letter-spacing: .3px; }
.kw-meta { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.muted-cell { color: var(--muted); font-size: 12.5px; }

/* ===== 预警：双栏卡片 ===== */
.cards-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 0 22px;
  margin-bottom: 14px;
}

/* 渠道列表 */
.channel-list { display: flex; flex-direction: column; gap: 10px; }
.channel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elevated);
}
.ch-icon {
  width: 34px; height: 34px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 9px; color: #fff;
}
.ch-icon.dingtalk { background: #1e9fff; }
.ch-icon.email { background: #2b6cb0; }
.ch-icon svg { width: 18px; height: 18px; }
.ch-main { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.ch-name { font-weight: 600; font-size: 14px; }
.ch-type { font-size: 12px; color: var(--muted); }

/* 开关 */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--border); border-radius: 22px; transition: .2s;
}
.slider::before {
  content: ""; position: absolute; height: 16px; width: 16px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); }

.del-btn { color: var(--muted); }
.del-btn:hover { color: #ef4444; background: color-mix(in srgb, #ef4444 14%, transparent); }

/* 预警记录 */
.alert-log { display: flex; flex-direction: column; gap: 9px; max-height: 460px; overflow: auto; }
.alert-item {
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  background: var(--bg-elevated);
}
.alert-item.ok { border-left-color: var(--down); }
.alert-item.fail { border-left-color: #ef4444; }
.alert-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.alert-badge {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  background: color-mix(in srgb, var(--up) 18%, transparent); color: var(--up);
}
.alert-badge.drop { background: color-mix(in srgb, #ef4444 18%, transparent); color: #ef4444; }
.alert-badge.change { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.alert-time { font-size: 11px; color: var(--muted); }
.alert-body { font-weight: 600; font-size: 13.5px; }
.alert-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 阈值列表 */
.threshold-list { display: flex; flex-direction: column; gap: 10px; }
.th-item {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg-elevated); flex-wrap: wrap;
}
.th-main { display: flex; flex-direction: column; min-width: 0; }
.th-kw { font-weight: 600; font-size: 14px; }
.th-meta { font-size: 12px; color: var(--muted); }
.th-inputs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.th-inputs label { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.th-inputs input { width: 64px; }
.th-inputs select { width: auto; }

.empty-hint { color: var(--muted); font-size: 13px; padding: 8px 2px; }

/* 响应式 */
@media (max-width: 760px) {
  .cards-2 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .tab { flex: 1 1 auto; text-align: center; }
}
