:root {
	/* --- 核心配色方案 (亮色系/仪表盘风格) --- */
	--bg-body: #f5f7fa;          /* 页面背景：极淡灰蓝 */
	--card-bg: #ffffff;          /* 卡片背景：纯白 */
	
	/* 品牌渐变色：蓝紫色 */
	--primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	--primary-color: #6a74bc;    /* 主色调 */
	--primary-light: #eceefc;    /* 浅色衬底 */
	
	/* 文字颜色 */
	--text-main: #2d3748;        /* 深灰主字 */
	--text-muted: #718096;       /* 浅灰辅字 */
	
	/* 边框与阴影 */
	--border-color: #e2e8f0;
	--shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
	
	/* 圆角变量 */
	--radius-card: 12px;
	--radius-pill: 999px;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	background-color: var(--bg-body);
	color: var(--text-main);
	min-height: 100vh;
	line-height: 1.5;
}

/* =========================================
   1. 顶部 Banner 区域
   ========================================= */
   .main-header {
	background: var(--primary-gradient);
	color: white;
	/* 【关键修改】上边距保持20px，下边距加大到60px，给按钮留坑 */
	padding: 24px 20px 60px 20px; 
	text-align: center;
	/* 【关键修改】负边距配合调整，确保按钮正好压在边线上 */
	margin-bottom: -40px; 
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
	border-bottom-left-radius: 24px;
	border-bottom-right-radius: 24px;
}

.header-content {
	max-width: 900px;
	margin: 0 auto;
}

.main-header h1 {
	margin: 0 0 10px;
	font-size: 28px;
	font-weight: 700;
	letter-spacing: 1px;
}

.main-header .subtitle {
	margin: 0;
	opacity: 0.9;
	font-size: 14px;
	font-weight: 300;
}

/* =========================================
   2. 布局容器与 Tab 切换
   ========================================= */
.container {
	max-width: 1100px;
	margin: 0 auto;
	padding: 20px;
}

/* Tab 切换 (胶囊风格) */
.mode-tabs {
	display: flex;
	justify-content: center;
	gap: 16px;
	/* 【关键修改】去掉 margin-top，完全靠 Header 的负边距来定位 */
	margin-top: 0; 
	margin-bottom: 30px;
	position: relative;
	z-index: 10;
}

.tab-pill {
	border: none;
	background: #fff;
	color: var(--text-muted);
	padding: 10px 30px;
	border-radius: var(--radius-pill);
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 2px 4px rgba(0,0,0,0.05);
	transition: all 0.2s ease;
}

.tab-pill:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 6px rgba(0,0,0,0.08);
	color: var(--primary-color);
}

.tab-pill.active {
	background: #fff;
	color: var(--primary-color);
	/* 激活状态：蓝色光晕边框 */
	box-shadow: 0 0 0 2px var(--primary-color), 0 4px 10px rgba(106, 116, 188, 0.2);
}

/* --- 核心布局 Grid --- */
.layout-grid {
	display: grid;
	grid-template-columns: 2fr 1.1fr; /* 稍微调整比例 */
	gap: 24px;
	align-items: stretch; /* 【关键修改】强制左右子元素高度拉伸一致 */
}

/* --- 通用卡片样式 --- */
.card {
	background: var(--card-bg);
	border-radius: var(--radius-card);
	box-shadow: var(--shadow-card);
	padding: 24px;
	border: 1px solid #fff;
	
	/* 【关键修改】让卡片变成 Flex 容器，确保内部高度占满 */
	height: 100%; 
	display: flex;
	flex-direction: column;
}

/* 让右侧结果区域自动撑开，确保布局对齐后内部不空 */
.result-section {
	justify-content: flex-start;
}
#results, .result-content-wrapper {
	flex: 1; /* 占满剩余空间 */
	display: flex;
	flex-direction: column;
}
/* 让结果内容垂直居中一点，或者靠上 */
.result-content-wrapper {
	justify-content: flex-start; 
}

.card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--border-color);
}

.card-header h3 {
	margin: 0;
	font-size: 16px;
	color: var(--text-main);
	font-weight: 700;
}

/* 小的重置文字链接 */
.reset-link {
	background: none;
	border: none;
	color: var(--primary-color);
	font-size: 13px;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 4px;
}
.reset-link:hover {
	background: var(--primary-light);
}

/* =========================================
   4. 表单元素样式
   ========================================= */
.panel { display: none; }
.panel.active { display: block; } /* 配合 JS 切换显示 */

