body {
    font-family: Segoe UI, Calibri, Arial, Helvetica, 'microsoft yahei';
	background: #555;
    font-size: 12px;
    color: #111;
    margin: 0;
}

#wrapper{
	width: 960px;
	margin: 0 auto;
	padding: 20px;
	background: #ffffff;	
}
#webheader {
	width: 960px;
	height: 172px;
	margin: 0 auto;
	background: url(images/img01.jpg) no-repeat left top;
}
#menu {
  width: 960px;
  height: 41px;
  margin: 0 auto;
  padding: 0;
  background: url(images/img02.jpg) no-repeat left top;
}
#menu ul {
  margin: 0;
  padding: 0;
  list-style: none;
  line-height: normal;
}
#menu li {
  float: left;
}
#menu a {
  display: block;
  padding: 13px 10px 10px 20px;
  text-transform: uppercase;
  text-decoration: none;
  font-size: 12px;
  font-weight: bold;
  color: #FFFFFF;
  border: none;
}

form, .header {
    display: block;
    margin: auto;
    width: 100%;
    /* min-width: 600px; */
    /* max-width: 700px; */
    position: relative;
}

.header{
	margin-bottom:10px;
}

main{
	display:flex;
	gap:20px;
}

form{
	/* width:100%; */
}
/* 表单组样式优化 */
.form-group {
	margin-bottom: 20px;
}

.form-group label,td label {
	display: block;
	margin-bottom: 8px;
	font-weight: bold;
	color: #333;
	margin-top: 10px;
    text-align: right;
}

.form-group input, 
.form-group select,
td input, 
td select,
nav select, 
.form-group textarea {
	width: 100%;
	padding: 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	box-sizing: border-box;
}

.form-group textarea {
	min-height: 80px;
}

.output{
	width:50%;
}
.header ul {
  width: 710px;
  font-size: 16px;
  line-height: 28px;
}
nav label {
  display: block;
  color: #900;
  font-size: 14px;
  font-weight: bold;
}

h3 {
  font-size: 14px;
  font-weight: bold;
  font-style: normal;
  padding-bottom: 4px;
  border-bottom: 1px solid #c8c8c8;
  margin: 0 0 14px 0;
  color: #900;
}

input, select {
    margin: 0;
}

input[type=text], input[type=number], select {
    border: 1px solid #ababab;
    padding: 2px;
}

select {
    padding-top: 1px;
    padding-bottom: 1px;
}

ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

section {
    margin-bottom: 24px;
}

section.output{
	width:100%;
}

h1 {
    display: none;
}

h2 {
    margin: 14px 0 8px 0;
    font-weight: normal;
    font-size: 20px;
}

h3 {
    font-size: 16px;
    font-weight: normal;
    font-style: italic;
    padding-bottom: 4px;
    border-bottom: 1px solid #c8c8c8;
    margin: 0 0 14px 0;
}

.logo {
    margin-top: 8px;
	margin-right:10px;
	float:left;
}

nav {
    float: right;
    position: absolute;
    top: 34px;
    right: 0;
	width:230px;
}

nav label {
    display: block;
}

nav select {
    margin: 2px 0;
    margin-left: 0;
	width:calc(100% - 10px);
}

table {
    table-layout: fixed;
    border-collapse: collapse;
    width: 100%;
}

table td {
    padding: 3px 10px 1px 4px;
    vertical-align: top;
    height: 26px; /* This act as a min-height */
    line-height: 30px;
}

table tr.odd {
    /* background-color: #eee; */
}

table tr.even {
}

table .col1 {
    width: 72px;
}

table .info,nav .info {
    position: absolute;
    dtop: 0;
    dright: 5px;
    line-height: 34px;
}

.info img {
    border: 0;
    vertical-align: text-bottom;
}

.generate {
    float: left;
}

.possiblechars {
    float: right;
    position: relative;
}

#dpiUnavailable {
    display: none;
    padding-left: 8px;
}
.main .configurations{
	width:100%;
}
.main>.configurations{
	width:50%;
}
div.configurations select {
    max-width: 96px;
}

div.configurations input[type=number] {
    width: 96px;
	height: 28px;
    margin-top: 10px;
}

#filetype{
	width:100%;
	max-width: 100%;
}

#font_size{
	width:48px;
}

