* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    text-align: center;
}

p {
    text-align: center;
    margin-bottom: 30px;
    color: #7f8c8d;
}

.upload-area {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-bottom: 30px;
    gap: 20px;
}

/* 布局选项样式 */
.layout-options {
    text-align: center;
    margin-bottom: 20px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.layout-options h3 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 18px;
}

.layout-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.layout-btn {
    padding: 10px 20px;
    background-color: #ecf0f1;
    color: #34495e;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.layout-btn:hover {
    background-color: #bdc3c7;
}

.layout-btn.active {
    background-color: #3498db;
    color: white;
}

.upload-box {
    flex: 1;
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    background-color: #f9f9f9;
}

.upload-box label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    color: #34495e;
}

.file-input {
    display: block;
    margin: 0 auto 15px;
}

.preview {
    width: 100%;
    min-height: 200px;
    border: 1px solid #ecf0f1;
    border-radius: 4px;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
}

.generate-btn {
    display: block;
    width: 200px;
    margin: 0 auto 30px;
    padding: 12px 24px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.generate-btn:hover:not(:disabled) {
    background-color: #2980b9;
}

.generate-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.upload-btn {
    padding: 10px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.upload-btn:hover {
    background-color: #2980b9;
}

.rotate-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background-color: #e67e22;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-right: 10px;
}

.rotate-btn:hover:not(:disabled) {
    background-color: #d35400;
}

.rotate-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.clear-btn {
    margin-top: 10px;
    padding: 8px 16px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.clear-btn:hover:not(:disabled) {
    background-color: #c0392b;
}

.clear-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.preview-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.result-area {
    text-align: center;
}



.result-area h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.canvas-container {
    margin-bottom: 20px;
    background-color: #f9f9f9;
    padding: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    overflow-x: auto;
    max-width: 100%;
    margin: 0 auto;
}

#resultCanvas {
    max-width: 50%;
    height: auto;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 用于控制空白显示时的预览区域大小 */
.canvas-container.empty-preview {
    max-width: 300px !important;
}

/* 确保在不同屏幕尺寸下都有良好的显示效果 */
@media (max-width: 1024px) {
    .canvas-container {
        max-width: 90%;
    }
    #resultCanvas {
        max-width: 70%;
    }
}

@media (max-width: 768px) {
    .canvas-container {
        max-width: 95%;
        padding: 5px;
    }
    #resultCanvas {
        max-width: 85%;
    }
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.download-btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #27ae60;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 16px;
    transition: background-color 0.3s;
}

.download-btn:hover {
    background-color: #229954;
}

.print-btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.print-btn:hover:not(:disabled) {
    background-color: #c0392b;
}

.print-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .upload-area {
        flex-direction: column;
    }
    
    .container {
        padding: 20px;
    }
}

/* 图片放大预览模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    position: relative;
    margin: 5% auto;
    padding: 0;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 1001;
}

.close-modal:hover,
.close-modal:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

.modal-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

/* A4纸张样式的预览效果 */
#a4-preview {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    padding: 2cm;
}

/* 底部网页信息样式 */
.footer {
    background-color: #f5f5f5;
    color: #333;
    padding: 30px 0;
    margin-top: 50px;
    border-top: 1px solid #e0e0e0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
}

.footer-section {
    flex: 1;
    padding: 0 20px;
    text-align: center;
}

.footer-section h3 {
    font-size: 16px;
    margin-bottom: 15px;
    color: #2c3e50;
    font-weight: bold;
    text-align: center;
}

.footer-section p {
    color: #7f8c8d;
    margin: 5px 0;
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .footer {
        padding: 20px 0;
        margin-top: 30px;
    }
    
    .footer-content {
        flex-direction: column;
    }
    
    .footer-section {
        margin-bottom: 20px;
        padding: 0;
    }
    
    .footer-section:last-child {
         margin-bottom: 0;
     }
 }

/* 页面内弹出提示样式 */
.welcome-message {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.welcome-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-header {
    padding: 20px 20px 10px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f8f9fa;
}

.welcome-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.close-welcome-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.close-welcome-btn:hover {
    background-color: #e9ecef;
    color: #2c3e50;
}

.welcome-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.welcome-body::-webkit-scrollbar {
    width: 6px;
}

.welcome-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.welcome-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.welcome-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 优化段落和标题样式 */
.welcome-section {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #fafafa;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.welcome-section:last-child {
    margin-bottom: 0;
}

.welcome-section h4 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

.welcome-section p {
    margin: 0;
    color: #333;
    text-align: left;
    line-height: 1.6;
    font-size: 14px;
}

/* 列表样式优化 */
.welcome-section ul {
    margin: 0;
    padding-left: 20px;
}

.welcome-section li {
    margin: 6px 0;
    color: #333;
    text-align: left;
    line-height: 1.5;
    font-size: 14px;
    position: relative;
}

.welcome-section li:before {
    content: "•";
    color: #3498db;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

.welcome-footer {
    padding: 15px 20px 20px;
    text-align: right;
    border-top: 1px solid #e0e0e0;
    background-color: #f8f9fa;
}

.got-it-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.got-it-btn:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.got-it-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 按钮样式优化 */
.agree-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-left: 10px;
}

.agree-btn:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.agree-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.reject-btn {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.reject-btn:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.reject-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .welcome-content {
        width: 95%;
        margin: 20px;
        max-height: 95vh;
    }
    
    .welcome-header, .welcome-body, .welcome-footer {
        padding: 15px;
    }
    
    .welcome-header h3 {
        font-size: 16px;
    }
    
    .welcome-section {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .welcome-section h4 {
        font-size: 15px;
    }
    
    .welcome-section p,
    .welcome-section li {
        font-size: 13px;
    }
    
    .welcome-footer {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }
    
    .agree-btn,
    .reject-btn {
        padding: 10px 20px;
        font-size: 15px;
        width: 100%;
        margin-left: 0;
    }
}