.label-text {
	display: block;
	font-size: 13px;
	color: var(--text-muted);
	margin-bottom: 6px;
	font-weight: 500;
}

.opt-tag {
	color: #cbd5e0;
	margin-left: 4px;
	font-weight: normal;
}

/* 顶部类型选择 (Radio Group 胶囊按钮组) */
.radio-group {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.radio-pill {
	position: relative;
	cursor: pointer;
}

.radio-pill input {
	position: absolute;
	opacity: 0; /* 隐藏原生 Radio */
}

.radio-pill span {
	display: inline-block;
	padding: 6px 16px;
	background: #edf2f7;
	color: var(--text-muted);
	border-radius: 6px;
	font-size: 13px;
	transition: all 0.2s;
	border: 1px solid transparent;
}

/* 选中状态 */
.radio-pill input:checked + span {
	background: var(--primary-light);
	color: var(--primary-color);
	border-color: var(--primary-color);
	font-weight: 600;
}

.divider {
	height: 1px;
	background: var(--border-color);
	margin: 20px 0;
	opacity: 0.5;
}

/* 输入框网格布局 */
.input-grid-internal {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 20px;
}

.full-width {
	grid-column: 1 / -1;
}

select, input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--border-color);
	border-radius: 6px;
	background: #fff;
	color: var(--text-main);
	font-size: 14px;
	transition: border-color 0.2s;
	outline: none;
}

select:focus, input:focus {
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgba(106, 116, 188, 0.1);
}

/* =========================================
   5. 结果显示区域 (包含 JS 生成内容的样式重写)
   ========================================= */
.result-content-wrapper {
	min-height: 200px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* 空状态占位符 */
.empty-state {
	text-align: center;
	color: var(--text-muted);
}
.dash-line {
	width: 40px;
	height: 4px;
	background: #e2e8f0;
	margin: 0 auto 16px;
	border-radius: 2px;
}
.badge-waiting {
	display: inline-block;
	background: #edf2f7;
	padding: 6px 16px;
	border-radius: 20px;
	font-size: 12px;
	color: #a0aec0;
	margin-bottom: 8px;
}

/* --- JS 生成的 HTML 样式覆盖 (Hack) --- */

/* 能效等级表格（紧凑表格样式） */
#resultContent .efficiency-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 16px;
	font-size: 13px;
}

#resultContent .efficiency-table thead {
	background: var(--primary-light);
}

#resultContent .efficiency-table th {
	padding: 8px 12px;
	text-align: left;
	font-weight: 600;
	color: var(--text-main);
	font-size: 12px;
	border-bottom: 2px solid var(--primary-color);
}

#resultContent .efficiency-table tbody tr {
	border-bottom: 1px solid var(--border-color);
	transition: background-color 0.15s;
}

#resultContent .efficiency-table tbody tr:hover {
	background-color: #f8fafc;
}

#resultContent .efficiency-table tbody tr:last-child {
	border-bottom: none;
}

#resultContent .efficiency-table td {
	padding: 8px 12px;
	text-align: left;
}

#resultContent .efficiency-table td:nth-child(1) {
	font-weight: 600;
	color: #2d3748;
}

#resultContent .efficiency-table td:nth-child(2),
#resultContent .efficiency-table td:nth-child(3) {
	font-family: monospace, sans-serif;
	font-weight: 700;
	color: #4a5568;
}

/* 输入提示 */
#resultContent .input-hint {
	margin-top: 12px;
	margin-bottom: 16px;
	text-align: center;
	color: #94a3b8;
	font-size: 12px;
	background: #f8fafc;
	padding: 8px;
	border-radius: 6px;
	border: 1px dashed #e2e8f0;
}

/* 结果底部区域（类别参数和来源） */
#resultContent .result-footer {
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid #e2e8f0;
}

#resultContent .result-params {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 8px;
}

#resultContent .pill {
	font-size: 11px;
	padding: 4px 8px;
	background: #fff;
	border: 1px solid #cbd5e0;
	color: var(--text-muted);
	border-radius: 4px;
	font-weight: 500;
}

#resultContent .result-source {
	text-align: center;
	margin-top: 8px;
	color: #a0aec0;
	font-size: 11px;
}

/* =========================================
   6. 判级结果卡片 (紧凑版)
   ========================================= */
