/* 墨轨 · 获客工作台 — 视觉系统基于「墨轨智联律所工作台」(codex-legal-workbench) 单色体系
   + 生物视觉辅助层：唯一强调色（琥珀）只标注「可交互」元素 —— 人眼对孤立暖色有
   前注意弹出（~0.25s 无需逐个搜索），有色=可点，黑白=信息 */
:root {
  --bg: #ffffff;
  --sidebar: #f7f7f7;
  --surface: #ffffff;
  --surface2: #f6f6f6;
  --hover: #ededed;
  --line: #e6e6e6;
  --text: #181818;
  --subtle: #626262;
  --muted: #777777;
  --accent: #a86f0e;
  --accent-deep: #8a5b08;
  --accent-soft: #f7ecd4;
  --danger: #b53737;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "PingFang SC", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: var(--font); color: var(--text); background: var(--bg);
       line-height: 1.6; text-rendering: optimizeLegibility; font-synthesis: none; }
a { color: inherit; text-decoration: none; }
/* 内容区链接 = 强调色（可点即有色）；侧栏是导航外壳，保持黑白；按钮类除外（自有配色） */
.main a:not(.tab):not(.pager a):not(.btnlink) { color: var(--accent-deep); }
.main a:not(.tab):not(.btnlink):hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; cursor: pointer; }
input[type="checkbox"] { accent-color: var(--accent); }
button, input, textarea, select, a { outline-offset: 3px; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); }
::selection { background: var(--accent-soft); }

/* ---------- 布局：左侧栏 248px + 主区 ---------- */
.layout { display: flex; min-height: 100vh; }
.side { width: 248px; background: var(--sidebar); border-right: 1px solid var(--line);
        display: flex; flex-direction: column;
        position: sticky; top: 0; height: 100vh; }

.brand { display: flex; align-items: center; gap: 10px; padding: 22px 18px 16px; }
.brand-symbol { width: 30px; height: 23px; flex: none; }
.brand-text { min-width: 0; }
.brand-name { font-size: 14px; font-weight: 500; letter-spacing: 0.08em; line-height: 1.3; }
.brand-sub { font-size: 10px; font-weight: 600; letter-spacing: 1.3px; color: var(--muted); margin-top: 1px; }

.side nav { flex: 1; display: flex; flex-direction: column; gap: 1px; padding: 2px 10px; overflow-y: auto; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px;
              border-radius: 7px; color: var(--subtle); font-size: 13px;
              transition: background 0.16s, color 0.16s; white-space: nowrap; }
.side nav a svg { width: 17px; height: 17px; flex: none; }
.side nav a:hover { background: var(--hover); color: var(--text); }
.side nav a.on { background: var(--hover); color: var(--text); font-weight: 500; }

.side-foot { padding: 14px 16px; border-top: 1px solid var(--line);
             font-size: 12px; color: var(--subtle); }
.side-foot form { margin-top: 8px; }
.side-foot button { border: 1px solid var(--line); background: var(--surface); color: var(--text);
                    border-radius: 8px; padding: 4px 12px; font-size: 11.5px; min-height: 26px;
                    transition: background 0.16s; }
.side-foot button:hover { background: var(--hover); }

.main { flex: 1; min-width: 0; max-width: 1040px; margin: 0 auto;
        padding: clamp(36px, 7vh, 78px) clamp(24px, 4vw, 64px) 96px; width: 100%; }
.main.lone { max-width: 380px; margin: 14vh auto 0; padding: 0 16px; }