#text{
	height: 40px;
	font-size: 28px;
	margin-bottom: 10px;
	padding: 5px;
}

#submit{
	font-size:16px;
}

/* Moved section by script */
#explanation, #dpiExplain, #validCharacters {
    display: none;
    max-width: 450px;
}

#explanation ul {
    list-style: disc;
    margin-left: 20px;
}

#specificOptions {
    display: none;
}

#validCharacters input[type=button] {
    width: 25px;
    padding: 1px 6px;
}

.BCGcode128 #validCharacters input[type=button],
.BCGcode39extended #validCharacters input[type=button],
.BCGcode93 #validCharacters input[type=button],
.BCGgs1128 #validCharacters input[type=button],
.BCGaztec #validCharacters input[type=button],
.BCGdatamatrix #validCharacters input[type=button],
.BCGmaxicode #validCharacters input[type=button],
.BCGqrcode #validCharacters input[type=button],
.BCGpdf417 #validCharacters input[type=button] {
    width: 39px;
}

.bubble {
    display: none;
}

.bubble.visible {
    display: block !important;
    position: absolute;
    background-color: #f8f8f8;
    border: 2px solid #ddd;
    padding: 16px;
}

.gs1128_id {
    width: 40px;
    text-align: center;
}

.gs1128_value {
    width: 295px;
}

.gs1128_delete img {
    border: 0;
    margin-left: 5px;
    vertical-align: text-bottom;
}

#identifierContainer {
    margin-top: 4px;
}

.warning {
    background-color: #fcf8e3;
    border: 1px solid #faf2cc;
    color: #8a6d3b;
    padding: 8px;
}

#imageOutput{
	min-height:120px;
	text-align: center;
	margin-top: 10px;
}

.footer {
  margin-top: 40px;
  height: 80px;
  text-align: center;
  color: #666666;
  background-color: #EAEAEA;
  border-top-width: 2px;
  border-top-style: solid;
  border-top-color: #CCC;
  margin-top: 5px;
}

.modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0,0,0,0.7);
	display: none;
	z-index: 1000;
	justify-content: center;
	align-items: center;
	padding: 20px;
	box-sizing: border-box;
	overflow: auto;
}

.modal-content {
	width: 90%;
	max-width: 1000px;
	height: auto;
	max-height: 90vh;
	background: white;
	border-radius: 8px;
	display: flex;
	flex-direction: column;
	position: relative;
	box-shadow: 0 5px 15px rgba(0,0,0,0.3);
	margin:0 auto;
}

/* 固定操作按钮区域 */
.action-buttons-container {
	position: sticky;
	margin-bottom: 20px;
	background: white;
	padding: 0 15px;
	/* border-top: 1px solid #eee; */
	display: flex;
	justify-content: center;
	z-index: 10;
}

.action-buttons {
	display: flex;
	gap: 15px;
}

.modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-bottom: 15px;
	border-bottom: 1px solid #eee;
}
.modal-header h2{
	margin-left:15px;
}

/* 标准关闭按钮样式 */
.modal-close {
    position: absolute;
    right: 10px;
    top: 10px; /* 固定距离顶部20px，不再需要垂直居中按钮 */
    width: 24px;
    height: 24px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 32px;
    line-height: 36px; /* 关键：使行高等于容器高度 */
    text-align: center; /* 关键：水平居中 */
    cursor: pointer;
    z-index: 10;
    padding: 0; /* 必须清除默认padding */
    display: flex; /* 弹性布局确保完美居中 */
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
    box-sizing: border-box; /* 包含padding和border */
	font-family: "Helvetica";
}

.modal-close:hover {
    background: #c0392b;
}

.close-modal {
	background: #e74c3c;
	color: white;
	border: none;
	padding: 5px 15px;
	border-radius: 4px;
	cursor: pointer;
}

/* 预览内容区域 - 可滚动 */
.preview-content {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
}


.action-buttons button {
	padding: 10px 25px;
	min-width: 100px;
}

/* 模态框高度优化 */
.modal-content {
	max-height: 85vh;
}


