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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

h1 i {
    margin-right: 10px;
    color: #3498db;
}

h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

h2 i {
    margin-right: 10px;
    color: #3498db;
}

.main-content {
    display: flex;
    gap: 30px;
    flex: 1;
}

/* 可视化区域 */
.visualization {
    flex: 0.6;
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.btn-action {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.btn-action i {
    margin-right: 5px;
}

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

#add-layer {
    background-color: #2ecc71;
}

#add-layer:hover {
    background-color: #27ae60;
}

#copy-layer {
    background-color: #f39c12;
}

#copy-layer:hover {
    background-color: #d35400;
}

#remove-layer {
    background-color: #e74c3c;
}

#remove-layer:hover {
    background-color: #c0392b;
}

/* 层堆栈 */
.layer-stack {
    position: relative;
    min-height: 400px;
    border: 1px solid #eee;
    border-radius: 5px;
    padding: 20px;
    background-color: #f9f9f9;
}

.layer {
    position: relative;
    margin-bottom: 12px;
    padding: 0 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    min-height: 35px;
    padding-right: 20px;
}

.layer:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.layer.selected {
    border: 2px solid #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
}

.layer-icon {
    margin-right: 10px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center; /* 图标水平居中 */
    width: 24px; /* 固定宽度，可根据实际情况调整 */
}

.layer-icon i {
    margin-right: 5px; /* 图标和文字之间的间距 */
}

/* 层属性 */
.layer-properties {
    flex: 0.4;
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #555;
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

/* 美化描述文本框 */
textarea.form-control {
    min-height: 80px;
    resize: vertical;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.5;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: #f9f9f9;
}

textarea.form-control:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    background-color: #fff;
}

.btn-update {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    font-size: 1rem;
    margin-top: 10px;
}

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

/* 拖拽相关 */
.layer.dragging {
    opacity: 0.7;
    border: 2px dashed #3498db;
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    pointer-events: none;
}

.drop-indicator {
    position: absolute;
    height: 3px;
    background-color: #3498db;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.6);
    transition: top 0.15s ease;
    will-change: transform, top;
}

.layer-gap-above {
    transform: translateY(15px);
    transition: transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.layer-gap-below {
    transform: translateY(-15px);
    transition: transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.drag-handle {
    cursor: grab;
    margin-right: 10px;
    color: #777;
    display: flex;
    align-items: center;
}

.drag-handle:hover {
    color: #333;
}

.layer-content {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
}

.layer-name {
    flex: 1;
    margin-left: 8px;
    font-weight: 700;
    font-size: 1.25rem;
    /* padding-left: 20px;  */
}


.layer-thickness {
    margin-left: auto; /* 关键改动 */
    text-align: right;
    font-weight: 500;
    padding-right: 10px; /* 替代 right: 10px */
}

/* 页脚 */
footer {
    margin-top: 30px;
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

footer i {
    color: #e74c3c;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .layer-properties {
        width: 100%;
        margin-top: 20px;
    }
}

/* 总厚度显示 */
.total-thickness {
    text-align: center;
    font-weight: bold;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #e3f2fd;
    border-radius: 4px;
    color: #1565c0;
    font-size: 1.2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 层类型特定样式 */
.layer.copper {
    background-image: linear-gradient(to right, #cd7f32, #e6b980);
    border-left: 5px solid #b36a20;
}

.layer.dielectric {
    background-image: linear-gradient(to right, #a5d6a7, #c8e6c9);
    border-left: 5px solid #81c784;
}

.layer.solder-mask {
    background-image: linear-gradient(to right, #1b5e20, #388e3c);
    border-left: 5px solid #0d3e14;
}

.layer.silkscreen {
    background-image: linear-gradient(to right, #f5f5f5, #ffffff);
    border: 1px solid #ddd;
    border-left: 5px solid #bdbdbd;
} 