/**
 * 通用CSS样式布局处理 - 优化版
 * Copyright (c) 2019 deer (优化于2023)
 */

/* ========== 基础工具类 ========== */
/* 间距工具类 */
.mt5 { margin-top: 5px; }
.mr5 { margin-right: 5px; }
.mb5 { margin-bottom: 5px; }
.ml5 { margin-left: 5px; }
.pt5 { padding-top: 5px; }
.pr5 { padding-right: 5px; }
.pb5 { padding-bottom: 5px; }
.pl5 { padding-left: 5px; }

.mt10 { margin-top: 10px; }
.mr10 { margin-right: 10px; }
.mb10 { margin-bottom: 10px; }
.ml10 { margin-left: 10px; }
.pt10 { padding-top: 10px; }
.pr10 { padding-right: 10px; }
.pb10 { padding-bottom: 10px; }
.pl10 { padding-left: 10px; }

.mt20 { margin-top: 20px; }
.mr20 { margin-right: 20px; }
.mb20 { margin-bottom: 20px; }
.ml20 { margin-left: 20px; }
.pt20 { padding-top: 20px; }
.pr20 { padding-right: 20px; }
.pb20 { padding-bottom: 20px; }
.pl20 { padding-left: 20px; }

/* 图片尺寸类 */
.img-xs { width: 32px; height: 32px; object-fit: cover; }
.img-sm { width: 64px; height: 64px; object-fit: cover; }
.img-md { width: 96px; height: 96px; object-fit: cover; }
.img-lg { width: 120px; height: 120px; object-fit: cover; }

