:root {
  --ink: #16233a;
  --ink-2: #4a5a72;
  --line: #e2e7ef;
  --bg: #f4f6fa;
  --brand: #14487a;
  --brand-2: #1d63a8;
  --gold: #b98b3d;
  --danger: #c0442f;
  --ok: #1c7a52;
}
/* 品牌标题字：庞门正道粗书体（子集 42KB，缺字自动回退） */
@font-face {
  font-family: "PangMenCu";
  src: url("assets/fonts/pangmen-cu.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
}
h1, h2, h3 { margin: 0; font-weight: 600; }
.hidden { display: none !important; }

/* 高质量发明专利补充协议 */
#qualitySupplementCard h3 { margin-bottom: 10px; }
#qualitySupplementSummary { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.8; }
#qualityOneTerms { margin-top: 16px; }
#qualityTermsPreview { margin: 10px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; color: var(--ink-2); }
#qualityTermsDialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fff; box-shadow: 0 24px 80px rgba(16, 38, 60, .25); }
#qualityTermsDialog::backdrop { background: rgba(15, 31, 49, .45); }
#qualityTermsDialog .quality-dialog-body { padding: 26px; }
#qualityTermsTitle { font-size: 19px; }
#qualityTermsDialog .quality-dialog-body > p:first-of-type { color: var(--ink-2); font-size: 13px; line-height: 1.8; }
#qualityTermsDraft { display: block; width: 100%; min-height: 160px; resize: vertical; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; font: inherit; line-height: 1.7; }
#qualityTermsDraft:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(29, 99, 168, .12); }
#qualityTermsCount { margin-top: 5px; text-align: right; }
#qualityTermsError { margin-top: 5px; }
#qualityTermsDialog .quality-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
#preview .pv-quality-note { margin: 12px 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--brand); font-size: 12px; line-height: 1.8; }
#preview .pv-quality-note span { color: var(--ink-2); }

@media (max-width: 600px) {
  #qualityTermsDialog .quality-dialog-body { padding: 21px; }
  #qualityTermsDraft { font-size: 16px; }
}

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(1100px 520px at 12% -12%, #e6edf7 0%, rgba(244,246,250,0) 60%),
    radial-gradient(900px 460px at 100% 110%, #eaf0f8 0%, rgba(244,246,250,0) 65%),
    #f4f6fa; }
.login-card { display: grid; grid-template-columns: 302px minmax(0, 1fr); width: 100%; max-width: 880px;
  min-width: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden;
  box-shadow: 0 28px 64px rgba(20, 40, 80, .14); }

/* 左侧品牌栏 */
.login-side { position: relative; overflow: hidden; padding: 30px 26px 22px; color: var(--ink);
  background: linear-gradient(165deg, #ffffff 0%, #f4f9ff 48%, #e9f2fb 100%);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; text-align: center; }
.login-side::before { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%;
  right: -80px; top: -90px; background: rgba(20,72,122,.055); }
.login-side::after { content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%;
  left: -70px; bottom: -80px; background: rgba(20,72,122,.045); }
.ls-mark { width: 66px; height: auto; position: relative; margin-top: auto;
  filter: drop-shadow(0 6px 14px rgba(20,72,122,.16)); }
.ls-words strong { display: block; font-size: 15px; font-weight: 600; letter-spacing: .6px; }
.ls-words em { display: block; font-style: normal; font-size: 9px; letter-spacing: 2.4px;
  color: rgba(255,255,255,.5); margin-top: 3px; }
.ls-tag { position: relative; margin: 20px 0 0; font-size: 11px; letter-spacing: 2px;
  color: var(--brand); background: rgba(255,255,255,.75);
  border: 1px solid rgba(20,72,122,.22); border-radius: 999px; padding: 4px 13px; }
.ls-title { font-family: "PangMenCu", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 58px; font-weight: normal; line-height: 1.06; letter-spacing: 5px; padding-left: 5px;
  margin: 14px 0 0; position: relative; color: #122a5c; }
.ls-slogan { margin: 10px 0 0; font-size: 12.5px; letter-spacing: 3px;
  color: #a8763a; position: relative; }
.ls-foot { margin-top: auto; padding-top: 22px; font-size: 10.5px; line-height: 1.9;
  color: #7b869b; position: relative; letter-spacing: .3px; }
.ls-org { margin: 0; font-size: 10.5px; line-height: 1.9; color: #7b869b; }
.ls-desc { margin: 8px 0 0; font-size: 9.5px; line-height: 1.6; letter-spacing: .5px;
  color: #9aa4b5; }

/* 右侧表单 */
.login-form { padding: 32px 34px 24px; display: flex; flex-direction: column; min-width: 0; }
.login-side, .login-form, .code-row { min-width: 0; }
.code-row input { min-width: 0; }
.lf-head h2 { font-size: 20px; letter-spacing: .5px; }
.lf-head p { margin: 7px 0 18px; font-size: 12.5px; color: var(--ink-2); line-height: 1.65; }
.lf-slogan { display: none; text-align: center; font-size: 12px; letter-spacing: 3px;
  color: var(--gold); margin: 8px 0 0; }
.lf-foot { margin: auto 0 0; padding-top: 18px; text-align: center; font-size: 11px;
  color: #b3bccb; letter-spacing: .5px; }

.tabs { display: flex; gap: 4px; background: #eef1f6; border-radius: 9px; padding: 4px; margin-bottom: 18px; }
.tab { flex: 1; border: 0; background: transparent; padding: 8px 0; border-radius: 7px; cursor: pointer;
  color: var(--ink-2); font-size: 13px; font-family: inherit; }
.tab.active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.pane { display: none; }
.pane.active { display: block; }

@media (max-width: 780px) {
  .login-card { grid-template-columns: minmax(0, 1fr); max-width: 460px; }
  .login-wrap { padding: 16px; }
  .login-side { padding: 24px 24px 20px; }
  .ls-foot { display: none; }
  .ls-title { font-size: 40px; margin-top: 10px; }
  .ls-mark { width: 46px; }
  .ls-foot { padding-top: 16px; }
  .login-form { padding: 24px 22px 20px; }
  .lf-slogan { display: block; }
  .lf-foot { display: none; }
}

label { display: block; font-size: 12px; color: var(--ink-2); margin: 14px 0 6px; }
input, select { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; font-family: inherit; color: var(--ink); background: #fff; outline: none; }
input:focus, select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(29,99,168,.12); }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.code-row .btn { flex: 0 0 108px; }
.hint { font-size: 12px; color: #8a94a6; margin: 10px 0 0; }

.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 9px 16px;
  border-radius: 8px; cursor: pointer; font-size: 14px; font-family: inherit; transition: .15s; }
.btn:hover { border-color: #c8d2e0; background: #fafbfd; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.ghost { background: #f2f5f9; }
.btn.block { display: block; width: 100%; margin-top: 14px; }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn.danger { color: var(--danger); border-color: #ecc9c1; background: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.msg { min-height: 18px; font-size: 13px; margin: 10px 0 0; color: var(--danger); }
.msg.ok { color: var(--ok); }

/* 布局 */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 208px; flex: 0 0 208px; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 18px 14px; }
.sb-brand { display: flex; align-items: center; gap: 9px; padding: 0 6px 14px;
  border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.sb-logo { width: 30px; height: 30px; object-fit: contain; flex: 0 0 auto; }
.sb-words { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.sb-name { font-family: "PangMenCu", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 19px; font-weight: normal; letter-spacing: 1px; color: #122a5c; white-space: nowrap; }
.sb-slogan { font-size: 9.5px; color: #a8763a; letter-spacing: .6px; margin-top: 5px;
  white-space: nowrap; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item { text-align: left; border: 0; background: transparent; padding: 9px 12px; border-radius: 8px;
  cursor: pointer; font-size: 14px; font-family: inherit; color: var(--ink-2); }
.nav-item:hover { background: #f2f5f9; }
.nav-item.active { background: #eaf1f9; color: var(--brand); font-weight: 600; }
.sb-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.user-box { font-size: 13px; color: var(--ink-2); padding: 0 6px 8px; word-break: break-all; }
.main { flex: 1; padding: 26px 30px 60px; overflow-x: hidden; }
.view { display: none; }
.view.active { display: block; }
.page-head { margin-bottom: 20px; }
.page-head h2 { font-size: 20px; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; }

.grid { display: grid; grid-template-columns: minmax(0,1fr) 380px; gap: 20px; align-items: start; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; }
.card h3 { font-size: 15px; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.card.sticky { position: sticky; top: 20px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.field { margin-bottom: 4px; }
.field-full { grid-column: 1 / -1; }

/* 项目检索 */
.search-wrap { position: relative; margin-bottom: 14px; }
.search-wrap input { padding-left: 34px; background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 12px center; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(20,40,80,.12);
  max-height: 280px; overflow: auto; padding: 4px; }
.suggest .s-item { display: flex; justify-content: space-between; gap: 10px; padding: 9px 11px;
  border-radius: 7px; cursor: pointer; font-size: 13px; }
.suggest .s-item:hover, .suggest .s-item.on { background: #eef4fb; }
.suggest .s-item .price { color: var(--ink-2); font-size: 12px; flex: 0 0 auto; }
.suggest .s-empty { padding: 14px; text-align: center; color: #8a94a6; font-size: 13px; }
.suggest .s-tip { padding: 6px 11px; color: #8a94a6; font-size: 12px; border-bottom: 1px solid var(--line); }
.search-wrap.in-field { margin-bottom: 0; }
.lb-tip { color: #9aa4b5; font-weight: 400; font-size: 11px; }
.suggest .s-item .sub2 { color: #8a94a6; font-size: 12px; display: block; margin-top: 2px; }
.suggest .s-item .cnt { flex: 0 0 auto; color: var(--brand); font-size: 12px; background: #eef4fb; border-radius: 20px; padding: 1px 8px; align-self: center; }
input.readonly { background: #f6f8fb; color: var(--brand); font-weight: 600; letter-spacing: .3px; cursor: default; }
table.pick .del { border: 0; background: transparent; color: #a3abba; cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
table.pick .del:hover { color: var(--danger); background: #fdf1ee; }
table.pick tr.empty-row td { color: #a3abba; text-align: center; padding: 18px 8px; }
table.pick td .pname { margin-top: 5px; font-size: 12px; padding: 5px 7px; }
table.pick td.nm { min-width: 210px; }

/* 项目勾选表 */
table.pick { width: 100%; border-collapse: collapse; }
table.pick th { text-align: left; font-size: 12px; color: var(--ink-2); font-weight: 500;
  padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.pick td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.pick input[type=number], table.pick input[type=text] { padding: 6px 8px; font-size: 13px; }
.pick .off { color: #a3abba; }
.pick .sub { font-weight: 600; }

/* 数据表 */
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { background: #fff; color: var(--ink-2); font-weight: 600; text-align: left;
  padding: 9px 10px; border: 1px solid #000; }
table.data td { background: #fff; padding: 9px 10px; border: 1px solid #000; text-align: center; }
table.data th { text-align: center; }
table.data tbody tr:hover td { background: #fafbfd; }
.add-row { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.add-row input { flex: 1; min-width: 110px; }
.add-row .btn { flex: 0 0 auto; }
#view-filing > .filing-back { margin: 0 0 16px; }

/* 组织架构 */
.org-dept { background: #fff; border: 1px solid var(--line); border-radius: 12px;
  margin-bottom: 12px; overflow: hidden; }
.org-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: #f7fafd; border-bottom: 1px solid var(--line); }
.org-name { font-weight: 600; font-size: 13.5px; color: #122a5c; }
.org-count { font-size: 12px; color: #8a94a6; }
.org-head .spacer { flex: 1; }
.org-head select { width: auto; min-width: 120px; padding: 4px 8px; font-size: 12px; }
.org-head .btn { padding: 4px 10px; font-size: 12px; }
.org-body { padding: 0; }
.org-body table { margin: 0; border: 0; }
.org-body table th { background: #fff; }
.org-empty { color: #a3abba; font-size: 12.5px; padding: 12px 14px; }
.org-l1 .org-head { background: #eef4fb; }
.org-l2 .org-head { background: #f4f8fd; }
.org-tag { font-size: 11px; background: #eaf1f9; color: var(--brand); border-radius: 6px;
  padding: 2px 7px; }
.org-head-flag { font-size: 11px; color: #a8763a; background: #fff7e8; border-radius: 6px; padding: 2px 7px; }
table.data td input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; }
table.data td select { padding: 5px 8px; font-size: 12.5px; }

.add-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.add-row input, .add-row select { width: auto; flex: 1 1 160px; min-width: 0; }
.add-row .btn { flex: 0 0 auto; }

.proj-bar { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.proj-bar span { font-size: 12.5px; color: #8a94a6; }
.proj-bar .btn { margin-left: auto; }

/* 今日新政：鲜红高亮 + 跳动 */
.brief-item.is-new { background: linear-gradient(90deg, #fff4f4, #ffffff 68%);
  border-color: #f6c9c9; box-shadow: 0 2px 10px rgba(217, 83, 79, .10); }
.bi-date.hot { background: #fdeaea; color: #c0392b; border: 1px solid #f3c4c4; font-weight: 700; }
.bi-dot { width: 8px; height: 8px; border-radius: 50%; background: #d9534f; flex: 0 0 auto;
  animation: briefPulse 1.5s infinite; }
.bi-newtag { font-size: 11px; color: #fff; background: #d9534f; border-radius: 999px;
  padding: 2px 9px; letter-spacing: .5px; animation: tagBreath 2.2s ease-in-out infinite; }
@keyframes briefPulse {
  0%   { box-shadow: 0 0 0 0 rgba(217, 83, 79, .55); }
  70%  { box-shadow: 0 0 0 9px rgba(217, 83, 79, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 83, 79, 0); }
}
@keyframes tagBreath {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(217,83,79,.35); }
  50%      { transform: scale(1.06); box-shadow: 0 0 0 5px rgba(217,83,79,0); }
}

/* 政策原文入口 */
.policy-links { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px;
  padding-top: 10px; border-top: 1px dashed var(--line); }
.policy-links span { font-size: 11.5px; color: #9aa4b5; margin-right: 2px; }
.policy-links a { font-size: 11.5px; color: var(--brand); text-decoration: none;
  background: #f2f7fd; border: 1px solid #dbe7f5; border-radius: 999px; padding: 3px 9px; }
.policy-links a:hover { background: #e5effb; border-color: #b9d0ea; }

/* 开票申请 */
.paste-box { width: 100%; min-height: 110px; padding: 9px 11px; font-size: 12.5px; line-height: 1.7;
  font-family: inherit; border: 1px solid var(--line); border-radius: 9px; resize: vertical;
  color: var(--ink); outline: none; }
.paste-box:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(29,99,168,.12); }
.inv-form { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px 14px; margin-top: 12px; }
.inv-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); }
.inv-form label.wide { grid-column: span 3; }
.inv-form input, .inv-form select { width: 100%; padding: 6px 9px; font-size: 12.5px; }
#invPoolTable td { white-space: nowrap; }
#invPoolTable input[type=checkbox] { width: 15px; height: 15px; }

/* 宽表格：单元格不换行，整体左右滚动 */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll::-webkit-scrollbar { height: 9px; }
.table-scroll::-webkit-scrollbar-thumb { background: #c2cfe0; border-radius: 5px; }
.table-scroll::-webkit-scrollbar-thumb:hover { background: #a9bad0; }
.table-scroll::-webkit-scrollbar-track { background: #f2f6fb; border-radius: 5px; }
.table-scroll { scrollbar-color: #c2cfe0 #f2f6fb; scrollbar-width: thin; }
.table-scroll > table.data { min-width: 1120px; }
#contractTable { width: max-content; min-width: 100%; table-layout: auto; }
#contractTable th, #contractTable td { white-space: nowrap; }
#contractTable td:last-child .btn { margin: 2px; white-space: nowrap; }
.contract-bulk-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.contract-bulk-tools label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.contract-bulk-tools input, #contractTable [data-contract-select] { width: 16px; height: 16px; cursor: pointer; }
.contract-bulk-results { margin: 12px 0; padding: 12px 14px; background: #f6f9fd; border: 1px solid var(--line); border-radius: 10px; }
.contract-bulk-list { margin: 10px 0; padding-left: 22px; max-height: 280px; overflow-y: auto; }
.contract-bulk-list li { margin: 6px 0; overflow-wrap: anywhere; }
.contract-bulk-list .bulk-success { color: #24734e; }
.contract-bulk-list .bulk-error, .contract-bulk-warning { color: var(--danger); }
.contract-bulk-list .bulk-forbidden { color: var(--ink-2); }
#contractBulkDeleteDialog { width: min(650px, calc(100vw - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 14px; }
#contractBulkDeleteDialog::backdrop { background: rgba(20, 34, 52, .45); }
.contract-bulk-dialog-body { padding: 24px; }
.contract-bulk-dialog-body h2 { margin-top: 0; }
.contract-bulk-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
/* 合同号 / 类型 / 承办 / 归属人：主副两行，居中显示 */
#contractTable .contract-list-main { display: block; text-align: center; }
#contractTable .contract-list-secondary { display: block; margin: 3px 0 0; color: var(--ink-2); font-size: 12px; line-height: 1.4; text-align: center; }
/* 合同记录检索框 */
.contract-search { width: 260px; max-width: 42vw; height: 34px; padding: 6px 12px; border: 1px solid var(--line, #d7dfe9); border-radius: 8px; font-size: 13px; }
.contract-search:focus { outline: 2px solid rgba(41, 94, 134, .25); border-color: var(--brand-2, #47799e); }
/* 操作列固定在右侧，横向滚动时不动 */
#contractTable th:last-child, #contractTable td:last-child { position: sticky; right: 0; z-index: 1; }
#contractTable th:last-child { background: #f6f9fd; }
#contractTable td:last-child { background: #fff; box-shadow: -12px 0 14px -12px rgba(23, 43, 66, .4); min-width: 236px; white-space: nowrap; }
.tech-charge-type { display: block; margin-top: 6px; color: var(--ink-2); font-size: 12px; }
.tech-charge-panel { margin: 12px 0; }
.tech-charge-panel label { margin-right: 10px; font-weight: 600; }
.tech-charge-panel select { max-width: 300px; }
#view-new .col-form { min-width: 0; }
.selected-items-scroll { width: 100%; max-width: 100%; overflow-x: auto; }
.selected-items-scroll > table.pick { min-width: 880px; }
.selected-items-scroll input[type=number] { min-width: 88px; }
table.pick .rm { width: 100%; min-width: 110px; }
#selBody input:disabled { color: var(--ink-2); background: #f1f4f8; }

/* 待办角标 + 首页待办条 */
.nav-item .nav-badge { display: inline-block; min-width: 16px; height: 16px; line-height: 16px;
  padding: 0 4px; margin-left: 6px; border-radius: 8px; background: #d9534f; color: #fff;
  font-size: 10.5px; text-align: center; vertical-align: middle; }
.todo-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  background: #fff7e8; border: 1px solid #f3dfb8; color: #8a5a00; border-radius: 10px;
  padding: 9px 13px; font-size: 12.5px; margin-bottom: 14px; }
.todo-bar b { color: #b23b3b; }

/* 产品报价：紧凑行 */
tr.row-off { background: #f5f7fa; }
tr.row-off td { color: #9aa4b5; }
tr.row-off input { background: #eef2f6; color: #98a2b3; border-color: #e2e8f0; }
tr.row-off td:last-child .btn { opacity: .85; }
#projTableIp td, #projTableTech td, #projTableConsult td { padding: 4px 8px; }
#projTableIp textarea.p-name, #projTableTech textarea.p-name, #projTableConsult textarea.p-name {
  min-height: 0; padding: 3px 8px; line-height: 1.45; resize: none; overflow: hidden; display: block; }

/* 需求反馈 */
.fb-list { margin-top: 8px; }
.fb-item { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.fb-item:last-child { border-bottom: 0; }
.fb-kind { flex: 0 0 auto; font-size: 11px; padding: 2px 8px; border-radius: 6px; margin-top: 1px; }
.fb-kind.request { background: #eaf3fd; color: #1d63a8; }
.fb-kind.bug { background: #fdeeea; color: #b23b3b; }
.fb-body { flex: 1 1 auto; white-space: pre-wrap; word-break: break-word; }
.fb-meta { flex: 0 0 auto; color: #8a94a6; font-size: 11px; }
.fb-files { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.fb-files .btn { font-size: 11px; }
.fb-when { color: #8a94a6; font-size: 11.5px; margin-top: 2px; }

/* 首页更新简报 */
.release-list { margin-top: 6px; max-height: 320px; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; scrollbar-gutter: stable; padding-right: 8px; }
.release-list:focus-visible { outline: 2px solid var(--blue, #185fa5); outline-offset: 4px; border-radius: 4px; }
.release-item { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; align-items: baseline; }
.release-item:last-child { border-bottom: 0; }
.release-date { flex: 0 0 auto; color: #1d63a8; font-variant-numeric: tabular-nums; font-size: 11.5px; }
.release-text { flex: 1 1 auto; }

/* 审批中心 */
.apv-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.apv-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.apv-client { font-weight: 600; font-size: 13.5px; }
.apv-status { font-size: 11px; padding: 2px 8px; border-radius: 6px; }
.apv-pending { background: #fff7e8; color: #a8763a; }
.apv-approved { background: #eaf7f0; color: #1a7f4b; }
.apv-rejected { background: #fdeeee; color: #b23b3b; }
.apv-meta { font-size: 12px; color: #7b869b; line-height: 1.9; }
.apv-meta b { color: #33415a; font-weight: 600; }
.apv-gap { color: #b23b3b; font-weight: 600; }
.apv-acts { margin-top: 8px; display: flex; gap: 8px; }
.apv-flags { font-size: 12px; color: #7b869b; margin-top: 4px; }
.apv-empty { color: #a3abba; font-size: 13px; padding: 16px 4px; }

/* 审批路径与评论 */
.apv-top { flex-wrap: wrap; }
.apv-path-caption { margin: 12px 0 7px; color: #64748b; font-size: 12px; }
.apv-path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.apv-node { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; background: #f8fafc; border: 1px solid var(--line); border-left: 3px solid #d3ab69; border-radius: 8px; font-size: 12px; }
.apv-node-approved { border-left-color: #258455; }
.apv-node-rejected { border-left-color: #b23b3b; }
.apv-node-role,.apv-node small { color: #64748b; }
.apv-node b { color: #33415a; }
.apv-comments { margin-top: 12px; }
.apv-comments h4 { margin: 0 0 6px; font-size: 12px; color: #475569; }
.apv-comments ul { list-style: none; margin: 0; padding: 0; }
.apv-comments li { padding: 8px 0; border-bottom: 1px solid #edf1f6; }
.apv-comments li div { display: flex; gap: 9px; flex-wrap: wrap; font-size: 12px; }
.apv-comments li span { color: #7b869b; }
.apv-comments p { margin: 5px 0 0; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; color: #475569; }
.apv-comment-label { display: block; font-size: 12px; margin: 12px 0 6px; color: #64748b; }
.apv-comment-input { width: 100%; box-sizing: border-box; resize: vertical; min-height: 60px; font: inherit; font-size: 12px; }
.apv-acts { flex-wrap: wrap; align-items: center; }
.apv-service-error { padding: 10px; border-radius: 6px; background: #fff7e8; color: #8a622c; font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 540px) { .apv-path { grid-template-columns: 1fr; } }

/* 组织架构树（思维导图式） */
.orgmap { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px 18px; }
.orgmap-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.orgmap-bar .spacer { flex: 1; }
.tchildren { margin-left: 20px; padding-left: 18px; border-left: 1.5px dashed #d8e2ef; }
.tbranch.root > .tchildren { border-left-color: #c3d4e8; }
.tnode, .tleaf { position: relative; display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 8px; }
.tnode::before, .tleaf::before { content: ""; position: absolute; left: -18px; top: 50%;
  width: 14px; border-top: 1.5px dashed #d8e2ef; }
.tbranch.root > .tchildren > .tbranch > .tnode::before,
.tbranch.root > .tchildren > .tleaf::before { border-top-color: #c3d4e8; }
.tnode:hover, .tleaf:hover { background: #f6fafe; }
.tnode { margin: 1px 0; }
.twist { width: 16px; height: 16px; line-height: 14px; border: 0; background: none;
  cursor: pointer; color: #8a94a6; font-size: 11px; padding: 0; flex: 0 0 auto; }
.twist.leaf { visibility: hidden; }
.tname { font-size: 13.5px; font-weight: 600; color: #122a5c; }
.tcount { font-size: 11.5px; color: #9aa4b5; }
.tbadge { font-size: 11px; background: #eaf1f9; color: var(--brand); border-radius: 6px; padding: 1px 6px; }
.tspacer { flex: 1; }
.tnode select { width: auto; min-width: 110px; padding: 2px 6px; font-size: 11.5px;
  border-radius: 6px; }
.tnode .btn { padding: 2px 8px; font-size: 11.5px; }
.tbranch.collapsed > .tchildren { display: none; }

.tleaf { cursor: pointer; }
.leaf-name { font-size: 13px; color: var(--ink); }
.leaf-lv { font-size: 10.5px; color: #7b869b; background: #f0f4f9; border-radius: 5px; padding: 1px 5px; }
.leaf-lv.lv-top { color: #8a5a00; background: linear-gradient(180deg,#fff4d8,#ffe9b8); font-weight: 600;
  box-shadow: 0 0 0 1px rgba(200,150,40,.35) inset; }
.leaf-head { font-size: 10.5px; color: #a8763a; background: #fff7e8; border-radius: 5px; padding: 1px 5px; }
.leaf-all { font-size: 10.5px; color: #1a7f4b; background: #eaf7f0; border-radius: 5px; padding: 1px 5px; }
.leaf-mail { font-size: 11.5px; color: #9aa4b5; }
.tleaf-edit { display: none; gap: 8px; align-items: center; flex-wrap: wrap;
  margin: 2px 0 8px 26px; padding: 10px 12px; background: #f7fafd;
  border: 1px solid var(--line); border-radius: 9px; }
.tleaf-edit.open { display: flex; }
.tleaf-edit input { width: 120px; padding: 5px 8px; font-size: 12px; }
.tleaf-edit input[type=checkbox] { width: 15px; height: 15px; }
.tleaf-edit select { width: 150px; padding: 5px 8px; font-size: 12px; }
.tleaf-edit label { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 5px; }

/* 首页 */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 15px 18px; }
.stat span { display: block; font-size: 12px; color: var(--ink-2); }
.stat strong { display: block; font-size: 25px; font-weight: 600; color: var(--brand);
  margin-top: 5px; letter-spacing: .5px; }
.stat em { display: block; font-style: normal; font-size: 11px; color: #9aa4b5; margin-top: 4px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 356px; gap: 16px; align-items: start; }
.home-grid .card { margin-bottom: 16px; }

.brief-list { display: flex; flex-direction: column; }
.brief-item { display: flex; align-items: center; gap: 12px; padding: 11px 2px;
  border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.brief-item:last-child { border-bottom: 0; }
.brief-item:hover { background: #f7fafd; }
.bi-date { flex: 0 0 auto; background: #eaf1f9; color: var(--brand); font-size: 12px;
  font-weight: 600; padding: 4px 9px; border-radius: 7px; letter-spacing: .3px; }
.bi-title { flex: 1; font-size: 13.5px; min-width: 0; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.bi-act { flex: 0 0 auto; font-size: 12px; color: var(--brand-2); }
.brief-empty { color: #a3abba; font-size: 13px; padding: 14px 0; }
.brief-del { flex: 0 0 auto; border: 0; background: none; cursor: pointer; color: #b3bccb;
  font-size: 12px; font-family: inherit; }
.brief-del:hover { color: var(--danger); }
#briefUploadBtn { float: right; font-weight: 400; }

.notice-form { background: #f7fafd; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; margin-bottom: 6px; }
.notice-form textarea { width: 100%; margin-top: 8px; resize: vertical; font-family: inherit;
  font-size: 13px; line-height: 1.6; padding: 8px 11px; border: 1px solid var(--line);
  border-radius: 8px; outline: none; color: var(--ink); }
.notice-form textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(29,99,168,.12); }
.notice-actions { display: flex; gap: 8px; margin-top: 8px; }
.notice-actions input { flex: 1; min-width: 0; }
.home-grid > div { min-width: 0; }
.notice-form, .notice-form input, .notice-form textarea { min-width: 0; }

.notice-list { display: flex; flex-direction: column; }
.notice-item { padding: 13px 0; border-bottom: 1px solid var(--line); }
.notice-item:last-child { border-bottom: 0; }
.notice-item h4 { margin: 0 0 5px; font-size: 14px; font-weight: 600; }
.notice-item p { margin: 0; font-size: 13px; line-height: 1.65; color: #33415a; white-space: pre-wrap; }
.notice-item .meta { margin-top: 7px; font-size: 11px; color: #9aa4b5; display: flex;
  align-items: center; gap: 10px; }
.notice-item .meta a { color: var(--brand-2); text-decoration: none; }
.notice-item .meta a:hover { text-decoration: underline; }
.notice-item .del-n { margin-left: auto; border: 0; background: none; cursor: pointer;
  color: #b3bccb; font-size: 12px; font-family: inherit; }
.notice-item .del-n:hover { color: var(--danger); }
.notice-empty { color: #a3abba; font-size: 13px; padding: 14px 0; }

.acc-card summary { cursor: pointer; font-size: 13px; color: var(--ink-2); list-style: none; }
.acc-card summary::-webkit-details-marker { display: none; }
.acc-card summary::before { content: "▸ "; color: var(--brand-2); }
.acc-card[open] summary::before { content: "▾ "; }
.acc-card[open] summary { margin-bottom: 8px; }
.acc-card input { margin-bottom: 8px; }
.acc-card .code-row input { margin-bottom: 0; }

.recent-list { display: flex; flex-direction: column; }
.recent-item { padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.recent-item:last-child { border-bottom: 0; }
.recent-item .no { display: block; color: var(--ink-2); font-size: 11.5px; }
.recent-item .amt { float: right; font-weight: 600; color: var(--brand); }
.recent-empty { color: #a3abba; font-size: 13px; padding: 10px 0; }

@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-grid { grid-template-columns: 1fr; }
}

/* 立案拖拽区 */
.dropzone { border: 1.5px dashed #c3cfdf; border-radius: 12px; background: #fafcff;
  padding: 26px 20px; text-align: center; cursor: pointer; transition: .16s; margin-bottom: 6px; }
.dropzone:hover { border-color: var(--brand-2); background: #f4f9ff; }
.dropzone.over { border-color: var(--brand-2); background: #eaf3fd; box-shadow: inset 0 0 0 3px rgba(29,99,168,.08); }
.dz-plus { width: 40px; height: 40px; line-height: 38px; margin: 0 auto 10px; border-radius: 50%;
  background: #eaf1f9; color: var(--brand); font-size: 22px; font-weight: 600; }
.dz-main { margin: 0; font-size: 14px; color: var(--ink); }
.dz-link { color: var(--brand-2); text-decoration: underline; }
.dz-hint { margin: 6px 0 0; font-size: 12px; color: #8a94a6; }

/* 预览 */
.preview { font-size: 13px; color: var(--ink); }
.preview .pv-title { text-align: center; font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.preview .row { display: flex; margin-bottom: 5px; }
.preview .row span { flex: 0 0 92px; color: var(--ink-2); }
.preview .pv-items { margin: 10px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); padding: 8px 0; }
.preview .pv-item { display: flex; justify-content: space-between; }
.preview .empty { color: #a3abba; }
.total-row { display: flex; justify-content: space-between; align-items: baseline;
  border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.total-row strong { font-size: 20px; color: var(--brand); }
.cn { font-size: 12px; color: var(--gold); margin: 4px 0 0; }

.party-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.party-grid .card { margin: 0; }
.party-grid label { margin-top: 10px; }
.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 20px;
  background: #eaf1f9; color: var(--brand); margin-left: 8px; vertical-align: middle; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: rgba(22,35,58,.94); color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .25s; z-index: 99; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 1080px) {
  .grid { grid-template-columns: 1fr; }
  .card.sticky { position: static; }
}
@media (max-width: 720px) {
  .app { flex-direction: column; }
  .sidebar { width: 100%; flex: none; }
  .main { padding: 18px; }
  .fields { grid-template-columns: 1fr; }
}

/* =====================================================================
   视觉精修 2026-10-18 —— 只上调色、层次、动效，不动布局尺寸
   ===================================================================== */

/* 基础质感 */
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(900px 420px at 100% 0%, #eef4fb 0%, rgba(244,246,250,0) 55%),
    var(--bg); }
::selection { background: rgba(20,72,122,.14); }
:focus-visible { outline: 2px solid rgba(29,99,168,.45); outline-offset: 2px; }

/* 滚动条（细、浅，不抢视线） */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cfd9e6; border-radius: 6px; border: 2px solid transparent;
  background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b7c5d7; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* 侧边栏：深蓝渐变 + 金色 slogan（品牌色），白字导航 */
.sidebar { background: linear-gradient(178deg, #0d2a52 0%, #123f70 52%, #0f3358 100%);
  border-right: 0; box-shadow: 2px 0 20px rgba(13,42,82,.16); }
.sb-brand { border-bottom: 1px solid rgba(255,255,255,.12); }
.sb-logo { filter: brightness(0) invert(1) drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
.sb-name { color: #fff; }
.sb-slogan { color: #ffd668; }
.nav-item { color: rgba(255,255,255,.74); position: relative; transition: background .16s ease, color .16s ease; }
.nav-item:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.16); color: #fff; font-weight: 600; }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: #ffd668; }
.sb-foot { border-top: 1px solid rgba(255,255,255,.12); }
.user-box { color: rgba(255,255,255,.62); }
.sidebar .btn { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.18); color: rgba(255,255,255,.86); }
.sidebar .btn:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.28); color: #fff; }
.nav-item .nav-badge { box-shadow: 0 0 0 2px rgba(217,83,79,.25); }

/* 页头：标题下加一道品牌短金线 */
.page-head { position: relative; padding-bottom: 12px; }
.page-head::after { content: ""; position: absolute; left: 0; bottom: 0; width: 34px; height: 3px;
  border-radius: 2px; background: linear-gradient(90deg, var(--brand), var(--gold)); }
.page-head h2 { font-size: 21px; letter-spacing: .2px; }

/* 卡片：更柔和的阴影与圆角，标题带竖条 */
.card { border-radius: 14px; border-color: #e6ebf3;
  box-shadow: 0 1px 2px rgba(20,40,80,.04), 0 8px 24px rgba(20,40,80,.05); }
.card h3 { position: relative; padding-left: 11px; border-bottom-color: #eef2f8; }
.card h3::before { content: ""; position: absolute; left: 0; top: 3px; bottom: 11px; width: 3px;
  border-radius: 2px; background: linear-gradient(180deg, var(--brand), var(--brand-2)); }

/* 统计卡：悬浮上浮 + 数字加粗放大 */
.stat-grid { gap: 14px; }
.stat { border-radius: 14px; border-color: #e6ebf3; position: relative; overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease; }
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2), transparent); opacity: .85; }
.stat:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(20,40,80,.10); }
.stat strong { font-size: 26px; letter-spacing: -.3px; }
.stat span { letter-spacing: .4px; }

/* 按钮：主按钮加渐变和柔和投影 */
.btn { border-radius: 9px; transition: background .16s ease, border-color .16s ease,
  box-shadow .16s ease, transform .06s ease; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #1a548b, var(--brand));
  border-color: #123f70; box-shadow: 0 2px 6px rgba(20,72,122,.22); }
.btn.primary:hover { background: linear-gradient(180deg, #1d63a8, #17548c);
  box-shadow: 0 4px 12px rgba(20,72,122,.28); }
.btn.danger { background: #fff7f5; border-color: #f0cdc5; }
.btn.danger:hover { background: #fdeeea; border-color: #e4b3a8; }

/* 输入：统一高度与更清晰的聚焦环 */
input, select, textarea { border-radius: 9px; transition: border-color .16s ease, box-shadow .16s ease; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2);
  box-shadow: 0 0 0 3px rgba(29,99,168,.14); }

/* 数据表：表头浅灰、边框转柔、行悬停更明显（打印仍走黑框） */
table.data th { background: #f6f9fd; color: #46566e; border-color: #dbe3ee; font-weight: 600; }
table.data td { border-color: #e6ebf3; }
table.data tbody tr:hover td { background: #f6faff; }
table.data tbody tr:last-child td { border-bottom-color: #dbe3ee; }

/* 标签页：胶囊化 */
.tabs { gap: 6px; }
.tab { border-radius: 999px; transition: background .16s ease, color .16s ease; }
.tab.active { background: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(20,72,122,.22); }

/* 简报条目：更柔和的hover */
.brief-item { transition: background .16s ease, border-color .16s ease; }

/* 提示条 / 空态 */
.apv-empty, .brief-empty { color: #98a2b3; }

@media print {
  .sidebar, .nav-item, .btn { display: none !important; }
  table.data th, table.data td { border-color: #000 !important; }
}

/* 客户档案：不换行 + 左右滑动 + 操作列固定 */
#clientTable { min-width: 1240px; }
#clientTable th, #clientTable td { white-space: nowrap; }
#clientTable th:last-child, #clientTable td:last-child {
  position: sticky; right: 0; z-index: 2; background: #fff;
  box-shadow: -10px 0 12px -8px rgba(20, 40, 80, .16);
}
#clientTable th:last-child { background: #f6f9fd; z-index: 3; }
#clientTable tbody tr:hover td:last-child { background: #f6faff; }
#clientTable td:last-child .btn { white-space: nowrap; }
.btn { white-space: nowrap; }

/* 常用项目收藏 */
.suggest .s-item { align-items: center; }
.suggest .s-fav { flex: 0 0 auto; width: 20px; text-align: center; cursor: pointer;
  font-size: 15px; line-height: 1; color: #c3ccda; transition: color .15s ease, transform .15s ease; }
.suggest .s-fav:hover { color: #e0a325; transform: scale(1.18); }
.suggest .s-fav.on { color: #e8a91c; }
.suggest .s-name { flex: 1 1 auto; min-width: 0; }

/* 合同预览栏：滚动时固定在右侧 */
.main { overflow-x: hidden; overflow-x: clip; min-width: 0; }   /* clip 不创建滚动容器（sticky 才能生效）；min-width:0 防止被表格撑宽 */
.col-preview { position: relative; align-self: stretch; }
.card.sticky { position: sticky; top: 16px; align-self: start; }
@media (max-width: 900px) { .card.sticky { position: static; } }

/* 合同记录：整行保持单行，操作按钮随表格一起左右滑动。 */
.contract-table-scroll { max-width: 100%; }
.contract-table-scroll:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 3px; }
#contractTable th:last-child, #contractTable td:last-child { width: auto; }
.contract-scroll-hint { margin: 10px 0 8px; color: var(--ink-2); font-size: 12px; }
#contractTable .contract-approval-row td { background: #fffaf0; }
.contract-approval-state { display: inline-block; padding: 3px 8px; border-radius: 6px; background: #fff0cc; color: #835b13; font-weight: 600; }
.contract-approval-hint { margin: 0 8px; font-size: 12px; color: var(--ink-2); }
.apv-manual-terms { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.apv-manual-terms summary { cursor: pointer; color: var(--brand); }
.apv-manual-terms p { margin-bottom: 0; overflow-wrap: anywhere; }
.supplement-approval-record { border-color: #ecdcb1; background: #fffaf0; }

/* 首页页头右上：品牌口号 */
.home-slogan { float: right; font-size: 12px; letter-spacing: 3px; color: var(--gold);
  font-weight: 400; margin-top: 8px; font-family: "Songti SC", "SimSun", serif; }

/* 侧边栏：整列钉在视口内，不随页面滚动；底部「退出登录」始终可见 */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;            /* 内部 nav 自己滚，foot 永远贴底 */
  box-sizing: border-box;
}
.sidebar nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-right: -6px;          /* 给内部滚动条留位，不挤压文字 */
  padding-right: 6px;
}
.sb-foot { flex: 0 0 auto; }

/* 窄屏（侧栏变顶部横条）时恢复普通流，否则 100vh 会占满整屏 */
@media (max-width: 720px) {
  .sidebar { position: static; height: auto; overflow: visible; }
  .sidebar nav { overflow: visible; margin-right: 0; padding-right: 0; }
}

/* ============ 合同预览 / 导出 PDF ============ */
/* docx 里引用的字体名映射到本机字体：macOS 用 STFangsong/STSong，Windows 命中原生 仿宋/宋体 */
@font-face { font-family: "Calibri"; src: local("STFangsong"), local("FangSong"), local("仿宋"); }
@font-face { font-family: "Cambria"; src: local("STFangsong"), local("FangSong"), local("仿宋"); }
@font-face { font-family: "仿宋"; src: local("STFangsong"), local("FangSong"), local("仿宋"); }
@font-face { font-family: "宋体"; src: local("STSong"), local("Songti SC"), local("SimSun"); }
@font-face { font-family: "黑体"; src: local("STHeiti"), local("Heiti SC"), local("SimHei"); }

.pv-modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(15, 28, 46, .55);
  display: flex; flex-direction: column;
}
.pv-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; background: #fff;
  border-bottom: 1px solid #e3e8ef; flex: 0 0 auto;
}
.pv-bar strong { font-size: 15px; }
.pv-name { font-size: 13px; color: #5a6678; max-width: 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-tip { font-size: 12px; color: #93a0b4; flex: 1 1 auto; }
.pv-btns { display: flex; gap: 8px; flex: 0 0 auto; }
.pv-body {
  flex: 1 1 auto; overflow: auto; padding: 22px 8px 40px;
  background: #e9edf2;
}
.pv-loading { text-align: center; color: #5a6678; margin-top: 80px; }

/* 通用信息弹窗（合同发票 / 合同概要） */
.info-modal { position: fixed; inset: 0; z-index: 210; background: rgba(15, 28, 46, .55); display: flex; align-items: flex-start; justify-content: center; }
.info-box { background: #fff; margin: 56px 16px; border-radius: 10px; width: min(900px, 96vw); max-height: 82vh; display: flex; flex-direction: column; box-shadow: 0 18px 50px rgba(15, 28, 46, .3); }
.info-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-bottom: 1px solid #e3e8ef; flex: 0 0 auto; }
.info-bar strong { font-size: 15px; }
.info-body { overflow: auto; padding: 14px 18px 20px; }
.info-body table.data { width: 100%; }
.info-kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 14px; font-size: 13px; margin-bottom: 14px; }
.info-kv b { color: #5a6678; font-weight: 600; }
.info-empty { color: #8a94a6; padding: 18px 0; text-align: center; }
.btn-link { background: none; border: none; padding: 0; color: #2f6fd0; cursor: pointer; font-size: inherit; text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { color: #1d4f9e; }

/* docx 渲染容器的外观修正 */
.pv-body .docx-wrapper,
#printRoot .docx-wrapper {
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
}
.pv-body .docx-wrapper > section.docx,
#printRoot .docx-wrapper > section.docx {
  margin: 0 auto 18px !important;
  box-shadow: 0 2px 14px rgba(16, 32, 56, .16);
  overflow: visible !important;
}
.pv-body .docx-wrapper section.docx,
#printRoot .docx-wrapper section.docx {
  font-family: "仿宋", "STFangsong", "FangSong", serif;
}
.pv-body .docx-wrapper section.docx *,
#printRoot .docx-wrapper section.docx * {
  font-family: "仿宋", "STFangsong", "FangSong", serif !important;
}
/* docx-preview 用 word-spacing 模拟 Word 制表位，原始值可能超过行宽把行撑断 → 收窄 */
.pv-body .docx-wrapper .docx-tab-stop,
#printRoot .docx-wrapper .docx-tab-stop { word-spacing: 2em !important; }
/* 多栏容器会让分页失效 */
.pv-body .docx-wrapper section.docx article,
#printRoot .docx-wrapper section.docx article { column-count: auto !important; column-gap: normal !important; }
.pv-body .docx-wrapper section.docx tr,
#printRoot .docx-wrapper section.docx tr { break-inside: avoid; }

/* 打印专用容器：移出可视区但保留排版（display:none 下算不出分页） */
#printRoot { position: absolute; left: -20000px; top: 0; width: 210mm; }

@media print {
  @page { size: A4; margin: 0; }
  html, body { background: #fff !important; }
  body > *:not(#printRoot) { display: none !important; }
  #printRoot {
    display: block !important;
    position: static !important; left: auto !important; top: auto !important;
    width: 210mm !important;
    margin: 0 !important;
  }
  #printRoot .docx-wrapper > section.docx {
    margin: 0 !important;
    box-shadow: none !important;
    break-after: auto;
  }
}

/* 本合同纯文本补充条款及已保存合同的关联协议 */
#genericSupplementCard h3 { margin-bottom: 12px; }
#genericTerms, #contractSupplementTerms { display: block; width: 100%; min-height: 140px; resize: vertical; margin-top: 7px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; font: inherit; line-height: 1.7; }
#genericTerms:focus, #contractSupplementTerms:focus { outline: 2px solid var(--brand-2); outline-offset: 2px; }
#genericTermsCount, #contractSupplementCount { text-align: right; }
#contractSupplementDialog { width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 0; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fff; box-shadow: 0 24px 80px rgba(16, 38, 60, .25); }
#contractSupplementDialog::backdrop { background: rgba(15, 31, 49, .45); }
#contractSupplementDialog .supplement-dialog-body { padding: 24px; }
#contractSupplementDialog h2 { font-size: 19px; }
#contractSupplementList { margin: 16px 0; }
#contractSupplementSources { margin:16px 0; padding:14px; border:1px solid var(--line); border-radius:8px; overflow-wrap:anywhere; }
#contractSupplementSources[hidden] { display:none; }
#contractSupplementSources h3 { margin:0 0 10px; font-size:16px; }
#contractSupplementSources p { margin:8px 0; }
#contractSupplementList .supplement-record { padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
#contractSupplementList .supplement-record p { margin: 5px 0; white-space: pre-wrap; max-height: 220px; overflow: auto; }
#contractSupplementList .btn { margin-top: 7px; }
#contractSupplementEditor { margin-top: 20px; }
#contractSupplementDialog .supplement-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
@media (max-width: 600px) {
  #genericTerms, #contractSupplementTerms { font-size: 16px; }
  #contractSupplementDialog .supplement-dialog-body { padding: 18px; }
  #contractSupplementDialog .supplement-dialog-actions .btn { width: 100%; }
}

/* Older contracts: keep recognized values readable inside the horizontal scroller. */
#legacyTable{table-layout:auto}
#legacyTable .lg-no{min-width:185px}
#legacyTable .lg-client{min-width:260px}
#legacyTable .lg-amount{min-width:130px}
#legacyTable .lg-date{min-width:135px}
#legacyTable .lg-party{min-width:310px}
#legacyTable .lg-emp{min-width:150px}

/* Contract actions: fixed positions and dimensions, status does not resize a button. */
#contractTable td.contract-actions-cell, #contractTable th:last-child { width:300px;min-width:300px;max-width:300px; }
.contract-row-state { display:flex;gap:10px;justify-content:flex-start;min-height:22px;font-size:11px;color:var(--ink-2);margin:0 2px 5px; }
.contract-row-state span { max-width:170px;overflow:hidden;text-overflow:ellipsis; }
.contract-row-actions { display:grid;grid-template-columns:repeat(2,132px);grid-auto-rows:34px;gap:7px;justify-content:start; }
#contractTable .contract-row-actions .btn { width:132px;min-width:132px;height:34px;min-height:34px;margin:0;padding:0 8px;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;font-size:13px;line-height:1;transform:none;overflow:hidden;text-overflow:ellipsis; }
#contractTable .contract-row-actions .btn.secondary { background:transparent;border-color:transparent;box-shadow:none;color:var(--ink-2); }
#contractTable .contract-row-actions .btn.secondary:hover { background:#f1f5fa;border-color:#dce5ef; }
#contractTable .contract-row-actions .btn.danger { color:#c13b32; }
#contractTable .contract-row-actions .btn:disabled { opacity:.4; }
#contractSearch { width:280px;min-width:220px;height:38px; }
@media(max-width:1100px){#contractTable th:last-child,#contractTable td:last-child{position:static;box-shadow:none}}

/* Legacy import queue: readable summaries, edit only the item being corrected. */
#legacyModal .legacy-box{width:min(1480px,calc(100vw - 32px));max-height:calc(100vh - 40px);margin:20px 16px;overflow:hidden}
#legacyModal .legacy-body{padding:16px 22px;min-height:0;background:#f7f9fc}
#legacyDrop.legacy-drop{padding:14px 18px;display:flex;align-items:center;justify-content:center;gap:18px;margin:0;background:#fff;font-size:15px}
#legacyDrop .hint{margin:0;font-size:13px}
.legacy-toolbar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:16px 0 8px}
.legacy-toolbar>strong{margin-right:auto;font-size:14px}
.legacy-toolbar label{display:flex;align-items:center;gap:6px;font-size:13px}
.legacy-toolbar select{width:145px}
.legacy-guidance{margin:4px 0 14px!important;font-size:13px}
.legacy-list{display:grid;gap:12px}
.legacy-card{border:1px solid #dce5ef;background:#fff;border-radius:10px;padding:16px}
.legacy-card.issue{border-left:4px solid #e4ad4b}
.legacy-card.done{border-left:4px solid #429c6d}
.legacy-card-head{display:grid;grid-template-columns:minmax(0,1fr) 190px 260px;align-items:center;gap:18px}
.legacy-identity{display:grid;gap:4px;min-width:0;line-height:1.5}
.legacy-identity strong{font-size:15px;color:#1a4b76;overflow-wrap:anywhere}
.legacy-identity>span{font-size:16px;font-weight:600;overflow-wrap:anywhere}
.legacy-identity small{color:#7a8798;font-size:12px;white-space:normal;overflow-wrap:anywhere}
.legacy-card-meta{display:grid;grid-template-columns:1fr 1fr;gap:6px;font-size:13px}
.legacy-card-meta .legacy-badge{grid-column:1/-1;font-size:12px;color:#8c5f0b}
.legacy-card.done .legacy-badge{color:#267548}
.legacy-card-actions{display:flex;gap:7px;justify-content:flex-end;flex-wrap:wrap}
.legacy-card-actions .btn{min-width:72px;height:34px;margin:0}
.legacy-issues{margin-top:10px;padding:9px 12px;border-radius:6px;background:#fff7e8;font-size:13px;color:#946100;line-height:1.7;overflow-wrap:anywhere}
.legacy-issues .btn{margin:4px 0 0 10px}
.legacy-editor{display:grid;grid-template-columns:minmax(200px,1fr) minmax(240px,1.2fr) minmax(200px,1fr);gap:16px;margin-top:16px;padding-top:16px;border-top:1px solid #e8edf3}
.legacy-editor label{display:grid;gap:7px;min-width:0;font-size:13px;color:#52677f}
.legacy-editor input,.legacy-editor select{width:100%;min-width:0;height:40px;box-sizing:border-box;font-size:14px}
.legacy-wide{grid-column:span 2}
.legacy-empty{padding:34px;text-align:center;color:#7a8798;background:white;border-radius:8px}
.legacy-resume-note{font-size:12px;color:#60778e;margin:10px 0 0}
.legacy-footer{display:flex;align-items:center;gap:16px;padding:14px 22px;background:#fff;border-top:1px solid #dce5ef;flex-shrink:0}
.legacy-footer .btn{min-width:170px;height:42px;flex-shrink:0}
.legacy-footer .hint{margin:0;line-height:1.6}
@media(max-width:950px){.legacy-card-head{grid-template-columns:minmax(0,1fr) 170px}.legacy-card-actions{grid-column:1/-1;justify-content:flex-start}.legacy-editor{grid-template-columns:1fr 1fr}.legacy-wide{grid-column:span 2}#legacyDrop.legacy-drop{align-items:flex-start;flex-direction:column;gap:4px}}
@media(max-width:600px){.legacy-card-head,.legacy-editor{grid-template-columns:1fr}.legacy-wide{grid-column:auto}.legacy-card-meta{grid-template-columns:1fr 1fr}.legacy-footer{align-items:flex-start;flex-direction:column}#legacyModal .legacy-body{padding:12px}.legacy-identity>span{font-size:15px}}
#contractBulkDelete[hidden] { display:none !important; }

/* Batch import: details remain readable, preview is separate from the editor. */
#beTable {min-width:1740px;table-layout:fixed;} #beTable input {min-width:0;width:100%;box-sizing:border-box;} #beTable .be-type{font-size:12px;margin-top:5px;color:var(--ink-2);}
#beTable th:nth-child(4){min-width:240px;} #beTable th:nth-child(5){min-width:200px;} #beTable th:nth-child(6){min-width:180px;}
.batch-empty{padding:20px !important;color:#7d8ca2;text-align:center;}
.batch-import-drop{border:1px dashed #96b6d5;border-radius:10px;padding:15px 18px;margin-bottom:10px;display:flex;flex-wrap:wrap;gap:5px 20px;cursor:pointer;background:#f6faff;}
.batch-import-drop span{font-size:13px;color:#71819a;}.batch-import-drop.dragover{border-color:#174e7f;background:#eaf4ff;}.batch-import-drop[aria-disabled="true"]{opacity:.55;cursor:wait;}.batch-import-drop[hidden],#beImportFiles[hidden]{display:none !important;}
#beImportDialog{width:min(1500px,96vw);max-width:96vw;max-height:92vh;border:0;border-radius:16px;padding:22px;box-sizing:border-box;color:var(--ink);}
#beImportDialog::backdrop{background:#10243888}.batch-import-head,.batch-import-foot{display:flex;align-items:center;justify-content:space-between;gap:14px;}.batch-import-head h2{margin:0;font-size:22px;}.batch-import-preview{max-height:52vh;overflow:auto;margin:12px 0;}.batch-import-preview table{min-width:1280px;}.batch-import-preview th{position:sticky;top:0;background:#f0f4f9;z-index:1;}.batch-import-preview td{vertical-align:top;min-width:100px;}.batch-import-preview td:nth-child(4){min-width:230px;max-width:330px;white-space:normal;}.batch-import-preview input:not([type="checkbox"]){width:130px;box-sizing:border-box;}.batch-import-preview .imp-service{width:180px !important;}.batch-import-preview small{display:block;color:#7d8ca2;white-space:normal;}.batch-import-preview .import-issue{color:#b85d27;}.batch-import-preview input[type="checkbox"]{width:18px;height:18px;}.batch-import-preview .imp-money{width:110px !important;}

.legacy-owner-review{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;padding:12px 16px;background:#fff6e6;border-top:1px solid #f0d7a8;color:#775320}.legacy-owner-review>strong,.legacy-owner-review>span{flex-basis:100%;line-height:1.5}.legacy-owner-review .btn{height:auto;min-height:34px;white-space:normal;text-align:left}

/* Client search is visible before import tools; dialogs share one centered surface. */
#clientTransferDialog,#clientEditDialog,#clientDeleteDialog{position:fixed;inset:0;margin:auto;max-height:calc(100dvh - 48px);overflow:auto;transform:none;box-sizing:border-box}
.client-query-bar{display:flex;flex-wrap:wrap;align-items:center;gap:10px 12px}.client-query-bar>label{margin:0;font-weight:600}.client-query-bar>input{flex:1;min-width:280px;width:auto}.client-query-bar>.hint{flex-basis:100%;margin:0}
#clientEditForm label{display:block;margin:12px 0}#clientEditForm input,#clientEditForm textarea{width:100%;margin-top:5px}.client-edit-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
@media(max-width:650px){.client-query-bar>input{min-width:0;flex-basis:100%}.client-edit-grid{grid-template-columns:1fr}#clientTransferDialog,#clientEditDialog,#clientDeleteDialog{max-height:calc(100dvh - 24px)}}

/* Customer names open the profile; previous names remain visible and searchable. */
.client-name-link{display:inline-block;padding:3px 0;border:0;border-radius:3px;background:transparent;color:#174f80;font:inherit;font-weight:600;line-height:1.5;white-space:normal;overflow-wrap:anywhere;text-align:inherit;cursor:pointer;box-shadow:none}
.client-name-link:hover{text-decoration:underline;background:transparent}.client-name-link:focus-visible{outline:2px solid #2168a4;outline-offset:3px}.client-name-link:disabled{opacity:.6;cursor:wait}
.client-name-cell{min-width:240px}.client-former-names{margin:6px 0;color:#64748b;font-size:12px;line-height:1.6;white-space:normal;overflow-wrap:anywhere}.client-former-names>span{font-weight:600}#clientEditOldNames{background:#f5f8fc;padding:10px 12px;border-radius:8px;font-size:13px}

#contractCorrectionDialog{position:fixed;inset:0;margin:auto;width:min(900px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;box-sizing:border-box;transform:none}#contractCorrectionForm label{display:block;font-size:13px;font-weight:500;margin:8px 0}#contractCorrectionForm input,#contractCorrectionForm select,#contractCorrectionForm textarea{width:100%;margin-top:5px;box-sizing:border-box}.contract-correction-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 20px}.contract-correction-link{border:0;background:transparent;color:#205f96;font:inherit;font-size:12px;padding:5px 0;cursor:pointer;text-decoration:underline}.contract-correction-link:disabled{opacity:.5;cursor:wait}@media(max-width:650px){.contract-correction-grid{grid-template-columns:1fr}}

/* Resolve legacy customer archives without leaving the import queue. */
.legacy-resolution{margin:12px 0;padding:14px;border:1px solid #d8e3ef;border-radius:10px;background:#f7faff;display:grid;gap:10px}.legacy-resolution-fields{display:grid;grid-template-columns:repeat(2,minmax(180px,1fr));gap:12px}.legacy-resolution label{display:grid;gap:5px;font-size:13px}.legacy-resolution input,.legacy-resolution select{width:100%;min-width:0}.legacy-client-search{display:flex;gap:8px}.legacy-client-search input{flex:1}.legacy-client-match{display:flex;gap:10px;align-items:center;justify-content:space-between;border-top:1px solid #dce5ef;padding-top:10px}.legacy-client-match span{flex:1;overflow-wrap:anywhere}.legacy-resolution .hint{margin:0}.legacy-client-match .btn{flex-shrink:0}@media(max-width:700px){.legacy-resolution-fields{grid-template-columns:1fr}.legacy-client-match{flex-wrap:wrap}}

/* 合同记录紧凑布局：重复人员合并，时间放在合同号下，全量信息在桌面宽度内展示。 */
.contract-table-scroll { width:100%; }
.contract-table-scroll > #contractTable { width:100%; min-width:960px; table-layout:fixed; font-size:13px; }
#contractTable col.ct-select, #contractTable col.ct-index { width:32px; }
#contractTable col.ct-number { width:150px; }
#contractTable col.ct-type { width:72px; }
#contractTable col.ct-people { width:92px; }
#contractTable col.ct-amount { width:86px; }
#contractTable col.ct-payment { width:110px; }
#contractTable col.ct-actions { width:222px; }
#contractTable th, #contractTable td { padding:8px 6px; white-space:normal; overflow-wrap:anywhere; vertical-align:middle; line-height:1.5; }
#contractTable th { padding:9px 4px; font-size:12px; }
#contractTable th:last-child, #contractTable td.contract-actions-cell { position:static; width:auto; min-width:0; max-width:none; box-shadow:none; white-space:normal; }
#contractTable .contract-number-cell { font-variant-numeric:tabular-nums; }
#contractTable .contract-created-time { font-size:11px; white-space:nowrap; }
#contractTable .contract-client-cell, #contractTable .contract-client-name { text-align:left; }
#contractTable .contract-client-name { display:block; }
#contractTable .contract-client-cell .iw-contract-mark { text-align:left; margin-top:4px; font-size:11px; }
#contractTable .contract-list-secondary { font-size:11px; margin-top:3px; white-space:normal; }
#contractTable .contract-client-meta { display:flex; flex-wrap:wrap; gap:3px 8px; align-items:center; margin-top:3px; }
#contractTable .contract-client-meta .contract-list-secondary { margin:0; }
#contractTable .contract-correction-link { padding:0; font-size:11px; }
#contractTable td:nth-child(8) > span { display:block; }
#contractTable .contract-row-state { margin:0 0 4px; min-height:16px; line-height:1.4; }
#contractTable .contract-row-state span { max-width:none; overflow:visible; white-space:normal; text-overflow:clip; }
#contractTable .contract-row-actions { grid-template-columns:repeat(2,minmax(0,1fr)); grid-auto-rows:32px; gap:5px 6px; }
#contractTable .contract-row-actions .btn { width:100%; min-width:0; min-height:32px; height:32px; padding:0 4px; font-size:12px; border-radius:7px; }
#contractTable .contract-approval-state, #contractTable .contract-approval-hint { display:block; margin:0 0 4px; white-space:normal; }
#contractTable .contract-approval-row [data-view-approval] { width:100%; max-width:160px; margin:0; }
#contractScrollHint { display:none; }
@media(max-width:1260px) { #contractScrollHint { display:block; font-size:11px; margin:8px 0; } }
#contractTable col.ct-amount { width:100px; }
#contractTable col.ct-payment { width:124px; }
#contractTable th:first-child, #contractTable th:nth-child(2) { padding:9px 2px; font-size:11px; white-space:nowrap; }
#contractTable td:nth-child(7), #contractTable td:nth-child(8) { font-size:12px; font-variant-numeric:tabular-nums; white-space:nowrap; }
#contractTable td:nth-child(8) > span { white-space:nowrap; }

/* 用户自行调整合同列宽；数值按当前浏览器与登录账号独立保存。 */
.contract-columns-tools { display:flex; align-items:center; flex-wrap:wrap; justify-content:space-between; gap:8px; margin:12px 0 8px; color:var(--ink-2); font-size:12px; }
.contract-columns-tools .btn { padding:4px 9px; font-size:12px; }
.contract-columns-tools .column-save-failed { color:var(--danger); }
#contractTable thead th, #contractTable thead th:last-child { position:relative; padding-right:8px; }
#contractTable .contract-column-handle { position:absolute; top:0; right:0; bottom:0; width:12px; z-index:3; cursor:col-resize; touch-action:none; user-select:none; }
#contractTable .contract-column-handle::after { content:''; position:absolute; top:23%; bottom:23%; right:0; width:2px; border-radius:2px; background:#aabbd0; }
#contractTable .contract-column-handle:hover::after, #contractTable .contract-column-handle:focus-visible::after { background:var(--brand-2); width:3px; }
#contractTable .contract-column-handle:focus-visible { outline:2px solid var(--brand-2); outline-offset:-2px; border-radius:2px; }
#contractTable.column-resizing, #contractTable.column-resizing * { cursor:col-resize !important; user-select:none !important; }
#contractTable th:first-child, #contractTable th:nth-child(2) { padding-right:2px; }

#contractTable.columns-customized td:nth-child(7), #contractTable.columns-customized td:nth-child(8), #contractTable.columns-customized td:nth-child(8) > span { white-space:normal; overflow-wrap:anywhere; }
#contractTable.columns-customized .contract-row-actions .btn { white-space:normal; line-height:1.1; }

/* 合同记录按页展示，上下翻页控件共用同一状态。 */
.contract-pagination { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px 16px; margin:12px 0; font-size:12px; color:var(--ink-2); }
.contract-pagination label { display:flex; align-items:center; gap:7px; margin:0; white-space:nowrap; }
.contract-pagination select { width:auto; min-width:84px; padding:6px 28px 6px 10px; }
.contract-page-buttons { display:flex; align-items:center; gap:8px; }
.contract-pagination [data-contract-page-info] { font-variant-numeric:tabular-nums; }
@media (max-width:600px) { .contract-pagination { gap:10px; } .contract-pagination [data-contract-page-info] { flex:1 1 100%; order:3; } }


/* 项目框架协议：附件一 / 附件二 录入 */
.pfa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 8px 0 4px; }
.pfa-sub { margin: 18px 0 8px; font-size: 14px; color: var(--ink); }
.pfa-sub small { font-weight: 400; color: #8a94a6; margin-left: 6px; font-size: 12px; }
.pfa-add { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.pfa-add input { flex: 1 1 260px; min-width: 200px; }
.pfa-toggle { margin: 6px 0 8px; font-size: 13px; color: var(--ink-2); }
#pfaA1table .a1name, #pfaA2table .a2svc { min-width: 200px; }
.pfa-disabled { opacity: .45; }
.pfa-block { border: 1px solid #d3dcea; border-left: 4px solid #1f4e79; border-radius: 10px; padding: 10px 14px 14px; background: #f7fafd; margin-top: 20px; }
.pfa-sub-strong { color: #13345c; }
.pfa-sub-strong small { color: #6b7a90; }

/* 客户修改版比对 */
.rev-toolbar { display:flex; gap:12px; align-items:center; margin:8px 0 12px; flex-wrap:wrap; }
.rev-summary { background:#f7fafd; border:1px solid #d3dcea; border-left:4px solid #1f4e79; border-radius:8px; padding:10px 12px; margin-bottom:12px; font-size:13px; }
.rev-list { max-height:52vh; overflow:auto; border:1px solid var(--line); border-radius:8px; }
.rev-item { padding:10px 12px; border-bottom:1px solid var(--line); font-size:13px; }
.rev-item:last-child { border-bottom:0; }
.rev-item .rev-tag { display:inline-block; font-size:12px; padding:1px 6px; border-radius:4px; margin-right:6px; }
.rev-tag.add { background:#e8f7ee; color:#1f7a45; }
.rev-tag.del { background:#fdecea; color:#b3261e; }
.rev-tag.mod { background:#fff4e5; color:#a15c00; }
.rev-tag.risk-high { background:#b3261e; color:#fff; }
.rev-tag.risk-medium { background:#e07a00; color:#fff; }
.rev-tag.risk-low { background:#5b6b82; color:#fff; }
.rev-old { color:#b3261e; text-decoration:line-through; display:block; margin-top:4px; }
.rev-new { color:#1f7a45; display:block; margin-top:2px; }
/* 只把真正改动的那几个字拎出来，其余保持原样式 */
.rev-old mark.rev-mark-del { background:#fadcda; color:#8d1b14; padding:0 1px; border-radius:2px; }
.rev-new mark.rev-mark-add { background:#d6f0e0; color:#0f5f36; font-weight:600; padding:0 1px; border-radius:2px; }
.rev-actions { margin-top:12px; display:flex; gap:12px; align-items:center; }

/* 客户修改版审批：风险清单 */
.apv-risk-head { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin:10px 0 8px; font-size:13px; color:#243447; }
.apv-risk-badge { font-size:12px; padding:1px 8px; border-radius:10px; color:#fff; }
.apv-risk-badge.high { background:#c0392b; }
.apv-risk-badge.medium { background:#d98324; }
.apv-risk-badge.low { background:#6b7f99; }
.apv-risk-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
.apv-risk-item { border-left:3px solid #d0d7e2; background:#fafbfd; padding:6px 10px; border-radius:0 6px 6px 0; font-size:12.5px; line-height:1.55; }
.apv-risk-item.risk-high { border-left-color:#c0392b; background:#fdf3f2; }
.apv-risk-item.risk-medium { border-left-color:#d98324; background:#fdf8f1; }
.apv-risk-tag { display:inline-block; font-size:11px; padding:0 6px; border-radius:3px; margin-right:6px; background:#eef1f6; color:#4a5a70; }
.apv-risk-tag.add { background:#e8f7ee; color:#1f7a45; }
.apv-risk-tag.del { background:#fdecea; color:#b3261e; }
.apv-risk-tag.mod { background:#fff4e5; color:#a15c00; }
.apv-risk-old { color:#b3261e; display:block; margin-top:2px; }
.apv-risk-new { color:#1f7a45; display:block; margin-top:1px; }
.apv-risk-more { font-size:12px; color:#6b7f99; margin-top:6px; }
.apv-risk-none { font-size:12.5px; color:#6b7f99; }
.apv-risk-low summary { cursor:pointer; font-size:12px; color:#6b7f99; margin-top:8px; }

/* 合同记录：委托内容列 */
table.data .contract-content-cell { color: #445266; font-size: 12.5px; line-height: 1.5; }

/* 客户修改版比对：修改前后标签 + 解读 */
.rev-line { display: flex; gap: 8px; align-items: flex-start; margin-top: 4px; }
.rev-label { flex: 0 0 auto; font-size: 12px; color: #6b7f99; background: #eef1f6; border-radius: 3px; padding: 0 6px; line-height: 18px; }
.rev-line .rev-old, .rev-line .rev-new { margin: 0; flex: 1 1 auto; }
.rev-note { margin-top: 6px; font-size: 12.5px; color: #243447; background: #f4f7fb; border-left: 3px solid #98a8bf; padding: 4px 8px; border-radius: 0 4px 4px 0; }

/* 实时提醒：侧栏待办角标 + 桌面通知开关 */
.nav-item { position: relative; }
.nav-badge { position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #d92d20; color: #fff;
  font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; letter-spacing: 0; }
.nav-item.active .nav-badge { background: #b42318; }
.live-notify { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.live-notify span { flex: 1 1 240px; min-width: 200px; }

/* 立案方式弹窗：上方合同文件，下方三种立案方式 */
.filing-start-dialog { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 40px); margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: #fff; box-shadow: 0 24px 80px rgba(16, 38, 60, .25); }
.filing-start-dialog::backdrop { background: rgba(15, 31, 49, .45); }
#contractWorkflowBody { line-height: 1.65; overflow-wrap: anywhere; }
.filing-start-body { padding: 24px 26px; max-height: calc(100vh - 40px); overflow-y: auto; }
.filing-start-body h2 { margin: 0 0 4px; font-size: 19px; }
.filing-start-body > .hint { margin: 0 0 14px; }
.fs-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.fs-block h3 { margin: 0 0 10px; font-size: 15px; }
.fs-drop { margin-bottom: 8px; }
.fs-scan-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 0; }
.fs-scan { display: flex; align-items: center; gap: 8px; margin: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fafcff; font-size: 13px; color: var(--ink); }
.fs-scan input[type=checkbox] { flex: 0 0 auto; box-sizing: border-box; width: 16px; height: 16px; min-width: 16px; padding: 0; margin: 0; border-radius: 3px; }
.fs-scan span { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; line-height: 1.5; }
.fs-scan small { flex: 0 0 auto; color: var(--ink-2); }
.fs-mode-label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--ink-2); }
#fsMode { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; }
#fsMode:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(29, 99, 168, .12); }
.fs-pay { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; }
.fs-pay label { flex: 1 1 200px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-2); }
.fs-pay input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; color: var(--ink); background: #fff; }
.fs-reason { margin-top: 12px; }
.fs-reason label { display: block; font-size: 13px; color: var(--ink-2); }
.fs-reason textarea { display: block; width: 100%; margin-top: 5px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; color: var(--ink); background: #fff; resize: vertical; }
.fs-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.fs-gate-route { margin: 10px 0 0; padding-left: 20px; font-size: 13px; line-height: 1.9; }
.fs-gate-route li.current { color: var(--brand-2); font-weight: 600; }
.fs-gate-route small { color: var(--ink-2); font-weight: 400; margin-left: 6px; }
.fs-gate-actions { display: flex; gap: 10px; margin-top: 12px; }
.pi-entry-summary p { margin: 4px 0; }
#filingStartDialog [hidden] { display: none !important; }

/* Header filters share the existing column layout; resize handles keep their own hit area. */
.contract-header-filter-tools { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:8px 0; color:var(--ink-2); font-size:12px; }
.contract-filter-heading { display:inline-flex; align-items:center; justify-content:center; gap:2px; max-width:100%; padding-right:6px; }
#contractTable .contract-filter-button { flex-shrink:0; width:22px; height:24px; padding:3px; border:1px solid transparent; border-radius:5px; background:transparent; color:#61768c; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; }
#contractTable .contract-filter-button svg { fill:none; stroke:currentColor; stroke-width:1.5; }
#contractTable .contract-filter-button:hover, #contractTable .contract-filter-button.active { color:var(--brand-2); background:#e4effb; border-color:#acc4e1; }
#contractTable .contract-filter-button.active svg { fill:currentColor; }
#contractTable .contract-filter-button:focus-visible { outline:2px solid var(--brand-2); outline-offset:1px; }
.contract-header-filter-panel[hidden] { display:none; }
.contract-header-filter-panel { position:fixed; z-index:2500; box-sizing:border-box; max-height:calc(100vh - 24px); overflow:auto; padding:16px; background:white; border:1px solid #c7d5e5; border-radius:12px; box-shadow:0 10px 34px #102e5140; color:var(--ink); font-size:13px; }
.contract-header-filter-panel h3 { margin:0 0 14px; font-size:15px; }
.contract-header-filter-panel label { display:block; margin-bottom:12px; font-weight:500; }
.contract-header-filter-panel input, .contract-header-filter-panel select { width:100%; box-sizing:border-box; margin-top:5px; padding:8px; min-height:36px; font-size:14px; }
.contract-filter-range { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; }
.contract-header-filter-panel fieldset { border:0; padding:0; margin:0; }
.contract-header-filter-panel legend { margin:0 0 10px; color:var(--ink-2); }
.contract-header-filter-panel .contract-filter-check { display:flex; gap:8px; align-items:center; }
.contract-header-filter-panel .contract-filter-check input { width:16px; min-height:16px; margin:0; }
.contract-filter-error { margin:0 0 10px; color:#b23b3b; font-size:12px; }
.contract-filter-error:empty { display:none; }
.contract-filter-actions { display:flex; gap:6px; justify-content:flex-end; flex-wrap:wrap; margin-top:4px; }

.contract-void-dialog { width:min(540px,calc(100vw - 32px)); box-sizing:border-box; border:1px solid #c7d5e5; border-radius:14px; padding:24px; color:var(--ink); }
.contract-void-dialog::backdrop { background:#122b4b55; }
.contract-void-dialog textarea { width:100%; box-sizing:border-box; margin:8px 0; }
.contract-void-dialog [role="status"] { color:#b23b3b; }
.contract-void-badge { display:inline-block; color:#84552a; background:#fff1dc; border-radius:4px; padding:2px 5px; font-size:11px; }
.contract-void-detail { display:block; font-size:11px; color:var(--ink-2); margin-top:4px; }
#contractTable .contract-void-row td { background:#f6f7f9; color:#6d7786; }
#contractTable .contract-void-action { color:#946023; }

/* 合同操作仅在当前行显示；工具条脱离文档流，悬停不改变行高。 */
@media (hover:hover) and (pointer:fine) {
  #contractTable tbody tr:has(.contract-row-actions) > td { height:78px; box-sizing:border-box; }
  #contractTable td.contract-actions-cell:has(.contract-row-actions) { position:relative; }
  #contractTable .contract-actions-cell:has(.contract-row-actions) .contract-row-state { margin:0 0 46px; }
  #contractTable .contract-row-actions {
    position:absolute; right:6px; bottom:6px; z-index:5;
    display:flex; flex-wrap:nowrap; gap:5px; width:max-content;
    max-width:min(820px,calc(100vw - 350px)); overflow-x:auto;
    padding:5px; border:1px solid #dce5ef; border-radius:9px;
    background:var(--paper,#fff); box-shadow:0 3px 12px rgba(22,48,80,.12);
    opacity:0; pointer-events:none;
  }
  #contractTable .contract-row-actions .btn { flex:0 0 auto; width:auto; min-width:76px; padding:0 10px; white-space:nowrap; }
  #contractTable tbody tr:hover > td { background:#f4f8fd; }
  #contractTable tbody tr:hover .contract-row-actions,
  #contractTable tbody tr:focus-within .contract-row-actions { opacity:1; pointer-events:auto; }
  #contractTable tbody tr:hover .contract-actions-cell,
  #contractTable tbody tr:focus-within .contract-actions-cell { z-index:6; }
}

/* The approved illustration fills the home banner; its lettering is part of the image. */
#view-home .november-hero[hidden]{display:none!important}
#view-home .november-hero{position:relative;overflow:hidden;margin:0 0 20px;border-radius:14px;background:#f5e1b6;box-shadow:0 6px 24px #754b1010}
#view-home .november-poster{display:block;width:100%;height:auto;object-fit:contain}
#view-home .november-caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
#view-home[data-home-month="11"]>.stat-grid>.stat{border-color:#e8d6b5;border-top:3px solid #c69b52;background:linear-gradient(180deg,#fffaf0 0,#fff 50%)}
#view-home[data-home-month="11"] .home-grid>.card,#view-home[data-home-month="11"] .home-grid>div>.card{border-color:#e9dec9}
@media(max-width:600px){#view-home .november-hero{border-radius:10px;margin-bottom:16px}#view-home[data-home-month="11"]>.stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}#view-home[data-home-month="11"]>.stat-grid>.stat:last-child{grid-column:1/-1}}
