/*
 * 统一详情页数据操作样式
 * 三栏结构：左侧模块栏 / 中间关联清单表格 / 右侧选中行详情。
 */
.wk-reference-detail .editable-row{
  display:flex !important;
  align-items:center !important;
  justify-content:space-between !important;
  gap:12px !important;
}
.wk-reference-detail .drw-card-main{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.wk-reference-detail .row-actions{
  display:flex;
  align-items:center;
  gap:6px;
  flex-shrink:0;
  white-space:nowrap;
}
.wk-reference-detail .row-edit-btn{
  height:26px;
  padding:0 8px;
  border:1px solid #dfe1e6;
  border-radius:3px;
  background:#fff;
  color:#2362c2;
  font-size:12px;
  cursor:pointer;
}
.wk-reference-detail .row-edit-btn:hover{
  background:#e9f2ff;
  border-color:#2362c2;
}
.wk-reference-detail .row-edit-btn.danger,
.wk-reference-detail .wk-btn.danger{
  color:#de350b;
  border-color:#ffbdad;
  background:#fff7f5;
}
.wk-reference-detail .row-edit-btn.danger:hover,
.wk-reference-detail .wk-btn.danger:hover{
  color:#fff;
  border-color:#de350b;
  background:#de350b;
}

/* === 详情页三栏母版 === */
.wk-reference-detail .detail-module-layout{
  display:grid !important;
  grid-template-columns:118px minmax(0,1fr) !important;
  gap:0 !important;
  height:100% !important;
  min-height:0 !important;
  overflow:hidden !important;
}
.wk-reference-detail .detail-side-menu{
  grid-column:1;
  min-width:0;
  border-right:1px solid #ebecf0;
  background:#fafbfc;
}
.wk-reference-detail .detail-main-with-modules{
  grid-column:2;
  min-width:0;
  min-height:0 !important;
  height:100% !important;
  overflow:hidden !important;
}
.wk-reference-detail .unified-detail-dynamic-body{
  height:calc(100% - 40px) !important;
  min-height:0 !important;
  overflow:hidden !important;
}
.wk-reference-detail .detail-main-with-modules .left-right-wrap.detail-three-column-content{
  display:grid !important;
  grid-template-columns:minmax(520px,1fr) 300px !important;
  gap:14px !important;
  height:100% !important;
  min-height:0 !important;
  overflow:hidden !important;
  padding:12px 16px 16px !important;
}
.wk-reference-detail .detail-main-with-modules .left-right-wrap:not(.detail-three-column-content){
  display:grid !important;
  grid-template-columns:minmax(0,1fr) 300px !important;
  gap:14px !important;
  height:100% !important;
  min-height:0 !important;
  overflow:hidden !important;
  padding:12px 16px 16px !important;
}
.wk-reference-detail .main-content-area{
  overflow:hidden !important; /* 单滚动条：外层只布局，不再和表格容器一起滚 */
  min-width:0 !important;
  min-height:0 !important;
}
.wk-reference-detail .detail-row-side-panel,
.wk-reference-detail .right-side-panel,
.wk-reference-detail .customer-summary-side{
  width:300px !important;
  flex:0 0 300px !important;
  min-width:0 !important;
  min-height:0 !important;
  max-height:none !important;
  height:100% !important;
  overflow:hidden !important; /* 单滚动条：右侧外壳不滚，只让 .d-card-body 滚 */
  border-left:1px solid #ebecf0 !important;
  padding-left:14px !important;
  padding-right:4px !important;
  background:#fff !important;
}
.wk-reference-detail .detail-row-side-panel .d-card,
.wk-reference-detail .right-side-panel .d-card,
.wk-reference-detail .customer-summary-side .d-card{
  height:100% !important;
  display:flex !important;
  flex-direction:column !important;
  min-height:0 !important;
  margin-bottom:0 !important;
}
.wk-reference-detail .detail-row-side-panel .d-card-body,
.wk-reference-detail .right-side-panel .d-card-body,
.wk-reference-detail .customer-summary-side .d-card-body{
  min-height:0 !important;
  flex:1 1 auto !important;
  max-height:none !important;
  overflow-y:auto !important; /* 右侧唯一纵向滚动条 */
  overflow-x:hidden !important;
  overscroll-behavior:contain !important;
}
.wk-reference-detail .detail-related-card{
  height:100% !important;
  max-height:100% !important;
  min-height:0 !important;
  flex:1 1 auto !important;
  margin-bottom:0 !important;
  overflow:hidden !important;
  display:flex !important;
  flex-direction:column !important;
  box-sizing:border-box !important;
}
.wk-reference-detail .detail-related-card .d-card-body{
  min-height:0 !important;
  flex:1 1 auto !important;
  display:flex !important;
  flex-direction:column !important;
  overflow:hidden !important;
  box-sizing:border-box !important;
  padding:0 !important;
}
.wk-reference-detail .detail-related-card .cfg-table-tools{
  position:static !important;
  top:auto !important;
  z-index:auto !important;
  min-height:0 !important;
  height:0 !important;
  padding:0 !important;
  border:0 !important;
  flex:0 0 0 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:flex-start !important;
  overflow:hidden !important;
  opacity:0 !important;
}
.wk-reference-detail .detail-related-table-wrap{
  min-height:0 !important;
  flex:1 1 auto !important;
  height:auto !important;
  max-height:none !important;
  overflow:auto !important; /* 中间表格唯一滚动条：横向+纵向都在这里 */
  overscroll-behavior:contain;
}
.wk-reference-detail .detail-related-table{
  min-width:max-content;
  width:100%;
  table-layout:fixed;
}
.wk-reference-detail .detail-related-table th.cfg-th{
  position:relative;
  user-select:none;
}
.wk-reference-detail .detail-related-table .cfg-drag{
  cursor:grab;
  color:#97a0af;
  margin-right:4px;
}
.wk-reference-detail .detail-related-table .sort-indicator{
  color:#2362c2;
  font-weight:700;
  margin-left:2px;
}
.wk-reference-detail .detail-related-table .col-resizer{
  position:absolute;
  top:0;
  right:-3px;
  width:7px;
  height:100%;
  cursor:col-resize;
  z-index:3;
}
.wk-reference-detail .detail-related-table .col-resizer:hover{
  background:rgba(35,98,194,.18);
}
body.is-col-resizing{
  cursor:col-resize !important;
  user-select:none !important;
}
.wk-reference-detail .detail-related-row{
  cursor:pointer;
}
.wk-reference-detail .detail-related-row:hover td{
  background:#f4f7fb !important;
}
.wk-reference-detail .detail-related-row.selected td{
  background:#e9f2ff !important;
}
.wk-reference-detail .detail-row-side-panel .d-card{
  margin-bottom:0;
}
.wk-reference-detail .detail-side-count{
  font-size:12px;
  font-weight:400;
  color:#6b778c;
}
.wk-reference-detail .detail-side-fields{
  display:grid;
  grid-template-columns:1fr;
  gap:10px;
}
.wk-reference-detail .detail-side-field{
  border-bottom:1px solid #f4f5f7;
  padding-bottom:8px;
}
.wk-reference-detail .detail-side-field label{
  display:block;
  margin-bottom:3px;
  font-size:12px;
  color:#8993a4;
}
.wk-reference-detail .detail-side-field span{
  display:block;
  word-break:break-word;
  color:#172b4d;
  font-size:13px;
}
.wk-reference-detail .detail-side-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid #ebecf0;
}

