﻿/* 黑框白底宋体清晰网格表格 —— 与旧版公司入口一致的视觉口径 */
.grid-table{width:100%;border-collapse:collapse;table-layout:fixed;background:#fff;color:#111;
  font-family:"宋体",SimSun,serif;font-size:12px}
.grid-table th,.grid-table td{border:1px solid #000;padding:5px 6px;text-align:center;vertical-align:middle;
  word-break:break-word;line-height:1.4}
.grid-table thead th{background:#f4efe6;font-weight:700;color:#000}
.grid-table tbody th{background:#faf8f3;font-weight:600}
.grid-table .t-title{font-size:15px;font-weight:700;letter-spacing:1px;padding:10px;border:1px solid #000;background:#fff}
.grid-table .num{text-align:right;font-variant-numeric:tabular-nums}
.grid-table .total-row{font-weight:700;background:#f4efe6}
.grid-table .sub-row{background:#faf8f3}
.grid-table .auto-cell{color:#666}
.grid-table .note-cell{text-align:left}
.grid-table .section-label{text-align:left;font-weight:700;background:#f4efe6}
.grid-table .blank-row td{height:8px;padding:0;border:1px solid #000;background:#fff}
.grid-table tfoot td{font-weight:700;background:#f4efe6}
.table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}
.table-scroll>.grid-table{min-width:1120px}
/* 模板化报表/公司查看：列宽按百分比自适应，铺满容器，不产生横向滚动 */
.table-scroll>.rpt-grid{min-width:0!important;width:100%!important}
.table-caption{font-family:"宋体",SimSun,serif;font-size:13px;color:#333;margin:8px 0}
@media(max-width:600px){
  .grid-table{font-size:11px}
  .table-scroll>.grid-table{min-width:1000px}
}
@media print{
  @page{size:A4 landscape;margin:8mm}
  body{background:#fff}
  .topbar,.no-print,.toolbar,.btn,.panel h2,.msg,.hint{display:none!important}
  .panel{border:0;box-shadow:none;margin:0;padding:0}
  .table-scroll{overflow:visible!important}
  .table-scroll>.grid-table{min-width:0!important;width:100%!important}
  .grid-table{font-size:10px}
  .grid-table th,.grid-table td{padding:3px 4px}
  .print-only{display:block!important}
}
.print-only{display:none}

/* ============ 模板化月度报表 ============ */
.rpt-grid{table-layout:fixed;width:100%;border-collapse:collapse;font-family:"宋体",SimSun,serif}
.rpt-grid td{border:1px solid #222;padding:3px 5px;font-size:12px;line-height:1.2;vertical-align:middle;overflow:hidden;word-break:break-all}
.rpt-grid tr{height:36px}
/* RPT-NOCOLOR-V1 锁定/公式=红色加粗；可填=黑色加粗；全部去底色 */
.rpt-grid .cell-lock{background:#fff;color:#c62828;font-weight:700}
.rpt-grid .cell-edit{background:#fff;color:#111;font-weight:700}
.rpt-grid .cell-formula{background:#fff;color:#c62828;font-weight:700}
.rpt-grid .cell-edit input{width:100%;border:0;outline:0;background:transparent;font:inherit;font-size:12px;padding:2px;text-align:right;color:#111;font-weight:700}
/* 多行文本可填格：自动增高 + 自动换行，白底左对齐 */
.rpt-grid .cell-text{background:#fff;vertical-align:top;color:#111;font-weight:700}
.rpt-grid textarea.rpt-textarea{display:block;width:100%;box-sizing:border-box;border:0;outline:0;background:transparent;font:inherit;font-size:12px;line-height:1.6;padding:3px 5px;color:#111;font-weight:700;text-align:left;resize:none;overflow:hidden;word-break:break-word;white-space:pre-wrap;min-height:36px}
.rpt-grid .cell-text{word-break:break-word;white-space:pre-wrap;text-align:left}
/* 金额/比率只读格右对齐，符合财务表惯例（编辑格 input 本身已右对齐） */
/* RPT-NOCOLOR-V1b 数字列收紧内边距，避免加粗后小数折行 */
.rpt-grid .cell-num{text-align:right;font-variant-numeric:tabular-nums;padding-right:2px;white-space:nowrap}
/* RPT-SPACING-V1 公式合计格紧凑显示，避免每日合计金额被截断 */
.rpt-grid .cell-formula{font-size:11px;line-height:1.1;padding-left:1px;padding-right:1px;letter-spacing:-0.3px;white-space:nowrap}
/* RPT-DIGIT5-V1 让每日合计可显示5位数：模板表格设最小宽度，日期列按比例放大到约53px；窄屏在表格区内横向滚动，前两行仍吸顶 */
.table-scroll>.rpt-grid{min-width:1980px!important}
#rp-table .rpt-grid .cell-formula{font-size:11px;letter-spacing:-0.3px}

.rpt-grid .cell-focus,.rpt-grid .cell-focus input{background:#fff!important;outline:2px solid var(--brand)}
.rpt-info{border:1px solid var(--line);background:var(--cream);padding:10px 12px;margin-bottom:12px;font-size:12px;line-height:2}
.rpt-info .info-item{display:inline-block;margin-right:14px;white-space:nowrap}
.tpl-grid input{width:100%;border:1px solid transparent;background:transparent;font:inherit;font-size:11px;padding:2px;color:#111}
.tpl-grid input:focus{border-color:var(--brand);background:#fff}
.tpl-grid td.selected{outline:2px solid var(--brand);background:#FFE082!important}
.tpl-tools textarea{width:100%;min-height:60px;font-family:Consolas,monospace;font-size:12px}
.tpl-prop{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;align-items:end;background:var(--cream);border:1px solid var(--line);padding:12px;margin-bottom:12px}
.tpl-prop label{display:block;font-size:11px;color:var(--muted);margin-bottom:4px}
.tpl-prop input,.tpl-prop select{width:100%;padding:5px 7px;border:1px solid var(--line);background:#fff;font-size:12px}
.tpl-grid .cell-date{background:#E8E2D6}
.tpl-grid .cell-blank{background:#FCFAF7}
.tpl-grid td{padding:0}
/* 模板编辑器：表格 + 公式侧栏 */
.tpl-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:14px;align-items:start}
.tpl-layout .table-scroll{min-width:0;overflow-x:auto}
.tpl-layout .tpl-grid{min-width:980px}
.tpl-formula-panel{position:sticky;top:12px;max-height:76vh;overflow:auto;border:1px solid var(--line);background:#fff;padding:12px}
.tpl-formula-panel h3{margin:0 0 8px;font-size:14px;color:var(--ink)}
.formula-list{margin-top:10px;display:flex;flex-direction:column;gap:4px}
.formula-row{display:grid;grid-template-columns:46px minmax(0,1fr);gap:6px;align-items:center}
.formula-row label{font-size:11px;color:var(--muted);cursor:pointer;font-weight:700}
.formula-row input{width:100%;padding:3px 5px;border:1px solid var(--line);font:11px Consolas,monospace;background:#fffdf8}
@media(max-width:1100px){.tpl-layout{grid-template-columns:1fr}.tpl-formula-panel{position:static;max-height:none}}
@media print{
  .rpt-grid td{border:1px solid #222!important}
  .rpt-info{display:none!important}
  .rpt-grid textarea.rpt-textarea{overflow:visible!important;resize:none!important}
}

/* RPT-PRINT-TABLE-ONLY */
@media print{
  html.rpt-print-pending,body.rpt-print-pending{}
  body.rpt-print > *{display:none!important}
  body.rpt-print > .sp-main{display:block!important}
  body.rpt-print > #main-content{display:block!important}
  body.rpt-print .sp-main > *{display:none!important}
  body.rpt-print .sp-main > .sp-paper{display:block!important}
  body.rpt-print .sp-paper > *{display:none!important}
  body.rpt-print .sp-paper > .sp-body{display:block!important}
  body.rpt-print .sp-paper > #rp-table{display:block!important}
  body.rpt-print .sp-body > *{display:none!important}
  body.rpt-print .sp-body > #rpt-fill{display:block!important}
  body.rpt-print #rpt-fill > *{display:none!important}
  body.rpt-print #rpt-fill > .panel{display:block!important}
  body.rpt-print #rpt-fill .panel > *{display:none!important}
  body.rpt-print #rpt-fill .panel > .table-scroll{display:block!important}
  body.rpt-print .table-scroll{overflow:visible!important}
  body.rpt-print .table-scroll > .grid-table{min-width:0!important;width:100%!important}
  body.rpt-print #rpt-fill .panel{border:0!important;box-shadow:none!important;margin:0!important;padding:0!important;background:none!important}
}
/* RPT-STICKY-HEAD */
/* 前端填报/后台模板编辑：表格区内部滚动，前两行(标题行+列名行)固定在顶部 */
#rp-table,#tpl-table{max-height:68vh;overflow:auto;-webkit-overflow-scrolling:touch}
/* RPT-NOCOLOR-V1 前台固定表头去底色（后台模板编辑器保持原配色） */
#rp-table .rpt-grid tr:nth-child(1)>td{position:sticky;top:0;z-index:6;background:#fff!important}
#tpl-table .tpl-grid tr:nth-child(1)>td{position:sticky;top:0;z-index:6;background:#FFF1B8!important}
#rp-table .rpt-grid tr:nth-child(2)>td{position:sticky;top:36px;z-index:5;background:#fff!important}
#tpl-table .tpl-grid tr:nth-child(2)>td{position:sticky;top:36px;z-index:5;background:#FFF1B8!important}
/* 合并标题行跨列，sticky 时补足下边框，避免滚动时边框消失 */
#rp-table .rpt-grid tr:nth-child(1)>td,
#tpl-table .tpl-grid tr:nth-child(1)>td{box-shadow:inset 0 -1px 0 #000}
@media print{
  #rp-table,#tpl-table{max-height:none!important;overflow:visible!important}
  #rp-table .rpt-grid tr:nth-child(1)>td,#tpl-table .tpl-grid tr:nth-child(1)>td,
  #rp-table .rpt-grid tr:nth-child(2)>td,#tpl-table .tpl-grid tr:nth-child(2)>td{position:static!important;box-shadow:none!important}
}
/* RPT-ONE-A4: 月度报表打印压缩到单张 A4 横向，行数变多时由 report.js 自动微调缩放 */
@page{size:A4 landscape;margin:3mm}
@media print{
  body.rpt-print #rpt-fill .rpt-grid{zoom:var(--rpt-print-zoom,.65)!important;width:100%!important;font-size:12px!important}
  body.rpt-print #rpt-fill .rpt-grid tr{height:20px!important}
  body.rpt-print #rpt-fill .rpt-grid td{padding:1px 3px!important;font-size:12px!important;line-height:1.05!important}
  body.rpt-print #rpt-fill .rpt-grid textarea.rpt-textarea{font-size:12px!important;line-height:1.15!important;padding:1px 2px!important}
}
