:root {
  --bg: #f4f7fb;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --brand: #0d9488;
  --brand-d: #0f766e;
  --brand-2: #06b6d4;
  --ok: #16a34a;
  --err: #dc2626;
  --warn: #d97706;
  --line: #e6ecf3;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.06);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px 56px; }

/* ── 顶部角色导航 ── */
.topnav {
  display: flex; gap: 6px; justify-content: center; flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
  padding: 10px 12px;
}
.topnav a { text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: 999px; transition: background 0.15s, color 0.15s; }
.topnav a:hover { background: #eef4ff; color: var(--brand); }
.topnav a.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3); }

/* ── 渐变 Hero ── */
.hero {
  margin: 22px 0 22px; padding: 30px 28px; border-radius: 20px;
  background: linear-gradient(135deg, #0f766e 0%, #0d9488 45%, #06b6d4 100%);
  color: #fff; box-shadow: 0 16px 40px rgba(13, 148, 136, 0.28); position: relative; overflow: hidden;
}
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 70%); border-radius: 50%; }
.hero .logo { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.hero .logo .mark { width: 40px; height: 40px; border-radius: 11px; background: rgba(255,255,255,0.16); display: grid; place-items: center; font-weight: 800; font-size: 18px; border: 1px solid rgba(255,255,255,0.3); }
.hero .logo .org { font-size: 13px; letter-spacing: 2px; opacity: 0.9; }
.hero h1 { font-size: 26px; margin: 0 0 8px; font-weight: 700; }
.hero p { margin: 0; opacity: 0.92; font-size: 14.5px; max-width: 640px; }

/* ── 客户端查询页 Hero：整体居中 ── */
.client-view .hero { text-align: center; padding: 40px 28px 36px; }
.client-view .hero .logo { flex-direction: column; align-items: center; gap: 12px; margin-bottom: 18px; }
.client-view .hero .logo .mark { width: 58px; height: 58px; border-radius: 16px; font-size: 26px; }
.client-view .hero .logo .org { font-size: 14px; letter-spacing: 1.5px; max-width: 520px; line-height: 1.6; opacity: 0.95; }
.client-view .hero h1 { font-size: 32px; margin: 0 0 14px; letter-spacing: 1px; }
.client-view .hero p { margin: 0 auto; max-width: 600px; line-height: 1.75; }

/* 登录页品牌区 */
.hero-login { text-align: center; padding: 34px 24px; }
.hero-login .logo { justify-content: center; margin-bottom: 18px; }
.hero-login .logo .mark { width: 52px; height: 52px; border-radius: 14px; font-size: 24px; }
.hero-login .logo .org { font-size: 13px; letter-spacing: 1px; opacity: 0.95; max-width: 360px; margin: 0 auto; line-height: 1.4; }
.hero-login h1 { font-size: 28px; margin-bottom: 0; }

/* ── 卡片 ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px; margin-bottom: 18px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input, textarea, select { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font-size: 15px; background: #fff; color: var(--ink); outline: none; font-family: inherit; }
input:focus, textarea:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.14); }
textarea { resize: vertical; }
button { cursor: pointer; border: none; border-radius: 10px; padding: 11px 20px; font-size: 15px; font-weight: 600; background: var(--brand); color: #fff; transition: background 0.15s, transform 0.05s; }
button:hover { background: var(--brand-d); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
button.ghost:hover { background: #e6f7f4; }
button.ghost.alt { color: #6d28d9; border-color: #ddd6fe; background: #f5f3ff; }
button.ghost.alt:hover { background: #ede9fe; }
button.ghost.alt-danger { color: var(--err); border-color: #fecaca; background: #fef2f2; }
button.ghost.alt-danger:hover { background: #fee2e2; }
button.block { width: 100%; }
.hint { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
.msg { margin-top: 14px; padding: 11px 13px; border-radius: 10px; font-size: 14px; }
.msg.err { background: #fef2f2; color: var(--err); }
.msg.ok { background: #ecfdf3; color: var(--ok); }
.msg.info { background: #f0fdfa; color: var(--brand); }
.msg.warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.foot { text-align: center; color: var(--brand-d); font-size: 14px; font-weight: 600; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); letter-spacing: 0.3px; }

/* ── 统计卡（仪表盘） ── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.last-update { text-align: right; font-size: 12px; color: var(--muted); margin: -10px 2px 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.stat .num { font-size: 30px; font-weight: 800; line-height: 1.1; }
.stat .lbl { font-size: 13px; color: var(--muted); margin-top: 6px; }
.stat { cursor: pointer; transition: transform 0.1s, box-shadow 0.15s, border-color 0.15s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--brand); }
.stat:active { transform: translateY(0); }
.stat .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.stat.b1 .bar { background: var(--brand); } .stat.b1 .num { color: var(--brand); }
.stat.b2 .bar { background: var(--ok); } .stat.b2 .num { color: var(--ok); }
.stat.b3 .bar { background: var(--warn); } .stat.b3 .num { color: var(--warn); }
.stat.b4 .bar { background: var(--brand-2); } .stat.b4 .num { color: var(--brand-2); }
.stat.b5 .bar { background: var(--warn); } .stat.b5 .num { color: var(--warn); }
.stat.b6 .bar { background: #7c3aed; } .stat.b6 .num { color: #7c3aed; }
.stat.b7 .bar { background: #db2777; } .stat.b7 .num { color: #db2777; }
.stat.b8 .bar { background: #ea580c; } .stat.b8 .num { color: #ea580c; }

/* ── 列表/卡片网格 ── */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.tile { border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; background: #fff; cursor: pointer; transition: border-color 0.15s, transform 0.1s, box-shadow 0.15s; position: relative; display: flex; flex-direction: column; min-height: 152px; }
.tile:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow); }
.tile b { display: block; font-size: 15.5px; margin-bottom: 6px; line-height: 1.4; }
.tile .rp-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.8em; line-height: 1.4;
  padding-right: 26px;
}
.tile .meta { color: var(--muted); font-size: 12.5px; display: block; margin-top: 2px; }
.tile .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.green { background: var(--ok); } .dot.amber { background: var(--warn); } .dot.gray { background: #cbd5e1; }
.tag { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 999px; background: #e6f7f4; color: var(--brand); margin-left: 6px; }
.tag.off { background: #fef2f2; color: var(--err); }
.tag.warn { background: #fff7ed; color: var(--warn); }

/* 客户列表筛选标签 */
.cust-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -4px 0 14px; }
.cf-label { font-size: 13px; color: var(--muted); }
.cf-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.cf-tabs button { padding: 6px 12px; font-size: 13px; border-radius: 8px; background: #fff; color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.cf-tabs button:hover { background: #f0fdfa; border-color: var(--brand); color: var(--brand); }
.cf-tabs button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.cf-count { font-size: 12.5px; color: var(--muted); margin-left: auto; }

/* 客户列表固定尺寸 */
#custList.grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
#custList .tile { min-height: 124px; max-height: 124px; padding: 10px 12px; justify-content: flex-start; overflow: hidden; }
#custList .tile b { font-size: 13.5px; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.4; }
#custList .tile .meta { font-size: 12px; margin-top: 3px; line-height: 1.4; }
#custList .tile .cust-delete {
  position: absolute; top: 8px; right: 8px;
  font-size: 11px; font-weight: 600; padding: 3px 8px;
  background: #fef2f2; color: var(--err); border: 1px solid #fecaca; border-radius: 6px;
  cursor: pointer; transition: background 0.15s, border-color 0.15s; z-index: 2;
}
#custList .tile .cust-delete:hover { background: #fee2e2; border-color: var(--err); }
#custList .tile b { padding-right: 42px; }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pg-info { font-size: 12.5px; color: var(--muted); }
.pg-btns { display: flex; gap: 6px; align-items: center; }
.pg-btn { padding: 6px 12px; font-size: 13px; border-radius: 8px; background: #fff; color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.pg-btn:hover { background: #f0fdfa; border-color: var(--brand); color: var(--brand); }
.pg-btn.active { background: var(--brand); color: #fff; border-color: var(--brand); }


/* ── 顶部条 / 区块标题 ── */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.topbar .who { font-size: 14px; color: var(--muted); }
.topbar .who b { color: var(--ink); }
.section-title { font-size: 16px; font-weight: 700; margin: 4px 0 14px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: linear-gradient(var(--brand), var(--brand-2)); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row .field { flex: 1; min-width: 160px; margin-bottom: 0; }
.cust-create .cc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; align-items: end; }
.cust-create .cc-addr { grid-column: span 2; }
.cust-create .cc-action { display: flex; align-items: flex-end; }
.cust-create .req { color: #ef4444; font-style: normal; margin-left: 2px; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }

/* ── Tab 切换（报告视图） ── */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: transparent; color: var(--muted); border: none; border-bottom: 2px solid transparent; border-radius: 0; padding: 10px 14px; font-weight: 600; font-size: 14px; }
.tabs button:hover { color: var(--brand); background: transparent; }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabpane { display: none; }
.tabpane.active { display: block; }

/* ── 报告展示 ── */
.report-bar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 14px; }
.report-company { font-size: 19px; font-weight: 800; }
.report-date { color: var(--muted); font-size: 12.5px; }
.report-body { font-size: 15px; }
/* 仅把报告内的主分隔线（hr）统一为实线，消除不同报告"虚线/实线"差异；h3 下边线、链接下划线等内部装饰虚线一律保留 */
.report-body hr { border-style: solid !important; }
.report-body h2 { font-size: 17px; margin: 18px 0 8px; }
.report-body table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 14px; }
.report-body th, .report-body td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.report-body th { background: #f7fafc; }
.report-body .kv { display: flex; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.report-body .kv b { color: var(--muted); font-weight: 600; min-width: 110px; }
.report-body .muted { color: var(--muted); font-size: 12.5px; }

/* ── 批注 / 反馈 / 汇总 面板 ── */
.anno { background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px; padding: 14px 16px; margin-top: 4px; }
.anno h3 { margin: 0 0 8px; font-size: 14px; color: #b45309; }
.anno textarea { min-height: 90px; background: #fffef8; }

.note-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; background: #fff; }
.note-card .nc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.note-card .nc-by { font-size: 12.5px; color: var(--brand); font-weight: 600; }
.note-card .nc-at { font-size: 12px; color: var(--muted); }
.note-card .nc-body { font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.file-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; background: #f0fdfa; color: var(--brand); border: 1px solid #99f6e4; border-radius: 999px; padding: 4px 12px; margin: 4px 6px 0 0; text-decoration: none; }
.file-chip:hover { background: #dbeafe; }

.kv-form .field { margin-bottom: 12px; }
.kv-form label > span { font-weight: 600; color: var(--ink); }

/* 脱敏标记 */
.masked { background: #f1f5f9; color: var(--muted); border-radius: 6px; padding: 1px 6px; font-family: ui-monospace, monospace; font-size: 0.92em; }
.ip-note { font-size: 12px; color: var(--warn); background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 8px 12px; margin-top: 10px; }

/* ── 后台客户详情抽屉 ── */
.drawer-mask { position: fixed; inset: 0; background: rgba(15,23,42,0.45); z-index: 40; display: none; }
.drawer-mask.open { display: block; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 94vw); background: var(--bg); z-index: 41; transform: translateX(100%); transition: transform 0.25s ease; box-shadow: -12px 0 40px rgba(0,0,0,0.18); display: flex; flex-direction: column; }
.drawer.open { transform: translateX(0); }
.drawer .d-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; background: #fff; }
.drawer .d-head h2 { font-size: 17px; margin: 0; }
.drawer .d-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.drawer .d-close { background: transparent; color: var(--muted); border: none; font-size: 22px; padding: 0 8px; }
.drawer .d-close:hover { background: transparent; color: var(--ink); }
.sub-title { font-size: 14px; font-weight: 700; margin: 18px 0 10px; color: var(--ink); }
.sub-title:first-child { margin-top: 0; }

/* ── 演示模式 ── */
.demo-on .card.query, .demo-on .topbar .ghost { display: none; }
.demo-badge { display: none; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 999px; }
.demo-on .demo-badge { display: inline-block; }

/* 转发提示条 */
.share-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 12px; padding: 12px 14px; margin-top: 14px; }
.share-bar .txt { font-size: 13px; color: var(--brand); flex: 1; min-width: 180px; }

@media (max-width: 560px) {
  .wrap { padding: 0 12px 44px; }
  .hero { padding: 22px 18px; } .hero h1 { font-size: 22px; }
  .row .field { min-width: 100%; }
  .cust-create .cc-grid { grid-template-columns: 1fr; }
  .cust-create .cc-addr { grid-column: span 1; }
  .report-bar { flex-direction: column; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 14px; }
  .grid { grid-template-columns: 1fr; gap: 8px; }
  .client-view .hero { padding: 18px 14px 16px; }
  .client-view .hero h1 { font-size: 22px; }
  .client-view .hero .logo .mark { width: 44px; height: 44px; font-size: 20px; }
  .client-view .hero p { font-size: 13px; line-height: 1.6; }
  .report-company { font-size: 16px; }
  .report-body iframe { min-height: 300px; }
}

/* ── 业务员端：顶部操作 / 编辑入口 ── */
.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.topbar-actions .ghost { font-size: 13px; padding: 8px 14px; }
.tile { position: relative; }
.tile-edit {
  margin-top: 10px; width: 100%; background: #f1f5f9; color: var(--brand); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.15s;
}
.tile-edit:hover { background: #e6edf7; }
.tile-claim {
  margin-top: 10px; width: 100%; background: var(--brand); color: #fff; border: 1px solid var(--brand);
  border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity 0.15s;
}
.tile-claim:hover { opacity: 0.9; }
.tile-claim:disabled { opacity: 0.6; cursor: default; }

/* ── 联系方式展示卡 ── */
.contact-card { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.contact-card .cc-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.contact-card .cc-body .kv { display: flex; gap: 10px; font-size: 14px; padding: 3px 0; }
.contact-card .cc-body .kv span { color: var(--muted); min-width: 56px; }
.contact-card .cc-body .kv b { font-weight: 600; word-break: break-all; }

/* ── 模态框 ── */
/* 弹窗：三段式，标题/底部固定，中间滚动，避免被长表单顶出屏幕 */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); display: flex; align-items: center; justify-content: center; z-index: 60; padding: 16px; }
.modal[hidden] { display: none !important; }
/* 顶部管理栏：登录前隐藏，登录后才显示（同 modal 的 hidden 覆盖逻辑） */
.admin-bar[hidden] { display: none !important; }
.admin-only[hidden] { display: none !important; }
.sales-only[hidden] { display: none !important; }
.modal-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  width: 100%; max-width: 520px; max-height: 86vh; display: flex; flex-direction: column;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px 10px; border-bottom: 1px solid var(--line);
}
.modal-title { font-size: 17px; font-weight: 800; margin: 0; }
.modal-close { background: none; border: none; font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; padding: 4px; }
.modal-close:hover { color: var(--ink); }
.modal-body { flex: 1 1 auto; overflow-y: auto; padding: 16px 20px 8px; max-height: calc(86vh - 120px); }
.modal-body::-webkit-scrollbar { width: 8px; }
.modal-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.modal-body::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.modal-footer { padding: 12px 20px 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.modal-footer button { min-width: 96px; }
button.ghost.sm { font-size: 12px; padding: 5px 10px; }

/* ── 后台布局：顶部管理栏 + 主内容区（上下结构） ── */
.app {
  display: flex; flex-direction: column; gap: 20px;
  width: 100%; max-width: 1320px; margin: 0 auto; padding: 20px 32px 40px;
  box-sizing: border-box;
}
.admin-bar {
  width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  box-shadow: var(--shadow-sm); box-sizing: border-box; flex-wrap: nowrap;
}
.bar-left { flex-shrink: 0; }
.bar-logo { display: flex; align-items: center; gap: 12px; }
.bar-logo .mark { width: 40px; height: 40px; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; box-shadow: 0 6px 16px rgba(13, 148, 136, 0.28); flex-shrink: 0; }
.bar-title { font-weight: 800; font-size: 16px; color: var(--ink); }
.bar-nav { display: flex; align-items: center; justify-content: center; gap: 6px; flex: 1; flex-wrap: nowrap; }
.bar-nav .nav-item { flex-direction: row; gap: 10px; padding: 9px 16px; border-radius: 11px; white-space: nowrap; }
.bar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; flex-wrap: nowrap; }
.bar-right .who { font-size: 13px; color: var(--muted); white-space: nowrap; }
.bar-right .who b { color: var(--ink); }

/* 侧边栏（业务员账号等管理入口） */
.layout { display: flex; gap: 20px; align-items: flex-start; width: 100%; }
.side-nav { width: 220px; flex-shrink: 0; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: var(--shadow-sm); box-sizing: border-box; display: flex; flex-direction: column; gap: 6px; }
.side-nav[hidden] { display: none !important; }
.side-nav .nav-item { width: 100%; justify-content: flex-start; gap: 10px; }
.side-nav .nav-cta { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 6px 16px rgba(13, 148, 136, 0.28); font-weight: 700; }
.side-nav .nav-cta .ni { font-size: 16px; }
.side-nav .nav-cta:hover { color: #fff; background: var(--brand-d); }
.side-nav .nav-cta.active { background: var(--brand-d); color: #fff; }
.main { width: 100%; padding: 0; position: relative; min-width: 0; }

.nav-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 11px; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; transition: background 0.15s, color 0.15s; }
.nav-item:hover { background: #f0fdfa; color: var(--brand-d); }
.nav-item.active { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(13, 148, 136, 0.28); }
.nav-item .ni { font-size: 16px; }

.main { width: 100%; padding: 0; position: relative; }
.login-card { max-width: 430px; margin: 34px auto; }
.sec { display: none; }
.sec.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── 报告演示 overlay（覆盖主区，侧边栏仍可见） ── */
.rpt-overlay { position: absolute; inset: 0; background: var(--bg); z-index: 15; overflow: auto; padding-bottom: 30px; padding: 18px 22px 44px; }
.rpt-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.rpt-head .report-company { font-size: 19px; font-weight: 800; }
.rpt-head .report-date { color: var(--muted); font-size: 12.5px; }

/* 报告全屏模式：隐藏顶部管理栏，让报告占满整个屏幕 */
.app.report-mode .admin-bar { display: none !important; }
.app.report-mode .main { padding: 0; }
.app.report-mode .rpt-overlay { padding: 20px 32px 50px; }
.app.report-mode .report-wrap { max-width: none; padding: 22px 28px; }

/* 演示布局：报告全宽在上，备注全宽在下 */
.demo-main { display: flex; flex-direction: column; gap: 18px; }
.report-wrap { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; max-height: 70vh; overflow: auto; }
.anno-wrap { background: #fff; border: 1px solid #fde68a; border-radius: 12px; padding: 16px 18px; }
.anno-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: #b45309; margin-bottom: 10px; }
.anno-status { font-size: 12px; color: var(--ok); font-weight: 600; }
.anno-wrap textarea { min-height: 220px; background: #fffef8; font-size: 15px; line-height: 1.7; }
.anno-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }

/* 旧版兼容（如其它页面仍引用 split） */
.split { display: grid; grid-template-columns: 1.45fr 1fr; gap: 16px; align-items: start; }
.split-l { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; max-height: 72vh; overflow: auto; }
.split-r { background: #fff; border: 1px solid #fde68a; border-radius: 12px; padding: 14px 16px; position: sticky; top: 0; }
.split-r textarea { min-height: 320px; background: #fffef8; }

/* 验证码只读展示（系统生成） */
.code-readonly { background: #f0fdfa; border: 1px solid #99f6e4; border-radius: 12px; padding: 12px 14px; margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--brand); }
.code-readonly[hidden] { display: none !important; }
.code-readonly b { font-size: 18px; letter-spacing: 3px; color: var(--brand-d); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* 生成专属码后的简洁展示（非通知条） */
.code-result { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 14px; color: var(--ink); }
.code-result b { font-size: 18px; letter-spacing: 3px; color: var(--brand-d); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.code-result .hint { margin: 0; color: var(--muted); }

/* 数据汇总台账表 */
.tbl-wrap { overflow-x: auto; }
.data-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-tbl th, .data-tbl td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.data-tbl th { background: #f7fafc; font-weight: 700; white-space: nowrap; }
.data-tbl td button { padding: 6px 12px; font-size: 13px; }

.modal-body .field { margin-bottom: 14px; }
.modal-body .field:last-of-type { margin-bottom: 6px; }

/* ── 修改密码弹窗 ── */
.modal-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-mask[hidden] { display: none !important; }
.modal-box { background: #fff; border-radius: 16px; box-shadow: var(--shadow); width: 100%; max-width: 380px; overflow: hidden; animation: modalIn 0.18s ease; }
@keyframes modalIn { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-box form { padding: 18px 20px 22px; }
.modal-box .d-close { background: transparent; color: var(--muted); border: none; font-size: 22px; padding: 0 6px; cursor: pointer; }
.modal-box .d-close:hover { color: var(--ink); }

/* 编辑客户信息弹窗：内容区可上下滚动 */
#preludeMask .modal-box { max-width: 460px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
#preludeMask .modal-head { flex-shrink: 0; }
#preludeMask .modal-box form { overflow-y: auto; flex: 1 1 auto; padding: 18px 20px 22px; }
#preludeMask .modal-box form::-webkit-scrollbar { width: 8px; }
#preludeMask .modal-box form::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
#preludeMask .modal-box form::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
#signMask .modal-box { max-width: 460px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
#signMask .modal-head { flex-shrink: 0; }
#signMask .modal-box form { overflow-y: auto; flex: 1 1 auto; padding: 18px 20px 22px; }
#pmMask .modal-box { max-width: 520px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
#pmMask .modal-head { flex-shrink: 0; }
#pmMask .modal-box form { overflow-y: auto; flex: 1 1 auto; padding: 18px 20px 22px; }
#pmMask .modal-box form::-webkit-scrollbar { width: 8px; }
#pmMask .modal-box form::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* 删除确认弹窗 */
.confirm-box { max-width: 360px; }
.confirm-box .confirm-body { padding: 20px; font-size: 14px; line-height: 1.7; color: var(--ink); }
.confirm-box .confirm-body .warn { color: var(--err); font-weight: 600; }
.confirm-actions { display: flex; gap: 10px; padding: 0 20px 20px; }
.confirm-actions button { flex: 1; }
button.danger { background: var(--err); color: #fff; border: 1px solid var(--err); font-weight: 600; }
button.danger:hover { filter: brightness(0.94); }

@media (max-width: 760px) {
  .app { gap: 12px; padding: 12px 14px 36px; }
  .admin-bar { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; border-radius: 12px; flex-wrap: wrap; }
  .bar-left { display: flex; justify-content: center; }
  .bar-nav { justify-content: center; flex-wrap: wrap; }
  .bar-right { justify-content: center; border-top: 1px solid var(--line); padding-top: 10px; flex-wrap: wrap; }
  .layout { flex-direction: column; }
  .side-nav { width: 100%; flex-direction: row; justify-content: center; flex-wrap: wrap; }
  .side-nav .nav-item { width: auto; }
  .main { padding: 0; }
  .split { grid-template-columns: 1fr; }
  .split-l { max-height: none; }
  .split-r { position: static; }
  .report-wrap { max-height: none; padding: 14px 16px; }
  .anno-wrap { padding: 14px 16px; }
  .anno-wrap textarea { min-height: 140px; }
  .app.report-mode .rpt-overlay { padding: 14px 16px 36px; }
  .modal { padding: 0; align-items: flex-end; background: rgba(15, 23, 42, 0.5); }
  .modal-card { max-height: 92vh; border-radius: 16px 16px 0 0; }
  .modal-header { padding-top: 14px; }
  .modal-body { padding: 12px 16px 6px; max-height: calc(92vh - 110px); }
  .modal-footer { padding: 10px 16px 18px; }
  .modal-footer button { flex: 1; }
}

/* ── 通知中心 ── */
.nav-badge { margin-left: auto; background: var(--err); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; min-width: 18px; text-align: center; display: none; }
.nav-badge.show { display: inline-block; }
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fff; display: flex; gap: 12px; align-items: flex-start; }
.notif-item.unread { border-color: #bfdbfe; background: #f5f9ff; }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); margin-top: 6px; flex-shrink: 0; }
.notif-item:not(.unread) .notif-dot { background: #cbd5e1; }
.notif-main { flex: 1; min-width: 0; }
.notif-msg { font-size: 14px; line-height: 1.5; }
.notif-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.notif-link { font-size: 13px; color: var(--brand); text-decoration: none; font-weight: 600; }
.notif-link:hover { text-decoration: underline; }
.notif-empty { color: var(--muted); font-size: 13px; padding: 24px; text-align: center; }

/* ── 状态徽章 ── */
.badge { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 999px; line-height: 1.6; }
.badge.gray { background: #f1f5f9; color: #475569; }
.badge.blue { background: #eff6ff; color: var(--brand); }
.badge.green { background: #ecfdf3; color: var(--ok); }
.badge.amber { background: #fff7ed; color: var(--warn); }
.badge.red { background: #fef2f2; color: var(--err); }
.badge.purple { background: #f5f3ff; color: #6d28d9; }
.badge.teal { background: #f0fdfa; color: var(--brand); }

/* ── 行内操作按钮 / 工单 / 详情 ── */
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.row-actions button { font-size: 13px; padding: 8px 14px; }
button.mini { font-size: 12px; padding: 6px 12px; }
.ticket-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 14px; }
.ticket-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.ticket-head b { font-size: 15px; }
.dl { display: grid; grid-template-columns: minmax(110px, 170px) 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); margin: 0; }
.dl dd { margin: 0; word-break: break-all; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 180px; }

/* 复选/下拉：分配与上传 */
.rep-checks { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.rep-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); }
.rep-chk input { width: auto; }
.assign-sel { flex: 1; min-width: 160px; }
.assign-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }

/* ── 演示模式：聚焦报告、隐藏干扰、可翻页 ── */

/* 演示工具条 */
.demo-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 9999; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; background: #0f172a; color: #fff; box-shadow: 0 4px 20px rgba(0,0,0,0.18); flex-wrap: wrap; }
.demo-bar .demo-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.demo-bar .demo-title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-bar .demo-counter { font-size: 12px; color: #94a3b8; background: rgba(255,255,255,0.1); padding: 2px 8px; border-radius: 999px; flex-shrink: 0; }
.demo-bar .demo-ctrl { display: flex; align-items: center; gap: 8px; }
.demo-bar button { background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.2); border-radius: 8px; padding: 7px 13px; font-size: 13px; font-weight: 600; }
.demo-bar button:hover { background: rgba(255,255,255,0.22); }
.demo-bar[hidden] { display: none !important; }

/* 客户端单页演示模式 */
body.client-view.demo-mode { padding-top: 52px; }
body.client-view.demo-mode .hero { display: none; }
body.client-view.demo-mode .client-shell { max-width: 1480px; padding: 20px 28px 60px; }
body.client-view.demo-mode .client-head { display: none; }
body.client-view.demo-mode .report-actions { display: none; }
body.client-view.demo-mode .share-bar { display: none; }
body.client-view.demo-mode .report-body { font-size: 24px; line-height: 1.85; max-width: 1400px; margin: 0 auto; }
body.client-view.demo-mode .report-body h1, body.client-view.demo-mode .report-body h2, body.client-view.demo-mode .report-body h3 { font-size: 1.45em; margin: 1.2em 0 0.6em; }
body.client-view.demo-mode .report-body p { margin: 0.8em 0; }
body.client-view.demo-mode .report-body table { font-size: 0.95em; }

/* 首页 reportCard 演示模式 */
body.demo-active { background: #fff; }
body.demo-active .topnav { display: none; }
body.demo-active .foot { display: none; }
body.demo-active .wrap .card:not(#reportCard) { display: none; }
body.demo-active .wrap { max-width: none; padding: 52px 0 0; }
#reportCard.demo-mode { max-width: 1480px; margin: 0 auto; border: none; border-radius: 0; box-shadow: none; min-height: calc(100vh - 52px); }
#reportCard.demo-mode .report-bar { display: none; }
#reportCard.demo-mode .report-body { font-size: 24px; line-height: 1.85; max-width: 1400px; margin: 0 auto; }
#reportCard.demo-mode .report-body h1, #reportCard.demo-mode .report-body h2, #reportCard.demo-mode .report-body h3 { font-size: 1.45em; margin: 1.2em 0 0.6em; }
#reportCard.demo-mode .report-body p { margin: 0.8em 0; }
#reportCard.demo-mode .report-body table { font-size: 0.95em; }

@media (max-width: 760px) {
  .demo-bar { padding: 8px 12px; }
  .demo-bar .demo-title { font-size: 13px; max-width: 160px; }
  body.client-view.demo-mode .report-body { font-size: 20px; }
  #reportCard.demo-mode .report-body { font-size: 20px; }
}

/* 报告操作栏（返回/演示） */
.report-actions { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }

/* 抽屉内上传表单 */
.drawer-upload { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.drawer-upload .field { margin-bottom: 12px; }
.drawer-upload .field:last-of-type { margin-bottom: 0; }

/* 报告列表卡片：统一高度，内容与操作对齐 */
.tile.report-tile { justify-content: space-between; position: relative; min-height: 110px; padding-top: 14px; }
.tile.report-tile .rt-chk { position: absolute; top: 10px; right: 10px; z-index: 2; }
.tile.report-tile .rt-chk input { width: 18px; height: 18px; cursor: pointer; margin: 0; accent-color: var(--brand); }
.tile.report-tile .rt-foot { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.tile.report-tile .link { color: var(--brand); }

/* 抽屉内报告卡片 */
.drawer-grid .tile.tile-report { min-height: 170px; justify-content: space-between; }
.drawer-grid .tile.tile-report .row-actions { margin-top: auto; }

/* ── 抽屉折叠区块 + 底部总保存 ── */
.drawer-sections { display: flex; flex-direction: column; gap: 12px; padding-bottom: 8px; }
.d-section { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.d-section.readonly { background: #f8fafc; }
.d-sec-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 14px 16px; background: none; border: none; font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; font-family: inherit; }
.d-section.readonly .d-sec-head { cursor: default; }
.d-sec-head h4 { margin: 0; font-size: 15px; font-weight: 600; }
.d-sec-title { flex: 1; }
.d-sec-meta { font-size: 13px; color: var(--muted); font-weight: 400; }
.d-sec-toggle { font-size: 13px; color: var(--brand); font-weight: 600; }
.d-sec-body { padding: 0 16px 16px; }
.d-section[data-collapsible] .d-sec-body[hidden] { display: none; }
.drawer-foot { position: sticky; bottom: 0; background: var(--bg); padding: 14px 0 4px; border-top: 1px solid var(--line); margin-top: auto; }
.drawer-foot button { width: 100%; }

/* ── 概览：全部报告表格 ── */
.ov-filter { margin: -4px 0 14px; max-width: 320px; }
.ov-filter .field { margin-bottom: 0; }
.ov-filter input { padding: 10px 12px; font-size: 14px; }
.table-wrap { overflow-x: auto; margin: 4px 0 0; }
.ov-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 720px; }
.ov-table th, .ov-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ov-table th { background: #f8fafc; color: #64748b; font-weight: 600; position: sticky; top: 0; }
.ov-table tbody tr:hover { background: #f8fafc; }
.ov-table td:nth-child(3) { white-space: normal; max-width: 260px; }
.ov-table .num-col { text-align: center; }
.ov-table .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 2px; color: var(--brand); }
.ov-table .muted { color: #94a3b8; }
.ov-table .status-select { padding: 5px 8px; font-size: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); cursor: pointer; }
.signed-table td:nth-child(3) { white-space: nowrap; max-width: none; }
.signed-table input, .signed-table select { padding: 5px 8px; font-size: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); font-family: inherit; }
.signed-table input.si-date { width: 130px; }
.signed-table input.si-content { width: 150px; }
.signed-table input.si-amount { width: 100px; }
.signed-table input.si-note { width: 140px; }
.signed-table select.si-mode { cursor: pointer; }
.signed-table .mini.ghost { padding: 5px 12px; font-size: 12px; border: 1px solid var(--brand); border-radius: 6px; background: #fff; color: var(--brand); cursor: pointer; }
.signed-table .mini.ghost:hover { background: var(--brand); color: #fff; }
/* 通用工具类（拜访前信息表 / 已拜访未签约表） */
.hidden { display: none !important; }
.center { text-align: center; }
.st-tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f0fdfa; color: var(--brand); border: 1px solid #99f6e4; white-space: nowrap; }
.prelude-table input.pu-phone { width: 112px; }
.prelude-table input.pu-contact { width: 88px; }
.prelude-table input.pu-address { width: 150px; }
.prelude-table input.pu-note { width: 140px; }
.muted { color: #94a3b8; }

/* 预览页（独立路由 /preview/...，刷新可用，版式与客户端一致） */
.demo-tools { position: fixed; top: 0; left: 0; right: 0; height: 44px; display: none; align-items: center; gap: 8px; padding: 0 14px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; z-index: 99998; font-size: 13px; }
.demo-tools.show { display: flex; }
.demo-tools button { padding: 6px 12px; border: 1px solid #e2e8f0; background: #fff; color: #334155; border-radius: 8px; font-size: 13px; cursor: pointer; line-height: 1; }
.demo-tools button.active { background: #0f766e; color: #fff; border-color: #0f766e; }
.demo-tools .color { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #e2e8f0; padding: 0; cursor: pointer; }
.demo-tools .color.active { border-color: #0f172a; }
#overlay { position: absolute; left: 0; top: 0; z-index: 1000; pointer-events: none; }
#overlay.active { pointer-events: auto; }
#overlay circle, #overlay line, #overlay path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
body.client-view.demo-mode .wrap { max-width: 1480px; }
/* 演示模式下把报栏悬浮到批注层之上，确保“退出演示 / 关闭”按钮始终可点 */
body.client-view.demo-mode .report-bar {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100002;
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  pointer-events: auto;
}

/* 仅客户端查看页禁止打印（管理后台保持可打印） */
@media print { body.client-view { display: none !important; } }
