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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 100%;
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

header p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.toolbar {
    background: white;
    padding: 1rem 2rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.tool-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-group label {
    font-weight: 500;
    color: #666;
    white-space: nowrap;
}

.tool-btn {
    padding: 0.5rem 1rem;
    border: 2px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: #f0f0f0;
    border-color: #667eea;
}

.tool-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

button {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

button:hover {
    background: #f0f0f0;
    border-color: #667eea;
}

button:active {
    transform: scale(0.98);
}

input[type="text"] {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    width: 150px;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.canvas-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #2a2a2a;
    position: relative;
    overflow: auto;
    padding: 20px;
}

#annotation-canvas {
    max-width: 100%;
    max-height: 100%;
    cursor: crosshair;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    background: white;
}

.sidebar {
    width: 300px;
    background: white;
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.panel {
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.panel h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #667eea;
    font-weight: 600;
}

#annotations-list {
    max-height: 300px;
    overflow-y: auto;
}

.annotation-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #667eea;
    cursor: pointer;
    transition: all 0.2s;
}

.annotation-item:hover {
    background: #e9ecef;
    transform: translateX(2px);
}

.annotation-item.selected {
    background: #e7f3ff;
    border-left-color: #2196F3;
}

.annotation-item .label {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 0.25rem;
}

.annotation-item .type {
    font-size: 0.85rem;
    color: #666;
}

#labels-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.label-tag {
    padding: 0.4rem 0.8rem;
    background: #e0e0e0;
    color: #666;
    border-radius: 20px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.label-tag.selected {
    background: #667eea;
    color: white;
    border-color: #4facfe;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.label-tag .label-name {
    cursor: pointer;
    flex: 1;
    user-select: none;
}

.label-tag .remove {
    cursor: pointer;
    font-weight: bold;
    opacity: 0.8;
    padding: 0 2px;
}

.label-tag .remove:hover {
    opacity: 1;
    transform: scale(1.2);
}

.label-tag:not(.selected):hover {
    background: #d0d0d0;
    transform: translateY(-1px);
}

#image-info {
    font-size: 0.9rem;
    color: #666;
}

#image-info p {
    margin-bottom: 0.5rem;
}

.status-bar {
    background: white;
    padding: 0.5rem 2rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
