/* 资金月报管理系统 · 页面补充样式（Token 沿用 ui-base.css） */
:root {
  --ui-sider-width: 100%;
  --ui-filter-label-width: auto;
  --ui-filter-label-gap: 8px;
  --ui-filter-gap-y: 8px;
  --ui-dialog-max: 480px;
}
.app-layout {
  flex-direction: column;
  overflow: hidden;
}
html, body {
  height: 100%;
  overflow: hidden;
}
.app-sider {
  width: 100%;
  height: 48px;
  flex-direction: row;
  align-items: stretch;
  border-right: none;
  border-bottom: 1px solid var(--ui-border);
}
.app-sider__brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 20px 0 16px;
  border-bottom: none;
  border-right: 1px solid var(--ui-border);
  flex-shrink: 0;
}
.app-sider__user { display: none; }
.app-sider__nav {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 8px;
  flex: 1;
}
.nav-group__label { display: none; }
.app-sider__nav .nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  padding: 0 20px;
  white-space: nowrap;
  border-right: none;
  border-bottom: 2px solid transparent;
}
.app-sider__nav .nav-item:hover {
  background: transparent;
  color: var(--ui-primary-active);
}
.app-sider__nav .nav-item.is-active {
  color: var(--ui-primary-active);
  background: transparent;
  font-weight: 600;
  border-right: none;
  border-bottom-color: var(--ui-primary-active);
}

.search-panel {
  flex-shrink: 0;
  padding: 8px 12px;
  margin-bottom: 6px;
}
.search-panel__form {
  display: flex;
  flex-wrap: nowrap;
  align-items: end;
  column-gap: var(--ui-filter-gap-x);
  row-gap: var(--ui-filter-gap-y);
}
.search-panel__form > .form-item {
  flex: 1 1 0%;
  min-width: 0;
  width: auto;
  column-gap: 8px;
}
.search-panel__form .form-item__label {
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  text-align: left;
}
.search-panel__form .form-item__control,
.search-panel__form .form-item input,
.search-panel__form .form-item select,
.search-panel__form .form-item textarea {
  flex: 1 1 0%;
  width: 100%;
  min-width: 0;
  max-width: none;
}
.search-panel__actions {
  flex: 0 0 auto;
  grid-column: unset;
  margin-left: 0;
  white-space: nowrap;
}

.kb-crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ui-text-muted);
  padding: 0 4px;
}
.kb-crumb span:last-child { color: var(--ui-text); }
.kb-crumb i { font-style: normal; color: var(--ui-placeholder); }

.page-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 8px 16px;
  min-height: 0;
}
.app-main {
  min-height: 0;
  overflow: hidden;
}
.app-main > .app-tabs {
  height: 28px;
  padding: 0 16px;
  flex-shrink: 0;
}
.page-header {
  flex-shrink: 0;
  margin-bottom: 6px;
  gap: 8px;
  align-items: center;
}
.page-header__title {
  margin: 0;
  line-height: 22px;
}
.page-header__desc { display: none; }
.stat-cards {
  flex-shrink: 0;
  gap: 8px;
  margin-bottom: 6px;
}
.stat-card {
  padding: 8px 12px;
}
.stat-card__label {
  margin-bottom: 4px;
}
.stat-card__value { font-size: 16px; }
.stat-card__sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--ui-text-muted);
}
.stat-card__value.is-up { color: var(--ui-success); }
.stat-card__value.is-down { color: var(--ui-danger); }

.table-panel {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
  background: var(--ui-bg-card);
  border: 1px solid var(--ui-border-card);
  border-radius: var(--ui-radius-card);
  padding: 8px 12px;
}
.table-panel .table-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* 资金月报：整页滚动，表格不内嵌滚动、表头不冻结 */
html:has(body.page-flow),
body.page-flow {
  height: auto;
  min-height: 100%;
  overflow: auto;
}
body.page-flow .app-layout {
  height: auto;
  min-height: 100vh;
  overflow: visible;
}
body.page-flow .app-main {
  overflow: visible;
}
body.page-flow .page-body {
  overflow: visible;
  flex: none;
}
body.page-flow .table-panel {
  flex: none;
  overflow: visible;
}
body.page-flow .table-panel .table-scroll {
  flex: none;
  overflow: visible;
}
.report-matrix thead th {
  position: static;
  top: auto;
  z-index: auto;
}
.data-table th,
.data-table td { text-align: left; }
.data-table th,
.ui-density-compact .data-table th {
  font-weight: 600;
  color: #303030;
}

