/* 
 * 修复版样式表 - 增加了移动端自适应缩放功能
 */
body {
    font-family: Microsoft YaHei, SimSun, Songti SC, NSimSun, FangSong, KaiTi,  sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column; /* Stack children vertically */
    align-items: center; /* Center children horizontally */
}

.container {
    display: flex;
    gap: 30px;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    max-width: 1200px;
    width: 100%;
    box-sizing: border-box; /* Added for consistent width calculation */
    /* overflow-x: hidden; */ /* 防止横向溢出 - 注释掉此行 */
}

.form-section, .preview-section {
    flex: 1;
}

.preview-section {
    display: flex;
    flex-direction: column; /* Ensure items stack vertically */
    align-items: stretch; /* 恢复原来的对齐方式，不居中 */
}

#templateSelectorContainer {
    margin-top: 20px; /* Add space above template selectors */
    margin-bottom: 15px; /* Added margin below template selector */
    width: 100%; /* 确保宽度占满父容器 */
}

.action-buttons {
    display: flex;
    gap: 10px; /* Space between buttons */
    margin-top: 10px; /* Space above buttons */
    width: 100%; /* 确保宽度占满父容器 */
}

.action-buttons button {
    flex: 1; /* Make buttons take equal width */
}

.form-section h2, .preview-section h2 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

label {
    display: block;
    margin-top: 10px;
    margin-bottom: 5px;
    color: #555;
    font-weight: bold;
}

input[type="text"], input[type="number"], select {
    width: calc(100% - 22px);
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Improved slider styles */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: calc(100% - 22px); /* Match other inputs */
    height: 8px;
    background: #ddd;
    border-radius: 5px;
    outline: none;
    opacity: 0.7;
    -webkit-transition: .2s;
    transition: opacity .2s;
    margin-bottom: 10px; /* Match other inputs */
    padding: 0; /* Remove default padding */
}

input[type="range"]:hover {
    opacity: 1;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #007bff;
    border-radius: 50%;
    cursor: pointer;
    border: none; /* Remove default border in Firefox */
}

#templateSelectorContainer select {
    margin-bottom: 15px; /* Add more space after template selects */
}

hr.separator {
    border: 0;
    height: 1px;
    background-color: #eee;
    margin: 20px 0;
}

button {
    display: block;
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
}

button:hover {
    background-color: #0056b3;
}

/* --- Electronic Label Styles --- */
.label-container {
    display: flex;
    justify-content: center;
    align-items: center; /* 添加垂直居中 */
    overflow: visible; /* 确保内容不被裁剪，且不出现滚动条 */
    width: 100%;
    height: auto; /* 自动高度，适应内容 */
}

.mobile-view-hint {
    display: none; /* 默认隐藏 */
    text-align: center;
    color: #666;
    font-size: 14px;
    padding: 5px;
    margin-bottom: 10px;
}

#electronic-label {
    width: 600px;
    min-width: 600px; /* 防止宽度缩小 */
    border: 2px solid black;
    padding: 20px;
    background-color: white;
    box-sizing: border-box;
    margin: 20px 0;
    font-family: inherit;
}

.label-title {
    font-size: 36px;
    font-weight: 900; /* Increased font-weight */
    text-align: center;
    margin-bottom: 25px;
    letter-spacing: 2px;
}

.label-content {
    display: flex;
    justify-content: space-between;
    align-items: center; /* Changed from flex-start to center for vertical alignment */
    gap: 20px;
}

.label-info {
    flex-grow: 1;
    line-height: 1.8;
    white-space: nowrap; /* 防止文本自动换行 */
}

.label-info div {
    margin-bottom: 8px;
}

.label-key {
    font-weight: bold;
}

#qrCodeContainer {
    display: flex; /* Added to allow centering of the image */
    align-items: center; /* Vertically center the QR code image */
    justify-content: center; /* Horizontally center the QR code image if needed, though flex-end on parent might be preferred */
    min-width: 160px; /* Ensure container has a minimum width for the QR code */
}