.assessment-result {
	margin-top: 12px !important;
	margin-bottom: 16px !important;
	padding: 12px 16px;
	border-radius: 6px;
	text-align: center;
	position: relative;
	overflow: hidden;
	animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

/* 卡片内的大标题（缩小） */
.assessment-result strong {
	display: block;
	font-size: 15px;
	font-weight: 700;
	margin-bottom: 4px;
	letter-spacing: 0.3px;
}

/* 卡片内的辅助说明（缩小） */
.assessment-result .sub-text {
	font-size: 12px;
	opacity: 0.9;
	font-weight: 500;
}

/* 成功状态 (Success) */
.assessment-result.success {
	background: #f0fdf4; /* 极淡薄荷绿 */
	border: 1px solid #bbf7d0;
	color: #166534; /* 深绿文字 */
}
.assessment-result.success::before {
	content: "";
	position: absolute;
	left: 0; top: 0; bottom: 0;
	width: 6px;
	background: #22c55e; /* 左侧鲜艳绿条 */
}

/* 失败状态 (Fail) */
.assessment-result.fail {
	background: #fef2f2; /* 极淡红 */
	border: 1px solid #fecaca;
	color: #991b1b; /* 深红文字 */
}
.assessment-result.fail::before {
	content: "";
	position: absolute;
	left: 0; top: 0; bottom: 0;
	width: 6px;
	background: #ef4444; /* 左侧鲜艳红条 */
}

/* 清理旧的 style 样式 (兼容性) */
#resultContent > div[style*="background"] {
	display: none !important;
}

/* 底部小字 */
.footer {
	text-align: center;
	margin-top: 40px;
	color: #a0aec0;
	font-size: 12px;
}

/* =========================================
   7. 添加到列表按钮样式
   ========================================= */
.add-to-list-container {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--border-color);
	text-align: center;
}

.add-to-list-btn {
	background: var(--primary-gradient);
	color: white;
	border: none;
	padding: 12px 32px;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.add-to-list-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.add-to-list-btn:active {
	transform: translateY(0);
}

/* =========================================
   8. 表格区域样式
   ========================================= */
.table-section {
	margin-top: 32px;
}

.table-actions {
	display: flex;
	gap: 12px;
}

.action-btn {
	border: none;
	padding: 8px 20px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
}

.copy-btn {
	background: #e0f2fe;
	color: #0369a1;
	border: 1px solid #bae6fd;
}

.copy-btn:hover {
	background: #bae6fd;
	border-color: #7dd3fc;
	transform: translateY(-1px);
}

.export-btn {
	background: #dcfce7;
	color: #166534;
	border: 1px solid #bbf7d0;
}

.export-btn:hover {
	background: #bbf7d0;
	border-color: #86efac;
	transform: translateY(-1px);
}

.table-container {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

#transformerTable {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
	background: var(--card-bg);
}

#transformerTable thead {
	background: var(--primary-light);
	position: sticky;
	top: 0;
	z-index: 10;
}

#transformerTable th {
	padding: 12px 8px;
	text-align: left;
	font-weight: 600;
	color: var(--text-main);
	border-bottom: 2px solid var(--primary-color);
	font-size: 12px;
	white-space: nowrap;
}

#transformerTable td {
	padding: 12px 8px;
	border-bottom: 1px solid var(--border-color);
	color: var(--text-main);
	white-space: nowrap;
}

#transformerTable tbody tr {
	transition: background-color 0.2s;
}

#transformerTable tbody tr:hover {
	background-color: #f8fafc;
}

#transformerTable tbody tr.empty-row {
	background-color: transparent;
}

#transformerTable tbody tr.empty-row:hover {
	background-color: transparent;
}

.empty-message {
	text-align: center;
	color: var(--text-muted);
	padding: 40px 20px !important;
	font-style: italic;
}

.delete-btn {
	background: #fee2e2;
	color: #dc2626;
	border: 1px solid #fecaca;
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s;
}

.delete-btn:hover {
	background: #fecaca;
	border-color: #f87171;
	transform: scale(1.05);
}

.delete-btn:active {
	transform: scale(0.98);
}

/* =========================================
   9. 移动端响应式适配
   ========================================= */
@media (max-width: 768px) {
	.layout-grid {
		grid-template-columns: 1fr; /* 变为单列布局 */
	}
	.radio-group {
		width: 100%;
	}
	.radio-pill {
		flex: 1;
		text-align: center;
	}
	.main-header {
		padding: 30px 15px;
	}
	.table-container {
		overflow-x: scroll;
	}
	#transformerTable {
		min-width: 1200px;
	}
	.add-to-list-btn {
		width: 100%;
		padding: 14px 32px;
	}
	.table-actions {
		flex-direction: column;
		width: 100%;
	}
	.action-btn {
		width: 100%;
		padding: 10px 20px;
	}
}