.table-scroll .data-table.report-matrix {
  width: 100%;
  min-width: 100%;
}
.report-matrix th,
.report-matrix td {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  padding: 4px 8px;
  height: 32px;
}
.report-matrix th.col-type,
.report-matrix td.col-type { width: 80px; min-width: 80px; text-align: left; }
.report-matrix th.col-account,
.report-matrix td.col-account { width: 108px; min-width: 108px; }
.report-matrix th.col-month,
.report-matrix td.col-month {
  width: auto;
  min-width: 86px;
  max-width: none;
  text-align: left;
  padding-left: 8px;
  padding-right: 8px;
}
.report-matrix td.col-type {
  background: #fff;
  font-weight: 600;
  vertical-align: middle;
}
.report-matrix .cell-num {
  width: 100%;
  min-width: 0;
  height: 24px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  padding: 0 2px;
  color: inherit;
  border-radius: 4px;
  overflow: visible;
}
.report-matrix .cell-num:hover { border-color: var(--ui-border-input); background: #fff; }
.report-matrix .cell-num:focus {
  outline: none;
  border-color: var(--ui-primary);
  background: #fff;
  box-shadow: 0 0 0 2px var(--ui-primary-light);
}
.report-matrix.data-table--report tbody tr td,
.report-matrix.data-table--report tbody tr:nth-child(even) td,
.report-matrix.data-table--report tbody tr:hover td,
.report-matrix.data-table--report tbody tr:nth-child(even):hover td {
  background: #fff;
}
.report-matrix .is-neg { color: var(--ui-danger); }
.report-matrix .is-zero { color: var(--ui-text-muted); }
.report-matrix.data-table--report tbody tr.is-subtotal td,
.report-matrix.data-table--report tbody tr.is-subtotal:nth-child(even) td,
.report-matrix.data-table--report tbody tr.is-subtotal:hover td,
.report-matrix.data-table--report tbody tr.is-subtotal td.col-type {
  background: #d4e8ff;
  font-weight: 600;
  color: var(--ui-text);
}
.report-matrix.data-table--report tbody tr.is-total td,
.report-matrix.data-table--report tbody tr.is-total:nth-child(even) td,
.report-matrix.data-table--report tbody tr.is-total:hover td,
.report-matrix.data-table--report tbody tr.is-total td.col-type {
  background: #ffd4a3;
  font-weight: 600;
}
.report-matrix.data-table--report tbody tr.is-mom td,
.report-matrix.data-table--report tbody tr.is-mom:nth-child(even) td,
.report-matrix.data-table--report tbody tr.is-mom:hover td,
.report-matrix.data-table--report tbody tr.is-mom td.col-type {
  background: #fff7e8;
  font-weight: 600;
}
.report-matrix .sum-cell { text-align: left; padding-left: 8px; padding-right: 8px; }

.fund-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translate(-50%, -12px);
  z-index: 2000;
  padding: 8px 16px;
  background: rgba(48, 48, 48, 0.92);
  color: #fff;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.fund-toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.fund-toast--ok { background: rgba(0, 180, 42, 0.92); }
.fund-toast--err { background: rgba(245, 63, 63, 0.92); }

.chart-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: 0;
  background: var(--ui-bg-card);
  border: 1px solid var(--ui-border-card);
  border-radius: var(--ui-radius-card);
  padding: 8px 12px;
}
.chart-panel__title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ui-text-title);
  margin-bottom: 8px;
}
.chart-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.chart-panel__head .chart-panel__title { margin-bottom: 0; }
.chart-panel__tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.chart-panel__head .ui-tabs {
  margin-bottom: 0;
  border-bottom: none;
}
.chart-zoom-btns { display: flex; gap: 6px; }
.chart-zoom-btns .ui-btn { min-width: 28px; padding: 0 8px; }
.chart-zoom-view {
  position: relative;
  overflow: hidden;
  width: 100%;
  cursor: grab;
  background: #fff;
  border-radius: 4px;
  user-select: none;
  touch-action: none;
}
.chart-zoom-view.is-panning { cursor: grabbing; }
.chart-zoom-canvas {
  transform-origin: 0 0;
  will-change: transform;
}
.form-item.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}
.chart-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
}
.chart-host {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 4px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--ui-text-secondary);
}
.chart-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend__item i {
  width: 10px; height: 10px; border-radius: 2px; display: inline-block;
}
.chart-donut { display: flex; justify-content: center; }
.fund-chart-tip {
  position: fixed;
  z-index: 2100;
  padding: 8px 10px;
  background: rgba(48, 48, 48, 0.92);
  color: #fff;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.5;
  pointer-events: none;
  opacity: 0;
}
.fund-chart-tip.is-show { opacity: 1; }

