/* --- 1. 容器與整體排版樣式 --- */
.growth-rate-selector-container {
	max-width: 850px; 
	margin: 20px auto 40px auto; 
	padding: 20px; 
	background-color: #f8fbfd; 
	border: 1px solid #c9e0f0; 
	border-radius: 12px; 
	font-family: 'Microsoft YaHei', 'SimHei', Arial, sans-serif;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); 
}

h3.h3class {
	color: #1a4a6b; 
	font-size: 20px !important; 
	font-weight: 700; 
	text-align: center; 
	margin-bottom: 25px !important; 
	padding-bottom: 12px !important; 
	border-bottom: 2px solid #e0f0f5 !important; 
}

fieldset.fieldclass {
	border: 1px solid #d4e7f3 !important; 
	padding: 15px !important; 
	margin-bottom: 25px !important; 
	border-radius: 8px !important;
	background-color: #ffffff; 
}

legend.legendclass {
	font-weight: 700 !important; 
	color: #007AA8 !important; 
	padding: 0 15px !important; 
	font-size: 15px !important; 
	margin-left: -5px !important;
}

/* 步驟一選項美化 */
.income-options {
	display: flex; 
	justify-content: space-around; 
	text-align: center; 
	font-size: 15px;
}
.income-radio-label {
	flex: 1;
	padding: 5px 10px;
	border-radius: 6px;
	transition: background-color 0.2s;
}
.income-radio-label:hover {
	background-color: #f0f7fb;
}
.income-radio-label input[type='radio']:checked + strong {
	text-decoration: underline;
}

/* --- 2. Grid 表格佈局與通用單元格樣式 --- */
.grid-table {
	display: grid; 
	grid-template-columns: 120px repeat(3, 1fr); 
	border: 1px solid #d4e7f3;
	border-radius: 8px; 
	overflow: hidden; 
	margin-top: 10px;
}
.grid-cell {
	padding: 12px 8px; 
	border-right: 1px solid #e9f5fa;
	border-bottom: 1px solid #e9f5fa;
	font-size: 13px;
	line-height: 1.4;
	background-color: #ffffff;
	text-align: center;
	transition: background-color 0.2s;
}
.grid-cell:nth-child(4n) { border-right: none; }
.grid-table > div:nth-last-child(-n+4) { border-bottom: none; }

/* 表頭樣式 */
.header-row .grid-cell {
	background-color: #e0f2f7; 
	font-weight: 700;
	border-bottom: 2px solid #b0e0e6;
	color: #4682b4;
	font-size: 14px;
}
/* 支出率列樣式 */
.expense-rate-cell {
	background-color: #f7f7f7;
	font-weight: 700;
	color: #007AB0;
	font-size: 16px;
	display: flex; 
	align-items: center; 
	justify-content: center;
}

/* --- 3. 數據單元格 (可互動) 與 Hover 效果 --- */
.data-cell {
	display: flex; 
	flex-direction: column; 
	justify-content: flex-start; 
	align-items: center; 
	cursor: pointer; 
}
.data-cell:hover:not(.disabled) {
	background-color: #eaf8ff; 
	box-shadow: inset 0 0 0 1px #8bd1f5;
}

.data-cell p {
	white-space: normal; 
	margin-top: 5px !important; 
	min-height: 2.4em; 
	text-align: left; 
	padding: 0 5px; 
	font-size: 12px;
	color: #555;
}

/* --- 4. 禁用視覺效果 (JS 控制的可互動單元格) --- */
.data-cell.disabled {
	background-color: #fcfcfc !important; 
	color: #aaaaaa !important; 
	cursor: not-allowed !important;
	opacity: 0.6; 
	pointer-events: none; 
}
.data-cell.disabled label, .data-cell.disabled p {
	color: #aaaaaa !important; 
}
.data-cell.disabled .radio-label {
	cursor: not-allowed !important;
}
.data-cell.disabled .radio-label::before {
	border-color: #cccccc !important;
	background-color: #efefef !important;
}

/* --- 5. 永久禁用單元格 (不建議組合) --- */
.permanently-disabled {
	background-color: #f7f9fa !important; 
	color: #aaaaaa !important;
	cursor: default !important;
	opacity: 0.8;
	display: flex; 
	flex-direction: column; 
	justify-content: flex-start;
	align-items: center;
}
.permanently-disabled p {
	color: #aaaaaa !important;
	margin-top: 5px !important;
	min-height: 2.4em;
}
.permanently-disabled .placeholder-text {
	font-size: 14px;
	font-weight: 600;
	margin-top: 5px;
	color: #aaaaaa;
	height: 1.5em; /* 確保與 radio label 佔用高度一致 */
	display: block;
}

/* --- 6. 自定義單選框樣式 (美觀且專業) --- */
.styled-radio {
	position: absolute;
	opacity: 0; 
}

.radio-label {
	position: relative;
	display: block; 
	padding-left: 25px; 
	text-align: left; 
	font-weight: 600; 
	color: #333; 
	margin-top: 5px; 
	margin-bottom: 0px; 
	line-height: 1.5; 
	margin-left: auto;
	margin-right: auto;
	cursor: pointer; 
	font-size: 14px; 
}

/* 勾選框外圈 */
.radio-label::before {
	content: '';
	position: absolute;
	left: 0;
	top: 3px; 
	width: 16px; 
	height: 16px; 
	border: 2px solid #4682b4; 
	border-radius: 50%;
	background-color: #fff;
	box-sizing: border-box; 
	transition: all 0.2s ease;
}

/* 勾選框內圈 (圓點) */
.radio-label::after {
	content: '';
	position: absolute;
	left: 4px; 
	top: 7px; 
	width: 10px; 
	height: 10px; 
	background-color: #4682b4; 
	border-radius: 50%;
	opacity: 0;
	transform: scale(0.5); 
	transition: all 0.2s ease;
}

/* 勾選後的樣式 */
.styled-radio:checked + .radio-label::before {
	border-color: #00A3A3; 
	box-shadow: 0 0 0 1px #00A3A3;
}

.styled-radio:checked + .radio-label::after {
	opacity: 1; 
	transform: scale(1); 
	background-color: #00A3A3;
}