#qrCodeContainer img {
    max-width: 100%;
    max-height: 100%;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .container {
        flex-direction: column; /* Stack sections vertically */
    }
    .preview-section {
        order: -1; /* Ensure preview section is on top */
        width: 100%; /* 确保预览部分占满容器宽度 */
    }
    .mobile-view-hint {
        display: block; /* 在移动设备上显示提示 */
    }    .label-container {
        overflow: visible; /* 内容完全可见，不裁剪 */
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center; /* 垂直居中 */
    }
    
    #electronic-label {
        font-family: inherit;
        width: 600px; /* 原始宽度 */
        min-width: auto; /* 移动端不设置最小宽度限制 */
        transform-origin: center center; /* 从中心点缩放 */
        /* 简化缩放公式，确保在移动设备上完整显示 */
        transform: scale(0.65);
        margin: 0 auto; /* 移除底部大边距 */
        height: auto; /* 自动高度 */
        position: static; /* 确保不使用绝对定位 */
    }
    #templateSelectorContainer {
        order: 0; /* Ensure template selector is below the preview image but above form */
    }
    .action-buttons {
        order: 1; /* Ensure buttons are after template selector on mobile */
    }
    .form-section {
        order: 2; /* Ensure form section is at the bottom */
    }
}

/* --- More Information Section Styles --- */
.more-info-section {
    margin-top: 20px;
    padding: 20px; /* Applied padding to all sides */
    background-color: #fff; /* Added for card style */
    border-radius: 8px; /* Added for card style */
    box-shadow: 0 0 10px rgba(0,0,0,0.1); /* Added for card style */
    max-width: 1200px; /* Match .container */
    width: 100%; /* Responsive width */
    box-sizing: border-box; /* Consistent box model */
    border-top: 1px solid #eee; /* Explicitly keeping this as per thought process */
}

.more-info-section h2 {
    color: #333;
    margin-top: 0; /* Remove default top margin */
    margin-bottom: 15px;
    border-bottom: 1px solid #eee; /* Consistent heading style */
    padding-bottom: 10px; /* Consistent heading style */
}

.more-info-section p, 
.more-info-section ul {
    color: #555;
    line-height: 1.6;
    margin-bottom: 10px;
}

.more-info-section ul {
    padding-left: 20px;
}

.more-info-section a {
    color: #007bff;
    text-decoration: none;
}

.more-info-section a:hover {
    text-decoration: underline;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* Responsive grid */
    gap: 20px;
    margin-top: 20px;
}

.contact-item {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #eee;
    display: flex; /* For aligning text and QR code */
    flex-direction: column; /* Stack items vertically */
    align-items: center; /* Center items horizontally */
    text-align: center; /* Center text */
}

.contact-item p {
    margin-bottom: 10px; /* Space between text and QR */
}

.qr-code-small-container {
    width: 80px; /* Match JS size */
    height: 80px; /* Match JS size */
    margin-top: 10px; /* Space above QR code */
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-code-small-container img {
    max-width: 100%;
    max-height: 100%;
    border: 1px solid #eee; /* Optional: slight border for the small QRs */
}

/* --- Disclaimer Section Styles --- */
.disclaimer-section {
    text-align: center; /* 居中显示 */
    font-size: 0.8em; /* 小字体 */
    color: #818181; /* 浅灰色 */
    margin-top: 20px; /* 与上方内容保持间距 */
    padding: 10px;
    border-top: 1px solid #eee; /* 可选：添加一个顶部分隔线 */
}

.disclaimer-section p {
    margin-bottom: 5px; /*段落间距*/
}

/* 广告区域样式 */
.ad-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    max-width: 1200px;
    width: 100%;
    box-sizing: border-box;
    margin-top: 20px;
    margin-bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ad-link {
    display: block;
    text-decoration: none;
    width: 100%;
    max-width: 100%;
}

.ad-image-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.ad-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    transition: opacity 0.3s ease;
}

.ad-image:hover {
    opacity: 0.9;
}

.ad-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #ccc;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 2px;
    opacity: 0.7;
}

/* 强制隐藏不蒜子计数元素 */
#busuanzi_container_site_pv,
#busuanzi_container_site_uv,
#busuanzi_value_site_pv,
#busuanzi_value_site_uv {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
}
