/* 知识产权销售工作台 — 浅色主题 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background: #f4f6fa; color: #1e293b; display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar { width: 220px; background: #fff; border-right: 1px solid #e5e9f0; padding: 20px 12px; position: fixed; top: 0; bottom: 0; }
.logo { font-size: 17px; font-weight: 700; padding: 0 10px 16px; border-bottom: 1px solid #eef1f6; margin-bottom: 12px; color: #1d4ed8; }
.logo small { display: block; font-size: 11px; color: #94a3b8; font-weight: 400; margin-top: 4px; }
.nav-item { padding: 11px 12px; border-radius: 10px; cursor: pointer; font-size: 14px; color: #475569; margin-bottom: 4px; transition: .15s; }
.nav-item:hover { background: #f1f5f9; }
.nav-item.active { background: #eff6ff; color: #1d4ed8; font-weight: 600; }
.sidebar-foot { position: absolute; bottom: 16px; left: 12px; right: 12px; font-size: 12px; color: #94a3b8; }

/* 主区 */
.content { margin-left: 220px; flex: 1; padding: 20px 28px 60px; max-width: 1280px; }
.topbar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-bottom: 8px; }
.topbar select { padding: 7px 10px; border-radius: 8px; border: 1px solid #dbe1ea; background: #fff; font-size: 13px; }
#roleBadge { background: #1d4ed8; color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 999px; }

.page-head { display: flex; justify-content: space-between; align-items: center; margin: 8px 0 16px; flex-wrap: wrap; gap: 10px; }
h1 { font-size: 22px; }
h3 { font-size: 15px; margin-bottom: 10px; color: #334155; }
.muted { color: #94a3b8; font-size: 13px; }

/* 时间筛选 */
.seg button { border: 1px solid #dbe1ea; background: #fff; padding: 7px 16px; cursor: pointer; font-size: 13px; }
.seg button:first-child { border-radius: 8px 0 0 8px; } .seg button:last-child { border-radius: 0 8px 8px 0; }
.seg button.on { background: #1d4ed8; color: #fff; border-color: #1d4ed8; }

/* KPI */
.kpi-section { margin-bottom: 14px; }
.kpi-section h3 { margin-bottom: 8px; font-size: 13px; color: #64748b; }
.kpi-row { display: flex; gap: 12px; flex-wrap: wrap; }
.kpi { background: #fff; border: 1px solid #e8ecf3; border-radius: 12px; padding: 14px 18px; min-width: 150px; flex: 1; }
.kpi-val { font-size: 24px; font-weight: 700; }
.kpi-val small { font-size: 12px; font-weight: 400; color: #94a3b8; margin-left: 3px; }
.kpi-label { font-size: 12px; color: #64748b; margin-top: 4px; }
.kpi.red .kpi-val { color: #dc2626; }   /* 涨/业绩=红 */
.kpi.green .kpi-val { color: #16a34a; } /* 跌/未回款=绿 */

/* 卡片与网格 */
.card { background: #fff; border: 1px solid #e8ecf3; border-radius: 12px; padding: 18px; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } .sidebar { display: none; } .content { margin: 0; } }

/* 通知条 */
.notice-bar { margin-bottom: 14px; }
.notice { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; padding: 9px 14px; border-radius: 10px; font-size: 13px; margin-bottom: 6px; }
.notice.renew { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.auto-log { font-size: 13px; color: #475569; padding: 4px 0; border-bottom: 1px dashed #eef1f6; }

/* 排行 */
.rank-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 13px; }
.rank { width: 22px; height: 22px; border-radius: 50%; background: #e2e8f0; color: #475569; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.rank.r1 { background: #fef3c7; color: #b45309; } .rank.r2 { background: #e5e7eb; color: #4b5563; } .rank.r3 { background: #fed7aa; color: #9a3412; }
.rank-name { width: 44px; }
.bar-wrap { flex: 1; height: 10px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.bar-wrap.big { height: 16px; margin-top: 8px; }
.bar { height: 100%; background: linear-gradient(90deg, #f87171, #dc2626); border-radius: 999px; }
.rank-amt { color: #64748b; font-size: 12px; white-space: nowrap; }
.top-item { padding: 8px 0; border-bottom: 1px dashed #eef1f6; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.top-item b { margin-left: auto; color: #dc2626; }

/* 标签 */
.tag { display: inline-block; font-size: 11px; padding: 3px 9px; border-radius: 999px; background: #f1f5f9; color: #475569; }
.tag.blue { background: #eff6ff; color: #1d4ed8; } .tag.indigo { background: #eef2ff; color: #4338ca; }
.tag.amber { background: #fffbeb; color: #b45309; } .tag.orange { background: #fff7ed; color: #c2410c; }
.tag.red { background: #fef2f2; color: #dc2626; } .tag.dark { background: #334155; color: #fff; }
.tag.purple { background: #f5f3ff; color: #7c3aed; } .tag.gray { background: #f1f5f9; color: #64748b; }
.tag.lite { background: #eff6ff; color: #2563eb; } .tag.src { background: #f0fdf4; color: #15803d; }
.tag.alert { background: #fef2f2; color: #dc2626; } .tag.hot { background: #fff7ed; color: #c2410c; font-size: 12px; padding: 5px 12px; margin: 3px; }
.up { color: #dc2626; } .down { color: #16a34a; }

/* 线索卡片 */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-bar input, .filter-bar select { padding: 8px 12px; border: 1px solid #dbe1ea; border-radius: 8px; font-size: 13px; background: #fff; }
.filter-bar input { width: 200px; }
.lead-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; }
.lead-card { background: #fff; border: 1px solid #e8ecf3; border-radius: 12px; padding: 14px 16px; cursor: pointer; transition: .15s; }
.lead-card:hover { box-shadow: 0 4px 16px rgba(29, 78, 216, .08); border-color: #bfdbfe; }
.lead-card.overdue { border-left: 4px solid #dc2626; background: #fffafa; }
.lead-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 14px; }
.lead-meta { font-size: 12px; color: #64748b; margin-bottom: 8px; }
.lead-tags { margin-bottom: 8px; display: flex; gap: 5px; flex-wrap: wrap; }
.lead-foot { font-size: 11px; color: #94a3b8; border-top: 1px dashed #eef1f6; padding-top: 8px; }

/* 弹窗 */
.del-btn { cursor: pointer; opacity: .4; font-size: 13px; transition: .15s; display: inline-block; }
.del-btn:hover { opacity: 1; transform: scale(1.15); }

.mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .4); display: flex; align-items: center; justify-content: center; z-index: 99; padding: 20px; }
.dialog { background: #fff; border-radius: 14px; padding: 22px; width: 680px; max-width: 100%; max-height: 88vh; overflow-y: auto; }
.dialog.small { width: 460px; }
.dlg-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dlg-head h2 { font-size: 17px; }
.x { border: none; background: #f1f5f9; border-radius: 8px; width: 28px; height: 28px; cursor: pointer; }
.dlg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; font-size: 13px; margin-bottom: 12px; }
.dlg-grid b { color: #64748b; font-weight: 500; margin-right: 6px; }
.dlg-row { display: flex; gap: 10px; align-items: center; font-size: 13px; margin: 10px 0; flex-wrap: wrap; }
.dialog select, .dialog input, .dialog textarea { padding: 8px 10px; border: 1px solid #dbe1ea; border-radius: 8px; font-size: 13px; font-family: inherit; }
.dialog textarea { width: 100%; min-height: 70px; margin-top: 6px; }
.dialog label { display: block; font-size: 13px; margin-bottom: 10px; color: #475569; }
.dialog label input, .dialog label select { width: 100%; margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.hidden { display: none !important; }
.chk { display: inline-flex !important; align-items: center; gap: 4px; margin-right: 10px; width: auto !important; }
.dlg-foot { margin-top: 16px; display: flex; gap: 10px; justify-content: flex-end; }
.records { max-height: 180px; overflow-y: auto; margin-bottom: 12px; }
.rec { font-size: 13px; padding: 8px 10px; background: #f8fafc; border-radius: 8px; margin-bottom: 6px; }
.rec-date { color: #94a3b8; font-size: 11px; margin-right: 8px; }

/* 按钮 */
.btn { padding: 8px 16px; border: 1px solid #dbe1ea; background: #fff; border-radius: 8px; cursor: pointer; font-size: 13px; margin-left: 6px; }
.btn:hover { background: #f8fafc; }
.btn.primary { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.btn.primary:hover { background: #1e40af; }
.btn.danger { color: #dc2626; border-color: #fecaca; }

/* 访问口令浮层（公网防护） */
.gate-mask { z-index: 999; backdrop-filter: blur(2px); }
.gate-box { background: #fff; border-radius: 16px; padding: 30px 34px; width: 360px; max-width: 92vw; text-align: center; box-shadow: 0 20px 60px rgba(15,23,42,.25); }
.gate-title { font-size: 18px; font-weight: 700; color: #1e293b; margin-bottom: 6px; }
.gate-box .muted { margin-bottom: 18px; display: block; }
.gate-input { width: 100%; padding: 12px 14px; border: 1px solid #dbe1ea; border-radius: 10px; font-size: 15px; margin-bottom: 10px; outline: none; }
.gate-input:focus { border-color: #1d4ed8; box-shadow: 0 0 0 3px rgba(29,78,216,.12); }
.gate-err { color: #dc2626; font-size: 13px; min-height: 18px; margin-bottom: 10px; }
.gate-box .btn { width: 100%; margin: 0; padding: 11px; font-size: 15px; }

/* 任务 */
.task-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 14px; }
@media (max-width: 1100px) { .task-cols { grid-template-columns: repeat(2, 1fr); } }
.task-col { background: #fff; border: 1px solid #e8ecf3; border-radius: 12px; padding: 14px; }
.task { padding: 10px; background: #f8fafc; border-radius: 8px; margin-bottom: 8px; font-size: 13px; }
.task.done { opacity: .5; text-decoration: line-through; }
.task-meta { font-size: 11px; color: #94a3b8; margin-top: 5px; }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; font-size: 13px; }
.tbl th { background: #f8fafc; text-align: left; padding: 10px 12px; color: #64748b; font-weight: 600; border-bottom: 1px solid #e8ecf3; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; }
.small-td { font-size: 11px; color: #64748b; }

/* 素材库 */
.mat { border: 1px solid #eef1f6; border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.mat-head { padding: 11px 14px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-size: 14px; background: #fafbfd; }
.mat-body { display: none; padding: 12px 14px; font-size: 13px; color: #475569; line-height: 1.8; border-top: 1px solid #eef1f6; }
.mat.open .mat-body { display: block; }
.copy-btn { font-size: 12px; color: #1d4ed8; cursor: pointer; }

/* 复盘 */
.rev { padding: 12px; border-radius: 10px; margin-bottom: 10px; font-size: 13px; line-height: 1.7; }
.rev.win { background: #fef9f9; border: 1px solid #fecaca; }
.rev.loss { background: #f7fdf9; border: 1px solid #bbf7d0; }
.rev .note { color: #64748b; font-size: 12px; }
.reason-bar { margin-bottom: 10px; }

/* 报表 */
.report-sheet h3 { margin: 14px 0 8px; }
.report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.rp { background: #f8fafc; border-radius: 10px; padding: 12px; font-size: 12px; color: #64748b; }
.rp b { display: block; font-size: 19px; color: #1e293b; margin-top: 4px; }
.report-hr { border: none; border-top: 2px dashed #e2e8f0; margin: 24px 0; }
@media print { .sidebar, .topbar, .page-head button, .btn { display: none !important; } .content { margin: 0; } }

/* 时间对比表（数据总览） */
.time-tbl { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; font-size: 14px; }
.time-tbl th { background: #f8fafc; text-align: center; padding: 11px 12px; color: #64748b; font-weight: 600; border-bottom: 1px solid #e8ecf3; }
.time-tbl th:first-child { text-align: left; }
.time-tbl td { padding: 12px; border-bottom: 1px solid #f1f5f9; text-align: center; }
.time-tbl td:first-child { text-align: left; font-weight: 600; color: #334155; }
.time-tbl td.red { color: #dc2626; font-weight: 700; font-size: 16px; }

/* 商机列表 */
.opp-list { display: flex; flex-direction: column; gap: 6px; }
.opp-item { font-size: 13px; padding: 9px 12px; background: #f8fafc; border-radius: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.opp-item b { color: #1e293b; }
.opp-item .muted { margin-left: auto; }

/* 类型 chips（管理员设置页） */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #eff6ff; color: #1d4ed8; font-size: 13px; padding: 6px 12px; border-radius: 999px; }
.chip-x { cursor: pointer; opacity: .5; font-weight: 700; }
.chip-x:hover { opacity: 1; color: #dc2626; }

/* 任务关联客户链接 */
.lk { color: #1d4ed8; cursor: pointer; text-decoration: underline; }
.lk:hover { color: #1e40af; }

/* 网络地址提示条 */
.net-bar { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 9px 12px; font-size: 13px; margin-bottom: 10px; color: #1e3a8a; }
.net-bar b { color: #1d4ed8; }
.net-bar.ok { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.net-bar.ok b { color: #047857; }
