body {
    font-family: Arial, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 20px;
}
.container {
    max-width: 900px;
    margin: 20px auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}
h1 {
    text-align: center;
    color: #343a40;
    margin-bottom: 10px;
}
.description {
    text-align: center;
    color: #6c757d;
    margin-bottom: 30px;
    font-size: 1.1em;
}
.simulation-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    gap: 10px;
    flex-wrap: wrap;
}
.control-btn {
    padding: 8px 18px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
    transition: background-color 0.3s;
}
.control-btn:hover { background-color: #0056b3; }
.simulation-area {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 30px 20px;
    background-color: #fdfdfd;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    min-height: 260px;
    position: relative;
}
.host {
    width: 150px;
    text-align: center;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: relative;
}
.host-title {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1.05em;
    color: #495057;
}
.host-mac {
    font-size: 0.9em;
    color: #6c757d;
    margin-bottom: 5px;
}
.host-a {
    position: absolute;
    left: 40px;
    bottom: 40px;
    background-color: #ffcccc; /* 主机A的背景颜色 */
}

.host-b {
    position: absolute;
    left: 390px;
    bottom: 200px;
    background-color: #ccffcc; /* 主机B的背景颜色 */
}

.host-c {
    position: absolute;
    right: 40px;
    bottom: 40px;
    background-color: #ccccff; /* 主机C的背景颜色 */
}
.switch-box {
    position: absolute;
    left: 50%;
    bottom: 10px; /* 将原来的100px调整为50px，向下移动 */
    transform: translateX(-50%);
    width: 220px; /* 将原来的180px调整为220px，加宽以显示完整MAC地址 */
    background: #e9ecef;
    border: 2px solid #adb5bd;
    border-radius: 10px;
    text-align: center;
    padding: 12px 10px 10px 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.switch-title {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 8px;
    color: #343a40;
}
.mac-table-title {
    font-size: 0.95em;
    color: #495057;
    margin-bottom: 2px;
}
.mac-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    margin-bottom: 0;
}
.mac-table th, .mac-table td {
    border: 1px solid #adb5bd;
    padding: 2px 6px;
    font-size: 0.92em;
}
.mac-table th {
    background: #dee2e6;
}
.frame {
    position: absolute;
    width: 40px;
    height: 24px;
    background: #ffc107;
    border: 2px solid #e0a800;
    border-radius: 8px;
    color: #343a40;
    font-weight: bold;
    font-size: 1em;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10;
    text-align: center;
    line-height: 24px;
}
.info-panel, .explanation-card {
    margin-top: 30px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
}
.panel-title, .card-title {
    font-weight: bold;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
    font-size: 1.1em;
    color: #495057;
}
.panel-content, .card-content {
    color: #6c757d;
    font-size: 1em;
    min-height: 30px;
}
.panel-content p { margin: 0; }
.card-content ul { padding-left: 20px; margin: 0; }
.card-content li { margin-bottom: 10px; }
.card-content strong { color: #343a40; }
@media (max-width: 768px) {
    .simulation-area { flex-direction: column; min-height: 400px; }
    .host, .switch-box { position: static; margin: 10px auto; }
}