body {
    font-family: 'Microsoft YaHei', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
    color: #333;
}

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

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

.flag-icon {
    vertical-align: middle;
}

.upload-section {
    margin-bottom: 30px;
    text-align: center;
    padding: 20px;
    border: 2px dashed #ccc;
    border-radius: 8px;
    transition: all 0.3s;
    background-color: #f9f9f9;
}

.upload-section.drag-over {
    background-color: #e8f5e9;
    border-color: #4CAF50;
}

#avatarUpload {
    display: none;
}

.upload-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #4CAF50;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-bottom: 10px;
}

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

#fileName {
    display: block;
    margin: 10px 0;
    font-size: 14px;
    color: #666;
}

.drag-tip {
    margin: 10px 0 0;
    color: #888;
    font-size: 14px;
}

.preview-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 30px;
    gap: 20px;
}

.preview-item {
    text-align: center;
    flex: 1;
    min-width: 250px;
    max-width: calc(50% - 10px);
}

.preview-item h3 {
    margin-bottom: 15px;
    font-size: 16px;
}

.example-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
}

.example-col {
    flex: 0 0 45%;
    min-width: 200px;
    max-width: 300px;
    text-align: center;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    /* 假设头像都是方形的，设置一个固定最大宽度 */
    max-width: 300px; 
    margin: 0 auto 20px;
    background-color: #e9e9e9;
    border-radius: 8px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}

canvas {
    display: block;
    width: 300px;
    height: 300px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    background-color: #f5f5f5;
    margin: 0 auto;
}

#tipText {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 1.1em;
    pointer-events: none; /* 确保不影响点击画布下的元素 */
}

#downloadBtn {
    background-color: #4CAF50; /* 绿色 */
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s;
    display: block;
    margin: 0 auto;
}

#downloadBtn:hover:not(:disabled) {
    background-color: #45a049;
}

#downloadBtn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.example-container {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.example-avatar, .example-flag {
    width: 150px;
    height: 150px;
    margin: 10px auto;
    background-color: #f5f5f5;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.example-avatar img, .example-flag img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}