:root {
  --bg: #f4f6fb;
  --panel: #ffffff;
  --primary: #4F46E5;
  --primary-dark: #4338ca;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --green: #16a34a;
  --yellow: #d97706;
  --red: #dc2626;
  --gray: #9ca3af;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
button { font-family: inherit; cursor: pointer; }

/* ---------- 登录 ---------- */
.login-view {
  position: fixed; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    radial-gradient(900px 500px at 12% 8%, rgba(124,58,237,.45) 0%, transparent 55%),
    radial-gradient(800px 500px at 90% 95%, rgba(37,99,235,.40) 0%, transparent 55%),
    linear-gradient(135deg, #312e81 0%, #4F46E5 45%, #6d28d9 100%);
  overflow: hidden;
}
.login-view::before, .login-view::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none;
}
.login-view::before { width: 360px; height: 360px; background: #a78bfa; top: -90px; right: 8%; }
.login-view::after { width: 300px; height: 300px; background: #38bdf8; bottom: -80px; left: 6%; }
.login-card {
  position: relative; z-index: 1;
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.6); border-radius: 24px;
  padding: 40px 40px 28px; width: 400px; text-align: center;
  box-shadow: 0 30px 80px rgba(15,23,42,.38);
  animation: cardIn .5s cubic-bezier(.22,.9,.31,1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.login-emblem {
  width: 66px; height: 66px; margin: 0 auto 14px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; font-weight: 800; color: #fff; letter-spacing: 0;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  box-shadow: 0 10px 24px rgba(99,102,241,.45);
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.login-logo { font-size: 34px; font-weight: 800; color: #1e1b4b; letter-spacing: 4px; }
.login-logo-en { font-size: 11px; letter-spacing: 5px; color: var(--gray); font-weight: 600; }
.login-sub { color: var(--muted); margin-top: 8px; margin-bottom: 24px; letter-spacing: 2px; font-size: 13.5px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form input {
  padding: 13px 15px; border: 1px solid var(--border-strong); border-radius: 12px;
  font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s; background: #fff;
}
.login-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79,70,229,.14); }
.btn-primary {
  background: linear-gradient(135deg, #4F46E5, #7c3aed); color: #fff; border: none; padding: 13px;
  border-radius: 12px; font-size: 15px; font-weight: 700; letter-spacing: 4px;
  transition: filter .15s, transform .1s, box-shadow .15s; box-shadow: 0 8px 20px rgba(79,70,229,.35);
}
.btn-primary:hover { filter: brightness(1.06); box-shadow: 0 10px 26px rgba(79,70,229,.45); }
.btn-primary:active { transform: translateY(1px); }
.login-error { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 10px; }
.login-accounts { margin-top: 22px; padding-top: 18px; border-top: 1px dashed var(--border); }
.login-hint-title { color: var(--text); font-weight: 600; font-size: 12.5px; margin-bottom: 12px; }
.acct-chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.acct-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px;
  background: #f8fafc; border: 1px solid var(--border); color: var(--text); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s, background .12s;
}
.acct-chip:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,23,42,.12); border-color: var(--c); background: #fff; }
.acct-chip:active { transform: translateY(0); }
.acct-chip i {
  width: 22px; height: 22px; border-radius: 50%; background: var(--c); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 12px; font-weight: 700;
}
.login-foot { position: relative; z-index: 1; margin-top: 22px; color: rgba(255,255,255,.75); font-size: 12px; letter-spacing: 1px; }

/* ---------- 顶栏 ---------- */
.main-view { display: flex; flex-direction: column; height: 100vh; }
.topbar {
  height: 60px; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px; flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 10px; }
.brand { font-size: 19px; font-weight: 800; color: #1e1b4b; letter-spacing: 1.5px; }
.brand::before {
  content: ""; display: inline-block; width: 26px; height: 26px; margin-right: 10px; border-radius: 8px; vertical-align: -6px;
  background: linear-gradient(135deg, #4F46E5, #a855f7); box-shadow: 0 4px 10px rgba(79,70,229,.35);
}
.brand-sub { font-size: 12.5px; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 20px; }
.user-chip:hover { background: var(--bg); }
.user-name { font-weight: 600; }

/* ---------- 头像 ---------- */
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; color: #fff; font-weight: 700;
  font-size: 14px; background: var(--primary); object-fit: cover; flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 64px; height: 64px; font-size: 24px; }

/* ---------- 布局 ---------- */
.layout { display: flex; flex: 1; overflow: hidden; }

/* 深色靛蓝侧边导航（呼应登录页） */
.sidebar {
  width: 248px; flex-shrink: 0;
  background: linear-gradient(180deg, #201b46 0%, #2c2a6e 55%, #312e81 100%);
  color: #c7d2fe; padding: 0 14px 16px; overflow-y: auto;
  display: flex; flex-direction: column;
  box-shadow: 4px 0 24px rgba(30,27,75,.12);
}
.sidebar::-webkit-scrollbar { width: 7px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(199,210,254,.22); border-radius: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }

.side-brand {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 12px 9px; border-bottom: 1px solid rgba(199,210,254,.16);
  flex-shrink: 0;
}
.sb-emblem {
  width: 28px; height: 28px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff; letter-spacing: 0;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  box-shadow: 0 5px 12px rgba(99,102,241,.45);
}
.sb-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.sb-name { font-size: 13px; font-weight: 800; color: #fff; letter-spacing: .5px; white-space: nowrap; }
.sb-sub { font-size: 8.5px; color: #a5b4fc; letter-spacing: 3px; }

.side-group-title {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 12px 3px;
  font-weight: 700; font-size: 10px; letter-spacing: 1.5px;
  color: #a5b4fc; text-transform: none;
  flex-shrink: 0;
}
.side-group-title::before {
  content: ""; width: 10px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #818cf8, transparent);
}

.side-module-title {
  display: flex; align-items: center; gap: 7px; padding: 6px 12px 3px;
  font-weight: 800; font-size: 10px; letter-spacing: 1px; color: #a5b4fc; text-transform: none;
  flex-shrink: 0;
}

.side-item {
  position: relative; display: flex; align-items: center; gap: 9px;
  padding: 5px 12px; margin: 1px 0; border-radius: 8px;
  color: #cbd5e1; cursor: pointer; font-size: 12.5px; font-weight: 500;
  transition: background .15s, color .15s, transform .12s, box-shadow .15s;
  flex-shrink: 0;
}
.side-item .side-icon {
  width: 20px; height: 20px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; border-radius: 6px; background: rgba(255,255,255,.07);
  transition: background .15s, transform .15s;
}
.side-item .side-dot {
  width: 4px; height: 4px; border-radius: 50%; flex-shrink: 0;
  margin: 0 8px 0 10px; background: rgba(199,210,254,.5);
  transition: background .15s;
}
.side-item .side-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.side-item:hover .side-icon { background: rgba(255,255,255,.16); transform: scale(1.06); }
.side-item:hover .side-dot { background: #e9d5ff; }
.side-item.active {
  background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; font-weight: 600;
  box-shadow: 0 5px 14px rgba(99,102,241,.35);
}
.side-item.active .side-icon { background: rgba(255,255,255,.22); }
.side-item.active .side-dot { background: #ede9fe; }
.side-item.active::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 14px; border-radius: 0 3px 3px 0; background: #c4b5fd;
}

.content { flex: 1; overflow-y: auto; padding: 22px 26px; }
.content-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
.breadcrumb { font-size: 18px; font-weight: 800; color: #1e1b4b; }
.breadcrumb .sep { color: var(--border-strong); margin: 0 8px; font-weight: 400; }
.breadcrumb .sub { color: var(--muted); font-weight: 500; font-size: 15px; }
.content-actions { display: flex; gap: 10px; }

/* ---------- 按钮 ---------- */
.btn {
  background: #fff; border: 1px solid var(--border-strong); color: var(--text);
  padding: 9px 15px; border-radius: 10px; font-size: 13px; font-weight: 600; transition: all .12s;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.btn:hover { border-color: var(--primary); color: var(--primary); box-shadow: 0 4px 12px rgba(79,70,229,.14); }
.btn-ghost { background: transparent; border: none; color: var(--muted); padding: 6px 10px; border-radius: 8px; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

/* ---------- 看板 ---------- */
.dashboard { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.dash-card {
  flex: 1; min-width: 130px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.dash-card .num { font-size: 30px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.dash-card .lbl { color: var(--muted); font-size: 13px; margin-top: 6px; }
.dash-card.warn .num { color: var(--red); }
.dash-card.ok .num { color: var(--green); }
.dash-card .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary); }

/* 图表卡片（诉讼案件看板） */
.chart-card {
  flex: 1 1 300px; min-width: 280px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow);
}
.chart-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.chart-card svg { display: block; width: 100%; height: auto; }

/* ---------- 筛选栏 ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.filter-bar .f-label { color: var(--muted); font-size: 13px; }
.filter-input {
  padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: 8px;
  font-size: 13px; outline: none; min-width: 120px;
}
.filter-input:focus { border-color: var(--primary); }
.filter-clear { font-size: 12px; color: var(--muted); cursor: pointer; }
.filter-clear:hover { color: var(--red); }

/* ---------- 表格 ---------- */
.table-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: auto; }
.data-table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.data-table thead th {
  position: sticky; top: 0; background: #f9fafb; z-index: 2;
  text-align: left; padding: 11px 12px; border-bottom: 2px solid var(--border);
  font-weight: 700; color: var(--text); white-space: nowrap;
}
.data-table thead th .sort-ico { color: var(--border-strong); cursor: pointer; margin-left: 4px; font-size: 11px; user-select: none; }
.data-table thead th .sort-ico.active { color: var(--primary); }
.data-table tbody td {
  padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle;
  cursor: text; max-width: 320px;
}
.data-table tbody tr:hover { background: #fafbff; }
.data-table tbody tr:last-child td { border-bottom: none; }
.cell-edit-input, .cell-edit-select {
  width: 100%; padding: 6px 8px; border: 2px solid var(--primary); border-radius: 6px;
  font-size: 13.5px; outline: none; font-family: inherit;
}
.cell-text { white-space: pre-wrap; word-break: break-word; min-height: 20px; }
.cell-empty { color: var(--gray); }
.row-actions { white-space: nowrap; width: 70px; text-align: center; cursor: default; }
.del-btn { color: var(--gray); border: none; background: none; font-size: 15px; padding: 2px 6px; border-radius: 6px; }
.del-btn:hover { color: var(--red); background: #fef2f2; }
.row-meta { color: var(--gray); font-size: 11px; margin-top: 3px; }

/* 状态灯 */
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; padding: 3px 10px; border-radius: 20px; font-size: 12.5px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.green { background: var(--green); }
.dot.yellow { background: var(--yellow); }
.dot.red { background: var(--red); }
.dot.gray { background: var(--gray); }
.status-pill.green { background: #dcfce7; color: #166534; }
.status-pill.yellow { background: #fef3c7; color: #92400e; }
.status-pill.red { background: #fee2e2; color: #991b1b; }
.status-pill.gray { background: #f3f4f6; color: #4b5563; }

.empty-tip { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- 操作记录 ---------- */
.logs-panel { margin-top: 16px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.logs-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); font-weight: 700; }
.logs-head-actions { display: flex; align-items: center; gap: 8px; }
.btn-danger { color: #dc2626; border: 1px solid #fecaca; background: #fff; }
.btn-danger:hover { background: #fef2f2; color: #b91c1c; }
.logs-list { list-style: none; margin: 0; padding: 8px 16px; max-height: 320px; overflow-y: auto; }
.logs-list li { padding: 8px 28px 8px 0; border-bottom: 1px dashed var(--border); font-size: 13px; color: var(--muted); position: relative; }
.logs-list li:last-child { border-bottom: none; }
.logs-list .log-user { color: var(--primary); font-weight: 600; }
.logs-list .log-time { color: var(--gray); font-size: 12px; }
.logs-list .log-diff { color: var(--text); }
.log-del {
  position: absolute; top: 6px; right: 0; width: 22px; height: 22px; border: none;
  border-radius: 6px; background: #f1f5f9; color: #94a3b8; cursor: pointer; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}
.log-del:hover { background: #fee2e2; color: #dc2626; }
.logs-empty { padding: 20px; text-align: center; color: var(--muted); }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; background: rgba(17,24,39,.5); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-box { background: #fff; border-radius: 14px; width: 420px; max-width: 92vw; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 700; font-size: 16px; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
.field-label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }
.field-label:first-child { margin-top: 0; }
.text-input { width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 8px; font-size: 14px; outline: none; }
.text-input:focus { border-color: var(--primary); }
.avatar-row { display: flex; align-items: center; gap: 16px; }
.file-btn { display: inline-block; background: var(--primary); color: #fff; padding: 9px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.file-btn:hover { background: var(--primary-dark); }
.avatar-hint { color: var(--gray); font-size: 12px; margin-top: 6px; }
.color-row { display: flex; gap: 10px; flex-wrap: wrap; }
.color-swatch { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; }
.color-swatch.active { border-color: var(--text); }

/* ---------- 采购 / 销售合同（线下审批）· 按年度月份计数网格 ---------- */
.contract-grid { display: flex; flex-direction: column; gap: 16px; margin-top: 4px; }

.cg-year {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; box-shadow: 0 1px 3px rgba(16,24,40,.06);
}
.cg-year:hover { box-shadow: 0 4px 16px rgba(16,24,40,.08); }

.cg-year-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 15px 20px; border-bottom: 1px solid var(--border);
  background: linear-gradient(90deg, #fafbff, #fff);
}
.cg-year-title { font-weight: 800; font-size: 17px; color: var(--text); letter-spacing: .2px; }
.cg-total { margin-left: auto; font-size: 13px; color: var(--muted); }
.cg-total b { color: var(--primary); font-size: 20px; font-weight: 800; margin: 0 2px; }
.cg-del {
  border: 1px solid var(--border); background: #fff; color: var(--gray);
  padding: 6px 12px; border-radius: 8px; font-size: 12.5px; transition: all .12s;
}
.cg-del:hover { color: var(--red); border-color: #fca5a5; background: #fef2f2; }

.cg-squares { display: flex; flex-wrap: wrap; gap: 10px; padding: 16px 20px; }

.cg-sq {
  width: 86px; background: #fafbff; border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 8px 8px; text-align: center; transition: border-color .15s, box-shadow .15s;
}
.cg-sq:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(79,70,229,.10); }
.cg-sq.h1 { background: #eef0ff; border-color: #c7d2fe; }
.cg-sq.h1:hover { border-color: var(--primary); }
.cg-sq-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.cg-sq.h1 .cg-sq-label { color: var(--primary-dark); font-weight: 700; }
.cg-sq-input {
  width: 100%; text-align: center; font-size: 18px; font-weight: 700; color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 8px; padding: 5px 2px;
  font-family: inherit; outline: none; background: #fff;
  -moz-appearance: textfield;
}
.cg-sq-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.cg-sq-input::-webkit-outer-spin-button,
.cg-sq-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #111827; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: #166534; }
.toast.err { background: #991b1b; }

/* ---------- 关联主体法律风险核查 · 月度待办手风琴 ---------- */
.risk-todos { display: flex; flex-direction: column; gap: 14px; margin-top: 4px; }

.risk-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.risk-add-form {
  flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  background: #f7f8ff; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
}
.risk-add-form input[type="text"], .risk-add-form input:not([type]) {
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 14px; min-width: 180px;
}
.risk-add-form .risk-add-month { min-width: 140px; }
.risk-add-form .risk-add-lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.risk-add-form .btn-primary, .risk-add-form .btn-ghost { padding: 8px 14px; font-size: 14px; }

.risk-month {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  overflow: hidden; box-shadow: 0 1px 3px rgba(16,24,40,.06);
}
.risk-month.open { border-color: var(--primary); box-shadow: 0 8px 24px rgba(79,70,229,.10); }

.risk-month-head {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 16px 20px; cursor: pointer; user-select: none;
  background: linear-gradient(90deg, #fafbff, #fff);
}
.risk-month-head:hover { background: #f5f6ff; }
.risk-caret { color: var(--primary); font-size: 14px; width: 16px; text-align: center; }

.risk-title-block { flex: 1 1 140px; min-width: 0; }
.risk-month-title { font-weight: 800; font-size: 17px; color: var(--text); letter-spacing: .2px; }
.risk-subtitle { font-size: 12px; color: var(--muted); margin-top: 3px; }

.risk-progress-block { width: 220px; display: flex; flex-direction: column; gap: 7px; }
.risk-progress-line { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.risk-progress-line span { width: 28px; color: var(--muted); }
.risk-progress-line b { width: 38px; text-align: right; font-weight: 700; color: var(--text); }
.risk-bar { flex: 1; height: 7px; background: var(--border); border-radius: 999px; overflow: hidden; }
.risk-bar i { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .35s ease; }

/* 月度状态药丸（独立于 status-pill，避免依赖 .dot） */
.rc-pill {
  margin-left: auto; font-size: 12px; font-weight: 700; padding: 5px 13px;
  border-radius: 999px; white-space: nowrap;
}
.rc-pill.ok { color: #15803d; background: #dcfce7; }
.rc-pill.warn { color: #b91c1c; background: #fee2e2; }
.rc-pill.info { color: #1d4ed8; background: #dbeafe; }
.rc-pill.muted { color: var(--muted); background: #f1f3f7; }

.risk-month-body { border-top: 1px solid var(--border); }

.risk-row {
  display: flex; align-items: center; gap: 16px;
  padding: 11px 20px; border-bottom: 1px solid var(--border);
}
.risk-row:last-child { border-bottom: none; }
.risk-row.header {
  padding: 9px 20px; background: #f9fafb; font-size: 12px; font-weight: 700;
  color: var(--muted); position: sticky; top: 0; z-index: 1;
}
.risk-row:nth-child(even):not(.header) { background: #fafbff; }
.risk-row.overdue { background: #fff1f2; }
.risk-row.overdue .rc-cell.name { color: #b91c1c; font-weight: 600; }

.rc-cell.name {
  flex: 1; min-width: 0; font-size: 13.5px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rc-cell.check { width: 86px; text-align: center; flex-shrink: 0; }
.rc-cell.act { width: 44px; text-align: center; flex-shrink: 0; }
.rc-del {
  border: none; background: transparent; cursor: pointer; font-size: 15px; line-height: 1;
  padding: 4px 6px; border-radius: 6px; color: var(--muted); opacity: .55;
}
.rc-del:hover { background: #fee2e2; color: #b91c1c; opacity: 1; }

.risk-del-month {
  margin-left: 12px; border: 1px solid var(--border); background: #fff; cursor: pointer;
  font-size: 12px; font-weight: 600; color: #b91c1c; padding: 5px 11px; border-radius: 8px;
  flex-shrink: 0;
}
.risk-del-month:hover { background: #fee2e2; border-color: #fca5a5; }

.risk-add-entity {
  display: flex; align-items: center; gap: 10px; padding: 12px 20px;
  border-top: 1px dashed var(--border); background: #fcfcff;
}
.risk-add-entity-input {
  flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 13.5px;
}
.risk-add-entity-btn { padding: 8px 14px; font-size: 13px; }

.rc-check2 {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  padding: 5px 10px; border-radius: 10px; border: 1px solid var(--border);
  background: #fff; transition: all .15s;
}
.rc-check2 input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; margin: 0; }
.rc-check2:hover { border-color: var(--primary); }
.rc-check2.todo { border-color: var(--border); }
.rc-check2.ok { border-color: #86efac; background: #f0fdf4; }
.rc-check2.warn { border-color: #fca5a5; background: #fef2f2; }
.rc-icon { display: inline-block; width: 16px; text-align: center; font-size: 13px; line-height: 1; }
.rc-check2.ok .rc-icon::before { content: "✓"; color: #16a34a; font-weight: 700; }
.rc-check2.warn .rc-icon::before { content: "!"; color: #dc2626; font-weight: 800; }
.rc-check2.todo .rc-icon::before { content: "—"; color: var(--gray); }

/* ===================== 一、年度统计聚合看板 ===================== */
.annual-view { padding: 4px 0; }
.annual-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.annual-toolbar .annual-year {
  padding: 7px 12px; border-radius: 10px; border: 1px solid var(--border);
  font-size: 14px; background: #fff; color: var(--text); cursor: pointer;
}
.annual-hint { font-size: 12.5px; color: var(--gray); }
.annual-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.annual-card {
  position: relative; background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 18px 18px 16px;
  box-shadow: 0 1px 3px rgba(15,23,42,.05); overflow: hidden; transition: transform .15s, box-shadow .15s;
}
.annual-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(15,23,42,.10); }
.annual-card::before {
  content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, #4F46E5, #a855f7);
}
.annual-card .ac-title { font-size: 14.5px; font-weight: 800; color: #1e1b4b; margin-bottom: 12px; padding-left: 11px; border-left: 4px solid var(--primary); }
.annual-card .ac-items { display: flex; flex-direction: column; gap: 8px; }
.annual-card .ac-item { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; color: #475569; }
.annual-card .ac-item b { font-size: 16px; color: var(--text); font-variant-numeric: tabular-nums; }
.annual-card .ac-total {
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border);
  display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--gray);
}
.annual-card .ac-total b { font-size: 21px; color: var(--primary); font-variant-numeric: tabular-nums; }

/* ===================== 二、工作规划折叠树 ===================== */
.workplan-view { padding: 4px 0; }
.wp-owner { background: #fff; border: 1px solid var(--border); border-radius: 14px; margin-bottom: 14px; overflow: hidden; }
.wp-owner-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px; cursor: pointer;
  background: #f8fafc; border-bottom: 1px solid transparent;
}
.wp-owner.open > .wp-owner-head { border-bottom-color: var(--border); }
.wp-owner-head b { font-size: 15px; color: var(--text); }
.wp-owner-years { font-size: 12.5px; color: var(--gray); }
.wp-caret { display: inline-block; width: 16px; color: var(--gray); transition: transform .15s; }
.wp-year { border-bottom: 1px solid #f1f5f9; }
.wp-year:last-child { border-bottom: none; }
.wp-year-head {
  display: flex; align-items: center; gap: 8px; padding: 11px 16px 11px 34px; cursor: pointer;
  font-weight: 600; color: #334155;
}
.wp-year-head .wp-del { margin-left: auto; }
.wp-del {
  border: none; background: #fef2f2; color: #dc2626; font-size: 12.5px; padding: 4px 10px;
  border-radius: 8px; cursor: pointer;
}
.wp-del:hover { background: #fee2e2; }
.wp-plan-wrap { padding: 6px 34px 4px; }
.wp-plan-label { display: block; font-size: 12.5px; color: var(--gray); margin: 6px 0 4px; }
.wp-plan, .wp-summary {
  width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px;
  font-size: 13.5px; color: var(--text); resize: vertical; font-family: inherit; line-height: 1.6;
  white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word;
  max-height: 260px; overflow-y: auto;
}
.wp-plan { min-height: 80px; }
.wp-periods { padding: 4px 34px 14px; display: flex; flex-direction: column; gap: 8px; }
.wp-period { border: 1px solid #eef2f7; border-radius: 10px; background: #fcfdff; }
.wp-period-head {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer;
  font-weight: 600; color: #334155; font-size: 13.5px;
}
.wp-period-sum { margin-left: auto; font-size: 11.5px; font-weight: 400; color: var(--gray); }
.wp-period-body { padding: 8px 12px 12px; }
.wp-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 14px; }
.wp-metric { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: #475569; }
.wp-metric label { flex: 1; min-width: 0; }
.wp-num {
  width: 78px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px;
  text-align: right; color: var(--text); font-variant-numeric: tabular-nums;
}
.wp-num:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.wp-summary { margin-top: 10px; min-height: 80px; }
.wp-plan-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 6px; }
.wp-plan-head .wp-plan-label { margin: 0; }

/* 三个独立维度分组（线下合同评审 / OA审批 / 知识产权） */
.wp-groups { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.wp-group {
  border: 1px solid #eef2f7; border-left: 4px solid var(--primary); border-radius: 10px;
  background: #fff; padding: 8px 12px 10px;
}
.wp-group:nth-of-type(1) { border-left-color: #4F46E5; }
.wp-group:nth-of-type(2) { border-left-color: #059669; }
.wp-group:nth-of-type(3) { border-left-color: #D97706; }
.wp-group:nth-of-type(4) { border-left-color: #7C3AED; }
.wp-group-title {
  font-size: 12.5px; font-weight: 700; color: #1e293b; margin-bottom: 6px;
  display: flex; align-items: center; gap: 6px;
}
.wp-group-title::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor;
}
.wp-group:nth-of-type(1) .wp-group-title { color: #4F46E5; }
.wp-group:nth-of-type(2) .wp-group-title { color: #059669; }
.wp-group:nth-of-type(3) .wp-group-title { color: #D97706; }
.wp-group:nth-of-type(4) .wp-group-title { color: #7C3AED; }
.wp-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 14px; }

/* 保存 / 复制 按钮 */
.wp-save {
  border: none; background: var(--primary); color: #fff; font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 8px; cursor: pointer; transition: background .15s, opacity .15s;
}
.wp-save:hover { background: #4338ca; }
.wp-save:active { opacity: .8; }
.wp-period-head .wp-save { margin-left: auto; }
.wp-copy {
  margin-left: 10px; border: 1px solid #10b981; background: #ecfdf5; color: #047857;
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 8px; cursor: pointer;
  transition: background .15s;
}
.wp-copy:hover { background: #d1fae5; }
.wp-owner-head .wp-copy { margin-left: auto; }

/* 工作规划：锁定（只读）状态 + 纠纷字段 + 编辑人 */
.wp-num[readonly], .wp-plan[readonly], .wp-summary[readonly], .wp-dispute[readonly] {
  background: #f8fafc; color: #475569; cursor: default;
}
.wp-save.locked {
  background: #fff; color: var(--primary); border: 1px solid var(--primary);
}
.wp-save.locked:hover { background: #eef2ff; }
.wp-dispute-row {
  display: flex; align-items: center; gap: 10px; margin-top: 10px;
  padding: 8px 10px; background: #f8fafc; border: 1px dashed #e2e8f0; border-radius: 10px;
}
.wp-dispute-label { font-size: 12.5px; color: #475569; font-weight: 600; white-space: nowrap; }
.wp-dispute { width: 90px; }
.wp-year-meta { margin-left: auto; font-size: 11.5px; color: var(--gray); white-space: nowrap; }
.wp-year-head .wp-del { margin-left: 10px; }

/* ===================== 其他例行工作 · 便签看板 ===================== */
.notes-view { padding: 4px 0; }
.notes-empty { padding: 30px 0; }
.notes-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; align-items: start;
}
.note-card {
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 12px 13px 10px;
  box-shadow: 0 1px 3px rgba(16,24,40,.06); display: flex; flex-direction: column; gap: 8px;
  border-top: 4px solid var(--primary);
}
.note-card:nth-child(3n+1) { border-top-color: #4F46E5; }
.note-card:nth-child(3n+2) { border-top-color: #DB2777; }
.note-card:nth-child(3n+3) { border-top-color: #059669; }
.note-title {
  border: none; border-bottom: 1px solid var(--border); padding: 4px 2px; font-size: 15px; font-weight: 700;
  color: var(--text); outline: none; font-family: inherit; width: 100%;
}
.note-title:focus { border-bottom-color: var(--primary); }
.note-tag {
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-size: 12px;
  color: #475569; outline: none; width: fit-content; max-width: 100%; font-family: inherit;
}
.note-tag:focus { border-color: var(--primary); }
.note-body {
  width: 100%; min-height: 90px; border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px;
  font-size: 13.5px; color: var(--text); resize: vertical; font-family: inherit; line-height: 1.5; outline: none;
}
.note-body:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.10); }
.note-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.note-meta { font-size: 11px; color: var(--gray); }
.note-del {
  border: none; background: #fef2f2; color: #dc2626; font-size: 13px; padding: 3px 9px;
  border-radius: 8px; cursor: pointer;
}
.note-del:hover { background: #fee2e2; }

/* 合规内控便签看板：工具栏 + 大卡 + 图片 */
.notes-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.note-add {
  border: none; background: linear-gradient(135deg, #4F46E5, #7c3aed); color: #fff;
  padding: 9px 16px; border-radius: 10px; font-size: 13px; font-weight: 700; letter-spacing: .5px;
  cursor: pointer; transition: filter .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 6px 16px rgba(79,70,229,.3);
}
.note-add:hover { filter: brightness(1.06); box-shadow: 0 8px 22px rgba(79,70,229,.4); }
.note-add:active { transform: translateY(1px); }
.note-export-html, .note-export-docx {
  border: none; background: #fff; color: #4F46E5; padding: 9px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s;
  border: 1px solid #c7d2fe;
}
.note-export-html:hover, .note-export-docx:hover { background: #eef2ff; }
.notes-hint { font-size: 12.5px; color: var(--muted); }

.notes-grid-lg { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.note-card-lg { padding: 16px 18px 14px; border-radius: 16px; gap: 10px; }
.note-card-lg .note-title { font-size: 16px; }
.note-card-lg .note-tag { font-size: 12.5px; }
.note-card-lg .note-body { min-height: 150px; font-size: 14px; }

.note-img-row { margin-top: 2px; }
.note-img-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px dashed var(--border-strong); color: var(--muted);
  padding: 7px 12px; border-radius: 9px; font-size: 12.5px; transition: all .15s;
}
.note-img-btn:hover { border-color: var(--primary); color: var(--primary); background: #f7f8ff; }
.note-img-wrap { position: relative; display: inline-block; max-width: 100%; }
.note-img { max-width: 100%; max-height: 220px; border-radius: 10px; border: 1px solid var(--border); display: block; }
.note-img-del {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border: none;
  border-radius: 50%; background: rgba(17,24,39,.6); color: #fff; cursor: pointer; font-size: 12px;
  display: flex; align-items: center; justify-content: center;
}
.note-img-del:hover { background: rgba(220,38,38,.85); }

/* 富文本正文：内嵌图片、可编辑 */
.note-body-rich {
  width: 100%; min-height: 120px; border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px;
  font-size: 14px; color: var(--text); line-height: 1.6; outline: none; overflow-wrap: anywhere;
  white-space: pre-wrap; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.note-body-rich:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.10); }
.note-body-rich:empty:before { content: attr(placeholder); color: var(--muted); pointer-events: none; }
.note-card-lg .note-body-rich { min-height: 150px; font-size: 14px; }
.note-inline-img {
  max-width: 100%; max-height: 320px; border-radius: 8px; border: 1px solid var(--border);
  display: inline-block; vertical-align: middle; margin: 2px 4px; cursor: zoom-in; object-fit: contain;
}
.note-inline-img:hover { box-shadow: 0 0 0 2px var(--primary); }

/* 点击内嵌图片后的放大预览层（支持缩放/平移） */
.img-lightbox {
  position: fixed; inset: 0; z-index: 9999; display: none;
  flex-direction: column; align-items: center; justify-content: center;
  padding: 0; background: rgba(15, 18, 40, .88); backdrop-filter: blur(3px);
}
.img-lightbox.open { display: flex; }
.img-lightbox img {
  max-width: 92vw; max-height: 86vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
  background: #fff; object-fit: contain; transform-origin: center center;
  user-select: none; -webkit-user-drag: none; cursor: default;
}
/* 缩放工具栏 */
.lb-bar {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; z-index: 1;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  padding: 6px 10px; border-radius: 999px; backdrop-filter: blur(6px);
}
.lb-btn {
  border: none; background: rgba(255,255,255,.16); color: #fff;
  min-width: 34px; height: 34px; padding: 0 10px; border-radius: 999px;
  font-size: 16px; cursor: pointer; transition: background .15s; display: inline-flex;
  align-items: center; justify-content: center;
}
.lb-btn:hover { background: rgba(255,255,255,.32); }
.lb-close { font-size: 14px; }
.lb-zoom-val { color: #fff; font-size: 13px; min-width: 48px; text-align: center; }

.table-view { padding: 4px 0; }
