/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

h1 {
    color: #2c3e50;
}

h2, h3 {
    color: #34495e;
    margin-bottom: 15px;
}

/* 登录界面样式 */
.login-container {
    max-width: 500px;
    margin: 50px auto;
    padding: 30px;
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.login-form {
    margin-top: 20px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

#login-button {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    margin-top: 10px;
}

.status-text {
    margin-top: 15px;
    font-size: 14px;
}

.status-text.success {
    color: #2ecc71;
}

.status-text.error {
    color: #e74c3c;
}

/* 用户信息 */
.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #f9f9f9;
    border-radius: 6px;
    margin-bottom: 20px;
}

#current-annotator {
    font-weight: bold;
}

.action-button.small {
    padding: 5px 10px;
    font-size: 14px;
}

/* 上传区域样式 */
.upload-section {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 6px;
    text-align: center;
}

.file-input-container {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#image-upload {
    display: none;
}

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

.file-input-label:hover {
    background-color: #2980b9;
}

#file-name {
    margin-left: 10px;
    color: #666;
}

#upload-status {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

#upload-status.hidden {
    display: none;
}

.upload-tips {
    margin-top: 10px;
    font-size: 12px;
    color: #777;
}

.spinner-small {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

/* 图片库样式 */
#image-gallery {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 6px;
}

#image-gallery.hidden {
    display: none;
}

.gallery-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.nav-button {
    padding: 8px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

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

.nav-button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

.thumbnail-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 15px;
}

.thumbnails {
    display: flex;
    gap: 10px;
    padding: 10px 0;
}

.thumbnail {
    position: relative;
    width: 100px;
    height: 100px;
    border: 2px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail.active {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.5);
    transform: scale(1.05);
}

.thumbnail .has-annotations {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 10px;
    height: 10px;
    background-color: #2ecc71;
    border-radius: 50%;
}

/* 编辑器样式 */
#editor-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#editor-container.hidden {
    display: none;
}

.editor-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 6px;
}

.tool-group {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tool-button, .action-button {
    padding: 8px 15px;
    margin: 5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-button {
    background-color: #3498db;
    color: white;
}

.tool-button:hover, .tool-button.active {
    background-color: #2980b9;
}

.action-button {
    background-color: #7f8c8d;
    color: white;
}

.action-button:hover {
    background-color: #6c7a7d;
}

.action-button:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

#save-button, #save-all, #login-button {
    background-color: #2ecc71;
}

#save-button:hover, #save-all:hover, #login-button:hover {
    background-color: #27ae60;
}

#clear-button, #logout-button {
    background-color: #e74c3c;
}

#clear-button:hover, #logout-button:hover {
    background-color: #c0392b;
}

/* 线条粗细控制 */
.line-width-control {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.line-width-control label {
    margin-right: 10px;
    font-size: 14px;
}

.line-width-control input {
    flex: 1;
}

#line-width-value {
    margin-left: 10px;
    font-size: 14px;
    color: #666;
    width: 40px;
}

/* 颜色选择器 */
.color-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
}

.color-option.active {
    border-color: #333;
}

/* 图片信息 */
.image-info {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    font-size: 14px;
    color: #555;
}

/* 缩放控制 */
.zoom-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.zoom-button {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.2s;
}

.zoom-button:hover {
    background-color: #f0f0f0;
    border-color: #bbb;
}

#zoom-reset {
    width: auto;
    font-size: 12px;
    padding: 0 8px;
}

/* 画布容器 */
.canvas-container {
    position: relative;
    margin: 0 auto;
    border: 1px solid #ddd;
    background-color: #ffffff;
    overflow: hidden;
    width: 100%;
    height: 700px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#image-canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
    image-rendering: -webkit-optimize-contrast; /* Chrome */
    image-rendering: crisp-edges; /* Firefox */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.loading-overlay.hidden {
    display: none;
}

/* 隐藏元素 */
.hidden {
    display: none !important;
}

/* 加载动画 */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .login-container {
        padding: 20px;
        margin: 20px auto;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .editor-tools {
        flex-direction: column;
    }
    
    .tool-group {
        min-width: 100%;
    }
    
    .canvas-container {
        height: 500px;
    }
    
    .image-info {
        flex-direction: column;
        gap: 5px;
    }
}

@media (min-width: 1200px) {
    .canvas-container {
        height: 800px;
    }
} 