/* ==========================================================================
   考研客户管理系统 · v3.0（ThinkPHP 8 + HTML 视图）
   配色沿用 v2.14 定稿：纯白底 + 中性灰分隔（最像 WPS），
   品牌紫 #762169 只用在按钮/主色文字上，不做大面积色块。
   ========================================================================== */

:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --primary: #762169;
  --primary-soft: #f2f3f5;
  --text: #1f2328;
  --text-2: #5c636a;
  --text-3: #8b929a;
  --line: #e6e8eb;
  --line-2: #f0f1f3;
  --ok: #0f6e56;
  --warn: #854f0b;
  --danger: #a32d2d;
  --info: #185fa5;
  /* 回访归属配色：市场=蓝，咨询=品牌紫（见下方 td.rd.mk / td.rd.cs） */
  --rd-market: #185fa5;
  --rd-consult: #762169;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
input, select, textarea, button { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d6d9dd; border-radius: 6px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- 布局 */
.shell { display: flex; min-height: 100vh; }
.side {
  width: 208px; flex: 0 0 208px; background: var(--panel);
  border-right: 1px solid var(--line); padding: 14px 10px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px; overflow: auto;
}
.brand { display: flex; align-items: center; gap: 8px; padding: 6px 10px 14px; }
.brand img { width: 26px; height: 26px; border-radius: 6px; }
.brand b { font-size: 15px; letter-spacing: .2px; }
.brand small { display: block; color: var(--text-3); font-size: 11px; font-weight: 400; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 7px;
  color: var(--text-2); text-decoration: none; font-size: 13.5px;
}
.nav a:hover { background: var(--primary-soft); color: var(--text); text-decoration: none; }
.nav a.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav a .ic { width: 16px; height: 16px; flex: none; opacity: .9; }
.nav .badge { margin-left: auto; background: var(--primary); color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; }
.side .foot { margin-top: auto; padding: 10px; color: var(--text-3); font-size: 11px; border-top: 1px solid var(--line-2); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  height: 54px; background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 0 18px; position: sticky; top: 0; z-index: 20;
}
.top h2 { font-size: 15px; }
.top .sp { flex: 1; }
.top .who { color: var(--text-2); font-size: 13px; }
.wrap { padding: 16px 18px 40px; }

/* ---------------------------------------------------------------- 组件 */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card + .card { margin-top: 14px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-h h3 { font-size: 14px; }
.card-h .sp { flex: 1; }
.card-b { padding: 14px; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.hidden { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 6px 12px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); cursor: pointer; font-size: 13px; white-space: nowrap;
}
.btn:hover { border-color: #cfd3d8; background: #fbfbfc; }
.btn.pri { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.pri:hover { filter: brightness(1.08); }
.btn.ghost { border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.danger { color: var(--danger); border-color: #ecd5d5; }
.btn.danger:hover { background: #fdf4f4; }
.btn.sm { padding: 3px 9px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.inp, .sel, .ta {
  width: 100%; padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; outline: none; font-size: 13px;
}
.inp:focus, .sel:focus, .ta:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(118, 33, 105, .08); }
.ta { min-height: 84px; resize: vertical; line-height: 1.55; }
.sel { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #9aa0a6 50%), linear-gradient(135deg, #9aa0a6 50%, transparent 50%); background-position: calc(100% - 14px) 13px, calc(100% - 9px) 13px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 26px; }

.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi .lab { color: var(--text-3); font-size: 12.5px; }
.kpi .val { font-size: 22px; font-weight: 600; margin-top: 2px; letter-spacing: .3px; }
.kpi .sub { color: var(--text-3); font-size: 12px; margin-top: 3px; }

/* 看板核心指标：卡片式一行摆开，数字大、说明小 */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 10px; }
.kpi-row .kpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 15px; }
.kpi-row .kpi .lab { font-size: 12.5px; color: var(--text-2); }
.kpi-row .kpi .val { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.kpi-row .kpi .sub { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.kpi-row .kpi .val small { font-size: 14px; font-weight: 600; margin-left: 2px; color: var(--text-2); }

/* ------------------------------------------------ 日期区间选择器
   核心指标右上角那个按钮：点开左边是快捷区间，右边是双月日历（laydate range）。 */
.dr { position: relative; }
.dr-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
  cursor: pointer; font-size: 13px; color: var(--text); white-space: nowrap;
}
.dr-btn:hover { border-color: #cfd3d8; }
.dr-btn > .layui-icon { font-size: 14px; color: var(--text-3); }
.dr-btn .dr-caret { font-size: 12px; transition: transform .16s; }
.dr.open .dr-btn { border-color: var(--primary); }
.dr.open .dr-caret { transform: rotate(180deg); }
.dr-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  display: none; gap: 12px; padding: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .12);
}
.dr.open .dr-panel { display: flex; }
.dr-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; align-content: start; width: 130px; }
.dr-presets button {
  border: 0; background: transparent; text-align: left; padding: 6px 9px;
  border-radius: 7px; font-size: 12.5px; color: var(--text-2); cursor: pointer; white-space: nowrap;
}
.dr-presets button:hover { background: var(--primary-soft); color: var(--primary); }
.dr-presets button.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.dr-split { width: 1px; background: var(--line-2); }
.dr-cal { width: 268px; }
.dr-cal-h { font-size: 12.5px; color: var(--text-2); margin-bottom: 8px; }
.dr-cal input {
  width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; font-size: 13px; outline: none; cursor: pointer;
}
.dr-cal input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(118, 33, 105, .08); }
.dr-tip { margin-top: 6px; }
@media (max-width: 700px) {
  .dr-panel { display: none; right: auto; left: 0; flex-direction: column; width: min(300px, 92vw); }
  .dr.open .dr-panel { display: flex; }
  .dr-presets { grid-template-columns: 1fr 1fr 1fr; width: auto; }
  .dr-split { width: auto; height: 1px; }
  .dr-cal { width: auto; }
}
.kpi .sub { color: var(--text-3); font-size: 12px; }
.pos { color: var(--danger); }
.neg { color: var(--ok); }

.tag { display: inline-block; padding: 1px 7px; border-radius: 20px; font-size: 12px; background: var(--primary-soft); color: var(--text-2); white-space: nowrap; }
.tag.sm { font-size: 11.5px; padding: 1px 6px; }
.tag.pri { background: #f6ecf4; color: var(--primary); }
.tag.ok { background: #e9f4f0; color: var(--ok); }
.tag.warn { background: #fdf3e6; color: var(--warn); }
.tag.danger { background: #fbecec; color: var(--danger); }
.tag.info { background: #eaf2fb; color: var(--info); }

/* ---------------------------------------------------------------- 表格 */
.tbl-wrap { overflow: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.tbl-wrap::-webkit-scrollbar { height: 10px; width: 10px; }
.tbl-wrap::-webkit-scrollbar-thumb { background: #d5d2ce; border-radius: 5px; }
.tbl-wrap::-webkit-scrollbar-thumb:hover { background: #bdb9b4; }
.tbl-wrap::-webkit-scrollbar-track { background: #f5f4f2; border-radius: 5px; }
table.tbl { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
table.tbl th, table.tbl td { border-bottom: 1px solid var(--line-2); border-right: 1px solid var(--line-2); padding: 7px 9px; text-align: left; vertical-align: top; }
table.tbl th { background: #fafbfc; font-weight: 600; color: var(--text-2); position: sticky; top: 0; z-index: 2; white-space: nowrap; font-size: 12.5px; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl td:last-child, table.tbl th:last-child { border-right: none; }
table.tbl tbody tr:hover td { background: #fcfcfd; }
table.tbl td.ed { cursor: text; }
table.tbl td.ed:hover { background: #f7f4f7; box-shadow: inset 0 0 0 1px #e7dce5; }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .blank td { background: #fdfdfe; height: 26px; }
table.tbl input.cell { width: 100%; border: none; outline: none; background: transparent; padding: 0; font-size: 13px; }
table.tbl input.cell:focus { box-shadow: 0 0 0 2px rgba(118, 33, 105, .18); border-radius: 3px; }

/* ---------------------------------------------------------------- 弹层 */
.mask { position: fixed; inset: 0; background: rgba(20, 22, 26, .38); display: flex; z-index: 60; }
.mask.center { align-items: center; justify-content: center; }
.mask.right { justify-content: flex-end; }
.dlg { background: #fff; border-radius: 10px; box-shadow: var(--shadow); width: min(560px, 94vw); max-height: 88vh; display: flex; flex-direction: column; }
.drawer { background: #fff; width: min(560px, 96vw); height: 100%; display: flex; flex-direction: column; box-shadow: -6px 0 24px rgba(16, 24, 40, .1); }
.dlg-h, .drawer-h { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.dlg-h h3, .drawer-h h3 { font-size: 15px; flex: 1; }
.dlg-b, .drawer-b { padding: 16px; overflow: auto; flex: 1; }
.dlg-f, .drawer-f { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }
.x { border: none; background: none; font-size: 20px; line-height: 1; color: var(--text-3); cursor: pointer; padding: 0 4px; }
.x:hover { color: var(--text); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border: none; background: none; padding: 8px 12px; cursor: pointer; color: var(--text-2); border-bottom: 2px solid transparent; font-size: 13.5px; }
.tabs button.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* 分段切换（表格 / 卡片 / 表格模式） */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.seg button { border: none; background: none; padding: 5px 11px; cursor: pointer; font-size: 12.5px; color: var(--text-2); border-right: 1px solid var(--line); }
.seg button:last-child { border-right: none; }
.seg button:hover { background: var(--primary-soft); }
.seg button.on { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* 号状态 */
.bad { color: var(--danger); }
.pill { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 11.5px; line-height: 18px; background: var(--primary-soft); color: var(--text-2); }
.pill.red { background: #fbecec; color: var(--danger); }
.pill.green { background: #e9f4f0; color: var(--ok); }
.pill.blue { background: #eaf2fb; color: var(--info); }
.pill.orange { background: #fdf3e6; color: var(--warn); }

/* 手机端悬浮按钮 */
.fab { display: none; }
@media (max-width: 860px) {
  .fab { display: flex; position: fixed; right: 16px; bottom: 78px; width: 52px; height: 52px; border-radius: 50%; background: var(--primary); color: #fff; border: none; align-items: center; justify-content: center; font-size: 24px; box-shadow: 0 6px 18px rgba(118, 33, 105, .35); z-index: 45; cursor: pointer; }
  .card-h { gap: 6px; }
  .card-h .inp, .card-h .sel { max-width: none !important; flex: 1 1 140px; }
  .tbl-wrap { font-size: 12.5px; }
}

/* 粘贴网格（表格模式）
   —— 后面接了「首轮咨询 + 五轮回访 + 成单数/成单金额」这些派生列，
      整张表一定比屏幕宽，所以 th 一律 nowrap + min-width，靠 .tbl-wrap 横滑。 */
.grid-paste { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.grid-paste th, .grid-paste td { border: 1px solid var(--line); padding: 3px 6px; white-space: nowrap; }
.grid-paste th { background: #fafbfc; color: var(--text-2); font-weight: 600; position: sticky; top: 0; z-index: 2; }
.grid-paste td input { width: 100%; border: none; outline: none; background: transparent; font-size: 12.5px; }
.grid-paste td select { border: none; outline: none; background: transparent; font-size: 12.5px; width: 100%; }
.grid-paste tr.blank td { background: #fdfdfe; }
.grid-paste td.focus { box-shadow: inset 0 0 0 2px var(--primary); }
/* 派生列（只读）：沿用列表页的回访配色，网格里也不混淆市场和咨询 */
.grid-paste td.rd { vertical-align: top; max-width: 190px; }
.grid-paste td.rd .rd-tx { display: block; white-space: normal; }
.grid-paste td.num { text-align: right; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); background: #1f2328; color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 13px; z-index: 90; box-shadow: var(--shadow); }
.toast.err { background: var(--danger); }

.field { margin-bottom: 11px; }
.field > label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 4px; }
.field .req { color: var(--danger); }
.hint { color: var(--text-3); font-size: 12px; margin-top: 4px; }

.timeline { border-left: 2px solid var(--line-2); padding-left: 14px; }
.tl-item { position: relative; padding: 0 0 14px; }
.tl-item::before { content: ''; position: absolute; left: -21px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px #fff; }
.tl-item .h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tl-item .c { white-space: pre-wrap; margin-top: 2px; }

/* 卡片视图 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(276px, 1fr)); gap: 12px; }
.cc { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.cc .t { display: flex; align-items: center; gap: 8px; }
.cc .t b { font-size: 14.5px; }
.cc .kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin-top: 8px; font-size: 12.5px; }
.cc .kv i { color: var(--text-3); font-style: normal; }
.cc .acts { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ------------------------------------------------ 回访单元格（首轮咨询 / 五轮回访）
   一位客户市场和咨询会一起回访，用文字颜色区分是谁在跟进：
     市场回访 = 蓝（--rd-market）   咨询回访 = 品牌紫（--rd-consult）
   两块颜色都只落在文字上，不铺底色 —— 表格里 5 列并排，铺底色会很吵。 */
td.rd { vertical-align: top; }
td.rd.empty { background-image: linear-gradient(45deg, var(--line-2) 25%, transparent 25%, transparent 75%, var(--line-2) 75%),
                                   linear-gradient(45deg, var(--line-2) 25%, transparent 25%, transparent 75%, var(--line-2) 75%);
              background-size: 6px 6px; background-position: 0 0, 3px 3px; }
td.rd .rd-at { display: block; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
td.rd .rd-tx { display: block; font-size: 12.5px; line-height: 1.45; margin-top: 1px; white-space: pre-wrap; word-break: break-word; }
td.rd .rd-who { display: block; font-size: 11px; margin-top: 2px; opacity: .8; }
td.rd.mk .rd-tx, td.rd.mk .rd-who { color: var(--rd-market); }
td.rd.cs .rd-tx, td.rd.cs .rd-who { color: var(--rd-consult); }
td.rd.over { background: #fdf6f6; }
td.rd.over .rd-at { color: var(--danger); }
td.rd.rd-first { border-left: 2px solid var(--line); }
td.rd.rd-first .rd-tx, td.rd.rd-first .rd-who { color: var(--rd-consult); }

/* 可点的派生格（首轮咨询 / 五轮回访 / 成单数·成单金额）：
   不给手型和悬停反馈的话，用户根本不知道这几列能点。 */
td.rd.ed-cell, td.num.ed-cell { cursor: pointer; }
td.rd.ed-cell:hover, td.num.ed-cell:hover { background: var(--primary-soft); }
td.rd.empty.ed-cell { position: relative; }
td.rd.empty.ed-cell::after {
  content: '＋'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text-3); opacity: 0;
}
td.rd.empty.ed-cell:hover { background-image: none; background: var(--primary-soft); }
td.rd.empty.ed-cell:hover::after { opacity: 1; }

/* 成单数 / 成单金额 */
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num.zero { color: var(--text-3); }
td.num.money.won { color: var(--primary); font-weight: 600; }

/* 回访列的表头窄一点、居中，跟正文区分开 */
table.tbl th.rdh { text-align: center; font-weight: 600; }

.pager { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.bar { height: 8px; background: var(--primary-soft); border-radius: 4px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--primary); }

/* ------------------------------------------------ 登录页
   版式：屏幕正中一张白卡（logo + 品牌名 + 欢迎回来 + 表单），桌面端与手机端同一套，不做左右分栏。
   配色：按需求走参考图的天蓝 —— 只在 .login 作用域里覆盖主色变量，
        所以卡里的 .btn.pri / 链接自动变天蓝，内页仍是海文紫，两边互不影响。 */
.login {
  --primary: #1E90FF;
  --primary-deep: #0B6FD4;
  --primary-soft: #EAF4FF;
  --primary-tint: #EAF4FF;
  --primary-ring: rgba(30, 144, 255, .16);
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden; background: #F8FAFD; padding: 20px;
}
/* 两块柔和的圆角色块，压住纯白背景的单调 */
.login::before, .login::after { content: ''; position: absolute; pointer-events: none; }
.login::before {
  left: -12%; bottom: -22%; width: min(46vw, 640px); height: min(46vw, 640px);
  border-radius: 46% 54% 62% 38% / 54% 42% 58% 46%;
  background: linear-gradient(140deg, rgba(30, 144, 255, .11), rgba(30, 144, 255, .02));
}
.login::after {
  right: -8%; top: -18%; width: min(44vw, 620px); height: min(44vw, 620px);
  border-radius: 58% 42% 38% 62% / 44% 58% 42% 56%;
  background: linear-gradient(150deg, rgba(96, 165, 250, .16), rgba(96, 165, 250, .02));
}
.login-main { position: relative; z-index: 1; width: 408px; max-width: 100%; }
.login-card {
  background: #fff; border: 1px solid rgba(16, 24, 40, .06); border-radius: 22px;
  padding: 34px 32px 26px; text-align: center;
  box-shadow: 0 24px 60px rgba(16, 24, 40, .12), 0 4px 14px rgba(16, 24, 40, .05);
}
.lc-logo-img {
  display: block; margin: 0 auto 16px; width: 60px; height: 60px;
  border-radius: 16px; background: var(--primary-tint); object-fit: contain; padding: 7px;
  box-shadow: 0 8px 20px rgba(16, 24, 40, .10);
}
.lc-brand {
  display: block; margin: 0 auto 26px; font-size: 15px; font-weight: 600;
  letter-spacing: 4px; text-indent: 4px; color: var(--primary-deep);
}
.login-card h1 { font-size: 25px; font-weight: 700; letter-spacing: -.4px; margin: 0 0 6px; color: var(--text); }
.login-card .sub { color: var(--text-2); font-size: 14px; margin: 0 0 24px; }
.field-login {
  display: flex; align-items: center; gap: 8px; position: relative;
  height: 46px; padding: 0 12px; margin-bottom: 14px; text-align: left;
  background: #F4F6F9; border: 1.5px solid transparent; border-radius: 12px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.field-login .fi { font-size: 16px; color: var(--text-3); }
.field-login input {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none;
  font-size: 14.5px; color: var(--text);
}
.field-login:focus-within { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.field-login.error { border-color: var(--danger); background: rgba(163, 45, 45, .05); animation: shake .4s; }
.pw-toggle {
  border: 0; background: transparent; color: var(--text-3); font-size: 12.5px;
  cursor: pointer; padding: 4px 6px; border-radius: 7px;
}
.pw-toggle:hover { color: var(--primary); background: var(--primary-soft); }
.login-err { color: var(--danger); font-size: 12.5px; margin: -6px 0 10px; text-align: left; }
.login-err:empty { display: none; }
.login-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 16px; }
.login-row .ck { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; cursor: pointer; }
.login-row .ck input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }
.login-row .link { font-size: 13px; color: var(--primary); cursor: pointer; }
.btn.block { width: 100%; height: 44px; font-size: 15px; border-radius: 12px; }
.login-foot { margin: 18px 0 0; font-size: 12px; color: var(--text-3); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* 「筛选」折叠按钮只在手机端出现（桌面端这一条不能被下面的 media query 反超，
   所以基础规则必须写在 media query 之前、且没被包进去） */
.f-tog { display: none; }

/* 手机端：侧栏变底部 tab */
@media (max-width: 860px) {
  .shell { display: block; }
  .side { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: 100%; height: auto; flex: none; flex-direction: row; border-right: none; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 40; overflow-x: auto; overflow-y: hidden; gap: 0; scrollbar-width: none; }
  .side::-webkit-scrollbar { display: none; }
  .brand, .side .foot { display: none; }
  /* 手机上入口多，必须 nowrap —— 一换行「客户列表」会被截成两半摞在图标上。
     每项给一个最小宽度，真的放不下就横着滑。 */
  .nav { flex-direction: row; flex-wrap: nowrap; width: auto; margin: 0 auto; justify-content: space-around; }
  .nav a { flex: 0 0 auto; min-width: 62px; flex-direction: column; gap: 2px; font-size: 11px; padding: 5px 6px; text-align: center; white-space: nowrap; }
  .nav a .ic { width: 20px; height: 20px; font-size: 16px; }
  .nav .badge { position: absolute; margin: -18px 0 0 12px; }
  /* 每日业绩 / 渠道消费是桌面端的活，手机上让位给常用的那几个入口 */
  .nav a.desk { display: none; }
  .main { padding-bottom: 66px; }
  .top { padding: 0 12px; }
  .wrap { padding: 12px; }
  .cards { grid-template-columns: 1fr; }
  table.tbl th, table.tbl td { padding: 6px 7px; }
  /* 筛选栏在手机上要铺 8 行，太高：默认收成一个「筛选」按钮，点开才展开 */
  .f-tog { display: inline-flex; }
  [data-collapsible]:not(.open) > *:not(.f-tog) { display: none; }
}

/* 「筛选」折叠按钮的基础样式在上面（手机端那条 media query 里再打开） */

@media print { .side, .top .row, .no-print { display: none !important; } }
