/* =========================================================================
   theme.css — G2 续费看板视觉系统
   ========================================================================= */
:root {
  --bg: #f4f6fb;
  --bg-2: #eef2f9;
  --card: #ffffff;
  --line: #e7ebf3;
  --line-2: #dde3ee;
  --ink: #101828;
  --ink-2: #475467;
  --ink-3: #7b879c;
  --ink-4: #98a2b3;
  --brand: #2f6bff;
  --brand-2: #1b4dd1;
  --brand-soft: #edf3ff;
  --brand-line: #cfe0ff;
  --violet: #7a5af8;
  --violet-soft: #f1eeff;
  --green: #12b76a;
  --green-soft: #e7f8f0;
  --orange: #f79009;
  --orange-soft: #fff4e5;
  --red: #f04438;
  --red-soft: #fdecea;
  --cyan: #0ba5ec;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .12);
  --shadow-lg: 0 24px 60px -24px rgba(16, 24, 40, .3);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --sidebar: 232px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
::selection { background: #cfe0ff; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d3dae6; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #bcc6d6; }
::-webkit-scrollbar-track { background: transparent; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.muted { color: var(--ink-3); }
.dim { color: var(--ink-4); }
.small { font-size: 11.5px; }
.tiny { font-size: 10.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
.right { text-align: right; }
.center { text-align: center; }
.flex { display: flex; align-items: center; }
.gap4 { gap: 4px; } .gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap10 { gap: 10px; } .gap12 { gap: 12px; }
.between { display: flex; align-items: center; justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ------------------------------- 布局 ------------------------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar);
  flex: 0 0 var(--sidebar);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 18px 14px 14px;
  z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, #2f6bff, #7a5af8 80%);
  color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .5px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px -6px rgba(47, 107, 255, .7);
}
.brand-name { font-size: 14px; font-weight: 650; letter-spacing: .2px; line-height: 1.2; }
.brand-sub { font-size: 10.5px; color: var(--ink-4); margin-top: 3px; letter-spacing: .3px; }
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.nav-label { font-size: 10px; color: var(--ink-4); letter-spacing: 1px; padding: 10px 10px 6px; text-transform: uppercase; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 9px; cursor: pointer;
  color: var(--ink-2); font-size: 13px; line-height: 1.2;
  border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s;
  user-select: none;
}
.nav-item svg { width: 17px; height: 17px; opacity: .72; flex: none; }
.nav-item:hover { background: #f3f6fc; color: var(--ink); }
.nav-item.active { background: var(--brand-soft); border-color: #dbe7ff; color: var(--brand-2); font-weight: 600; }
.nav-item.active svg { opacity: 1; }
.nav-item .nav-badge {
  margin-left: auto; font-size: 10px; padding: 1px 6px; border-radius: 99px;
  background: #fff; border: 1px solid var(--line-2); color: var(--ink-3); font-weight: 500;
}
.nav-item.active .nav-badge { background: #fff; border-color: #dbe7ff; color: var(--brand); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.mode-card {
  border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px;
  background: #fff; box-shadow: var(--shadow-sm);
}
.mode-row { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--ink-2); }
.mode-row + .mode-row { margin-top: 7px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; box-shadow: 0 0 0 3px rgba(18, 183, 106, .12); }
.dot.off { background: var(--ink-4); box-shadow: none; }
.dot.warn { background: var(--orange); box-shadow: 0 0 0 3px rgba(247, 144, 9, .14); }
.sidebar-tip { font-size: 10.5px; color: var(--ink-4); line-height: 1.55; padding: 0 4px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 25;
  height: 62px; padding: 0 24px;
  display: flex; align-items: center; gap: 14px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .crumb { font-size: 12px; color: var(--ink-4); letter-spacing: .2px; }
.topbar .crumb b { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.topbar .spacer { flex: 1; }
.topbar-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-4); min-width: 0; }
.topbar-meta > * { flex: 0 0 auto; }
.topbar .crumb { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-meta .sep { width: 1px; height: 14px; background: var(--line-2); }

.page { padding: 20px 24px 56px; max-width: 1640px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.page-title { font-size: 21px; font-weight: 650; letter-spacing: -.2px; margin: 0; }
.page-desc { margin-top: 6px; font-size: 12px; color: var(--ink-3); line-height: 1.6; max-width: 760px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* ------------------------------ 卡片 ------------------------------ */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.card + .card { margin-top: 14px; }
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 14px 16px 0;
}
.card-head.tight { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.card-title { font-size: 13.5px; font-weight: 650; display: flex; align-items: center; gap: 7px; letter-spacing: .1px; }
.card-title .k { font-size: 10px; font-weight: 600; color: var(--brand); background: var(--brand-soft); border-radius: 5px; padding: 2px 6px; letter-spacing: .3px; }
.card-sub { font-size: 11.5px; color: var(--ink-4); margin-top: 4px; line-height: 1.55; }
.card-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.card-body { padding: 14px 16px 16px; }
.card-body.flush { padding: 0; }
.card-body.tight { padding: 10px 16px 12px; }
.card-foot { padding: 10px 16px 14px; border-top: 1px dashed var(--line); font-size: 11px; color: var(--ink-4); }

.grid { display: grid; gap: 14px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-23 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-32 { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.g-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 8px; }

/* ------------------------------ KPI ------------------------------ */
.kpi-grid { display: grid; gap: 12px; }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 13px 15px 12px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi-label { font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
.kpi-value { font-size: 26px; font-weight: 650; letter-spacing: -.6px; margin-top: 7px; line-height: 1; }
.kpi-value small { font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.kpi-foot { margin-top: 8px; font-size: 11px; color: var(--ink-4); min-height: 16px; line-height: 1.55; }
.kpi-foot .delta { margin: 0 2px; }
.kpi-foot b { font-weight: 600; color: var(--ink-2); }
.kpi.hero .kpi-foot { padding-right: 86px; }
.kpi.hero .kpi-foot b { color: #fff; }
.kpi.hero { background: linear-gradient(135deg, #1f4fd8 0%, #2f6bff 52%, #5b82ff 100%); border-color: transparent; color: #fff; }
.kpi.hero .kpi-label { color: rgba(255, 255, 255, .78); }
.kpi.hero .kpi-value { color: #fff; }
.kpi.hero .kpi-value small { color: rgba(255, 255, 255, .72); }
.kpi.hero .kpi-foot { color: rgba(255, 255, 255, .82); }
.kpi.hero::after {
  content: ""; position: absolute; right: -30px; top: -40px; width: 130px; height: 130px;
  border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.22), rgba(255,255,255,0) 70%);
}
.kpi.hero .kpi-spark { position: absolute; right: 12px; bottom: 12px; opacity: .92; }

.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: 11px; padding: 1px 6px; border-radius: 5px; }
.delta.up { color: #067647; background: var(--green-soft); }
.delta.down { color: #b42318; background: var(--red-soft); }
.delta.flat { color: var(--ink-3); background: #f2f4f7; }
.delta.light { background: rgba(255, 255, 255, .18); color: #fff; }

/* ---------------------------- 控件 ---------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; padding: 0 11px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line-2); background: #fff; color: var(--ink-2);
  font-size: 12px; font-weight: 500; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
}
.btn:hover { background: #f7f9fd; border-color: #cbd5e5; color: var(--ink); }
.btn:active { transform: translateY(.5px); }
.btn svg { width: 14px; height: 14px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 10px -4px rgba(47, 107, 255, .6); }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.soft { background: var(--brand-soft); border-color: #dbe7ff; color: var(--brand-2); }
.btn.soft:hover { background: #e2ecff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-3); }
.btn.ghost:hover { background: #f3f6fc; color: var(--ink); }
.btn.danger { color: var(--red); border-color: #f6d2ce; background: #fff; }
.btn.danger:hover { background: var(--red-soft); }
.btn.sm { height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: 7px; }
.btn.xs { height: 23px; padding: 0 7px; font-size: 11px; border-radius: 6px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid transparent; background: transparent;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink-3);
}
.icon-btn:hover { background: #f3f6fc; color: var(--ink); }
.icon-btn svg { width: 15px; height: 15px; }

.seg {
  display: inline-flex; padding: 2px; background: #f1f4fa; border: 1px solid var(--line);
  border-radius: 9px; gap: 2px;
}
.seg button {
  border: 0; background: transparent; color: var(--ink-3); height: 26px; padding: 0 11px;
  border-radius: 7px; cursor: pointer; font-size: 12px; font-weight: 500; white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.seg button:hover { color: var(--ink); }
.seg button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .1); font-weight: 600; }
.seg.blue button.active { color: var(--brand-2); }
.seg.sm button { height: 22px; padding: 0 8px; font-size: 11px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 27px; padding: 0 10px;
  border-radius: 99px; border: 1px solid var(--line-2); background: #fff; color: var(--ink-2);
  font-size: 11.5px; cursor: pointer; white-space: nowrap; transition: all .15s;
}
.chip:hover { border-color: #c4d2e8; background: #f9fbff; }
.chip.on { background: var(--brand-soft); border-color: #c9dcff; color: var(--brand-2); font-weight: 600; }
.chip .x { color: var(--ink-4); font-size: 13px; line-height: 1; }
.chip.term { border-radius: 8px; height: 28px; padding: 0 12px; }

.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); }
.tab {
  padding: 9px 0 10px; font-size: 12.5px; color: var(--ink-3); cursor: pointer; position: relative;
  border: 0; background: transparent; font-weight: 500;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand-2); font-weight: 650; }
.tab.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand);
  border-radius: 2px 2px 0 0;
}
.tab .n { font-size: 10.5px; color: var(--ink-4); margin-left: 4px; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field > label { font-size: 11px; color: var(--ink-3); font-weight: 500; }
.input, .select, textarea.input {
  height: 31px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px;
  background: #fff; outline: none; font-size: 12.5px; transition: border-color .15s, box-shadow .15s;
  width: 100%;
}
.input:hover, .select:hover { border-color: #c3cfe2; }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 107, 255, .12); }
.input.sm { height: 27px; padding: 0 8px; font-size: 12px; border-radius: 7px; }
.input.xs { height: 24px; padding: 0 6px; font-size: 11.5px; border-radius: 6px; }
textarea.input { height: auto; padding: 8px 10px; line-height: 1.6; resize: vertical; }
.input-group { display: flex; align-items: center; gap: 6px; }
.input-group .suffix { font-size: 11.5px; color: var(--ink-3); }
.input.w-60 { width: 60px; } .input.w-80 { width: 80px; } .input.w-100 { width: 100px; }
.select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M3 4.5L6 7.5L9 4.5' stroke='%237b879c' stroke-width='1.4' fill='none' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 9px center; padding-right: 26px; }
.switch { position: relative; width: 32px; height: 18px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; background: #dfe5ef; border-radius: 99px; transition: .18s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; width: 14px; height: 14px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: .18s; box-shadow: 0 1px 2px rgba(16,24,40,.2); }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(14px); }

.range { -webkit-appearance: none; height: 4px; border-radius: 99px; background: #e3e9f4; outline: none; flex: 1; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--brand); box-shadow: 0 1px 3px rgba(16,24,40,.25); cursor: pointer; }
.range-val { font-size: 11.5px; color: var(--ink-2); font-weight: 600; min-width: 54px; text-align: right; }

/* ---------------------------- 标签 / 徽章 ---------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600;
  padding: 2px 7px; border-radius: 5px; background: #f2f4f7; color: var(--ink-2); white-space: nowrap;
}
.badge.blue { background: var(--brand-soft); color: var(--brand-2); }
.badge.green { background: var(--green-soft); color: #067647; }
.badge.orange { background: var(--orange-soft); color: #b54708; }
.badge.red { background: var(--red-soft); color: #b42318; }
.badge.violet { background: var(--violet-soft); color: #5b3bc4; }
.badge.gray { background: #f2f4f7; color: var(--ink-3); }
.badge.line { background: #fff; border: 1px solid var(--line-2); color: var(--ink-3); font-weight: 500; }
.tag-term { font-size: 10px; padding: 1px 5px; border-radius: 4px; background: var(--brand-soft); color: var(--brand-2); font-weight: 600; }
.tag-term.jie { background: var(--violet-soft); color: #5b3bc4; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ink-2); background: #f7f9fd; border: 1px solid var(--line); border-radius: 99px; padding: 3px 9px; }

/* ---------------------------- 表格 ---------------------------- */
.tbl-wrap { width: 100%; overflow: auto; }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px; }
.tbl th {
  text-align: left; font-weight: 600; color: var(--ink-3); font-size: 10.5px; letter-spacing: .3px;
  background: #fafbfe; border-bottom: 1px solid var(--line); padding: 8px 10px; white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
.tbl td { padding: 8px 10px; border-bottom: 1px solid #f1f4f9; color: var(--ink-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #fafcff; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl th.num { text-align: right; }
.tbl .rowhead { font-weight: 600; color: var(--ink); }
.tbl .sub { font-size: 10.5px; color: var(--ink-4); margin-top: 2px; }
.tbl.compact td { padding: 6px 8px; }
.tbl.compact th { padding: 6px 8px; }
.tbl tr.total td { background: #f7f9fd; font-weight: 600; color: var(--ink); border-top: 1px solid var(--line); }
.tbl tr.hl td { background: var(--brand-soft); }
.tbl .cell-input { width: 62px; height: 25px; text-align: right; padding: 0 6px; font-size: 11.5px; }
.tbl .sticky-col { position: sticky; left: 0; background: #fff; z-index: 1; }
.tbl tr:hover .sticky-col { background: #fafcff; }
.tbl th.sticky-col { z-index: 3; background: #fafbfe; }
.tbl-scroll { max-height: 460px; overflow: auto; }

.rate { font-weight: 600; font-variant-numeric: tabular-nums; }
.rate.good { color: #067647; }
.rate.warn { color: #b54708; }
.rate.bad { color: #b42318; }
.rate.mute { color: var(--ink-4); font-weight: 500; }
.abn { position: relative; }
.abn::after { content: ""; position: absolute; right: 3px; top: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--red); }
.mini-bar { height: 4px; border-radius: 99px; background: #eef2f9; overflow: hidden; min-width: 40px; }
.mini-bar > i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }

/* ---------------------------- 进程时间轴 ---------------------------- */
.timeline { display: flex; gap: 4px; overflow-x: auto; padding: 2px 0 4px; }
.tl-item {
  flex: 1 0 58px; min-width: 54px; border: 1px solid var(--line); border-radius: 9px;
  padding: 6px 7px 7px; cursor: pointer; background: #fff; transition: all .15s; position: relative;
}
.tl-item:hover { border-color: #c6d5ee; background: #fbfcff; }
.tl-item.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(47, 107, 255, .1); }
.tl-item.future { opacity: .55; }
.tl-item .d { font-size: 10px; color: var(--ink-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-item.active .d { color: var(--brand-2); font-weight: 600; }
.tl-item .v { font-size: 13px; font-weight: 650; margin-top: 3px; letter-spacing: -.2px; }
.tl-item .b { height: 3px; border-radius: 2px; background: #e9eef8; margin-top: 5px; overflow: hidden; }
.tl-item .b > i { display: block; height: 100%; background: var(--brand); border-radius: 2px; }
.tl-item.today::before {
  content: "今日"; position: absolute; top: -7px; right: 4px; font-size: 9px; color: #fff;
  background: var(--brand); padding: 1px 4px; border-radius: 4px; letter-spacing: .2px;
}

/* ---------------------------- IP 色块 ---------------------------- */
.ip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 8px; }
.ip-tile {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; background: #fff;
  position: relative; overflow: hidden; cursor: default;
}
.ip-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tone, #cbd5e5); }
.ip-tile.hit { background: linear-gradient(135deg, #f2fcf7, #ffffff 70%); border-color: #c7ebd8; }
.ip-tile.miss { background: linear-gradient(135deg, #fff6f5, #ffffff 70%); border-color: #f6d7d3; }
.ip-tile.mid { background: linear-gradient(135deg, #fffaf1, #ffffff 70%); border-color: #f6e2bd; }
.ip-name { font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.ip-name .gl { font-size: 10px; color: var(--ink-4); font-weight: 400; }
.ip-main { display: flex; align-items: baseline; gap: 4px; margin-top: 7px; }
.ip-main b { font-size: 19px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.ip-main span { font-size: 10.5px; color: var(--ink-4); }
.ip-meta { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-3); margin-top: 6px; }
.ip-progress { height: 4px; background: rgba(16, 24, 40, .07); border-radius: 99px; margin-top: 7px; overflow: hidden; }
.ip-progress > i { display: block; height: 100%; border-radius: 99px; background: var(--green); }
.ip-tile.miss .ip-progress > i { background: var(--red); }
.ip-tile.mid .ip-progress > i { background: var(--orange); }

/* ---------------------------- 进度条 ---------------------------- */
.progress-track { height: 8px; border-radius: 99px; background: #eef2f9; position: relative; overflow: hidden; }
.progress-track > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #4d80ff, #2f6bff); }
.progress-track > i.ok { background: linear-gradient(90deg, #32d583, #12b76a); }
.progress-track > i.warn { background: linear-gradient(90deg, #fdb022, #f79009); }
.progress-track > i.bad { background: linear-gradient(90deg, #f97066, #f04438); }
.progress-marker { position: absolute; top: -2px; bottom: -2px; width: 2px; background: rgba(16, 24, 40, .35); }
.progress-scale { display: flex; justify-content: space-between; font-size: 10px; color: var(--ink-4); margin-top: 5px; }

/* ---------------------------- 图表 ---------------------------- */
.chart-host { width: 100%; position: relative; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 0 2px 8px; }
.legend-item {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ink-2);
  cursor: pointer; user-select: none; padding: 1px 2px; border-radius: 4px;
}
.legend-item:hover { background: #f4f7fc; }
.legend-item.off { color: var(--ink-4); opacity: .6; }
.legend-item .sw { width: 9px; height: 3px; border-radius: 2px; background: var(--c); flex: none; }
.legend-item .sw.dot { height: 8px; width: 8px; border-radius: 50%; box-shadow: none; }
.legend-item .sw.dash { background: repeating-linear-gradient(90deg, var(--c) 0 3px, transparent 3px 6px); }
.chart-tip {
  position: fixed; z-index: 999; pointer-events: none; background: rgba(17, 26, 46, .94); color: #fff;
  border-radius: 8px; padding: 8px 10px; font-size: 11px; line-height: 1.55; box-shadow: 0 10px 24px -10px rgba(0,0,0,.5);
  min-width: 120px; max-width: 280px; opacity: 0; transform: translateY(4px); transition: opacity .1s, transform .1s;
  backdrop-filter: blur(6px);
}
.chart-tip.show { opacity: 1; transform: translateY(0); }
.chart-tip .t { font-size: 11px; color: rgba(255,255,255,.72); margin-bottom: 4px; }
.chart-tip .r { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.chart-tip .r b { font-variant-numeric: tabular-nums; font-weight: 600; }
.chart-tip .r i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); display: inline-block; margin-right: 5px; }
.chart-empty { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--ink-4); font-size: 12px; }

/* ---------------------------- 弹窗 / 提示 ---------------------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .45); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  backdrop-filter: blur(3px); animation: fadeIn .16s ease;
}
.modal {
  background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); width: 520px; max-width: 100%;
  max-height: 86vh; display: flex; flex-direction: column; animation: pop .18s cubic-bezier(.2,.8,.3,1);
}
.modal.wide { width: 760px; }
.modal-head { padding: 18px 20px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-title { font-size: 15px; font-weight: 650; }
.modal-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; line-height: 1.6; }
.modal-body { padding: 4px 20px 18px; overflow: auto; }
.modal-foot { padding: 12px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: rgba(17, 26, 46, .95); color: #fff; font-size: 12px; padding: 9px 14px; border-radius: 9px;
  box-shadow: 0 12px 30px -12px rgba(0,0,0,.5); display: flex; align-items: center; gap: 8px;
  animation: toastIn .2s ease; max-width: 70vw;
}
.toast.ok::before { content: "✓"; color: #6ce9a6; font-weight: 700; }
.toast.err::before { content: "!"; color: #fda29b; font-weight: 700; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------------------------- 空状态 / 提示 ---------------------------- */
.empty { padding: 34px 16px; text-align: center; color: var(--ink-4); }
.empty .ico { font-size: 26px; margin-bottom: 8px; opacity: .5; }
.empty .t { font-size: 13px; color: var(--ink-2); font-weight: 600; margin-bottom: 5px; }
.empty .d { font-size: 11.5px; line-height: 1.7; max-width: 420px; margin: 0 auto; }
.hint { font-size: 11px; color: var(--ink-4); line-height: 1.65; }
.note {
  background: #f8fafd; border: 1px dashed var(--line-2); border-radius: 10px; padding: 9px 11px;
  font-size: 11px; color: var(--ink-3); line-height: 1.65;
}
.note b { color: var(--ink-2); font-weight: 600; }
.warn-note { background: #fff8ed; border: 1px solid #f8e3c0; border-radius: 10px; padding: 9px 11px; font-size: 11px; color: #b54708; line-height: 1.65; }
.info-note { background: var(--brand-soft); border: 1px solid #d8e6ff; border-radius: 10px; padding: 9px 11px; font-size: 11px; color: #1d4ed8; line-height: 1.65; }

.kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 12px; }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--ink-3); font-size: 11.5px; }
.kv .v { font-weight: 600; font-variant-numeric: tabular-nums; }

.stat-row { display: flex; gap: 18px; flex-wrap: wrap; }
.stat { min-width: 76px; }
.stat .l { font-size: 10.5px; color: var(--ink-4); }
.stat .v { font-size: 17px; font-weight: 650; margin-top: 3px; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 11px; font-weight: 500; color: var(--ink-3); margin-left: 2px; }

.divider { height: 1px; background: var(--line); margin: 12px 0; }
.divider.v { width: 1px; height: auto; align-self: stretch; margin: 0; }
.section-label { font-size: 10.5px; color: var(--ink-4); letter-spacing: .6px; text-transform: uppercase; font-weight: 600; margin: 2px 0 8px; }

/* 数据上传区 */
.upload {
  border: 1px dashed var(--line-2); border-radius: 12px; padding: 13px 14px; background: #fcfdff;
  display: flex; align-items: center; gap: 12px; cursor: pointer; transition: all .15s;
}
.upload:hover { border-color: var(--brand); background: var(--brand-soft); }
.upload .ico {
  width: 34px; height: 34px; border-radius: 9px; background: #fff; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--brand); flex: none;
}
.upload .ico svg { width: 17px; height: 17px; }
.upload .t { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.upload .d { font-size: 10.5px; color: var(--ink-4); margin-top: 3px; line-height: 1.5; }
.upload .meta { margin-left: auto; text-align: right; font-size: 10.5px; color: var(--ink-4); white-space: nowrap; }

.lock-panel { display: flex; flex-direction: column; align-items: center; padding: 26px 20px 30px; text-align: center; }
.lock-ico {
  width: 46px; height: 46px; border-radius: 14px; background: linear-gradient(135deg, #2f6bff, #7a5af8);
  color: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
  box-shadow: 0 10px 24px -10px rgba(47, 107, 255, .8);
}
.lock-ico svg { width: 22px; height: 22px; }
.pin-input { width: 190px; text-align: center; letter-spacing: 4px; height: 36px; font-size: 14px; }

/* 数据源列表 */
.ds-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.ds-row:last-child { border-bottom: 0; }
.ds-file { flex: 1; min-width: 0; }
.ds-file .n { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.ds-file .m { font-size: 10.5px; color: var(--ink-4); margin-top: 3px; }

/* 可编辑单元格 */
.editable { border-bottom: 1px dashed #c8d5ea; cursor: text; padding-bottom: 1px; }
.editable:hover { color: var(--brand-2); border-color: var(--brand); }

/* 阶段表 */
.stage-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.stage-row:last-child { border-bottom: 0; }
.stage-idx { width: 22px; height: 22px; border-radius: 6px; background: #f3f6fc; color: var(--ink-3); font-size: 10px; display: flex; align-items: center; justify-content: center; flex: none; font-weight: 600; }
.stage-name { font-size: 12px; font-weight: 500; min-width: 92px; }
.stage-bar { flex: 1; height: 6px; background: #f1f4fa; border-radius: 99px; overflow: hidden; }
.stage-bar > i { display: block; height: 100%; background: linear-gradient(90deg, #6b97ff, #2f6bff); border-radius: 99px; }
.stage-num { font-size: 11px; color: var(--ink-2); width: 54px; text-align: right; font-variant-numeric: tabular-nums; }

/* 工具布局 */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.toolbar-group { display: flex; align-items: center; gap: 6px; }
.toolbar-label { font-size: 11px; color: var(--ink-4); margin-right: 2px; }

@media (max-width: 1440px) {
  .g-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-23, .g-32, .g-12 { grid-template-columns: minmax(0, 1fr); }
  .page { padding: 16px 16px 48px; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 960px) {
  :root { --sidebar: 72px; }
  .brand-name, .brand-sub, .nav-item span, .nav-badge, .sidebar-tip, .mode-card .txt { display: none; }
  .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .nav-item { justify-content: center; padding: 10px 0; }
  .nav-item svg { width: 19px; height: 19px; }
  .mode-card { padding: 9px; }
  .mode-row { justify-content: center; }
  .g-2, .g-3, .g-4, .g-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .g-2, .g-3, .g-4, .g-5 { grid-template-columns: minmax(0, 1fr); }
  .topbar .crumb { display: none; }
}

/* 打印 */
@media print {
  .sidebar, .topbar, .page-actions, .btn, .seg, .chip { display: none !important; }
  body { background: #fff; }
  .card { break-inside: avoid; box-shadow: none; }
  .page { padding: 0; }
}

/* ---------------------------- 当日对比 / 填写 ---------------------------- */
.g-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1500px) { .g-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .g-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.cmp-list { display: flex; flex-direction: column; gap: 2px; }
.cmp-row {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) 52px 62px; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 8px; font-size: 11.5px;
}
.cmp-row:hover { background: #f8fafd; }
.cmp-row.current { background: var(--brand-soft); }
.cmp-name { color: var(--ink-2); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-bar { height: 7px; background: #eef2f9; border-radius: 99px; overflow: hidden; }
.cmp-bar > i { display: block; height: 100%; border-radius: 99px; background: #9db8e8; }
.cmp-row.current .cmp-bar > i { background: linear-gradient(90deg, #4d80ff, #2f6bff); }
.cmp-val { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.cmp-diff { text-align: right; font-size: 10.5px; }

.fill-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 8px; }
.fill-extras { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.fill-cell { display: flex; align-items: center; gap: 4px; }
.fill-cell > label { font-size: 10px; color: var(--ink-4); min-width: 42px; white-space: nowrap; }
.fill-cell .input { width: 100%; height: 25px; text-align: center; }
@media (max-width: 1500px) { .fill-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

@keyframes shakeX { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.shake { animation: shakeX .28s ease; border-color: var(--red) !important; }

.chart-host { min-height: 40px; }
.chart-host svg { max-width: 100%; }

/* ---------------------------- 目标页 ---------------------------- */
.goal-bars { display: flex; flex-direction: column; gap: 8px; }
.goal-bar-row { display: grid; grid-template-columns: 68px minmax(0, 1fr) 52px; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-3); }
.goal-bar-row b { text-align: right; font-size: 11.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.goal-bar { height: 8px; background: #f1f4fa; border-radius: 99px; overflow: hidden; }
.goal-bar > i { display: block; height: 100%; border-radius: 99px; }

/* ---------------------------- 转化表 ---------------------------- */
.conv-cell { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.conv-cell .d { font-size: 9.5px; color: var(--ink-4); }
.conv-cell .d.up { color: #067647; }
.conv-cell .d.down { color: #b42318; }
.abn-cell { position: relative; background: #fff7f6 !important; box-shadow: inset 2px 0 0 #f04438; }
.abn-cell::before { content: ""; position: absolute; right: 3px; top: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--red); }
.conv-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 10.5px; color: var(--ink-4); }
.select.xs { height: 24px; padding: 0 22px 0 6px; font-size: 11.5px; border-radius: 6px; }
.tag-term { white-space: nowrap; }

/* 加载 */
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid #dbe5f5; border-top-color: var(--brand); margin: 0 auto; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1180px) {
  .topbar { height: auto; min-height: 62px; flex-wrap: wrap; padding: 10px 16px; gap: 8px; }
  .topbar .spacer { display: none; }
  .topbar-meta { width: 100%; justify-content: flex-end; }
  .topbar .crumb { display: none; }
  .topbar-meta { flex-wrap: wrap; justify-content: flex-end; }
  .topbar-meta #syncState { display: none; }
}
@media (max-width: 760px) {
  .topbar-meta select { width: 170px !important; }
  .page-head { gap: 10px; }
  .page-title { font-size: 18px; }
  .kpi-value { font-size: 22px; }
}
.seg button:disabled { opacity: .35; cursor: not-allowed; }

/* 批量导入 */
.upload.batch { background: linear-gradient(135deg, #f5f9ff 0%, #fbfdff 70%); border-color: #c9dcff; }
.upload.batch .ico { background: linear-gradient(135deg, #2f6bff, #7a5af8); color: #fff; border-color: transparent; box-shadow: 0 6px 14px -8px rgba(47, 107, 255, .9); }
.upload.batch .t { color: var(--brand-2); }
.upload.dragging { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px rgba(47, 107, 255, .12); }

/* 续费阶段自定义 */
.stage-panel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 6px; max-height: 268px; overflow: auto; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcff; }
.stage-chip { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; font-size: 11.5px; min-width: 0; }
.stage-chip:hover { border-color: #c9d8f0; }
.stage-chip.on { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(47,107,255,.08); }
.stage-chip.disabled { opacity: .62; cursor: not-allowed; background: #f3f5fa; }
.stage-check { width: 16px; height: 16px; border-radius: 5px; border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; font-size: 10px; color: transparent; flex: none; background: #fff; }
.stage-chip.on .stage-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.stage-chip.disabled .stage-check { background: #e3e8f1; border-color: #d8dfec; }
.stage-chip-main { min-width: 0; flex: 1; }
.stage-chip .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.stage-chip .rg { font-size: 9.5px; color: var(--ink-4); white-space: nowrap; }
.stage-chip .bd { flex: none; }
.custom-stage-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.custom-stage-row + .custom-stage-row { margin-top: 6px; }
.custom-stage-row .nm { font-weight: 600; font-size: 12px; }
.custom-stage-row .meta { font-size: 11px; color: var(--ink-3); }

/* 计算逻辑悬浮提示 */
.calc-tip {
  position: fixed; z-index: 1200; max-width: 380px; pointer-events: none;
  background: rgba(17, 26, 46, .96); color: #fff; border-radius: 9px; padding: 9px 11px;
  font-size: 11px; line-height: 1.65; box-shadow: 0 16px 36px -16px rgba(0,0,0,.6);
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
  word-break: break-word;
}
.calc-tip.show { opacity: 1; transform: translateY(0); }
.calc-tip b { color: #fff; font-weight: 600; }
.calc-tip .muted { color: rgba(255,255,255,.65); }

/* 预测矩阵 */
.matrix-tbl th.layer-h { text-align: center; background: #f2f6fd; border-left: 1px solid var(--line); }
.matrix-tbl th.sub-h { text-align: center; font-weight: 500; font-size: 10px; background: #f7f9fd; border-left: 1px dashed #e2e8f4; }
.matrix-tbl td { text-align: center; border-left: 1px dashed #eef2f9; }
.matrix-tbl td.row-h { text-align: left; font-weight: 600; color: var(--ink); background: #fbfcff; }
.matrix-tbl .rate-pill { display: inline-block; min-width: 54px; padding: 2px 5px; border-radius: 5px; font-variant-numeric: tabular-nums; }
.matrix-tbl .rate-pill.max { outline: 1.5px solid rgba(18,183,106,.55); font-weight: 700; }
.matrix-tbl .rate-pill.min { outline: 1.5px solid rgba(240,68,56,.55); font-weight: 700; }
.matrix-tbl .count-row td { background: #f7f9fd; color: var(--ink-3); font-size: 10.5px; }
.matrix-tbl .sep-top td { border-top: 1px solid var(--line); }
.matrix-tbl td.total-col { background: #f8fafd; font-weight: 650; }
.heat-tag { display: inline-block; font-size: 9px; color: var(--ink-4); margin-left: 3px; }

[data-tip] { cursor: help; }

/* 续费进程日历 */
.calendar { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); background: #f7f9fd; border-bottom: 1px solid var(--line); }
.cal-head span { text-align: center; font-size: 10.5px; color: var(--ink-3); padding: 7px 0; font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell { min-height: 92px; padding: 7px 8px; border-right: 1px solid #eef2f9; border-bottom: 1px solid #eef2f9; cursor: pointer; position: relative; background: #fff; transition: background .12s; }
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell:hover { background: #f6f9ff; }
.cal-cell.empty { cursor: default; background: #fbfcff; }
.cal-cell.pre { background: #fffaf0; }
.cal-cell.buffer { background: #f6f2ff; }
.cal-cell.today { box-shadow: inset 0 0 0 2px #2f6bff; }
.cal-cell.active { background: #eef4ff; box-shadow: inset 0 0 0 2px #2f6bff; }
.cal-cell.future .cal-num { color: var(--ink-4); }
.cal-top { display: flex; align-items: baseline; justify-content: space-between; }
.cal-date { font-size: 12px; font-weight: 700; color: var(--ink); }
.cal-wd { font-size: 9.5px; color: var(--ink-4); }
.cal-tag { display: inline-block; margin-top: 4px; font-size: 9px; color: var(--ink-3); background: #f2f5fb; border-radius: 4px; padding: 1px 4px; }
.cal-cell.pre .cal-tag { background: #fff1d6; color: #b54708; }
.cal-cell.buffer .cal-tag { background: #ede9fe; color: #6941c6; }
.cal-num { margin-top: 5px; font-size: 17px; font-weight: 700; color: var(--ink); line-height: 1.15; }
.cal-num span { font-size: 9px; font-weight: 400; color: var(--ink-4); margin-left: 2px; }
.cal-rate { font-size: 10px; color: var(--ink-3); }
.cal-target { font-size: 9.5px; color: var(--ink-4); margin-top: 2px; }
.cal-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 9px; }
.cal-summary .cal-tag { margin: 0; padding: 3px 8px; font-size: 10.5px; }
.cal-summary .cal-tag.pre { background: #fff1d6; color: #b54708; }
.cal-summary .cal-tag.buffer { background: #ede9fe; color: #6941c6; }
.fill-day-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.fill-ip-tbl td { padding: 3px 4px; }
.fill-ip-tbl th { white-space: nowrap; font-size: 10.5px; }
.fill-ip-tbl .rowhead { white-space: nowrap; font-size: 10.5px; }
.fill-ip-tbl input { text-align: center; }
.ip-best { background: #f0fdf4 !important; }
.ip-worst { background: #fff1f0 !important; }
.ip-rank { font-size: 9px; padding: 1px 4px; border-radius: 4px; margin-left: 4px; }
.ip-rank.best { background: #d1fadf; color: #05603a; }
.ip-rank.worst { background: #fee4e2; color: #b42318; }
.ip-next { font-size: 9.5px; color: var(--ink-4); margin-top: 3px; }

.cmp-pick { max-height: 420px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; }
.cmp-pick-row { display: grid; grid-template-columns: 18px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid #eef2f9; cursor: pointer; font-size: 12px; }
.cmp-pick-row:last-child { border-bottom: 0; }
.cmp-pick-row:hover { background: #f7f9fd; }
.cmp-pick-row input { margin: 0; }
.ip-compare .rowhead { min-width: 110px; }
.ip-compare td, .ip-compare th { white-space: nowrap; }
.ip-tile .ip-next { line-height: 1.5; }
.ip-tile .ip-next b.up { color: #05603a; }
.ip-tile .ip-next b.down { color: #b42318; }

/* 前置出单阶段（时间范围，不按日期展示） */
.pre-range {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 14px; margin-bottom: 10px; border: 1px solid #fedf89; border-radius: 10px;
  background: linear-gradient(180deg,#fffcf5,#fff8eb); cursor: pointer;
}
.pre-range:hover { border-color: #fdb022; }
.pre-range.active { box-shadow: 0 0 0 2px rgba(247,144,9,.22); border-color: #f79009; }
.pre-range-title { font-size: 12.5px; font-weight: 700; color: #b54708; }
.pre-range-sub { font-size: 10.5px; color: #b54708; opacity: .75; margin-top: 3px; }
.pre-range-num { text-align: right; color: #b54708; }
.pre-range-num b { font-size: 22px; font-weight: 700; color: #b54708; }
.pre-range-num span { font-size: 10px; margin-left: 3px; }

.inline-check { display: flex; align-items: flex-start; gap: 7px; font-size: 11px; color: var(--ink-2); cursor: pointer; line-height: 1.6; }
.inline-check input { margin-top: 2px; }

/* 组长填写：时段表与出单方式分层 */
.fill-ip-tbl .group-row td {
  background: #f8fafc; color: #475467; font-size: 10px; font-weight: 700;
  letter-spacing: .04em; border-top: 1px solid #e4e7ec; border-bottom: 1px solid #e4e7ec;
  padding-top: 8px; padding-bottom: 8px;
}
.fill-ip-tbl .extra-row td { background: #fcfcfd; }
.fill-ip-tbl .extra-row .rowhead { color: #344054; font-weight: 600; border-left: 3px solid #b2ddff; }
.fill-ip-tbl .stage-total-row td { background: #fff; }
.fill-ip-tbl .stage-total-row .rowhead { border-left: 3px solid #84caff; font-weight: 650; }
.fill-ip-tbl .cell-max input { border-color: #12b76a !important; background: #ecfdf3 !important; color: #05603a !important; font-weight: 700; }
.fill-ip-tbl .cell-min input { border-color: #f04438 !important; background: #fef3f2 !important; color: #b42318 !important; font-weight: 700; }
.fill-ip-tbl .cell-max .num { color: #05603a; font-weight: 700; }
.fill-ip-tbl .cell-min .num { color: #b42318; font-weight: 700; }
.fill-legend { display: flex; gap: 16px; align-items: center; margin: 0 0 8px; font-size: 10.5px; color: #667085; }
.fill-legend .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.fill-ip-tbl .fill-input { text-align: center; }
.fill-ip-tbl .fill-input::placeholder { color: #98a2b3; }

/* IP 图例开关 */
.ip-legend { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.ip-legend-chip { border: 1px solid var(--line-2); background: #fff; color: var(--ink-4); border-radius: 999px; padding: 3px 9px; font-size: 10.5px; cursor: pointer; }
.ip-legend-chip.on { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-2); font-weight: 600; }

/* 手机/平板适配 */
@media (max-width: 760px) {
  .app { display: block; }
  .sidebar {
    position: sticky; top: 0; width: 100%; height: auto; min-height: 0;
    flex-direction: row; align-items: center; padding: 7px 9px;
    border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto;
  }
  .brand { padding: 0 8px 0 0; flex: 0 0 auto; }
  .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
  .brand-name, .brand-sub, .nav-label, .nav-badge, .sidebar-tip, .mode-card { display: none !important; }
  .nav { flex-direction: row; gap: 3px; margin: 0; flex: 0 0 auto; }
  .nav-item { padding: 7px 9px; gap: 5px; font-size: 11.5px; white-space: nowrap; }
  .nav-item svg { width: 16px; height: 16px; }
  .nav-item span { display: inline; }
  .sidebar-foot { display: none; }
  .main { min-width: 0; }
  .topbar { padding: 8px 10px; position: relative; }
  .topbar-meta { gap: 6px; }
  .topbar-meta select { width: 170px !important; }
  .page { padding: 11px 9px 42px; }
  .page-title { font-size: 19px; }
  .page-desc { font-size: 10.5px; line-height: 1.55; }
  .card { border-radius: 11px; }
  .card-head, .card-body { padding-left: 11px; padding-right: 11px; }
  .kpi-value { font-size: 23px; }
  .grid.g-2, .grid.g-3, .grid.g-4, .grid.g-5, .grid.g-6 { grid-template-columns: minmax(0, 1fr) !important; }
  .calendar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cal-grid { min-width: 650px; }
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .fill-ip-tbl { min-width: 560px; }
  .fill-ip-tbl .fill-input { width: 48px !important; }
  .fill-day-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .fill-day-tabs .chip { flex: 0 0 auto; }
  .upload { padding: 12px; }
  .upload .t { font-size: 12px; }
  .modal { width: calc(100vw - 20px) !important; max-height: 88vh; }
  .page-head { gap: 8px; }
  .topbar .seg button { padding: 4px 7px; font-size: 11px; }
  .ip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 420px) {
  .ip-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .kpi-value { font-size: 21px; }
  .topbar-meta select { width: 150px !important; }
}

/* 奖金进度 */
.bonus-future-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.bonus-future { display: flex; align-items: baseline; gap: 6px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fbfdff; font-size: 11px; color: var(--ink-3); }
.bonus-future b { color: var(--ink); font-size: 13px; }

/* 组长填写：紧凑、无内部滚动、对齐 */
.fill-ip-tbl { width: 100%; table-layout: fixed; }
.fill-ip-tbl th, .fill-ip-tbl td { padding: 5px 6px !important; vertical-align: middle !important; }
.fill-ip-tbl th { text-align: center; }
.fill-ip-tbl th:first-child, .fill-ip-tbl td:first-child { text-align: left; }
.fill-ip-tbl td { text-align: center; }
.fill-ip-tbl .rowhead { text-align: left; }
.fill-ip-tbl .fill-input { width: 48px !important; height: 28px !important; padding: 2px 4px !important; text-align: center; }
.fill-ip-tbl .group-row td { padding: 5px 8px !important; }
.fill-ip-tbl .extra-row td { padding-top: 4px !important; padding-bottom: 4px !important; }
.fill-ip-tbl tr.total td { padding: 7px 6px !important; }
.fill-ip-tbl .sub { white-space: nowrap; }

/* IP 对比整行颜色 */
.ip-compare tr.ip-best td { background: #ecfdf3 !important; }
.ip-compare tr.ip-worst td { background: #fef3f2 !important; }
.ip-compare tr.ip-best .rowhead { box-shadow: inset 3px 0 0 #12b76a; }
.ip-compare tr.ip-worst .rowhead { box-shadow: inset 3px 0 0 #f04438; }
.ip-compare tr.ip-subrow td { background: #fcfcfd; font-size: 11px; }
.ip-compare tr.ip-subrow .rowhead { padding-left: 18px !important; color: var(--ink-2); }

/* 续费奖金：仅按 IP */
.bonus-ip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.bonus-ip-card { border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; background: linear-gradient(180deg,#fff,#fbfdff); }
.bonus-ip-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.bonus-ip-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.bonus-ip-rate { font-size: 18px; font-weight: 700; color: var(--brand-2); text-align: right; font-variant-numeric: tabular-nums; }
.bonus-ip-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.bonus-money { color: var(--brand-2); font-size: 17px !important; margin-top: 2px; }
.bonus-next { color: var(--green); font-size: 17px !important; margin-top: 2px; }
.bonus-ip-card .bonus-future-wrap { margin-top: 6px; }
.bonus-ip-card .bonus-future { padding: 3px 7px; font-size: 10px; gap: 4px; }
.bonus-ip-card .bonus-future b { font-size: 11px; color: var(--brand-2); }

/* 分析页逐期对比 */
tr.peer-row td { background: #f8fafc; color: #667085; font-size: 11.5px; }
tr.peer-row td.rowhead { color: #475467; font-weight: 600; }
.conv-legend { gap: 10px; }

/* 当日看板对比表：紧凑、不横向滚动 */
.day-compare-wrap { overflow-x: hidden; }
.day-compare-tbl { width: 100%; table-layout: fixed; font-size: 11px; }
.day-compare-tbl th, .day-compare-tbl td { padding: 5px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-compare-tbl th { font-size: 10.5px; letter-spacing: 0; }
.day-compare-tbl .sub { font-size: 9.5px; }
.day-compare-tbl .rowhead { max-width: none; }
.day-compare-tbl .ip-subrow .rowhead { padding-left: 8px; }

/* IP 时段/当日对比：固定列宽，避免横向滚动 */
.ip-compare { width: 100%; table-layout: fixed; font-size: 10.5px; }
.ip-compare th, .ip-compare td { padding: 5px 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ip-compare th { font-size: 10px; }
.ip-compare .rowhead { min-width: 0; }
.ip-compare .sub { font-size: 9px; }

/* 组长填写：阶段快速切换 */
.fill-stage-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.fill-stage-tabs .chip { height: 24px; }

.uid-import-head{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-start;justify-content:space-between;margin-bottom:8px}
.uid-import-title{min-width:220px;flex:1}
.uid-import-title .section-label{white-space:nowrap}
.uid-import-title .hint{margin-top:3px;line-height:1.5;max-width:360px}
.uid-import-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;flex:0 1 auto}
.uid-import-actions .btn{white-space:nowrap}
@media (max-width:700px){
  .uid-import-head{display:block}
  .uid-import-title{min-width:0;margin-bottom:8px}
  .uid-import-actions{justify-content:flex-start}
  .uid-import-actions .btn{flex:1 1 140px;text-align:center}
}

.uid-source-card{border:1px solid var(--line);border-radius:10px;padding:10px 12px;margin-top:10px;background:#fbfcfe}
.uid-source-card.inc{border-left:3px solid #12b76a}
.uid-source-card.dec{border-left:3px solid #f04438;background:#fffafa}
.uid-source-card .badge{font-weight:500;margin-left:4px}

.ip-head-nick{font-size:13px;font-weight:700;color:#101828;letter-spacing:.2px;margin-bottom:1px}
.ip-head-meta{font-size:11px;font-weight:500;color:#667085;margin-bottom:1px}

.ip-member{color:#667085;font-weight:500}
.ip-leader{color:#6941c6;font-weight:700}
.ip-sep{color:#98a2b3}

.ip-leader-head{text-align:center!important;color:#6941c6!important;font-weight:700!important;background:#f9f5ff!important;border-bottom:1px solid #e9d7fe!important}
.fill-ip-tbl thead tr:first-child th.ip-leader-head{padding-top:6px;padding-bottom:4px}
.fill-ip-tbl thead tr:nth-child(2) th{padding-top:4px;padding-bottom:6px}
