Files
2025-04-21 15:56:25 +08:00

685 lines
12 KiB
CSS

* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Microsoft YaHei', sans-serif;
background-color: #f5f5f5;
color: #333;
}
.container {
display: flex;
height: 100vh;
overflow: hidden;
}
/* 侧边栏样式 */
.sidebar {
width: 300px;
background-color: #fff;
border-right: 1px solid #ddd;
padding: 15px;
display: flex;
flex-direction: column;
overflow-y: auto;
}
.sidebar h2, .sidebar h3 {
margin-bottom: 15px;
color: #333;
text-align: center;
}
.sidebar h3 {
margin: 10px 0;
font-size: 16px;
border-bottom: 1px solid #eee;
padding-bottom: 5px;
}
/* 图形库样式 */
.shape-container {
margin-bottom: 20px;
}
.shape-group {
margin-bottom: 15px;
}
.shape-item {
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
margin-bottom: 8px;
cursor: grab;
user-select: none;
background-color: #f9f9f9;
transition: all 0.2s;
}
.shape-item:hover {
background-color: #e3f2fd;
border-color: #2196F3;
}
.shape-item:active {
cursor: grabbing;
}
/* 图形样式 */
.start-shape {
width: 100%;
height: 40px;
background-color: #fff;
border: 2px solid #ff0000;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
position: relative;
text-align: center;
}
.start-shape::after {
content: "";
position: absolute;
right: -6px;
top: 50%;
transform: translateY(-50%);
width: 12px;
height: 12px;
background-color: #ff0000;
border-radius: 50%;
}
.process-shape {
width: 100%;
height: 40px;
background-color: #fff;
border: 2px solid #4CAF50;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
}
.transport-shape {
width: 80px;
height: 40px;
margin: 0 auto;
position: relative;
background-color: #fff;
border: none;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
}
.transport-shape::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 2px solid #FF9800;
clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.endpoint-shape {
width: 100px;
height: 40px;
margin: 0 auto;
background-color: #fff;
border: 2px solid #9C27B0;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
}
/* 控制面板样式 */
.control-panel {
display: flex;
flex-direction: column;
gap: 10px;
margin-bottom: 15px;
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
background-color: #f9f9f9;
}
.control-panel button {
padding: 8px 12px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s;
}
.control-panel button:hover {
background-color: #45a049;
}
#stop-simulation {
background-color: #f44336;
}
#stop-simulation:hover {
background-color: #d32f2f;
}
#reset-simulation {
background-color: #2196F3;
}
#reset-simulation:hover {
background-color: #1976D2;
}
.simulation-settings {
margin-top: 10px;
padding-top: 10px;
border-top: 1px solid #ddd;
}
.project-actions {
margin-top: 10px;
padding-top: 10px;
border-top: 1px solid #ddd;
display: flex;
gap: 10px;
}
.project-actions button {
flex: 1;
background-color: #673AB7;
}
.project-actions button:hover {
background-color: #5E35B1;
}
/* 仿真信息样式 */
.simulation-info {
margin-top: 15px;
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
background-color: #f9f9f9;
}
#simulation-stats {
margin-top: 10px;
font-size: 14px;
}
#simulation-stats div {
margin-bottom: 5px;
}
#simulation-stats span {
font-weight: bold;
color: #FF5722;
}
/* 主内容区域样式 */
.main-content {
flex: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
.canvas-container {
flex: 1;
position: relative;
background-color: #f1f1f1;
overflow: hidden;
background-image: linear-gradient(#ddd 1px, transparent 1px),
linear-gradient(90deg, #ddd 1px, transparent 1px);
background-size: 20px 20px;
}
#flow-canvas {
width: 100%;
height: 100%;
cursor: grab;
}
#flow-canvas:active {
cursor: grabbing;
}
/* 状态栏样式 */
.status-bar {
height: 30px;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 15px;
background-color: #f5f5f5;
border-top: 1px solid #ddd;
}
#status-message {
font-size: 14px;
color: #666;
}
#zoom-controls {
display: flex;
align-items: center;
gap: 5px;
}
#zoom-controls button {
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
background-color: #f1f1f1;
border: 1px solid #ddd;
border-radius: 3px;
cursor: pointer;
}
#zoom-controls button:hover {
background-color: #e0e0e0;
}
#zoom-level {
font-size: 14px;
color: #666;
width: 50px;
text-align: center;
}
/* 模态框样式 */
.modal {
display: none;
position: fixed;
z-index: 100;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.5);
}
.modal-content {
background-color: #fff;
margin: 10% auto;
padding: 20px;
border-radius: 5px;
width: 60%;
max-width: 600px;
max-height: 80vh;
overflow-y: auto;
}
.close {
color: #aaa;
float: right;
font-size: 28px;
font-weight: bold;
cursor: pointer;
}
.close:hover {
color: #333;
}
.form-group {
margin-bottom: 15px;
}
.form-group label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}
.form-group input,
.form-group select {
width: 100%;
padding: 8px;
border: 1px solid #ddd;
border-radius: 4px;
}
.form-actions {
display: flex;
justify-content: flex-end;
gap: 10px;
margin-top: 20px;
}
.form-actions button {
padding: 8px 15px;
border-radius: 4px;
cursor: pointer;
}
.form-actions button[type="submit"] {
background-color: #4CAF50;
color: white;
border: none;
}
.form-actions button[type="button"] {
background-color: #f1f1f1;
border: 1px solid #ddd;
}
.delete-btn {
background-color: #f44336 !important;
color: white !important;
}
.add-btn {
background-color: #4CAF50 !important;
color: white !important;
padding: 5px 10px;
border: none;
border-radius: 4px;
cursor: pointer;
margin-top: 10px;
}
.step-item {
border: 1px solid #ddd;
border-radius: 4px;
padding: 10px;
margin-bottom: 10px;
position: relative;
background-color: #f9f9f9;
}
.step-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.step-title {
font-weight: bold;
}
.step-remove {
background-color: #f44336;
color: white;
border: none;
border-radius: 50%;
width: 24px;
height: 24px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 14px;
}
.step-content {
display: flex;
flex-wrap: wrap;
gap: 10px;
}
.step-field {
flex: 1;
min-width: 100px;
}
.steps-actions {
margin-top: 10px;
text-align: center;
}
/* 画布上的图形和连接样式 */
.flow-shape {
position: absolute;
cursor: move;
user-select: none;
}
.flow-start {
width: 160px;
height: 80px;
background-color: white;
border: 2px solid #ff0000;
border-radius: 10px;
display: flex;
align-items: center;
justify-content: center;
position: relative;
text-align: center;
padding: 0;
}
.flow-start::after {
content: "";
position: absolute;
right: -6px;
top: 50%;
transform: translateY(-50%);
width: 12px;
height: 12px;
background-color: #ff0000;
border-radius: 50%;
}
.flow-process {
width: 160px;
height: 80px;
background-color: white;
border: 2px solid #4CAF50;
border-radius: 10px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.flow-transport {
width: 140px;
height: 80px;
background-color: white;
border: none;
transform: rotate(0deg);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
}
.flow-transport::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: 2px solid #FF9800;
clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.flow-endpoint {
width: 160px;
height: 80px;
background-color: white;
border: 2px solid #9C27B0;
border-radius: 40px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.shape-title {
font-weight: bold;
margin-bottom: 5px;
max-width: 90%;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.shape-info {
font-size: 12px;
color: #666;
margin-bottom: 2px;
}
.shape-throughput {
font-size: 13px;
color: #FF5722;
font-weight: bold;
}
.connection-point {
position: absolute;
width: 16px;
height: 16px;
background-color: #2196F3;
border-radius: 50%;
cursor: pointer;
z-index: 100;
transition: transform 0.2s, background-color 0.2s;
}
.connection-point:hover {
transform: scale(1.3);
background-color: #1976D2;
}
.connection-point.output {
right: 0;
top: 50%;
transform: translate(50%, -50%);
}
.connection-point.input {
left: 0;
top: 50%;
transform: translate(-50%, -50%);
}
.connection-helper {
position: absolute;
width: 24px;
height: 24px;
background-color: rgba(33, 150, 243, 0.3);
border-radius: 50%;
border: 2px solid #2196F3;
display: flex;
align-items: center;
justify-content: center;
color: white;
font-weight: bold;
cursor: pointer;
z-index: 10;
transform: translate(-50%, -50%);
}
.connection-helper:hover {
background-color: rgba(33, 150, 243, 0.6);
}
/* 连接线样式 */
.connection-line {
stroke: #2196F3;
stroke-width: 2;
fill: none;
}
.connection-arrow {
fill: #2196F3;
}
.connection-label {
font-size: 12px;
fill: #333;
text-anchor: middle;
dominant-baseline: central;
}
.connection-label-bg {
fill: white;
stroke: #ddd;
stroke-width: 1;
rx: 3;
ry: 3;
}
/* 物料流动动画 */
.material-particle {
fill: #FF9800;
stroke: #F57C00;
stroke-width: 1;
}
/* 已保存项目列表样式 */
#saved-projects-list {
list-style: none;
margin-top: 10px;
}
#saved-projects-list li {
padding: 8px;
border: 1px solid #ddd;
border-radius: 4px;
margin-bottom: 5px;
cursor: pointer;
display: flex;
justify-content: space-between;
align-items: center;
}
#saved-projects-list li:hover {
background-color: #e3f2fd;
}
#saved-projects-list .project-actions {
display: flex;
gap: 5px;
border: none;
margin: 0;
padding: 0;
}
#saved-projects-list .project-actions button {
padding: 3px 6px;
font-size: 12px;
}
/* 响应式设计 */
@media (max-width: 768px) {
.container {
flex-direction: column;
}
.sidebar {
width: 100%;
height: 300px;
}
.modal-content {
width: 90%;
}
}