/* 谷创科技数字化办公平台 —— 全局样式
   设计目标：专业、克制、信息密度高；浅色为主，蓝色主色，符合企业办公系统习惯 */

:root {
  --brand: #1f6feb;
  --brand-2: #2f7ef7;
  --brand-dark: #1653b8;
  --brand-soft: #e8f1ff;
  --ok: #18a058;
  --ok-soft: #e7f6ee;
  --warn: #f59e0b;
  --warn-soft: #fef3e2;
  --danger: #f5222d;
  --danger-soft: #fdecec;
  --info: #6b7280;

  --bg: #f2f4f7;
  --panel: #ffffff;
  --border: #e4e7ed;
  --border-2: #eef0f4;
  --text: #1f2329;
  --text-2: #5a6472;
  --text-3: #8a94a6;

  --side-bg: #21334d;
  --side-bg-2: #1a2941;
  --side-text: #c3ccda;
  --side-active: #2f7ef7;

  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c9cfd8; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #aab2bd; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- 登录 */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(1200px 600px at 15% 10%, rgba(47,126,247,.16), transparent 60%),
    radial-gradient(900px 500px at 85% 85%, rgba(24,160,88,.12), transparent 60%),
    linear-gradient(135deg, #17305a 0%, #1f4b8f 45%, #2f7ef7 100%);
  padding: 24px;
}
.login-box {
  width: 100%; max-width: 940px; background: #fff; border-radius: 14px;
  box-shadow: var(--shadow-lg); display: grid; grid-template-columns: 1.05fr .95fr;
  overflow: hidden; min-height: 500px;
}
.login-side {
  background: linear-gradient(160deg, #1f4b8f, #2f7ef7);
  color: #fff; padding: 40px 36px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-side h1 { font-size: 26px; margin: 0 0 10px; letter-spacing: 1px; font-weight: 600; }
.login-side .sub { opacity: .85; font-size: 13px; line-height: 1.9; }
.login-side .feat { margin-top: 26px; display: grid; gap: 10px; }
.login-side .feat div {
  background: rgba(255,255,255,.12); border-radius: var(--radius);
  padding: 9px 12px; font-size: 13px; backdrop-filter: blur(2px);
}
.login-side .foot { font-size: 12px; opacity: .7; }
.login-form { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.login-form h2 { margin: 0 0 6px; font-size: 20px; }
.login-form .tip { color: var(--text-3); font-size: 13px; margin-bottom: 26px; }
.login-form .btn-login { margin-top: 8px; height: 42px; font-size: 15px; }
.login-form .err {
  color: var(--danger); background: var(--danger-soft); border-radius: var(--radius-sm);
  padding: 8px 12px; font-size: 13px; margin-bottom: 14px; display: none;
}
.login-form .err.show { display: block; }
@media (max-width: 860px) {
  .login-box { grid-template-columns: 1fr; }
  .login-side { display: none; }
}

/* ---------------------------------------------------------------- 布局 */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; flex: 0 0 216px; background: var(--side-bg); color: var(--side-text);
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 30;
}
.sidebar .logo {
  height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 16px;
  background: var(--side-bg-2); color: #fff; font-size: 15px; font-weight: 600; letter-spacing: .5px;
}
.sidebar .logo .dot {
  width: 26px; height: 26px; border-radius: 6px; background: linear-gradient(135deg, #2f7ef7, #18a058);
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
}
.side-nav { flex: 1; overflow-y: auto; padding: 8px 0 20px; }
/* 一级菜单（大类）：可点击展开/收起 */
.side-group {
  display: flex; align-items: center; gap: 9px;
  margin: 3px 8px; padding: 10px 10px; border-radius: 7px;
  font-size: 13.5px; font-weight: 500; color: #c6d0de; cursor: pointer;
  user-select: none; transition: background .15s, color .15s;
}
.side-group:hover { background: rgba(255,255,255,.07); color: #fff; }
.side-group .sg-ico { width: 17px; text-align: center; opacity: .85; font-size: 13px; }
.side-group .sg-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-group .sg-count {
  min-width: 18px; padding: 0 5px; height: 16px; line-height: 16px; text-align: center;
  font-size: 10.5px; border-radius: 8px; background: rgba(255,255,255,.1); color: #9fb0c6;
}
.side-group .sg-arrow { font-size: 13px; color: #7c8ba1; transition: transform .2s ease; transform: rotate(0deg); }
.side-group.open { color: #fff; background: rgba(255,255,255,.05); }
.side-group.open .sg-arrow { transform: rotate(90deg); }
/* 二级菜单容器：默认收起 */
.side-sub { max-height: 0; overflow: hidden; transition: max-height .22s ease; }
.side-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 34px; cursor: pointer;
  font-size: 13px; color: #aebbcb; border-left: 3px solid transparent; white-space: nowrap;
}
.side-item .dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .45; flex: none; }
.side-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-item.active { background: rgba(47,126,247,.18); color: #fff; border-left-color: var(--side-active); }
.side-item.active .dot { opacity: 1; background: var(--side-active); }
.side-foot {
  padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08);
  font-size: 12px; color: #7c8ba1;
}
.side-foot-links { display: flex; gap: 14px; margin-top: 6px; }
.side-foot-links a { color: #9fb0c4; text-decoration: none; cursor: pointer; }
.side-foot-links a:hover { color: #fff; }
.side-foot-links a.danger:hover { color: #ff9c9c; }

.main { flex: 1; margin-left: 216px; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; background: var(--panel); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 20px; position: sticky; top: 0; z-index: 20;
}
.topbar .crumb { font-size: 15px; font-weight: 600; }
.topbar .crumb small { font-weight: 400; color: var(--text-3); font-size: 12px; margin-left: 8px; }
.topbar .spacer { flex: 1; }
.topbar .search {
  width: 260px; height: 32px; border: 1px solid var(--border); border-radius: 16px;
  padding: 0 12px; font-size: 13px; outline: none; background: #fafbfc;
}
.topbar .search:focus { border-color: var(--brand); background: #fff; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 50%; border: none; background: transparent;
  cursor: pointer; color: var(--text-2); font-size: 16px; position: relative;
}
.icon-btn:hover { background: var(--border-2); }
.badge-dot {
  position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; border-radius: 8px;
  background: var(--danger); color: #fff; font-size: 10px; line-height: 16px; text-align: center; padding: 0 4px;
}
.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 18px; }
.user-chip:hover { background: var(--border-2); }
.user-chip .uc-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-chip .uc-name { font-size: 13px; color: var(--text); }
.user-chip .uc-role { font-size: 11px; color: var(--text-3); }
.user-chip .uc-caret { font-size: 10px; color: var(--text-3); margin-left: 2px; }

/* 账号下拉菜单 */
.user-wrap { position: relative; }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 198px; z-index: 60;
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 28px rgba(16,24,40,.14); padding: 6px; display: none;
}
.user-menu.show { display: block; }
.user-menu .um-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border-2); margin-bottom: 6px; }
.user-menu .um-name { font-size: 13px; font-weight: 600; color: var(--text); }
.user-menu .um-sub { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.user-menu .um-item { padding: 8px 10px; border-radius: 7px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.user-menu .um-item:hover { background: var(--border-2); color: var(--text); }
.user-menu .um-item.danger { color: var(--danger); }
.user-menu .um-item.danger:hover { background: var(--danger-soft); color: var(--danger); }
.user-menu .um-sep { height: 1px; background: var(--border-2); margin: 6px 4px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-size: 12px; font-weight: 600;
}
.content { padding: 16px 20px 40px; flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- 组件 */
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.card-head {
  padding: 12px 16px; border-bottom: 1px solid var(--border-2);
  display: flex; align-items: center; gap: 10px;
}
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card-head .spacer { flex: 1; }
.card-body { padding: 16px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1280px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g6 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 900px) { .g2, .g3, .g4, .g6 { grid-template-columns: 1fr; } }

.stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.stat .label { color: var(--text-3); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 24px; font-weight: 600; margin-top: 6px; letter-spacing: -.5px; }
.stat .value.up { color: var(--danger); }
.stat .value.down { color: var(--ok); }
.stat .sub { color: var(--text-3); font-size: 12px; margin-top: 4px; }
.stat .bar { height: 4px; border-radius: 2px; background: var(--border-2); margin-top: 10px; overflow: hidden; }
.stat .bar i { display: block; height: 100%; background: var(--brand); }

.btn {
  height: 32px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: #fff; color: var(--text); cursor: pointer; font-size: 13px; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: .15s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); color: #fff; }
.btn.danger { color: var(--danger); border-color: #f5c6c7; }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.ok { color: var(--ok); border-color: #bfe5cd; }
.btn.ok:hover { background: var(--ok-soft); border-color: var(--ok); }
.btn.sm { height: 26px; padding: 0 10px; font-size: 12.5px; }
.btn.lg { height: 38px; padding: 0 20px; font-size: 14px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

.input, .select, .textarea {
  width: 100%; height: 32px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 0 10px; font-size: 13px; font-family: inherit; color: var(--text); background: #fff; outline: none;
}
.textarea { height: auto; min-height: 72px; padding: 8px 10px; line-height: 1.6; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(47,126,247,.12); }
.input:disabled, .select:disabled { background: #f5f6f8; color: var(--text-3); }
label.fl { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; }
label.fl .req { color: var(--danger); }

.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filters .input, .filters .select { width: auto; min-width: 130px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left; padding: 10px 12px; background: #fafbfc; color: var(--text-2);
  font-weight: 600; font-size: 12.5px; border-bottom: 1px solid var(--border); white-space: nowrap;
  position: sticky; top: 0; z-index: 1;
}
table.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
table.tbl tbody tr:hover { background: #f8fafc; }
table.tbl tbody tr.clickable { cursor: pointer; }
table.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .center { text-align: center; }
.table-wrap { overflow: auto; max-height: calc(100vh - 260px); }
.table-foot {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-top: 1px solid var(--border-2); font-size: 12.5px; color: var(--text-2);
}
.table-foot .spacer { flex: 1; }
.pager { display: flex; gap: 4px; align-items: center; }
.pager button {
  min-width: 28px; height: 28px; border: 1px solid var(--border); background: #fff;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 12.5px; color: var(--text-2);
}
.pager button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

.tag {
  display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px;
  background: var(--border-2); color: var(--text-2); white-space: nowrap;
}
.tag.blue { background: var(--brand-soft); color: var(--brand); }
.tag.green { background: var(--ok-soft); color: var(--ok); }
.tag.orange { background: var(--warn-soft); color: #b26a00; }
.tag.red { background: var(--danger-soft); color: var(--danger); }
.tag.gray { background: #f1f2f4; color: var(--text-3); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 14px; flex-wrap: wrap; }
.tabs .tab {
  padding: 8px 16px; cursor: pointer; font-size: 13.5px; color: var(--text-2);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs .tab:hover { color: var(--brand); }
.tabs .tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.empty { padding: 48px 16px; text-align: center; color: var(--text-3); font-size: 13px; }
.empty .big { font-size: 34px; opacity: .35; margin-bottom: 8px; }

/* 弹窗 / 抽屉 */
.mask { position: fixed; inset: 0; background: rgba(16,24,40,.45); z-index: 100; display: flex; }
.mask.center { align-items: center; justify-content: center; }
.modal {
  background: #fff; border-radius: 10px; box-shadow: var(--shadow-lg);
  width: 560px; max-width: calc(100vw - 40px); max-height: calc(100vh - 80px);
  display: flex; flex-direction: column; animation: pop .16s ease-out;
}
.modal.wide { width: 880px; }
.modal.narrow { width: 420px; }
/* 附件预览：大窗 + 无内边距，PDF 交给浏览器内置阅读器渲染 */
.modal.viewer { width: 94vw; max-width: 1320px; height: 91vh; }
.modal.viewer .modal-body { padding: 0; display: flex; overflow: hidden; }
.viewer { display: flex; flex-direction: column; flex: 1; min-height: 0; width: 100%; }
.viewer-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  border-bottom: 1px solid var(--border-2); background: #fafbfc; flex: none;
}
.viewer-bar .vb-name { font-size: 13px; font-weight: 600; max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-bar .vb-meta { white-space: nowrap; }
.viewer-bar .spacer { flex: 1; }
.viewer-stage { position: relative; flex: 1; min-height: 0; display: flex; background: #525659; }
.viewer-frame { flex: 1; width: 100%; height: 100%; border: 0; background: #525659; }
.viewer-img { flex: 1; width: 100%; height: 100%; object-fit: contain; background: #1c1f24; }
.viewer-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  gap: 8px; color: #dfe4ea; font-size: 13px; background: #525659; z-index: 2;
}
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head {
  padding: 14px 18px; border-bottom: 1px solid var(--border-2); font-size: 15px; font-weight: 600;
  display: flex; align-items: center;
}
.modal-head .spacer { flex: 1; }
.modal-head .x { cursor: pointer; color: var(--text-3); font-size: 18px; line-height: 1; }
.modal-head .x:hover { color: var(--text); }
.modal-body { padding: 18px; overflow: auto; flex: 1; }
.modal-foot {
  padding: 12px 18px; border-top: 1px solid var(--border-2); display: flex; justify-content: flex-end; gap: 8px;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 620px; max-width: calc(100vw - 40px);
  background: #fff; box-shadow: var(--shadow-lg); z-index: 101; display: flex; flex-direction: column;
  animation: slideIn .18s ease-out;
}
@keyframes slideIn { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.toast-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 300; display: grid; gap: 8px; }
.toast {
  background: #fff; border: 1px solid var(--border); border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 10px 18px; font-size: 13.5px;
  animation: pop .16s ease-out; min-width: 200px;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warn); }

/* 图表 */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }

/* 时间线 */
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 1px; background: var(--border); }
.timeline .item { position: relative; padding-bottom: 16px; }
.timeline .item::before {
  content: ''; position: absolute; left: -19px; top: 5px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--brand); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border);
}
.timeline .item .t { font-size: 12.5px; color: var(--text-3); }
.timeline .item .c { font-size: 13.5px; margin-top: 3px; }

.kv { display: grid; grid-template-columns: 96px 1fr; gap: 8px 12px; font-size: 13.5px; }
.kv .k { color: var(--text-3); }
.desc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.desc-item { border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.desc-item .k { font-size: 12px; color: var(--text-3); }
.desc-item .v { font-size: 14px; margin-top: 3px; }

.progress { height: 6px; background: var(--border-2); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--brand); }
.progress.ok i { background: var(--ok); }
.progress.warn i { background: var(--warn); }

.loading { padding: 40px; text-align: center; color: var(--text-3); font-size: 13px; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.list-item { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border-2); font-size: 13px; }
.list-item:last-child { border-bottom: none; }
.list-item .spacer { flex: 1; }
.list-item .tt { color: var(--text); }
.list-item .mm { color: var(--text-3); font-size: 12px; }

.section-title { font-size: 13px; font-weight: 600; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ''; width: 3px; height: 13px; background: var(--brand); border-radius: 2px; }

.mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb8 { margin-bottom: 8px; }
.flex { display: flex; gap: 10px; align-items: center; }
.flex .spacer { flex: 1; }

/* ============================================================
 * 财务报表（金蝶风格版式）
 * ============================================================ */
.rpt {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 26px 18px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}
.rpt-head { text-align: center; margin: 4px 0 14px; }
.rpt-title { font-size: 22px; font-weight: 700; letter-spacing: 8px; margin: 0 0 10px; color: var(--text-1); }
.rpt-sub { display: flex; justify-content: space-between; font-size: 12.5px; color: #475467; padding: 0 4px; }
.rpt-table { width: 100%; border-collapse: collapse; font-size: 12.5px; background: #fff; }
.rpt-table th, .rpt-table td { border: 1px solid #d5dbe7; padding: 6px 9px; line-height: 1.5; }
.rpt-table thead th { background: #f3f6fb; font-weight: 600; color: #344054; text-align: center; white-space: nowrap; }
.rpt-table td.num, .rpt-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rpt-table .center { text-align: center; }
.rpt-table td.strong { font-weight: 700; }
.rpt-table tbody tr.rpt-total { background: #fafcff; }
.rpt-table tbody tr.rpt-total td { font-weight: 700; }
.rpt-table tbody tr.rpt-group td { background: #eef3fa; font-weight: 700; }
.rpt-table .line { color: #667085; width: 52px; }
.rpt-table .name.lv2 { padding-left: 26px; }
.rpt-table .name.lv3 { padding-left: 44px; }
.rpt-table tbody tr:hover { background: #f7fbff; }
.rpt-check {
  display: flex; gap: 28px; flex-wrap: wrap; align-items: center;
  margin-top: 12px; font-size: 12.5px; color: #475467;
}
.rpt-check b { color: #101828; font-variant-numeric: tabular-nums; }
.rpt-check .ok { color: #15803d; font-weight: 600; }
.rpt-check .bad { color: #b42318; font-weight: 600; }
.rpt-foot { display: flex; justify-content: space-between; margin-top: 14px; font-size: 11.5px; color: #98a2b3; }
.rpt-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.rpt-toolbar .spacer { flex: 1; }
table.table.vt td { vertical-align: middle; }

/* 期末结账检查清单 */
.check-list { display: flex; flex-direction: column; gap: 8px; }
.check-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border-2); background: #fbfcfe;
}
.check-item .ico { width: 20px; text-align: center; font-weight: 700; }
.check-item .tt { font-weight: 500; }
.check-item .dd { margin-left: auto; font-size: 12px; }
.check-item.ok { border-color: #bbf7d0; background: #f6fef9; }
.check-item.ok .ico { color: #15803d; }
.check-item.bad { border-color: #fecdca; background: #fffbfa; }
.check-item.bad .ico { color: #b42318; }

/* 打印：只输出报表本体，隐藏导航与工具栏 */
@media print {
  .sidebar, .topbar, .page-head, .rpt-toolbar, .table-foot, .toast-wrap { display: none !important; }
  .app { display: block; }
  .main { margin-left: 0 !important; }
  .content { padding: 0 !important; }
  .rpt { border: 0; border-radius: 0; box-shadow: none; padding: 0; }
  .rpt-table th, .rpt-table td { border-color: #666; }
  body { background: #fff; }
}

/* ============================================================
 * 合同附件 / OCR / 付款条款 / 合同执行
 * ============================================================ */

/* 通用小尺寸按钮、提示条 */
.btn.xs { height: 24px; padding: 0 8px; font-size: 12px; border-radius: 5px; }
.mb12 { margin-bottom: 12px; }
.text-danger { color: var(--danger); }
.alert { padding: 9px 12px; border-radius: 7px; font-size: 12.5px; line-height: 1.6; }
.alert.err { background: var(--danger-soft); color: var(--danger); border: 1px solid #fecdca; }
.alert.warn { background: var(--warn-soft); color: #b26a00; border: 1px solid #fde3b0; }

/* 分段切换（执行中 / 已执行完毕） */
.seg { display: inline-flex; background: #f1f3f7; border-radius: 8px; padding: 3px; gap: 2px; }
.seg-btn {
  border: 0; background: transparent; padding: 6px 16px; border-radius: 6px;
  font-size: 13px; color: var(--text-2); cursor: pointer; font-family: inherit;
}
.seg-btn:hover { color: var(--brand); }
.seg-btn.active { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 1px 3px rgba(16,24,40,.1); }
.exec-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; flex-wrap: wrap; }
.exec-head .spacer { flex: 1; }

/* 附件 */
.attach { border: 1px solid var(--border); border-radius: 9px; background: #fff; overflow: hidden; }
.attach-drop {
  margin: 10px; padding: 16px; border: 1.5px dashed #cbd3e1; border-radius: 8px;
  text-align: center; cursor: pointer; background: #fbfcfe; transition: .15s;
  font-size: 13px; color: var(--text-2); line-height: 1.7;
}
.attach-drop:hover, .attach-drop.over { border-color: var(--brand); background: #f5f9ff; }
.attach-drop .ad-ico { font-size: 20px; color: var(--brand); opacity: .8; margin-bottom: 2px; }
.attach-drop.busy { opacity: .7; pointer-events: none; }
.attach-tip { padding: 0 12px 8px; }
.attach-list { border-top: 1px solid var(--border-2); }
.attach-empty { padding: 18px; text-align: center; color: var(--text-3); font-size: 12.5px; }
.attach-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-bottom: 1px solid var(--border-2); font-size: 13px;
}
.attach-row:last-child { border-bottom: 0; }
.attach-row:hover { background: #fafbfd; }
.attach-main { min-width: 0; flex: 1; }
.attach-main .an { color: var(--text-1); text-decoration: none; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-main .an:hover { color: var(--brand); text-decoration: underline; }
.attach-meta { margin-top: 2px; }
.attach-status { flex: none; }
.attach-row .aa { display: flex; gap: 6px; flex: none; }
.attach.compact .attach-drop { padding: 12px; }

/* OCR 结果 */
.ocr-text {
  max-height: 300px; overflow: auto; background: #fafbfd; border: 1px solid var(--border-2);
  border-radius: 7px; padding: 10px 12px; font-size: 12px; line-height: 1.75;
  white-space: pre-wrap; word-break: break-word; color: var(--text-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.ocr-badge { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ocr-stage { margin-top: 12px; }
.ocr-loading { padding: 18px; text-align: center; color: var(--text-2); font-size: 13px; }

/* 付款比例编辑器 */
.terms-box { border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: #fbfcfe; }
.terms-head, .terms-row {
  display: grid; grid-template-columns: 1fr 100px 100px 34px; gap: 8px; align-items: center;
}
.terms-head { font-size: 11.5px; color: var(--text-3); padding: 0 2px 6px; }
.terms-row { margin-bottom: 6px; }
.terms-row .input { height: 30px; font-size: 12.5px; }
.terms-row .input.num { text-align: right; }
.terms-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.terms-foot .spacer { flex: 1; }
.terms-sum { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.terms-sum.ok { color: #15803d; }
.terms-sum.bad { color: var(--danger); }
.terms-bar { display: block; height: 4px; border-radius: 2px; background: var(--border-2); margin-top: 8px; overflow: hidden; }
.terms-bar i { display: block; height: 100%; width: 0; background: var(--danger); transition: width .2s; }
.terms-bar.ok i { background: #18a058; }

/* ---------------- 企业微信登录入口 ---------------- */
.wecom-sep { display: flex; align-items: center; gap: 10px; margin: 16px 0 12px; color: #98a2b3; font-size: 12px; }
.wecom-sep::before, .wecom-sep::after { content: ''; flex: 1; height: 1px; background: var(--border-2, #e7eaf0); }
.wecom-btn {
  width: 100%; height: 40px; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: #fff; color: #1a7f5a; border: 1px solid #cfe9de; font-weight: 600;
}
.wecom-btn:hover { background: #f2fbf7; border-color: #1a7f5a; }
.wecom-btn::before {
  content: ''; width: 16px; height: 16px; border-radius: 4px;
  background: #1a7f5a;
  -webkit-mask: radial-gradient(circle at 50% 50%, #000 40%, transparent 41%);
}
.wx-bound { display: inline-flex; align-items: center; gap: 6px; }

/* ---------------- 手机端适配（企业微信工作台内打开） ---------------- */
.menu-btn { display: none; }
.side-mask { display: none; }
@media (max-width: 820px) {
  .menu-btn { display: inline-flex; }
  .sidebar {
    width: 240px; flex: 0 0 240px;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .side-mask {
    display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45);
    z-index: 29; opacity: 0; pointer-events: none; transition: opacity .2s ease;
  }
  .side-mask.show { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0 !important; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .topbar .search { display: none; }
  .crumb { font-size: 13px; }
  .tbl-wrap, .table-wrap { overflow-x: auto; }
  .drawer, .modal { width: 96vw !important; max-width: 96vw !important; }
  .viewer { width: 96vw !important; height: 94vh !important; }
  .grid.g2, .grid.g3, .grid.g4, .grid.g6 { grid-template-columns: 1fr; }
  .desc-list { grid-template-columns: 1fr; }
}