.acct-layout {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  align-items: stretch;
}
.acct-card {
  background: var(--ui-bg-card);
  border: 1px solid var(--ui-border-card);
  border-radius: var(--ui-radius-card);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.acct-card--types { min-width: 0; }
.acct-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--ui-border);
  font-weight: 600;
  flex-shrink: 0;
}
.acct-card--types .acct-card__head { flex-wrap: wrap; }
.acct-card--types .acct-card__head .ui-btn { padding: 0 8px; }
.acct-type-list { padding: 6px; flex: 1; overflow: auto; }
.acct-card .search-panel {
  flex-shrink: 0;
  margin: 8px 12px 0;
  padding: 8px 12px;
}
.acct-card .search-panel__form {
  column-gap: 12px;
}
.acct-card .search-panel__form .form-item__label {
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  min-width: 0;
}
.acct-card .search-panel__form .form-item__control,
.acct-card .search-panel__form .form-item input,
.acct-card .search-panel__form .form-item select {
  flex: 1 1 0%;
  width: 100%;
  max-width: none;
}
.acct-card .table-scroll--acct {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0 12px 4px;
}
.acct-card .table-scroll--acct .data-table th,
.acct-card .table-scroll--acct .data-table td {
  padding: 4px 12px;
  height: 32px;
}
.acct-card .table-footer { padding: 4px 12px 8px; flex-shrink: 0; }
.acct-card .pager-size {
  font-size: 12px;
  color: var(--ui-text-secondary);
}
.acct-type-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  border-radius: 4px;
  color: var(--ui-text);
}
.acct-type-item:hover { background: #fafafa; }
.acct-type-item.is-active {
  background: var(--ui-primary-light);
  color: var(--ui-primary-active);
}
.acct-type-item__dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.acct-type-item__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct-type-item__count { color: var(--ui-text-muted); flex-shrink: 0; }
.type-actions { display: flex; gap: 4px; }
.type-actions .row-actions__btn { padding: 0 4px; }

.pro-form--stack .form-item { margin-bottom: 12px; max-width: none; }
.pro-form--stack .form-item__label { display: block; margin-bottom: 6px; color: var(--ui-text-secondary); }
.pro-form--stack .form-item__control { width: 100%; max-width: none; }
.ui-dialog {
  max-width: min(var(--ui-dialog-max), calc(100vw - 48px));
}

.acct-card--types .acct-type-toolbar {
  padding: 8px;
  border-top: 1px solid var(--ui-border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.acct-card--types .acct-type-toolbar .ui-btn { padding: 0 8px; }

/* 行业研究 */
.industry-panel {
  padding: 0;
  background: #fff;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
}
.industry-panel .table-scroll {
  overflow: visible;
}
.industry-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13px;
  line-height: 1.5;
}
.industry-table th,
.industry-table td {
  border: 1px solid #000;
  padding: 8px 10px;
  text-align: center;
  vertical-align: middle;
  word-break: break-word;
}
.industry-table thead th {
  background: #4472c4;
  color: #fff;
  font-weight: 700;
}
.industry-table td.is-held {
  background: #f4cccc;
}

@media (max-width: 1200px) {
  .chart-grid { grid-template-columns: 1fr; }
  .acct-layout { grid-template-columns: 1fr; }
}
