/* 風控前台在 Ynex 模板之上的少量微調 */
.captcha-img {
  height: 48px;
  min-width: 120px;
  border-radius: 0.5rem;
  cursor: pointer;
  background: #fff;
  border: 1px solid var(--default-border);
  object-fit: contain;
}
.dev-out {
  background: var(--custom-white);
  border: 1px solid var(--default-border);
  border-radius: 0.5rem;
  padding: 1rem;
  max-height: 380px;
  overflow: auto;
  font: 12px/1.6 "Consolas", monospace;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--default-text-color);
}
#checkCode {
  letter-spacing: 6px;
  text-align: center;
}
.conn-pill {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
}

/* 來源徽章(紀錄管理)：清楚好讀的實色文字 */
.src-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 11px;
  border-radius: 999px;
  line-height: 1.4;
}
.src-sample {
  background: #ece3fb;
  color: #6a3bd1;
  border: 1px solid #d6c4f4;
}
.src-auto {
  background: #e2eefb;
  color: #1f6fb2;
  border: 1px solid #c6def4;
}
.src-manual {
  background: #eceef3;
  color: #565d6e;
  border: 1px solid #dcdfe7;
}

/* 對打範圍徽章：同站深藍、跨站深紅(更可疑)，文字都夠深好讀 */
.scope-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 11px;
  border-radius: 999px;
  line-height: 1.4;
  white-space: nowrap;
}
.scope-same {
  background: #e0ecfb;
  color: #1c5fa8;
  border: 1px solid #c2d9f3;
}
.scope-cross {
  background: #fbe1e1;
  color: #c0332c;
  border: 1px solid #f3c5c5;
}

/* 規則設定：緊湊欄位排版(避免數字框過寬留白) */
.lr-field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  align-items: flex-start;
}
.lr-field {
  width: 150px;
}
.lr-field.lr-field-wide {
  width: 220px;
}
.lr-field .input-group,
.lr-field .form-control {
  max-width: 130px;
}
.lr-field .form-text {
  max-width: 100%;
}

/* 輸入框線加深一點點(原本太淡看不清) */
.form-control,
.form-select {
  border-color: #c4cad6;
}
.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color, #845adf);
  box-shadow: 0 0 0 0.15rem rgba(132, 90, 223, 0.12);
}
.input-group-text {
  border-color: #c4cad6;
}

/* 卡片微互動 */
.custom-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.custom-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(20, 30, 60, 0.08);
}

/* 首頁 Hero 橫幅 */
.lr-hero {
  background: linear-gradient(120deg, #845adf 0%, #4c8dff 100%);
  color: #fff;
  border-radius: 16px;
  padding: 22px 26px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: 0 10px 28px rgba(132, 90, 223, 0.28);
}
.lr-hero .lr-hero-title { font-size: 20px; font-weight: 700; margin: 0; }
.lr-hero .lr-hero-sub { margin: 6px 0 0; opacity: 0.9; font-size: 13px; }
.lr-hero .lr-hero-badge {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
}

/* 首頁統計卡：頂部彩條 + 大數字 */
.stat-card { position: relative; overflow: hidden; }
.stat-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--sc, #845adf); }
.stat-card .stat-val { font-size: 22px; font-weight: 700; }

/* 監控總覽列 */
.monitor-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px; border: 1px solid var(--default-border);
  border-radius: 12px; flex-wrap: wrap;
}
.monitor-row + .monitor-row { margin-top: 10px; }
.monitor-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 8px; }

/* flatpickr 日期範圍：起訖深紫、中間淡紫 */
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover {
  background: #845adf !important;
  border-color: #845adf !important;
  color: #fff !important;
}
.flatpickr-day.inRange {
  background: #e6dcfa !important;
  border-color: #e6dcfa !important;
  box-shadow: -5px 0 0 #e6dcfa, 5px 0 0 #e6dcfa !important;
  color: #5a3db8 !important;
}
.flatpickr-day.today { border-color: #b79bf5 !important; }

/* 品牌 Logo（IG Lottery） */
.lr-logo { height: 30px; width: auto; display: block; }
.main-sidebar-header { display: flex; align-items: center; justify-content: center; height: 60px; }
.lr-logo-side { height: 34px; width: auto; }
.lr-logo-login { height: 52px; width: auto; }
.app-sidebar.sticky[data-toggled] .lr-logo-side { height: 30px; }

/* SPA 視圖切換 */
.view { display: none; }
.view.active { display: block; }

/* 自訂側邊欄選單（不依賴 Ynex 選單 JS） */
.lr-menu { list-style: none; margin: 0; padding: 0.5rem 0; }
.lr-menu .cat { padding: 0.9rem 1.5rem 0.3rem; font-size: 11px; letter-spacing: 0.05em; color: #7b8191; }
.lr-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.65rem 1.5rem; color: #cfd4e0; cursor: pointer;
  text-decoration: none; font-size: 14px; white-space: nowrap;
}
.lr-item:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.lr-item.active { color: #fff; background: var(--primary-color, #4c8dff); border-radius: 8px; margin: 0 0.75rem; padding-inline: 0.75rem; }
.lr-item .lr-ico { font-size: 17px; }
.lr-caret { margin-inline-start: auto; transition: transform 0.2s; font-size: 16px; }
.has-sub.lr-open > .lr-item .lr-caret { transform: rotate(90deg); }
.lr-sub { list-style: none; margin: 0; padding: 0; }
.has-sub:not(.lr-open) .lr-sub { display: none; }
.lr-sub .lr-item { padding-inline-start: 3.2rem; font-size: 13px; }
.captcha-box { display: flex; gap: 12px; align-items: stretch; max-width: 340px; }

/* 對打明細：自動換行、固定最大寬度，不再橫向拖 */
.duida-samples { max-width: min(920px, 82vw); }
.duida-sample {
  white-space: normal;
  word-break: break-word;
  border: 1px solid var(--default-border);
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 12.5px;
  background: var(--custom-white);
}
.duida-sample .ds-head { font-weight: 600; margin-bottom: 0.3rem; }
.duida-sample .ds-row { line-height: 1.8; }
.ds-tag { display: inline-block; width: 18px; text-align: center; border-radius: 4px; background: var(--primary-color, #4c8dff); color: #fff; font-size: 11px; margin-right: 6px; }
.ds-nums { font-family: "Consolas", monospace; }

/* 側邊欄收合 */
body.lr-hide-sidebar .app-sidebar { display: none; }
body.lr-hide-sidebar .main-content { margin-inline-start: 0 !important; }
.main-sidebar { overflow-y: auto; }