.wk-reference-detail .detail-inline-input{
  width:100%;
  min-height:32px;
  border:1px solid #dfe1e6;
  border-radius:4px;
  padding:5px 8px;
  font-size:13px;
  color:#172b4d;
  background:#fff;
  box-sizing:border-box;
}
.wk-reference-detail .detail-inline-input:focus{
  outline:none;
  border-color:#2362c2;
  box-shadow:0 0 0 2px rgba(35,98,194,.12);
}
.wk-reference-detail .detail-inline-textarea{
  min-height:66px;
  resize:vertical;
}
.wk-reference-detail .detail-side-fields.is-editing{
  gap:9px;
}
.wk-reference-detail .detail-side-field.editing{
  padding-bottom:9px;
}

@media (max-width:1100px){
  .wk-reference-detail .detail-main-with-modules .left-right-wrap.detail-three-column-content{
    grid-template-columns:1fr !important;
  }
  .wk-reference-detail .detail-row-side-panel,
  .wk-reference-detail .right-side-panel,
  .wk-reference-detail .customer-summary-side{
    width:auto !important;
    flex:auto !important;
    border-left:0 !important;
    padding-left:0 !important;
  }
}
@media (max-width:760px){
  .wk-reference-detail .detail-module-layout{
    grid-template-columns:1fr !important;
  }
  .wk-reference-detail .detail-side-menu{
    grid-column:1;
    border-right:0;
    border-bottom:1px solid #ebecf0;
  }
  .wk-reference-detail .detail-main-with-modules{
    grid-column:1;
  }
}
