
.container {
    max-width: 1200px;
    margin: 0 auto;
    /* padding: 20px; */
}

.container h1 {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    background-color: #4CAF50;
    color: white;
    border-radius: 8px;
}

.container img {
	
	margin: 0 auto 0px !important;
}

main {
    /* display: grid; */
    grid-template-columns: 1fr;
    gap: 30px;
}

.description {
    text-align: center;
    margin-bottom: 10px;
    font-size: 0.88em;
    color: #555;
    line-height: 1.6;
}

/* 确保上传区域始终在最上方 */
.upload-section {
    grid-column: 1 / -1;
}

section {
    background-color: white;
    /* padding: 20px; */
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #4CAF50;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* 文件上传区域 */
.upload-section {
    text-align: center;
}

#document-upload {
    display: none;
}

.upload-btn {
    display: inline-block;
    padding: 15px 35px;
    background-color: #467e1c;
    color: white;
    font-size: 1.2rem;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.upload-btn:hover {
    background-color: #45a049;
}

/* 签名区域 */
.signature-section,
.document-section {
    display: none;
}

.signature-options {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.signature-options button {
    padding: 10px 20px;
    background-color: #f1f1f1;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.signature-options button.active {
    background-color: #4CAF50;
    color: white;
}

.signature-options button:hover:not(.active) {
    background-color: #ddd;
}

.signature-canvas-container {
    position: relative;
    display: block;
    width: 100%;
    margin-top: 10px;
}

#signature-canvas {
    border: 2px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
    cursor: crosshair;
    width: 100%;
    height: 300px;
}

/* 清除签名按钮特殊样式 */
.signature-options #clear-signature-btn {
    background-color: #b23f36;
    color: white;
}

.signature-options #clear-signature-btn:hover {
    background-color: #a91f15;
}
/* 保存签名按钮特殊样式 */
.signature-options #save-signature-btn {
    background-color: #393db8;
    color: white;
}

.signature-options #save-signature-btn:hover {
    background-color: #3617b0;
}

/* 确认签名按钮样式 */
.signature-section #confirm-signature-btn {
    display: block;
    margin: 20px auto 0;
    padding: 15px 30px;
    background-color: #4CAF50;
    color: white;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.signature-section #confirm-signature-btn:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.signature-upload-container {
    text-align: center;
    width: 100%;
}

#signature-upload {
    display: none;
}

#uploaded-signature-preview {
    margin-top: 20px;
    width: 100%;
    max-height: 500px;
    border: 2px dashed #ddd;
    border-radius: 4px;
    /* padding: 10px; */
    text-align: center;
}

#uploaded-signature-preview img {
    max-width: 100%;
    max-height: 180px;
    border-radius: 4px;
}

/* 默认上传图片样式 */
.default-upload-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 150px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.default-upload-image {
    transition: all 0.3s ease;
}

.default-upload-container:hover .default-upload-image {
    transform: scale(0.88);
    font-size: 18px;
}

.default-upload-container:hover .default-upload-image svg {
    stroke: #4CAF50;
    stroke-width: 2.5px;
}

/* 上传提示样式 */
.upload-prompt {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.default-upload-container:hover .upload-prompt {
    opacity: 1;
}

/* 已上传图片容器样式 */
.uploaded-image-container {
    position: relative;
    display: inline-block;
    cursor: pointer;
    border: 2px dashed transparent;
    padding: 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.uploaded-image-container:hover {
    border-color: #4CAF50;
}

.uploaded-image-container:hover .upload-prompt {
    opacity: 1;
}

/* 文档预览区域 */
#document-preview {
    width: 100%;
    height: 100%;
    border: 2px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
    overflow: auto;
    position: relative;
}

/* PDF容器 */
#pdf-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* padding: 20px; */
    min-height: 100%;
}

/* 页面容器 */
#page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* PDF页面包装器 */
.pdf-page-wrapper {
    display: inline-block;
    position: relative;
    text-align: center;
    vertical-align: top;
    margin-bottom: 10px;
}

