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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: #f5f5f5;
    overflow: hidden;
}

.container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 300px;
    background: #2c3e50;
    padding: 20px;
    color: white;
    overflow-y: auto;
}

.sidebar h2 {
    margin-bottom: 20px;
    font-size: 18px;
    border-bottom: 1px solid #34495e;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #bdc3c7;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 4px;
    background: #34495e;
    color: white;
    font-size: 14px;
}

.coord-toggle {
    display: flex;
    gap: 5px;
    margin-top: 5px;
}

.coord-btn {
    flex: 1;
    padding: 8px;
    background: #34495e;
    color: #bdc3c7;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    text-align: center;
    transition: all 0.2s;
}

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

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

.btn {
    width: 100%;
    padding: 10px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

.btn:hover {
    background: #2980b9;
}

.main-area {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #ecf0f1;
}

.canvas-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: auto;
}

.canvas {
    position: relative;
    background: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    margin: 50px;
}

.screen {
    position: absolute;
    cursor: move;
    border: 2px solid #3498db;
    background: rgba(52, 152, 219, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #2c3e50;
    transition: all 0.3s ease;
}

.screen:hover {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.2);
}

.screen.selected {
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.3);
}

.tooltip {
    position: absolute;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
}

.distance-line {
    position: absolute;
    background: #e74c3c;
    z-index: 10;
}

.distance-line.horizontal {
    height: 2px;
}

.distance-line.vertical {
    width: 2px;
}

.distance-arrow {
    position: absolute;
    width: 0;
    height: 0;
    border: 4px solid transparent;
    z-index: 10;
}

.distance-arrow.left {
    border-right-color: #e74c3c;
    border-right-width: 6px;
    border-left-width: 0;
}

.distance-arrow.right {
    border-left-color: #e74c3c;
    border-left-width: 6px;
    border-right-width: 0;
}

.distance-arrow.up {
    border-bottom-color: #e74c3c;
    border-bottom-width: 6px;
    border-top-width: 0;
}

.distance-arrow.down {
    border-top-color: #e74c3c;
    border-top-width: 6px;
    border-bottom-width: 0;
}

.distance-label {
    position: absolute;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    z-index: 11;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 0 2px rgba(0,0,0,0.3);
}

.canvas-info {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px;
    border-radius: 4px;
    font-size: 12px;
}

.export-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    background: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.export-btn:hover {
    background: #229954;
}

.import-export-btns {
    position: absolute;
    bottom: 20px;
    right: 120px;
    display: flex;
    gap: 10px;
}

.import-export-btns button {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.import-export-btns button:hover {
    background: #2980b9;
}

.import-btn {
    background: #f39c12 !important;
}

.import-btn:hover {
    background: #e67e22 !important;
}

.screen-list {
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
}

.screen-item {
    background: #34495e;
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.screen-item:hover {
    background: #2c3e50;
}

.screen-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
    z-index: 1000;
}

.screen-item.drag-over {
    border-top: 2px solid #3498db;
    margin-top: -2px;
}

.screen-item.drag-over-bottom {
    border-bottom: 2px solid #3498db;
    margin-bottom: 3px;
}

.screen-number {
    background: #3498db;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.screen-info {
    flex: 1;
}

.screen-name {
    font-weight: bold;
    margin-bottom: 2px;
}

.screen-details {
    color: #bdc3c7;
    font-size: 11px;
}

/* 弹窗样式 */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #2c3e50;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 300px;
    color: white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: white;
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.modal-content .form-group {
    margin-bottom: 15px;
}

.modal-content .form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: #bdc3c7;
}

.modal-content .form-group input {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 4px;
    background: #34495e;
    color: white;
    font-size: 14px;
}

.modal-content .btn {
    width: 48%;
    display: inline-block;
    margin: 10px 1% 0 1%;
}

.canvas-toolbar {
    position: absolute;
    top: 0px;
    left: 0px;
    z-index: 1000;
    display: flex;
    gap: 8px;
}

.canvas-toolbar .btn {
    width: 36px;
    height: 36px;
    margin-right: 8px;
    font-size: 18px;
    background: #34495e;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.canvas-toolbar .btn:hover {
    background: #2980b9;
}