/* 文本工具类 */
.text-ellipsis {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.text-primary { color: #409EFF; }
.text-success { color: #67C23A; }
.text-warning { color: #E6A23C; }
.text-danger { color: #F56C6C; }
.text-info { color: #909399; }

/* 布局工具类 */
.flex-center {
	display: flex;
	align-items: center;
	justify-content: center;
}
.flex-between {
	display: flex;
	align-items: center;
	justify-content: space-between;
}
.flex-column {
	display: flex;
	flex-direction: column;
}

/* ========== 全局样式 ========== */
body {
	font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
	color: #333;
	background-color: #f5f7fa;
	line-height: 1.5;
}

/* 容器样式 */
.container-div {
	padding: 20px;
	background-color: #fff;
	border-radius: 8px;
	box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
	margin: 15px auto;
	max-width: 99%;
}

.section-content {
	min-height: 250px;
	margin: 0 auto;
	padding: 15px;
	width: 100%;
	position: relative;
}

/* 卡片样式 */
.ibox {
	margin-bottom: 25px;
	background-color: #fff;
	border: 1px solid #e6ebf5;
	border-radius: 8px;
	box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
	transition: all 0.3s ease;
}

.ibox:hover {
	box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.1);
}

.ibox-title-gray {
	height: 48px;
	background-color: #f8fafc;
	color: #333;
	font-weight: 600;
	border-radius: 8px 8px 0 0;
	padding: 14px 20px;
	border-bottom: 1px solid #e6ebf5;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

/* 列表组样式 */
.list-group-striped > .list-group-item {
	border-left: 0;
	border-right: 0;
	border-radius: 0;
	padding: 12px 20px;
	transition: background-color 0.3s;
}

.list-group-striped > .list-group-item:nth-child(odd) {
	background-color: #f8fafc;
}

.list-group-striped > .list-group-item:hover {
	background-color: #f0f4f8;
}

/* ========== 导航页签 ========== */
.nav-tabs-custom {
	margin-bottom: 20px;
	background: #fff;
	box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
	border-radius: 8px;
	overflow: hidden;
}

.nav-tabs-custom > .nav-tabs {
	margin: 0;
	border-bottom-color: #e6ebf5;
	background-color: #f8fafc;
}

.nav-tabs-custom > .nav-tabs > li {
	border-top: 3px solid transparent;
	margin-bottom: -2px;
	margin-right: 8px;
}

.nav-tabs-custom > .nav-tabs > li > a {
	color: #606266;
	font-weight: 500;
	border-radius: 0;
	padding: 12px 20px;
	transition: all 0.3s;
}

.nav-tabs-custom > .nav-tabs > li.active {
	border-top-color: #409EFF;
}

.nav-tabs-custom > .nav-tabs > li.active > a {
	background-color: #fff;
	color: #409EFF;
	border-left-color: #e6ebf5;
	border-right-color: #e6ebf5;
}

.nav-tabs-custom > .tab-content {
	background: #fff;
	padding: 20px;
	border-radius: 0 0 8px 8px;
}

/* ========== 表单样式 ========== */
/* 表单验证 */
label.error {
	position: absolute;
	right: 10px;
	top: 10px;
	color: #F56C6C;
	font-size: 12px;
	font-weight: 500;
}

.input-group label.error {
	right: 40px;
	z-index: 99;
}

.Validform_error, input.error, select.error {
	border-color: #F56C6C !important;
}

.Validform_wrong {
	color: #F56C6C;
}

.Validform_right {
	color: #67C23A;
}

/* 复选框 & 单选框 */
.check-box, .radio-box {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
	position: relative;
	padding-left: 25px;
	margin-right: 15px;
	user-select: none;
}

.icheckbox, .iradio {
	position: absolute;
	left: 0;
	width: 18px;
	height: 18px;
	background-color: #fff;
	border: 1px solid #dcdfe6;
	border-radius: 2px;
	transition: all 0.3s;
}

.iradio {
	border-radius: 50%;
}

.icheckbox.checked {
	background-color: #409EFF;
	border-color: #409EFF;
}

.iradio.checked {
	background-color: #409EFF;
	border-color: #409EFF;
}

/* 切换开关 */
.toggle-switch {
	display: inline-flex;
	align-items: center;
	margin-bottom: 0;
}

.toggle-switch input {
	position: absolute;
	opacity: 0;
}

.toggle-switch span {
	position: relative;
	width: 40px;
	height: 20px;
	border-radius: 10px;
	background-color: #dcdfe6;
	transition: all 0.3s;
	cursor: pointer;
}

.toggle-switch span:after {
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background-color: #fff;
	top: 2px;
	left: 2px;
	transition: all 0.3s;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch input:checked ~ span {
	background-color: #409EFF;
}

.toggle-switch input:checked ~ span:after {
	transform: translateX(20px);
}

/* ========== 表格样式 ========== */
/* 基础表格 */
.table {
	width: 100%;
	border-collapse: collapse;
	color: #606266;
}

.table th {
	background-color: #f8fafc;
	color: #606266;
	font-weight: 600;
	padding: 12px 10px;
	border-bottom: 1px solid #e6ebf5;
	text-align: left;
}

.table td {
	padding: 12px 10px;
	border-bottom: 1px solid #e6ebf5;
}

.table tr:hover td {
	background-color: #f5f9ff;
}

/* 条纹表格 */
.table-striped tbody tr:nth-child(odd) {
	background-color: #f8fafc;
}

/* ========== 树形表格专用样式 ========== */
/* 保持原有树形结构样式不变 */
.bootstrap-tree-table {
	border: 0 !important;
	margin-bottom: 0;
}

.bootstrap-tree-table .treetable-thead th {
	line-height: 24px;
	border: 0 !important;
	border-bottom: 1px solid #e7eaec !important;
	text-align: left;
	background-color: #f8fafc;
	font-weight: normal;
	font-size: 13px;
	padding: 12px 10px;
}

.bootstrap-tree-table .treetable-tbody td {
	border: 0 !important;
	border-bottom: 1px solid #e7eaec !important;
	white-space: nowrap;
	text-overflow: ellipsis;
	padding: 12px 10px;
}

/* 修复树形缩进和展开图标样式 */
.bootstrap-tree-table .treetable-indent {
	width: 16px;
	height: 16px;
	display: inline-block;
	position: relative;
}

.bootstrap-tree-table .treetable-expander {
	width: 16px;
	height: 16px;
	display: inline-block;
	position: relative;
	cursor: pointer;
	color: #909399;
}

.bootstrap-tree-table .treetable-expander:hover {
	color: #409EFF;
}

/* 修复选中行样式 */
.bootstrap-tree-table .treetable-selected {
	background: #f5f5f5 !important;
}

/* 修复树形表格布局 */
.bootstrap-tree-table .treetable-table {
	border: 0 !important;
	margin-bottom: 0;
}

.bootstrap-tree-table .treetable-table tbody {
	display: block;
	height: auto;
}

.bootstrap-tree-table .treetable-table thead,
.bootstrap-tree-table .treetable-table tbody tr {
	display: table;
	width: 100%;
	table-layout: fixed;
}

/* 修复固定列样式 */
.bootstrap-tree-table .left-fixed-table-columns {
	position: absolute;
	background-color: #fff;
	display: none;
	border-right: 1px solid #ddd;
	overflow: hidden;
}

.bootstrap-tree-table .right-fixed-table-columns {
	position: absolute;
	right: 63px;
	border-left: 1px solid #ddd;
	display: none;
	z-index: 100;
}

/* 修复操作列按钮样式 */
.bootstrap-tree-table .btn-group-xs {
	display: flex;
	flex-wrap: nowrap;
	gap: 5px;
}

.bootstrap-tree-table .btn-xs {
	padding: 4px 8px;
	font-size: 12px;
	line-height: 1.5;
	border-radius: 3px;
	min-width: auto;
}

/* ========== 弹层组件 ========== */
/* 遮罩层 */
.loaderbox {
	display: inline-block;
	min-width: 125px;
	padding: 15px 20px;
	margin: 0 auto;
	color: #606266 !important;
	font-size: 14px;
	font-weight: 500;
	text-align: center;
	vertical-align: middle;
	border-radius: 4px;
	background-color: #fff;
	box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}

.loaderbox .loading-activity {
	display: inline-block;
	width: 20px;
	height: 20px;
	border: 2px solid transparent;
	border-top-color: #409EFF;
	border-left-color: #409EFF;
	border-radius: 50%;
	animation: spin 0.6s linear infinite;
	margin-right: 10px;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

/* 弹层禁用样式 */
.layer-disabled {
	background-color: #f5f7fa !important;
	color: #c0c4cc !important;
	cursor: not-allowed;
	pointer-events: none;
}

/* ========== 表单查询条件 ========== */
.search-collapse {
	width: 100%;
	background: #fff;
	border-radius: 8px;
	margin-bottom: 20px;
	padding: 15px 20px;
	box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
}

.select-list ul {
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 15px;
}

.select-list li {
	list-style: none;
	display: flex;
	align-items: center;
}

.select-list li label {
	margin-right: 8px;
	color: #606266;
	font-weight: 500;
}

.select-list li input,
.select-list li select {
	border: 1px solid #dcdfe6;
	border-radius: 4px;
	background: #fff;
	outline: none;
	height: 36px;
	padding: 0 12px;
	transition: border-color 0.3s;
	color: #606266;
}

.select-list li input:focus,
.select-list li select:focus {
	border-color: #409EFF;
}

.search-btn {
	background-color: #409EFF;
	border-color: #409EFF;
	color: #fff;
	padding: 8px 16px;
	font-size: 14px;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.3s;
}

.search-btn:hover {
	background-color: #66b1ff;
	border-color: #66b1ff;
}

/* ========== 响应式处理 ========== */
@media (max-width: 768px) {
	.container-div {
		padding: 15px;
	}

	.select-list ul {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
	}

	.select-list li {
		width: 100%;
	}

	.select-list li input,
	.select-list li select {
		width: 100%;
	}

	.ibox-title-gray {
		flex-direction: column;
		height: auto;
		padding: 12px;
	}
}

/* ========== 自定义面板 ========== */
.deer-panel {
	background: #fff;
	border-radius: 8px;
	border-top: 4px solid #409EFF;
	padding: 20px;
	margin-bottom: 20px;
	box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.05);
}

.deer-breadcrumb {
	padding: 0 15px;
	height: 40px;
	line-height: 40px;
	background-color: #f8fafc;
	border-radius: 4px;
}

.deer-key {
	color: #409EFF;
	width: 80px;
	font-weight: 500;
}

.deer-value {
	font-weight: 600;
}

.el-divider--horizontal {
	display: block;
	height: 1px;
	width: 100%;
	margin: 16px 0;
	background-color: #e6ebf5;
}