/**
 * 移动端基础优化样式
 * 保持PC端完整布局，仅添加移动端体验优化
 * 用户可以通过缩放和横向滚动查看完整界面
 */

/* ==================== 基础设置 ==================== */
/* 确保页面保持最小宽度，可以横向滚动 */
html, body {
    min-width: 1350px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
}

/* ==================== 触摸优化 ==================== */
/* 优化点击区域的视觉反馈 */
a, button, .layui-btn, input[type="button"], input[type="submit"] {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    -webkit-touch-callout: none;
}

/* 防止长按弹出菜单 */
img {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
}

/* ==================== 输入框优化 ==================== */
/* 防止iOS自动缩放输入框 */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="tel"],
input[type="url"],
textarea,
select {
    font-size: 16px !important; /* 防止iOS缩放 */
    -webkit-appearance: none;
    border-radius: 0; /* 移除iOS默认圆角 */
}

/* ==================== 滚动条美化（仅移动端webkit浏览器） ==================== */
@media screen and (max-width: 1200px) {
    ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
    }
    
    ::-webkit-scrollbar-track {
        background: #f1f1f1;
    }
    
    ::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 3px;
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
}

/* ==================== 表格优化 ==================== */
/* 确保表格可以横向滚动 */
.layui-table-view,
.layui-table-box,
table {
    -webkit-overflow-scrolling: touch;
}

/* ==================== 固定元素优化 ==================== */
/* 确保固定定位元素在移动端正常显示 */
.right_kefu {
    position: fixed !important;
    z-index: 9999;
}

/* ==================== 性能优化 ==================== */
/* 使用硬件加速优化滚动性能 */
.user_main,
.layui-table-view {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* ==================== 弹出层响应式优化 ==================== */
/* 响应式弹出层样式 - 只针对进货数据弹出层 */
/* 隐藏layer默认的最大化最小化按钮，避免重复 */
.layui-layer.caozuokuang.responsive-layer .layui-layer-min,
.layui-layer.caozuokuang.responsive-layer .layui-layer-max,
.layui-layer.caozuokuang.responsive-layer .layui-layer-maxmin {
	display: none !important;
}

/* 只保留关闭按钮 */
.layui-layer.caozuokuang.responsive-layer .layui-layer-setwin {
	position: absolute;
	right: 15px;
	top: 15px;
	z-index: 10;
}

.layui-layer.caozuokuang.responsive-layer .layui-layer-setwin a {
	position: relative;
	width: 16px;
	height: 16px;
	margin-left: 0;
	display: inline-block;
}

/* 通用响应式优化 */
.caozuokuang.responsive-layer {
	box-shadow: 0 3px 12px rgba(0,0,0,0.3);
}

/* 确保表格在所有设备上正常显示 */
.caozuokuang.responsive-layer .layui-table {
	width: 100%;
	table-layout: auto;
}

/* 优化关闭按钮样式 */
.caozuokuang.responsive-layer .layui-layer-close {
	background-position: center !important;
	cursor: pointer;
}

.caozuokuang.responsive-layer .layui-layer-close:hover {
	background-color: #ff5722;
	opacity: 0.8;
}

/* 选择采购端账号弹出层响应式样式 */
.layui-layer.caozuokuang-modal.responsive-modal .layui-layer-min,
.layui-layer.caozuokuang-modal.responsive-modal .layui-layer-max,
.layui-layer.caozuokuang-modal.responsive-modal .layui-layer-maxmin {
	display: none !important;
}

/* ==================== 手机端样式 (max-width: 768px) ==================== */
@media screen and (max-width: 768px) {
    /* 添加缩放提示，3秒后自动消失 */
    body::after {
        content: "提示：双指可缩放页面，左右滑动查看";
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 8px 15px;
        border-radius: 20px;
        font-size: 12px;
        z-index: 99999;
        white-space: nowrap;
        pointer-events: none;
        animation: fadeInOut 3s ease-in-out forwards;
    }
    
    @keyframes fadeInOut {
        0% { opacity: 0; }
        20% { opacity: 1; }
        80% { opacity: 1; }
        100% { opacity: 0; visibility: hidden; }
    }
    
    /* 在小屏幕上稍微缩小右侧客服栏 */
    .right_kefu {
        transform: scale(0.8);
        transform-origin: right center;
    }
    
    /* 已有进货数据弹出层 */
    .layui-layer.caozuokuang.responsive-layer {
		position: fixed !important;
		top: 50% !important;
		left: 50% !important;
		transform: translate(-50%, -50%) !important; /* 居中显示 */
		width: 95% !important;
		height: 95% !important;
		margin: 0 !important;
		box-shadow: 0 2px 8px rgba(0,0,0,0.2);
	}
	
	.caozuokuang.responsive-layer .layui-layer-content {
		overflow-y: auto !important;
		overflow-x: hidden !important;
		-webkit-overflow-scrolling: touch; /* iOS平滑滚动 */
		height: calc(100% - 43px) !important; /* 减去标题栏高度 */
		box-sizing: border-box;
		padding: 10px;
	}
	
	/* 调整表格响应式 */
	.caozuokuang.responsive-layer .layui-table-view {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		width: 100%;
	}
	
	/* 调整表格工具栏 */
	.caozuokuang.responsive-layer .layui-table-tool {
		overflow-x: auto;
		font-size: 12px;
	}
	
	/* 调整标题栏 */
	.caozuokuang.responsive-layer .layui-layer-title {
		height: 43px;
		line-height: 43px;
		font-size: 14px;
		padding: 0 50px 0 15px;
		cursor: move; /* 显示可拖动光标 */
		-webkit-user-select: none; /* 防止选中文字 */
		-moz-user-select: none;
		-ms-user-select: none;
		user-select: none;
	}
	
	/* 确保按钮区域正常显示 */
	.caozuokuang.responsive-layer .layui-layer-btn {
		position: fixed;
		bottom: 0;
		left: 2%;
		width: 96%;
		background: #fff;
		padding: 10px;
		border-top: 1px solid #e6e6e6;
		box-sizing: border-box;
		z-index: 10;
	}
	
	/* 内容区域留出底部按钮空间 */
	.caozuokuang.responsive-layer #jinhuo_list {
		padding-bottom: 60px;
	}
	
	/* 选择采购端账号弹出层 */
	.layui-layer.caozuokuang-modal.responsive-modal {
		position: fixed !important;
		top: 50% !important;
		left: 50% !important;
		transform: translate(-50%, -50%) !important;
		width: 95% !important;
		height: 95% !important;
		margin: 0 !important;
		box-shadow: 0 2px 8px rgba(0,0,0,0.2);
	}
	
	.layui-layer.caozuokuang-modal.responsive-modal .layui-layer-content {
		overflow-y: auto !important;
		overflow-x: hidden !important;
		-webkit-overflow-scrolling: touch;
		height: calc(100% - 43px) !important;
		box-sizing: border-box;
		padding: 10px;
	}
	
	.layui-layer.caozuokuang-modal.responsive-modal .layui-table-view {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		width: 100%;
	}
	
	.layui-layer.caozuokuang-modal.responsive-modal .layui-layer-title {
		height: 43px;
		line-height: 43px;
		font-size: 14px;
		padding: 0 50px 0 15px;
		cursor: move;
		-webkit-user-select: none;
		-moz-user-select: none;
		-ms-user-select: none;
		user-select: none;
	}
}