/* PDF页面画布 */
.pdf-page-canvas {
    display: block;
    border: 2px solid #acbdae;
    max-width: 100%;
    height: auto;
}

/* 页面签名覆盖层 */
.page-signature-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 签名覆盖层（Word文档使用） */
#signature-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

/* Word文档表格样式 - 最小化干预，保留原始样式 */
.word-table {
    border-collapse: collapse;
    max-width: 100%;
    margin: 10px 0;
    box-sizing: border-box;
}

/* 确保表格在容器内正确显示 */
.word-table {
    display: block;
    overflow-x: auto;
    box-sizing: border-box;
}

#signature-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.signature-item {
    position: absolute;
    cursor: move;
    pointer-events: auto;
    border: 2px solid transparent;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.signature-item:hover {
    border-color: #4CAF50;
}

.signature-item img {
    max-width: 100%;
    max-height: 100%;
}

.page-info {
    text-align: center;
    margin: 10px 0;
    font-size: 16px;
    color: #555;
    font-weight: bold;
}

.signature-tools {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center; /* 使按钮居中显示 */
}

.zoom-targets {
    display: flex;
    gap: 5px;
    margin-right: 10px;
}

.zoom-targets button {
    padding: 8px 16px;
    background-color: #f1f1f1;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.zoom-targets button.active {
    background-color: #4CAF50;
    color: white;
}

.zoom-targets button:hover:not(.active) {
    background-color: #ddd;
}

.signature-tools button {
    padding: 12px 24px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.signature-tools button:hover {
    background-color: #45a049;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.signature-tools button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    transition: all 0.1s ease;
}

/* 禁用按钮样式 */
.signature-tools button.disabled,
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    pointer-events: none;
}

/* 导航按钮 - 蓝色系 */
.signature-tools #prev-page-btn,
.signature-tools #next-page-btn {
    background-color: #2196F3;
}

.signature-tools #prev-page-btn:hover,
.signature-tools #next-page-btn:hover {
    background-color: #0b7dda;
}

/* 缩放按钮 - 橙色系 */
.signature-tools #zoom-in-btn,
.signature-tools #zoom-out-btn {
    background-color: #ff9800;
}

.signature-tools #zoom-in-btn:hover,
.signature-tools #zoom-out-btn:hover {
    background-color: #e68a00;
}

/* 重置按钮 - 灰色系 */
.signature-tools #reset-btn {
    background-color: #9e9e9e;
}

.signature-tools #reset-btn:hover {
    background-color: #757575;
}

/* 清除按钮 - 红色系 */
.signature-tools #clear-btn {
    background-color: #f44336;
}

.signature-tools #clear-btn:hover {
    background-color: #da190b;
}

/* 下载保存按钮 - 绿色系（主色调，增加视觉强调） */
.signature-tools #save-btn {
    background-color: #4CAF50;
    padding: 10px 30px;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 10px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
}

/* 响应式设计 */
@media (min-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }
    
    .document-section {
        grid-column: 1;
        grid-row: 3;
    }
}

@media (min-width: 1024px) {
    main {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }
    
    .signature-section {
        grid-column: 1;
        grid-row: 2;
    }
    
    .document-section {
        grid-column: 1;
        grid-row: 3;
    }
}

/* 移动设备签名适配 */
@media (max-width: 767px) {
    #signature-canvas {
        width: 100%;
        height: 250px;
    }
    
    #document-preview {
        height: 900px;
    }
    
    /* 优化移动设备上的按钮样式 */
    .signature-tools {
        gap: 8px;
        margin-top: 15px;
    }
    
    .signature-tools button {
        padding: 10px 20px;
        font-size: 0.9rem;
        flex: 1;
        min-width: 80px;
    }
}

/* 横屏模式适配 */
@media (orientation: landscape) and (max-width: 1023px) {
    #signature-canvas {
        height: 200px;
    }
    
    .signature-section {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

/* 右下角通知弹框样式 */
.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    background-color: rgba(51, 51, 51, 0.9);
    color: white;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
    font-size: 14px;
    max-width: 300px;
    word-wrap: break-word;
}