/* ---------- 页头 ---------- */
h1 { font-size: 26px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.35;
     padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.sub { font-size: 12.5px; color: var(--muted); margin: 8px 0 14px; }
h2 { font-size: 14.5px; font-weight: 600; letter-spacing: -0.01em; margin: 22px 0 10px; }
.eyebrow { display: block; font-size: 10px; font-weight: 600; letter-spacing: 1.3px;
           color: var(--muted); margin-bottom: 8px; }

/* ---------- 指标卡（legal-metric） ---------- */
.cards { display: flex; gap: 16px; margin: 4px 0 16px; flex-wrap: wrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
        padding: 20px 22px; min-width: 132px; flex: 1 1 auto; min-height: 96px;
        display: flex; flex-direction: column; justify-content: center;
        transition: background 0.16s; }
.card:hover { background: var(--surface2); }
.card > .num { font-size: 32px; font-weight: 500; letter-spacing: -0.02em;
               font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 6px; }
.card .lab { font-size: 12px; color: var(--muted); }
.card.dark { background: var(--surface2); border-color: var(--line); }
.card.dark > .num { color: var(--text); font-weight: 600; }
.card.dark .lab { color: var(--subtle); }
.avatar-img { border-radius: 50%; object-fit: cover; border: 1px solid var(--line);
              vertical-align: -6px; }
/* 点击即复制（电话/抖音号/微信号）——浮动提示，不改原文 */
.cp { cursor: pointer; }
.cp:hover { text-decoration: underline; text-underline-offset: 3px; }
.cp-tip { position: fixed; z-index: 99; background: var(--text); color: #fff;
          font-size: 11px; line-height: 1.5; padding: 3px 10px; border-radius: 6px;
          pointer-events: none; animation: cpfade 1.4s ease forwards; }
@keyframes cpfade {
  0% { opacity: 0; transform: translateY(3px); }
  10% { opacity: 1; transform: none; }
  78% { opacity: 1; }
  100% { opacity: 0; }
}
/* 线索抖音头像 */
.lead-av { width: 24px; height: 24px; border-radius: 50%; object-fit: cover;
           vertical-align: -7px; margin-right: 7px; border: 1px solid var(--line);
           background: var(--surface2); }
.lead-av.lg { width: 44px; height: 44px; vertical-align: -13px; margin-right: 11px; }

/* ---------- 表格（卡片化数据行） ---------- */
table { width: 100%; background: var(--surface); border: 1px solid var(--line);
        border-radius: var(--radius); border-collapse: separate; border-spacing: 0; }
th { text-align: left; font-weight: 600; font-size: 10px; letter-spacing: 0.6px;
     color: var(--muted); padding: 13px 16px 9px; border-bottom: 1px solid var(--line);
     white-space: nowrap; text-transform: uppercase; }
td { border-bottom: 1px solid var(--line); padding: 12px 16px; vertical-align: top;
     font-size: 13px; color: var(--text); }
tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) td { background: #fbfbfb; }
table tbody tr:hover td { background: var(--surface2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.dim { color: var(--muted); }

/* ---------- 徽标（status-chip，紧凑统一） ---------- */
.tag { display: inline-block; border-radius: 4px; padding: 0 7px; font-size: 10.5px;
       line-height: 1.8; white-space: nowrap;
       background: var(--surface2); color: var(--subtle); }
.tag.fill { background: var(--accent-soft); color: var(--text); font-weight: 500; }
.tag.ok { background: var(--text); color: var(--bg); }
.tag.warn { background: var(--surface2); color: var(--subtle); }
.due { display: inline-block; border-radius: 4px; padding: 0 6px; font-size: 10.5px;
       line-height: 1.8; background: var(--text); color: var(--bg); }

/* ---------- 工具栏与输入 ---------- */
.bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
select, input[type=text], input[type=password], input[type=date], input[type=file] {
  font: inherit; font-size: 13px; border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; background: var(--surface); color: var(--text);
  min-width: 0; transition: border-color 0.16s; }
input::placeholder { color: var(--muted); font-size: 12px; }
select:focus, input:focus { outline: 2px solid var(--accent); outline-offset: 3px; }

button.act { border: 1px solid var(--accent-deep); background: var(--accent); color: #fff;
             border-radius: 9px; padding: 6px 14px; font-size: 12.5px; font-weight: 500;
             min-height: 32px; white-space: nowrap;
             transition: background 0.16s, transform 0.16s; }
button.act:hover { background: var(--accent-deep); }
button.act:active:not(:disabled) { transform: translateY(1px); }
button.plain { border: 1px solid var(--line); background: var(--surface); color: var(--text);
               border-radius: 9px; padding: 6px 14px; font-size: 12.5px; min-height: 32px;
               white-space: nowrap; transition: background 0.16s, transform 0.16s; }
button.plain:hover { background: var(--hover); }
button.plain:active:not(:disabled) { transform: translateY(1px); }
button.act:disabled, button.plain:disabled { cursor: not-allowed; opacity: 0.42; }
.bar form { display: flex; gap: 8px; align-items: center; }

details > summary { cursor: pointer; list-style: none; color: var(--accent); font-size: 12px;
                    border-radius: 6px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "+"; display: inline-block; width: 14px; color: var(--accent); }
details[open] > summary::before { content: "-"; }
.logform { display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
           padding: 10px 0 4px; border-top: 1px dashed var(--line); margin-top: 8px; }

/* ---------- 登录 ---------- */
.login-box { background: var(--surface); border: 1px solid var(--line);
             border-radius: var(--radius); padding: 30px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 12px;
               margin-bottom: 24px; }
.login-brand img { width: 44px; height: auto; }
.login-brand .brand-name { font-size: 12px; font-weight: 500; letter-spacing: 0.16em; }
.login-box h1 { font-size: 17px; border-bottom: none; padding-bottom: 0;
                letter-spacing: -0.01em; }
.login-box label { display: block; font-size: 12px; color: var(--subtle); margin: 13px 0 5px; }
.login-box input { width: 100%; }
.login-box button { width: 100%; margin-top: 20px; padding: 10px; font-size: 13px; }
.err { border: none; border-radius: 8px; background: #f9ececec; color: var(--danger);
       padding: 9px 13px; margin-bottom: 14px; font-size: 13px; }
.ok { background: var(--surface2); color: var(--text); border-radius: 8px;
      padding: 9px 13px; margin-bottom: 14px; font-size: 13px; font-weight: 500;
      border: 1px solid var(--line); }

/* ---------- 分页 ---------- */
.pager { display: flex; gap: 6px; margin-top: 16px; font-size: 12px; }
.pager a, .pager span { border-radius: 7px; padding: 3px 10px; border: 1px solid var(--line);
                        min-height: 26px; display: inline-flex; align-items: center; }
.pager a:hover { background: var(--hover); }
.pager .cur { background: var(--accent); color: #fff; border-color: var(--accent-deep); }
.muted-line { font-size: 13px; color: var(--muted); margin: 6px 0; }

/* ---------- 页签（segmented） ---------- */
.tabs { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; }
.seg { display: inline-flex; background: var(--surface2); padding: 3px;
       border: 1px solid var(--line); border-radius: 8px; gap: 2px; }
.tab { font-size: 12px; padding: 6px 12px; border-radius: 5px; color: var(--muted);
       white-space: nowrap; transition: background 0.16s, color 0.16s; }
a.tab:hover { color: var(--text); }
.tab.on { background: var(--accent); color: #fff; font-weight: 500; }
.tab .cnt { display: inline-block; min-width: 18px; text-align: center; font-size: 10px;
            padding: 0 5px; margin-left: 6px; line-height: 15px; border-radius: 4px;
            background: rgba(0, 0, 0, 0.07); color: var(--subtle); }
.tab.on .cnt { background: rgba(255, 255, 255, 0.28); color: #fff; }
.tabs-sp { flex: 1; }
.tabs > a.tab:not(.on) { color: var(--subtle); }
/* 紧凑分段控件（全站筛选统一规格） */
.seg.sm { gap: 1px; padding: 2px; border-radius: 7px; }
.seg.sm .tab { font-size: 11.5px; padding: 4px 10px; border-radius: 5px; }
.seg.sm .tab .cnt { font-size: 9.5px; min-width: 15px; line-height: 13px;
                    padding: 0 4px; margin-left: 5px; border-radius: 3px; }
.filt { margin: 0; }
.tool { gap: 8px; margin-bottom: 12px; }
.tool input[type="text"] { flex: 1 1 150px; }

/* ---------- 任务筛选 / 微信号编辑 ---------- */
.wxform { display: flex; gap: 4px; align-items: center; }
.wxform input[type="text"] { width: 108px; min-width: 0; padding: 4px 8px;
                             font-size: 12px; border-radius: 6px; }
button.mini { padding: 4px 8px; font-size: 11px; border-radius: 6px;
              background: var(--accent); color: #fff; border: 1px solid var(--accent-deep); }
button.mini:hover { background: var(--accent-deep); }
button.mini:active { transform: translateY(1px); }

/* ---------- 看板作战大屏 ---------- */
.kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 6px 0 18px; }
.kpi .card .num { font-size: 38px; }
.quick { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 22px; }
a.btnlink { display: inline-flex; align-items: center; gap: 6px;
            border: 1px solid var(--accent-deep); background: var(--accent); color: #fff;
            border-radius: 9px; padding: 8px 16px; font-size: 12.5px; font-weight: 500;
            min-height: 34px; white-space: nowrap;
            transition: background 0.16s, transform 0.16s; }
a.btnlink:hover { background: var(--accent-deep); }
a.btnlink:active { transform: translateY(1px); }
a.btnlink.ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
a.btnlink.ghost:hover { background: var(--hover); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.funnel { display: flex; flex-direction: column; gap: 9px; }
.frow { display: grid; grid-template-columns: 62px 1fr 52px; gap: 10px; align-items: center;
        font-size: 12.5px; color: var(--subtle); }
.frow .fnum { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); }
.track { flex: 1; height: 8px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.track i { display: block; height: 100%; background: var(--text); border-radius: 4px; }
.loadrow { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.loadrow .nm { width: 64px; font-size: 12.5px; flex: none; }
.loadrow .val { font-size: 12px; color: var(--subtle); min-width: 88px; text-align: right;
                font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px;
            margin-right: 5px; vertical-align: -1px; }
/* 看板趋势图：正常尺寸（按天数定宽，不再全宽拉伸） */
.chart-wrap.sm { max-width: 780px; padding: 16px 16px 10px; }
.chart-wrap.sm .chart { width: auto; min-width: 0; height: 116px; }
@media (max-width: 760px) {
  .kpi { grid-template-columns: 1fr 1fr; }
  .kpi .card .num { font-size: 30px; }
  .grid2 { grid-template-columns: 1fr; }
  .wxform input[type="text"] { font-size: 16px; width: 130px; }
  button.mini { font-size: 13px; }
}

/* ---------- 图表 ---------- */
.chart-wrap { background: var(--surface); border: 1px solid var(--line);
              border-radius: var(--radius); padding: 20px 18px 12px; margin: 8px 0 6px;
              overflow-x: auto; }
.chart { width: 100%; min-width: 560px; height: auto; display: block; }
.cpct { font-size: 9px; fill: var(--text); font-weight: 600; }
.caxis { font-size: 9px; fill: var(--muted); }
.cn { font-size: 8.5px; fill: #a0a0a0; }
.legend { font-size: 12px; color: var(--muted); margin: 8px 0 4px 8px; }

/* ---------- 头像 ---------- */
.avatar { display: inline-flex; align-items: center; justify-content: center;
          border-radius: 50%; background: var(--surface2); color: var(--subtle);
          font-weight: 500; vertical-align: middle; flex: none;
          border: 1px solid var(--line); }
.member-link { display: inline-flex; align-items: center; gap: 8px; }
.member-link:hover .avatar { background: var(--accent-soft); }

/* ---------- 员工卡片 ---------- */
.staff-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
              gap: 16px; margin-top: 8px; }
.staff-card { display: flex; gap: 14px; align-items: center; background: var(--surface);
              border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px;
              transition: background 0.16s, border-color 0.16s; }
.staff-card:hover { background: var(--surface2); border-color: var(--line); }
.staff-name { font-weight: 600; margin-bottom: 4px; font-size: 14px; }
.staff-line { font-size: 12px; color: var(--muted); margin: 2px 0; font-variant-numeric: tabular-nums; }

/* ---------- 勾选标签 ---------- */
label.ck { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
           border-radius: 8px; padding: 7px 13px; font-size: 12.5px; cursor: pointer;
           color: var(--subtle); background: var(--surface);
           transition: background 0.16s, color 0.16s; min-height: 34px; }
label.ck:hover { background: var(--hover); color: var(--text); }
label.ck:has(input:checked) { background: var(--text); color: var(--bg); border-color: var(--text); }
label.ck:has(input:checked) input { accent-color: var(--bg); }

/* ---------- 移动端（源码 ≤620px 收窄侧栏形态 → Web 用顶导航） ---------- */
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .side { width: 100%; height: auto; position: static; padding: 0;
          border-right: none; border-bottom: 1px solid var(--line); }
  .brand { padding: 14px 16px 10px; }
  .side nav { flex-direction: row; overflow-x: auto; -webkit-overflow-scrolling: touch;
              scrollbar-width: none; padding: 0 10px 10px; }
  .side nav::-webkit-scrollbar { display: none; }
  .side nav a { padding: 8px 11px; flex: none; }
  .side-foot { padding: 10px 16px; border-top: 1px solid var(--line);
               display: flex; justify-content: space-between; align-items: center; }
  .side-foot form { margin: 0; }
  .page { padding: 22px 16px 80px; }
  h1 { font-size: 21px; padding-bottom: 10px; }
  .sub { font-size: 12.5px; margin-bottom: 18px; }
  .card { min-width: calc(50% - 8px); padding: 14px 16px; min-height: 84px; }
  .card .num { font-size: 24px; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  td, th { white-space: nowrap; }
  select, input[type=text], input[type=password], input[type=date] { font-size: 16px; }
  .tabs { overflow-x: auto; scrollbar-width: none; }
  .staff-grid { grid-template-columns: 1fr; }
  .chart-wrap { padding: 12px 8px 6px; }
}
