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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    overflow: hidden;
    background: #1e1e1e;
    color: #d4d4d4;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* 菜单栏 */
.menu-bar {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: #252526;
    border-bottom: 1px solid #3e3e42;
    gap: 16px;
}

.menu-section {
    display: flex;
    gap: 8px;
    align-items: center;
}

.menu-btn {
    padding: 6px 12px;
    background: #0e639c;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.menu-btn:hover {
    background: #1177bb;
}

.menu-select {
    padding: 6px 12px;
    background: #3c3c3c;
    color: #d4d4d4;
    border: 1px solid #3e3e42;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
}

.menu-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #d4d4d4;
    cursor: pointer;
}

.menu-checkbox input[type="checkbox"] {
    cursor: pointer;
}

/* 主内容区 */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 左侧工具栏 */
.left-toolbar {
    width: 200px;
    background: #252526;
    border-right: 1px solid #3e3e42;
    padding: 16px;
    overflow-y: auto;
}

.tool-group {
    margin-bottom: 24px;
}

.tool-group h3 {
    font-size: 12px;
    color: #858585;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.tool-btn {
    width: 100%;
    padding: 10px;
    margin-bottom: 8px;
    background: #2d2d30;
    color: #d4d4d4;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: #37373d;
    border-color: #0e639c;
}

.tool-btn.active {
    background: #0e639c;
    border-color: #1177bb;
    color: white;
}

.tool-btn span:first-child {
    font-size: 16px;
}

/* 元器件库 */
.component-search {
    margin-bottom: 8px;
}

.search-input {
    width: 100%;
    padding: 6px;
    background: #3c3c3c;
    color: #d4d4d4;
    border: 1px solid #3e3e42;
    border-radius: 3px;
    font-size: 12px;
}

.search-input:focus {
    outline: none;
    border-color: #0e639c;
}

.component-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.category-tag {
    padding: 4px 8px;
    background: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    color: #d4d4d4;
    transition: all 0.2s;
}

.category-tag:hover {
    background: #37373d;
    border-color: #0e639c;
}

.category-tag.active {
    background: #0e639c;
    border-color: #1177bb;
    color: white;
}

.component-library {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 8px;
}

.component-item {
    padding: 8px;
    margin-bottom: 4px;
    background: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.component-item:hover {
    background: #37373d;
    border-color: #0e639c;
}

.component-item.selected {
    background: #0e639c;
    border-color: #1177bb;
}

.component-item.selected .component-name {
    color: white;
}

.component-item.selected .component-details {
    color: #d4d4d4;
}

.component-preview {
    width: 40px;
    height: 30px;
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 2px;
    flex-shrink: 0;
    position: relative;
}

.component-info {
    flex: 1;
    min-width: 0;
}

.component-name {
    font-weight: bold;
    color: #d4d4d4;
    margin-bottom: 2px;
}

.component-details {
    font-size: 10px;
    color: #858585;
    display: flex;
    gap: 8px;
}

.component-preview-tooltip {
    position: fixed;
    background: #252526;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 8px;
    z-index: 10000;
    display: none;
    pointer-events: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* 画布容器 */
.canvas-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1e1e1e;
    position: relative;
}

.canvas-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#mainCanvas {
    display: block;
    background: #1e1e1e;
    cursor: crosshair;
}

.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.status-bar {
    height: 24px;
    background: #007acc;
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 24px;
    font-size: 12px;
    color: white;
}

/* 右侧属性面板 */
.right-panel {
    width: 250px;
    background: #252526;
    border-left: 1px solid #3e3e42;
    padding: 16px;
    overflow-y: auto;
}

.panel-section {
    margin-bottom: 24px;
}

.panel-section h3 {
    font-size: 12px;
    color: #858585;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.placeholder {
    color: #858585;
    font-size: 12px;
    font-style: italic;
}

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

.form-group label {
    display: block;
    font-size: 12px;
    color: #d4d4d4;
    margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 6px;
    background: #3c3c3c;
    color: #d4d4d4;
    border: 1px solid #3e3e42;
    border-radius: 3px;
    font-size: 13px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #0e639c;
}

/* 图层列表 */
.layer-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    padding: 4px;
    border-radius: 3px;
    transition: background 0.2s;
}

.layer-item:hover {
    background: #2d2d30;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #252526;
    border: 1px solid #3e3e42;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #3e3e42;
}

.modal-header h2 {
    font-size: 18px;
    color: #d4d4d4;
}

.close-btn {
    background: none;
    border: none;
    color: #d4d4d4;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 3px;
}

.close-btn:hover {
    background: #3c3c3c;
}

.modal-body {
    padding: 16px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid #3e3e42;
}

.btn-primary {
    padding: 8px 16px;
    background: #0e639c;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
}

.btn-primary:hover {
    background: #1177bb;
}

.btn-secondary {
    padding: 8px 16px;
    background: #3c3c3c;
    color: #d4d4d4;
    border: 1px solid #3e3e42;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
}

.btn-secondary:hover {
    background: #4a4a4a;
}

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

::-webkit-scrollbar-track {
    background: #1e1e1e;
}

::-webkit-scrollbar-thumb {
    background: #424242;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4e4e4e;
}

