diff --git a/src/components/Reports/TotalReport/TotalReport.module.css b/src/components/Reports/TotalReport/TotalReport.module.css index d94ed96449..fc4b5f191a 100644 --- a/src/components/Reports/TotalReport/TotalReport.module.css +++ b/src/components/Reports/TotalReport/TotalReport.module.css @@ -1,4 +1,14 @@ /* stylelint-disable */ +/* .totalContainer { + display: flex; + flex-direction: column; + justify-content: space-between; + background-color: #f1ebf7; + border-radius: 16px; + padding: 20px 40px; + margin-bottom: 30px; +} */ + .totalContainer { display: flex; flex-direction: column; @@ -7,6 +17,8 @@ border-radius: 16px; padding: 20px 40px; margin-bottom: 30px; + word-break: break-word; /* 防止极窄情况下文字硬撑破容器 */ + overflow: hidden; /* 隐藏任何意外溢出的边界 */ } .tables { @@ -15,14 +27,23 @@ -webkit-overflow-scrolling: touch; } +/* .totalTitle { + font-size: 32px; + font-weight: 600; + text-align: center; + color: steelblue; +} */ + .totalTitle { font-size: 32px; font-weight: 600; text-align: center; color: steelblue; + word-break: normal; /* 确保正常标题不会乱换行 */ + overflow-wrap: break-word; } -.totalNumber { +/* .totalNumber { font-size: 32px; font-weight: 700; margin-right: 5px; @@ -32,11 +53,27 @@ display: flex; flex-direction: row; align-items: center; +} */ + +.totalItem { + display: flex; + flex-direction: column; /* 核心:改为纵向堆叠,数字在上,文本在下,彻底根治重叠 */ + align-items: flex-start; /* 左对齐 */ + margin-bottom: 10px; /* 上下模块间距 */ +} + +.totalNumber { + font-size: 32px; + font-weight: 700; + margin-right: 0; /* 移除原本的横向右边距 */ + margin-bottom: 2px; /* 数字和下方文字留出微小间距 */ + line-height: 1.1; /* 限制行高,防止撑开 */ } .totalPeriod { font-size: 24px; font-weight: 400; + text-align: center;/* 建议在极窄时居中或保持自然对齐 */ } .totalDetail { diff --git a/src/components/Reports/TotalReport/TotalReportBarGraph.module.css b/src/components/Reports/TotalReport/TotalReportBarGraph.module.css index b48ba8025d..56b53b8341 100644 --- a/src/components/Reports/TotalReport/TotalReportBarGraph.module.css +++ b/src/components/Reports/TotalReport/TotalReportBarGraph.module.css @@ -2,11 +2,16 @@ .svgContainer { margin: 10px 0; padding: 0; + /* Ensure the container spans full width and allows overflowing elements (like rotated labels) to remain visible */ + width: 100%; + overflow: visible; } .svgChart { width: 100%; height: 100%; + /* Allow chart to fill container and prevent clipping of axis labels */ + overflow: visible; } .bar { @@ -22,3 +27,16 @@ color: #d1d5db; } +/* Reduce base font size for chart text to prevent crowding */ +.svgContainer text { + font-size: 10px; +} + +/* Rotate X-axis year labels and adjust font size to prevent horizontal overlapping on narrow screens */ +.svgContainer g.x-axis text, +.svgContainer .tick text { + transform: rotate(-35deg); + text-anchor: end; + font-size: 9px; +} +