/* 客户管理系统 - 界面样式（v2 精致版）
   配色基于经过色盲安全验证的调色板（浅色模式） */
:root {
  color-scheme: light;
  --page: #f6f7f9;          /* 页面底色 */
  --page-2: #f0f2f5;
  --surface: #ffffff;       /* 卡片底色 */
  --ink: #0b0b0b;           /* 主文字 */
  --ink-2: #52514e;         /* 次要文字 */
  --ink-3: #898781;         /* 弱化文字 */
  --line: #e7e8ea;          /* 分隔线 */
  --line-2: #c3c2b7;        /* 基线 / 轴 */
  --border: rgba(11, 11, 11, 0.08);
  --accent: #2a78d6;        /* 主色（蓝） */
  --accent-strong: #256abf;
  --accent-deep: #1c5cab;
  --accent-soft: #e8f1fc;   /* 主色最浅档 */
  --good: #0ca30c;
  --warning: #fab219;
  --serious: #ec835a;
  --critical: #d03b3b;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.05);
  --shadow: 0 1px 3px rgba(17, 24, 39, 0.06), 0 8px 24px rgba(17, 24, 39, 0.05);
  --shadow-lg: 0 12px 40px rgba(17, 24, 39, 0.16);
  --grad: linear-gradient(135deg, #2a78d6 0%, #1c5cab 100%);
  --sidebar-w: 236px;
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--page);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft); color: var(--accent-deep); }
.hidden { display: none !important; }
.flex-1 { flex: 1; }
.muted { color: var(--ink-3); }
.small { font-size: 12.5px; }
a { color: inherit; }
.link { color: var(--accent); text-decoration: none; cursor: pointer; }
.link:hover { text-decoration: underline; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #cfd2d6; border-radius: 6px; border: 2px solid var(--page); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 通用控件 ---------- */
.input, select.input {
  font-family: inherit;
  font-size: 15px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:hover { border-color: rgba(11, 11, 11, 0.16); }
.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42, 120, 214, 0.14);
}
textarea.input { resize: vertical; min-height: 84px; }
.btn {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.btn:hover { background: #f2f4f7; border-color: rgba(11, 11, 11, 0.16); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(42, 120, 214, 0.35);
}
.btn-primary:hover { background: linear-gradient(135deg, #256abf 0%, #184f95 100%); box-shadow: 0 4px 14px rgba(42, 120, 214, 0.42); }
.btn-danger { background: var(--critical); border-color: transparent; color: #fff; box-shadow: 0 2px 8px rgba(208, 59, 59, 0.3); }
.btn-danger:hover { background: #b83333; }
.btn-danger-ghost { color: var(--critical); border-color: rgba(208, 59, 59, 0.35); }
.btn-danger-ghost:hover { background: rgba(208, 59, 59, 0.07); }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 12px; font-size: 13px; border-radius: 8px; }
.icon-btn {
  border: none;
  background: none;
  color: var(--ink-2);
  cursor: pointer;
  padding: 7px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all .15s;
}
.icon-btn:hover { background: rgba(11, 11, 11, 0.06); color: var(--ink); }
.field { display: block; margin-bottom: 15px; }
.field > span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.field .input { width: 100%; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); cursor: pointer; font-size: 13.5px; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- 登录 ---------- */
#login-view {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, #eef4fc 0%, #f6f7f9 45%, #edf1f6 100%);
}
#login-view::before, #login-view::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .5;
  pointer-events: none;
}
#login-view::before { width: 480px; height: 480px; background: #cfe3fa; top: -160px; right: -120px; }
#login-view::after { width: 420px; height: 420px; background: #e3ecf9; bottom: -180px; left: -100px; }
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(11, 11, 11, 0.07);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 40px 34px 26px;
  animation: rise .45s ease both;
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(42, 120, 214, 0.28);
}
.login-brand h1 { font-size: 21px; margin: 14px 0 4px; letter-spacing: .01em; }
.login-sub { color: var(--ink-3); margin: 0; font-size: 13px; }
.login-error { color: var(--critical); font-size: 13px; margin: 0 0 10px; }
.login-foot { text-align: center; color: var(--ink-3); font-size: 12.5px; margin: 20px 0 0; }
#login-form .btn-primary { margin-top: 4px; padding: 11px; font-size: 15px; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 40;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 20px 18px 16px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .01em;
}
.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: 0 2px 8px rgba(42, 120, 214, 0.25);
}
.nav { padding: 6px 12px; display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 13px;
  border-radius: 10px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14px;
  transition: all .14s ease;
}
.nav a:hover { background: #f2f4f7; color: var(--ink); }
.nav a.active {
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(42, 120, 214, 0.14);
}
.nav svg { flex: none; }
.sidebar-user {
  margin-top: auto;
  padding: 13px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fafbfc;
}
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex: none;
  box-shadow: 0 2px 6px rgba(42, 120, 214, 0.3);
}
.user-info { flex: 1; min-width: 0; }
.user-name { margin: 0; font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { margin: 0; font-size: 12px; color: var(--ink-3); }
.sidebar-mask { display: none; }
.content { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar-title { font-weight: 600; }
.topbar-user { color: var(--ink-2); font-size: 13px; }
.main { padding: 26px 30px 56px; flex: 1; width: 100%; max-width: 1220px; margin: 0 auto; animation: fade .3s ease both; }

/* ---------- 页头 ---------- */
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h2 { margin: 0; font-size: 21px; flex: none; letter-spacing: .01em; }
.page-sub { margin: 3px 0 0; color: var(--ink-3); font-size: 13px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px 22px;
}
.card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 15.5px; }
.card-sub { margin: 0; color: var(--ink-3); font-size: 12.5px; }
.card-head .flex-1 { flex: 1; }

/* ---------- 首页 ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: all .18s ease;
}
.stat-tile:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.tile-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.ti-blue { background: #e8f1fc; color: var(--accent-deep); }
.ti-green { background: #e4f5ec; color: #0f7a4d; }
.ti-orange { background: #fdeee4; color: #b4531e; }
.ti-red { background: #fce9e9; color: #b83333; }
.tile-main { min-width: 0; }
.tile-label { margin: 1px 0 4px; color: var(--ink-2); font-size: 13px; }
.tile-value { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.tile-delta { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-3); }
.tile-delta .due { color: var(--critical); font-weight: 600; }
.dash-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; align-items: start; }
.dash-left { display: flex; flex-direction: column; gap: 16px; }

/* 趋势图 */
.chart-wrap { position: relative; }
.chart-wrap svg { display: block; }
.axis-text { font-size: 11px; fill: var(--ink-3); }
.bar { fill: var(--accent); transition: fill .1s; }
.bar-hover { fill: var(--accent-strong); }
.bar-hit { fill: transparent; cursor: pointer; outline: none; }
.chart-tip {
  position: absolute;
  background: var(--ink);
  color: #fff;
  border-radius: 9px;
  padding: 6px 12px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  white-space: nowrap;
  z-index: 5;
  box-shadow: 0 4px 14px rgba(11, 11, 11, 0.25);
}
.chart-tip strong { font-size: 13px; }
.chart-tip span { font-size: 11.5px; opacity: .75; }
.chart-empty { padding: 40px 10px; text-align: center; color: var(--ink-3); }

/* 最近跟进 */
.recent-item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.recent-item:last-child { border-bottom: none; }
.recent-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--accent-soft); color: var(--accent-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.recent-main { min-width: 0; flex: 1; }
.recent-main p { margin: 0; }
.recent-content {
  color: var(--ink-2); font-size: 13px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.recent-meta { color: var(--ink-3); font-size: 12px; }

/* ---------- 筛选行 ---------- */
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-row .input[type="search"], .filter-row .input[type="text"] { width: 220px; }
.filter-row select.input { width: auto; }
.filter-row .grow { flex: 1; min-width: 180px; }
.filter-row input[type="date"] { font-size: 14px; }

/* ---------- 表格 ---------- */
.table-card { padding: 0; overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left;
  font-weight: 600;
  color: var(--ink-3);
  font-size: 12.5px;
  letter-spacing: .02em;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { cursor: pointer; transition: background .12s; }
.table tbody tr:hover { background: #f7fafd; }
.table tbody tr:last-child td { border-bottom: none; }
.cust-name { font-weight: 600; }
.cust-name-sub { color: var(--ink-3); font-size: 12.5px; }
.num-cell { font-variant-numeric: tabular-nums; }

/* 标签与状态小徽章 */
.tag-chip {
  display: inline-block;
  background: #f2f4f7;
  color: var(--ink-2);
  border-radius: 6px;
  padding: 1px 9px;
  font-size: 12px;
  margin: 1px 3px 1px 0;
}
.method-chip {
  display: inline-block;
  background: #f2f4f7;
  color: var(--ink-2);
  border-radius: 6px;
  padding: 0 9px;
  font-size: 12px;
}
.owner-tag {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-deep);
  border-radius: 6px;
  padding: 0 9px;
  font-size: 12px;
}
.status-chip {
  display: inline-block;
  border-radius: 6px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.st-wait { background: #fdf3d7; color: #8a6400; }
.st-done { background: #e2f5e2; color: #006300; }
.st-finish { background: #f2f4f7; color: var(--ink-2); }
.old-tag {
  display: inline-block;
  background: #fdf3d7;
  color: #8a6400;
  border-radius: 6px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.id-chip {
  display: inline-block;
  border-radius: 6px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.id-project { background: #e8f1fc; color: var(--accent-deep); }
.id-home { background: #e4f5ec; color: #0f7a4d; }
.due-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.due-dot.overdue { background: var(--critical); }
.due-dot.today { background: var(--warning); }
.due-dot.future { background: var(--accent); }
.date-urgent { color: var(--critical); font-weight: 600; }
.date-today { color: #8a6400; font-weight: 600; }
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--accent); }
.sort-arrow { font-size: 10px; }

/* 分页 */
.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 13px 16px;
  color: var(--ink-2);
  font-size: 13px;
  border-top: 1px solid var(--line);
}

/* 空状态 */
.empty { text-align: center; color: var(--ink-3); padding: 46px 16px; }
.empty p { margin: 0 0 12px; }

/* ---------- 客户详情 ---------- */
.detail-head-card { margin-bottom: 16px; }
.detail-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-title h2 { margin: 0; font-size: 22px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 13px 20px; margin-top: 16px; }
.info-item .k { font-size: 12px; color: var(--ink-3); margin-bottom: 2px; }
.info-item .v { font-size: 14px; word-break: break-all; }
.info-item .v.pre { white-space: pre-wrap; }
.detail-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }

/* 跟进时间线 */
.fu-item { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.fu-item:last-child { border-bottom: none; }
.fu-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--accent-soft); color: var(--accent-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
}
.fu-main { flex: 1; min-width: 0; }
.fu-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.fu-user { font-weight: 600; font-size: 13.5px; }
.fu-time { color: var(--ink-3); font-size: 12px; }
.fu-del { margin-left: auto; color: var(--ink-3); }
.fu-del:hover { color: var(--critical); background: rgba(208, 59, 59, 0.08); }
.fu-edit { color: var(--ink-3); }
.fu-edit:hover { color: var(--accent); background: rgba(42, 120, 214, 0.08); }
.fu-content { margin: 0; color: var(--ink-2); font-size: 13.5px; word-break: break-word; }
.fu-next { margin: 5px 0 0; font-size: 12.5px; color: var(--ink-3); }

/* ---------- 待办提醒 ---------- */
.scope-tabs { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.scope-tabs button {
  border: none; background: none; padding: 7px 18px;
  font-family: inherit; font-size: 13.5px; cursor: pointer; color: var(--ink-2);
  transition: all .15s;
}
.scope-tabs button.active { background: var(--grad); color: #fff; }
.rem-section { margin-bottom: 18px; }
.rem-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.rem-head h3 { margin: 0; font-size: 14.5px; display: flex; align-items: center; gap: 7px; }
.rem-head .desc { color: var(--ink-3); font-size: 12.5px; }
.rem-head .count { color: var(--ink-3); font-weight: 400; }
.rem-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.rem-dot.overdue { background: var(--critical); }
.rem-dot.today { background: var(--warning); }
.rem-dot.week { background: var(--accent); }
.rem-dot.later { background: var(--line-2); }
.rem-list { border-top: 1px solid var(--line); }
.rem-item { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.rem-date { flex: none; width: 86px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; padding-top: 1px; }
.rem-date.overdue { color: var(--critical); }
.rem-date.today { color: #8a6400; }
.rem-date.week { color: var(--accent); }
.rem-date.later { color: var(--ink-3); }
.rem-main { flex: 1; min-width: 0; }
.rem-main p { margin: 0 0 2px; }
.rem-note { color: var(--ink-2); font-size: 13px; }
.rem-actions { flex: none; display: flex; gap: 6px; }

/* ---------- 跟进记录页 ---------- */
.fu-page-item { display: flex; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.fu-page-item:last-child { border-bottom: none; }

/* ---------- 导出 / 设置 ---------- */
.section-grid { display: grid; gap: 16px; max-width: 780px; }
.export-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.export-row label { color: var(--ink-2); font-size: 13px; }

/* ---------- 模态框 ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 16px;
  z-index: 100;
  overflow-y: auto;
  animation: fade .18s ease both;
}
.modal {
  background: var(--surface);
  border-radius: 16px;
  width: 100%;
  max-width: 580px;
  box-shadow: var(--shadow-lg);
  animation: rise .22s ease both;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px 22px 22px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.confirm-text { margin: 0 0 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.method-picker { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 15px; }
.method-picker label {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 18px;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--ink-2);
  user-select: none;
  transition: all .14s;
}
.method-picker label:hover { border-color: var(--accent); }
.method-picker input { display: none; }
.method-picker label.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-deep); font-weight: 600; }

/* 快捷日期按钮 */
.quick-dates { display: flex; gap: 5px; margin-top: 7px; flex-wrap: wrap; }
.quick-date {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 7px;
  padding: 2px 9px;
  font-size: 12px;
  cursor: pointer;
  color: var(--ink-2);
  font-family: inherit;
  transition: all .14s;
}
.quick-date:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- 提示 ---------- */
#toast-root { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--ink);
  color: #fff;
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(11, 11, 11, 0.3);
  max-width: 80vw;
  animation: rise .25s ease both;
}
.toast-error { background: var(--critical); }

/* ---------- 合同模板 / 合同编辑 ---------- */
.picker-fixed { padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 15px; background: #f7f9fb; font-size: 14px; }
.tpl-form { border-top: 1px solid var(--line); padding-top: 16px; }
.tpl-form input[type="file"] { padding: 7px; font-size: 13.5px; }
.tpl-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.tpl-item:last-child { border-bottom: none; }
.tpl-main { flex: 1; min-width: 0; }
.tpl-main p { margin: 0; }
.tpl-actions { display: flex; gap: 6px; flex: none; }
.template-mode p { margin: 0 0 6px; }
.ce-info { margin-bottom: 14px; }
.ce-info .filter-row { align-items: flex-end; margin-bottom: 0; }
.ce-toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.paper-wrap { background: #e9ebef; padding: 24px 12px 40px; border-radius: var(--radius); }
.paper {
  background: #fff;
  max-width: 800px;
  margin: 0 auto;
  padding: 64px 72px;
  box-shadow: 0 2px 16px rgba(17, 24, 39, 0.14);
  min-height: 1050px;
}
.doc-row { position: relative; display: flex; }
.doc-row:hover { background: #f2f8ff; }
.doc-row:hover .doc-del { opacity: 1; }
.doc-block {
  flex: 1;
  outline: none;
  font-family: SimSun, "宋体", serif;
  font-size: 15px;
  line-height: 2;
  color: var(--ink);
  min-height: 30px;
  white-space: pre-wrap;
  word-break: break-word;
}
.doc-block:focus { background: #fbfdff; }
.doc-block:empty::before { content: "点击输入内容…"; color: #b9b8b3; }
.doc-title { text-align: center; font-weight: 700; font-family: SimHei, "黑体", "Microsoft YaHei", sans-serif; font-size: 20px; }
.doc-head { font-weight: 700; font-family: SimHei, "黑体", "Microsoft YaHei", sans-serif; margin-top: 8px; }
.doc-body { text-indent: 2em; text-align: justify; }
.doc-sign { text-align: left; }
.doc-del {
  position: absolute;
  left: -30px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: var(--critical);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  font-size: 13px;
  line-height: 1;
  transition: opacity .12s;
  box-shadow: 0 2px 6px rgba(208, 59, 59, 0.35);
}

/* 客户搜索下拉 */
.cp-wrap { position: relative; }
.cp-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 10;
  max-height: 260px;
  overflow-y: auto;
  margin-top: 3px;
}
.cp-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: none;
  padding: 9px 13px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}
.cp-item:last-child { border-bottom: none; }
.cp-item:hover { background: #f2f4f7; }
.cp-empty { padding: 10px 13px; color: var(--ink-3); font-size: 13px; }
.field-hint {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 5px;
}
.desc-note { color: var(--ink-3); font-size: 12px; }

/* ---------- 动效 ---------- */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 每日欢迎动画 ---------- */
.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: linear-gradient(160deg, #2a78d6 0%, #1c5cab 55%, #184f95 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: fade .3s ease both;
  overflow: hidden;
}
.welcome-overlay::before {
  content: "";
  position: absolute;
  width: 620px; height: 620px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  top: -220px; right: -160px;
}
.welcome-overlay::after {
  content: "";
  position: absolute;
  width: 460px; height: 460px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  bottom: -190px; left: -130px;
}
.welcome-card {
  position: relative;
  text-align: center;
  color: #fff;
  animation: welcomeIn .6s cubic-bezier(.2, .8, .3, 1.1) both;
}
.welcome-logo {
  width: 88px; height: 88px;
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  margin-bottom: 24px;
  animation: logoBounce .8s ease both;
}
.welcome-card h1 { margin: 0 0 8px; font-size: 30px; font-weight: 700; letter-spacing: .02em; }
.welcome-card p { margin: 0; opacity: .85; font-size: 15px; }
.welcome-hint { margin-top: 40px !important; opacity: .7 !important; font-size: 13px !important; animation: hintPulse 2s ease-in-out infinite; }
.welcome-hide { opacity: 0; transition: opacity .5s; }
@keyframes hintPulse { 0%, 100% { opacity: .4; } 50% { opacity: .85; } }
@keyframes welcomeIn {
  from { opacity: 0; transform: translateY(26px) scale(.96); }
  to { opacity: 1; transform: none; }
}
@keyframes logoBounce {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s; box-shadow: 0 0 24px rgba(11,11,11,.2); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-mask { display: block; position: fixed; inset: 0; background: rgba(17,24,39,.35); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sidebar-mask.show { opacity: 1; pointer-events: auto; }
  .content { margin-left: 0; }
  .topbar { display: flex; }
  .main { padding: 18px 14px 44px; }
  .filter-row .input[type="search"], .filter-row .input[type="text"] { width: 100%; }
  .filter-row .grow { min-width: 0; }
  .col-hide-sm { display: none; }
  .form-row { grid-template-columns: 1fr; }
  .rem-item { flex-direction: column; gap: 6px; }
  .rem-date { width: auto; }
  .paper { padding: 36px 22px; }
  .doc-del { left: auto; right: -8px; top: -8px; transform: none; }
}