.preview-panel {
	flex: 1;
	padding: 15px;
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* 操作按钮样式 */
.action-buttons {
	display: flex;
	gap: 10px;
	margin-top: 20px;
	justify-content: center;
}

.action-buttons button {
	padding: 10px 20px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 16px;
	transition: background 0.3s;
}

.btn-print {
	background: #3498db;
	color: white;
}

.btn-pdf {
	background: #e74c3c;
	color: white;
}

.btn-close {
	background: #95a5a6;
	color: white;
}

.barcode-item {
	border: 1px solid #eee;
	padding: 10px;
	text-align: left;
}

/* 响应式调整 */
@media (max-width: 1000px) {
	.layout-container {
		flex-direction: column;
	}
}

/* 自适应布局容器 */
.layout-container {
	display: flex;
	height: calc(100% - 60px);
	margin-top: 0;
}

/* 加宽表单面板 */
.form-panel {
	width: 240px; 
	padding: 20px; /* 增加内边距 */
	/* border-right: 1px solid #eee; */
	overflow-y: auto;
	padding-right:0;
}

.form-panel-content {
	border-right: 1px solid #eee;
	padding-right: 20px;
	padding-bottom: 1px;
}

/* 预览区域自适应高度 */
.preview-container {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0; /* 重要：允许内容收缩 */
	width:800px;
}

.preview-content {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
}

/* A4预览区域自适应 */
.a4-preview {
	width: 100%;
	max-width: 210mm;
	margin: 0 auto;
	background: white;
	box-shadow: 0 0 10px rgba(0,0,0,0.1);
	padding: 10mm;
	box-sizing: border-box;
	max-height: 520px;
	min-height: 520px;
	overflow: auto;
}

.barcode-item {
	display: flex;
	flex-direction: column;
	align-items: last baseline;
	justify-content: center;
	padding: 10px;
	border: 1px solid #eee;
	box-sizing: border-box;
}

.small .product-name{
	font-size:12px;
}

.medium .product-name{
	font-size:16px;
}

.large .product-name{
	font-size:24px;
}

.barcode-container {
	text-align: center;
	/* margin-bottom: 20px; */
}

.product-info {
	text-align: left;
	font-family: 'Arial', sans-serif;
}

.product-name {
	font-size: 24px;
	font-weight: bold;
	margin-bottom: 10px;
}

.product-price {
	font-size: 28px;
	color: #e74c3c;
	margin-bottom: 10px;
}

.product-date {
	font-size: 16px;
	color: #7f8c8d;
}

.action-buttons {
	display: flex;
	gap: 10px;
	margin-top: 15px;
}

.action-buttons button {
	padding: 10px 20px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 16px;
}

.btn-print {
	background: #3498db;
	color: white;
}

.btn-close {
	background: #95a5a6;
	color: white;
}

/* 下载按钮样式 */
.download-btn,.gen-btn {
	display: inline-block;
	padding: 8px 15px;
	background: #2ecc71;
	color: white;
	text-decoration: none;
	border-radius: 4px;
	margin: 0 5px;
	transition: background 0.3s;
	cursor: pointer;
}

.download-btn:hover,.gen-btn:hover {
	background: #27ae60;
	cursor: pointer;
}

.gen-btn{
	margin-left:0;
}
.layout-btn {
	display: inline-block;
	padding: 8px 15px;
	background: #9b59b6;
	color: white;
	text-decoration: none;
	border-radius: 4px;
	margin: 0 5px;
	transition: background 0.3s;
}

.layout-btn:hover {
	background: #8e44ad;
}
	
/* 打印样式优化 */
@media print {
	body * {
		visibility: hidden;
	}
	.preview-panel, .preview-panel * {
		visibility: visible;
	}
	.preview-panel {
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		padding: 0;
		margin: 0;
	}
	.a4-preview {
		box-shadow: none;
		padding: 0;
		width: 210mm;
		height: 297mm;
	}
}

/* 新增打印数量样式 */
.print-quantity {
	margin-bottom: 20px;
}

/* 预览区域网格布局 */
.a4-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	gap: 15px;
	margin-bottom: 15px;
	width: 100%;
}

/* PDF生成按钮样式 */
.btn-pdf {
	background: #e74c3c;
	color: white;
}

/* 图片加载状态指示 */
#barcodeImage.loading {
    background: url('images/loading.gif') center center no-repeat;
    min-height: 50px;
}

/* 图片显示动画 */
#barcodeImage {
    transition: opacity 0.2s ease-in-out;
    max-width: 100%;
    height: auto;
}