/* ==================== 平板端样式 (769px - 1024px) ==================== */
@media screen and (max-width: 1024px) and (min-width: 769px) {
	/* 已有进货数据弹出层 */
	.layui-layer.caozuokuang.responsive-layer {
		position: fixed !important;
		top: 5% !important;
		left: 5% !important;
		width: 90% !important;
		max-height: 750px !important; /* 提高到750px */
		margin: 0 !important;
	}
	
	.layui-layer.caozuokuang.responsive-layer .layui-layer-content {
		padding: 10px;
		overflow-y: auto !important;
		-webkit-overflow-scrolling: touch;
		height: calc(100% - 43px) !important;
		max-height: 707px; /* 750px - 43px标题栏 */
	}
	
	.layui-layer.caozuokuang.responsive-layer .layui-table-view {
		overflow-x: auto;
		width: 100%;
	}
	
	/* 调整标题栏 */
	.layui-layer.caozuokuang.responsive-layer .layui-layer-title {
		cursor: move;
		-webkit-user-select: none;
		-moz-user-select: none;
		-ms-user-select: none;
		user-select: none;
	}
	
	/* 选择采购端账号弹出层 */
	.layui-layer.caozuokuang-modal.responsive-modal {
		position: fixed !important;
		top: 5% !important;
		left: 5% !important;
		width: 90% !important;
		max-height: 750px !important;
		margin: 0 !important;
	}
	
	.layui-layer.caozuokuang-modal.responsive-modal .layui-layer-content {
		padding: 10px;
		overflow-y: auto !important;
		-webkit-overflow-scrolling: touch;
		height: calc(100% - 43px) !important;
		max-height: 707px;
	}
	
	.layui-layer.caozuokuang-modal.responsive-modal .layui-table-view {
		overflow-x: auto;
		width: 100%;
	}
	
	.layui-layer.caozuokuang-modal.responsive-modal .layui-layer-title {
		cursor: move;
		-webkit-user-select: none;
		-moz-user-select: none;
		-ms-user-select: none;
		user-select: none;
	}
}

/* ==================== 小屏幕电脑样式 (1025px - 1366px) ==================== */
@media screen and (max-width: 1366px) and (min-width: 1025px) {
	.caozuokuang.responsive-layer .layui-layer-content {
		overflow: auto !important;
	}
	
	.layui-layer.caozuokuang-modal.responsive-modal .layui-layer-content {
		overflow: auto !important;
	}
}

/* ==================== 调试信息（开发时可启用） ==================== */
/*
@media screen and (max-width: 1200px) {
    body::before {
        content: "宽度: " attr(data-width);
        position: fixed;
        top: 0;
        left: 0;
        background: red;
        color: white;
        padding: 5px;
        z-index: 99999;
        font-size: 12px;
    }
}
*/