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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    padding: 20px;
}

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

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

h2 {
    margin-top: 20px;
    margin-bottom: 15px;
    color: #2c3e50;
}

/* 上传部分样式 */
.upload-section {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

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

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

#fileName {
    margin-left: 15px;
    color: #7f8c8d;
}

/* 图片容器样式 */
.image-container {
    position: relative;
    width: 100%;
    min-height: 400px;
    border: 2px dashed #bdc3c7;
    border-radius: 4px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.placeholder {
    color: #95a5a6;
    font-size: 18px;
}

#imageCanvas {
    max-width: 100%;
    max-height: 600px;
    display: block;
}

/* 角落手柄和放大镜样式 */
#cornerHandles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.corner-handle {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: rgba(52, 152, 219, 0.8);
    border: 2px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: move;
    pointer-events: auto;
    z-index: 10;
}

#topLeft {
    top: 10%;
    left: 10%;
}

#topRight {
    top: 10%;
    left: 90%;
}

#bottomLeft {
    top: 90%;
    left: 10%;
}

#bottomRight {
    top: 90%;
    left: 90%;
}

.magnifier {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid #3498db;
    overflow: hidden;
    pointer-events: none;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translate(-50%, -130%);
}

/* 顶部圆圈的放大镜显示在下方 */
#topLeft .magnifier,
#topRight .magnifier {
    transform: translate(-50%, 130%);
}

/* 底部圆圈的放大镜显示在上方 */
#bottomLeft .magnifier,
#bottomRight .magnifier {
    transform: translate(-50%, -130%);
}

.magnifier-canvas {
    position: absolute;
    width: 100%;
    height: 100%;
}

.crosshair {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.crosshair::before,
.crosshair::after {
    content: '';
    position: absolute;
    background-color: rgba(231, 76, 60, 0.7);
}

.crosshair::before {
    width: 1px;
    height: 100%;
    left: 50%;
    transform: translateX(-50%);
}

.crosshair::after {
    width: 100%;
    height: 1px;
    top: 50%;
    transform: translateY(-50%);
}

/* 按钮样式 */
.buttons-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.btn {
    padding: 10px 25px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

#correctBtn {
    background-color: #2ecc71;
    color: white;
}

#correctBtn:hover {
    background-color: #27ae60;
}

#correctBtn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

#downloadBtn {
    background-color: #e74c3c;
    color: white;
}

#downloadBtn:hover {
    background-color: #c0392b;
}

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

/* 结果容器样式 */
.result-container {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

#resultCanvas {
    max-width: 100%;
    max-height: 500px;
    border: 1px solid #ecf0f1;
    margin-top: 15px;
}

/* 辅助类 */
.hidden {
    display: none !important;
}