  /* 本文件只保留首页剩余自有样式；群列表项/信息头/汇总栏/记账表格等通用规则已抽取到 shared/common.css 并先于本文件加载 */

  /* 设置对话框：内容超出屏幕高度时显示滚动条，不超出时不显示 */
  #settingsModal .modal-box { max-height: 98vh; overflow: hidden; display: flex; flex-direction: column; }
  #settingsModal .modal-header { flex-shrink: 0; }
  #settingsModal .modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

  /* 顶部用户栏 */
  .top-user-info-inline > span#currentUserName,
  .top-user-info-inline span#currentUserPosition,
  .top-user-info-inline span#currentUserNickname { color: #667eea; font-weight: bold; }
  .top-user-info-inline span.hide-in-all-view,
  .top-user-info-inline span#adminPositionSwitcher { color: #666; font-weight: normal; }

  /* 记账表格：关联组容器 - 蓝色实线框，缩进2px，不依附表格线 */
  .ledger-table-group td { position: relative; }
  /* 所有关联组td的伪元素：撑满高度，边框由缩进控制 */
  .ledger-table-group td::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 1;
  }
  /* 第一行：上边框缩进1px */
  .ledger-table-group.group-first td::before {
    top: 4px;
    border-top: 1px solid #91d5ff;
  }
  /* 最后一行：下边框缩进1px */
  .ledger-table-group.group-last td::before {
    bottom: 4px;
    border-bottom: 1px solid #91d5ff;
  }
  /* 第一列：左边框不缩进 */
  .ledger-table-group td:first-child::before {
    left: 4px;
    border-left: 1px solid #91d5ff;
  }
  /* 最后一列：右边框不缩进 */
  .ledger-table-group td:last-child::before {
    right: 4px;
    border-right: 1px solid #91d5ff;
  }
  /* 中间行：去掉上下边框 */
  .ledger-table-group.group-middle td::before {
    border-top: none;
    border-bottom: none;
  }
  /* 四个角圆角 */
  .ledger-table-group.group-first td:first-child::before { border-radius: 3px 0 0 0; }
  .ledger-table-group.group-first td:last-child::before { border-radius: 0 3px 0 0; }
  .ledger-table-group.group-last td:first-child::before { border-radius: 0 0 0 3px; }
  .ledger-table-group.group-last td:last-child::before { border-radius: 0 0 3px 0; }
  /* 单行关联组：上下边框连续，左右边框只加在首尾单元格上，避免中间出现竖分割线 */
  .ledger-table-group.group-first.group-last td::before {
    top: 4px;
    bottom: 4px;
    left: 0;
    right: 0;
    border-top: 1px solid #91d5ff;
    border-bottom: 1px solid #91d5ff;
    border-left: none;
    border-right: none;
    border-radius: 0;
  }
  /* 单行关联组：圆角只落在整组四角，否则相邻单元格各自圆角会在列边界处留缺口 */
  .ledger-table-group.group-first.group-last td:first-child::before { border-left: 1px solid #91d5ff; border-radius: 3px 0 0 3px; }
  .ledger-table-group.group-first.group-last td:last-child::before { border-right: 1px solid #91d5ff; border-radius: 0 3px 3px 0; }
  /* 单行且只有一个单元格时：左右边框都要，四角全圆 */
  .ledger-table-group.group-first.group-last td:first-child:last-child::before { border-right: 1px solid #91d5ff; border-radius: 3px; }

  /* 全部机位视图下隐藏的元素 */
  body.all-positions-view .hide-in-all-view { display:none !important; }
  body.all-positions-view #mainToolbar { display:none !important; }

/* 主页：汇总条/表头行高度收紧（把两行文字之间的空白减半） */
.coin-summary-bar { grid-auto-rows: 30px; }
.csb-block { height: 30px; }
/* 折叠态：汇总条高度对齐内部账目行（42px），展开态保持原样 */
/* 首屏加载中：汇总行先不显示，避免先出现一版错位表头 */
html.app-loading .coin-summary-bar { display: none !important; }

/* 折叠三角形：展开态相对「汇总行 + 列标题行」整体垂直居中 */
.coin-summary-bar:not(.collapsed) .csb-rmb .csb-arrow { top: 28px; }
/* 折叠态：默认与展开态同 30px（人民币行），三折叠时由 :has 规则改回 42px */
.coin-summary-bar.collapsed,
html.detail-collapsed .coin-summary-bar { grid-auto-rows: 30px; }
html.detail-collapsed .coin-summary-bar .csb-block,
.coin-summary-bar.collapsed .csb-block { height: 30px; }
/* 三折叠单行：四角全部圆角，内部区块不再自己画圆角 */
html.detail-collapsed .coin-summary-bar:has(.internal-section) {
  border-radius: 0 !important;
  overflow: visible;
}
/* 统一 6px：内层区块只在三折叠（并入胶囊行）时取消圆角，其余状态保留下圆角 */
html.detail-collapsed .coin-summary-bar .internal-section { border-radius: 0 !important; }
html.detail-collapsed .coin-summary-bar:has(.internal-section),
.coin-summary-bar:has(.internal-section) { grid-auto-rows: 42px; }
html.detail-collapsed .coin-summary-bar:has(.internal-section) .csb-block,
.coin-summary-bar:has(.internal-section) .csb-block { height: 42px; }
.dhc-cell { height: 26px; }
.detail-header-card { border-bottom: 1px solid #0d9488; }
/* 胶囊底边与「汇总行/表头行」分界线重合：胶囊贴着汇总行底部 */
.csb-block { align-items: flex-end !important; padding-bottom: 0 !important; }
.csb-content { margin-top: 0 !important; margin-bottom: 0 !important; }

/* 主页：内部账目 / 业务明细表格自带底色（与余额明细一致），不受页面背景色影响 */
.internal-section { background: #fff; }
.dk-table-container { background: #fff; }
.internal-section #internalTable,
.internal-section #internalDetail,
.dk-table-container #dkTable,
.dk-table-container #dkDetail { background: #fff; }

/* 主页：余额明细与内部账目/综合收支连成一体（无间距、相交处无圆角、相交边框合并为一条） */
.ledger-container { border-radius: 6px 6px 0 0; margin-bottom: 0; }
/* 三折叠：整行到此结束，外框底角也倒圆角，左右边框随圆角裁剪 */
html.detail-collapsed .ledger-container:has(.internal-section) { border-radius: 6px !important; }
.internal-section { margin-top: 0; border-top: none; border-radius: 0 0 6px 6px; }

/* 折叠态：余额明细与内部账目之间无分割线（折叠时去掉容器底部边框） */
.ledger-container:has(.detail-section.collapsed) { border-bottom: none; }

/* 跑马灯竖线统一由 .tbl-marquee-line（JS 绘制）负责：
   原先按单元格/按状态的 ::before 伪元素线全部关闭，避免同一位置画两根（叠成 2px）。 */
/* 内部账目/综合支出折叠时：跑马线更小巧（表头内居中短线） */
.internal-grid .marquee-divider-sm::before {
  top: 13px;
  height: 16px;
}

/* 设置弹窗余额明细：完整圆角（下方也圆角，不影响主页） */
#settingsModal .ledger-container { border-radius: 6px; }

/* 三张表（余额明细 / 内部账目 / 业务明细）：除跑马线外，移除所有内部分割线（保留外框与布局） */
.ledger-container .detail-section div:not(.tbl-marquee-line),
.ledger-container .dhc-cell,
.internal-section div:not(.tbl-marquee-line),
.dk-table-container div:not(.tbl-marquee-line) {
  border-color: transparent !important;
}

/* 三张表的外边框线也移除（保留 1px 占位，避免布局跳动） */
.ledger-container,
.internal-section,
.dk-table-container {
  border-color: transparent !important;
}

/* 三张表青色外边框（相邻表格只保留一条分隔，避免双线） */
.ledger-container { border: 1px solid #13c2c2 !important; }
.internal-section { border: 1px solid #13c2c2 !important; border-top: 0 !important; }
.dk-table-container { border: 1px solid #13c2c2 !important; }

/* 余额明细折叠 + 内部账目展开：去掉内部账目表格顶部那条分割线 */
html.detail-collapsed .ledger-container:not(:has(.internal-section)) { border-bottom: 0 !important; }

/* 三折叠：内层区块不再画边框/圆角，避免单行出现重复边框与圆角漏底 */
html.detail-collapsed .coin-summary-bar .internal-section {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
}

/* 余额明细展开：去掉内部账目表格顶部分割线（余额明细容器底边不画线） */
html:not(.detail-collapsed) .ledger-container { border-bottom: 0 !important; }

/* 白色背景区域加内部分割线（颜色同账户管理表格 #d1d5db） */
.ledger-container .detail-section div.drc-cell:not(:nth-child(4)) { border-right: 1px solid #d1d5db !important; }
.ledger-container .detail-section div.drc-cell:last-child { border-right: 0 !important; }
.ledger-container .detail-section div.detail-row-card { border-bottom: 1px solid #d1d5db !important; }
.ledger-container .detail-section div.detail-row-card:last-child { border-bottom: 0 !important; }
.internal-section .internal-grid > div:not([style*="color:#fff"]):not(.internal-label-right):not(.marquee-boundary) {
  border-right: 1px solid #d1d5db !important;
  border-bottom: 1px solid #d1d5db !important;
}
.dk-table-container div[style*="height:40px"]:not(.marquee-divider-right),
.dk-table-container div[style*="height:36px"]:not(.marquee-divider-right) {
  border-right: 1px solid #d1d5db !important;
  border-bottom: 1px solid #d1d5db !important;
}
.dk-table-container div[style*="height:40px"]:last-child,
.dk-table-container div[style*="height:36px"]:last-child { border-right: 0 !important; }

/* 内部账目：项目名称行单元格去掉右边线（下方金额行保留） */
.internal-section .internal-grid > div.internal-project-header-cell { border-right: 0 !important; }

/* 内部账目：左标签列右侧不再画线（首个项目格左边无线） */
.internal-section .internal-grid > div.internal-label-left.internal-label-left { border-right: 0 !important; }

/* 折叠态：汇总条自身不画圆角，统一由外层容器裁切，避免顶部圆角漏白底 */
html.detail-collapsed .coin-summary-bar { border-radius: 0 !important; overflow: visible !important; }

/* 表头行文字增加字间距（数字不加） */
.dhc-cell,
.internal-project-header-cell,
.internal-label-left > div:first-child,
.internal-label-right { letter-spacing: 4px; }

/* 业务明细 客户/对接 表头：仅文字加间距，汇总金额不加 */
.dk-table-container div[style*="font-size:19px"] { letter-spacing: normal; }
.dk-table-container div[style*="font-size:19px"] span { letter-spacing: 4px; }
.dk-table-container #kehuTotal,
.dk-table-container #duijieTotal { letter-spacing: normal !important; }

/* 人民币 / 数字币 胶囊：文字加间距，金额不加 */
.csb-content { letter-spacing: normal; }
.csb-content .csb-label { letter-spacing: 4px; }
.csb-content .csb-value { letter-spacing: normal !important; }

/* 人民币/数字币：图标与文字间距加倍（3px -> 6px） */
.csb-label-icons { gap: 6px !important; }

/* 汇率表头齿轮与下方刷新按钮水平居中对齐 */
.rate-settings-icon { transform: translateY(-50%) translateX(3.5px) !important; }

/* 折叠三角 / 眼睛图标 / 群总余额文字：默认隐藏，鼠标移到所在行才显示 */
.coin-summary-bar .csb-arrow,
.internal-section .csb-arrow,
.dk-table-container .dk-arrow,
.dk-table-container [onclick*="toggleTotalBalance"],
.dk-table-container .dk-total-label {
  opacity: 0 !important;
  transition: opacity .15s ease;
}
.ledger-container:hover .coin-summary-bar .csb-arrow,
.internal-section:hover .csb-arrow,
.dk-table-container:hover .dk-arrow,
.dk-table-container:hover [onclick*="toggleTotalBalance"],
.dk-table-container:hover .dk-total-label {
  opacity: 1 !important;
}

/* 设置弹窗：余额明细表格补回底部边框线 */
#settingsModal .ledger-container { border-bottom: 1px solid #13c2c2 !important; }

/* 设置弹窗：内部账目/综合收支 仅在金额行画竖分割线（名称行不画） */
#settingsModal #settingInternalDetail div[style*="background:transparent;display:flex"]:not([style*="color:#fff"]):not([class*="setting-internal-total"]) {
  border-right: 1px solid #d1d5db !important;
}

/* 综合收支汇总金额数字间距恢复默认 */
.internal-label-right #otherExpenseCollapsedAmount,
.setting-expense-total { letter-spacing: normal !important; }

/* 设置弹窗：让「内部账目 / 综合收支」两个标签比「机位号 / 项目名称」更醒目。
   名称格字号是行内样式（14px），必须 !important 才能覆盖。
   作用域仅 #settingsModal，主页不受影响。 */
#settingsModal .si-label-head {
  font-size: 15px !important;
  letter-spacing: 0 !important;
  padding: 0 2px !important;
  font-weight: 800 !important;
}
#settingsModal .si-label-head .si-label-icon {
  font-size: 13px !important;
  line-height: 1 !important;
  margin: 0 2px !important;
}
/* 机位号（内部账目列名）与项目名称收小一档，拉开层级 */
#settingsModal .cell[data-field="internal-name"],
#settingsModal .cell[data-field="expense-name"] {
  font-size: 12px !important;
  font-weight: 600 !important;
}
