/* 将容器内的 h1 标题居中 */
.container h1 {
    text-align: center;
    color: #333; /* 可以保留或根据需要调整颜色 */
    margin-bottom: 20px; /* 可选：增加标题和下方内容的间距 */
}

.dhcp-diagram {
    position: relative;
    height: 350px; /* 调整高度 */
    border: 1px solid #ddd;
    margin: 20px auto;
    background-color: #f9f9f9;
    border-radius: 5px;
    padding: 20px;
    overflow: hidden;
    width: 70%; /* 调整宽度 */
    box-sizing: border-box;
}

.dhcp-node {
    position: absolute;
    border: 1px solid #999;
    padding: 10px 15px;
    border-radius: 5px;
    background-color: #e7f3fe;
    text-align: center;
    font-size: 0.9em;
    min-width: 180px; /* 调整最小宽度 */
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
}

.dhcp-node span, .dhcp-node div {
    display: block;
    font-size: 0.8em;
    color: #555;
    margin-top: 5px;
}
.dhcp-node .pool, .dhcp-node .leases {
    font-style: italic;
    background-color: #f0f0f0;
    padding: 3px;
    border-radius: 3px;
    margin-top: 8px;
}

/* 节点布局 */
.client { top: 150px; left: 10%; }
.server { top: 150px; right: 10%; background-color: #fffacd; }

.network-area {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9em;
    color: #aaa;
    border: 1px dashed #ccc;
    padding: 50px 20px;
    border-radius: 5px;
    text-align: center;
    width: 50%;
    z-index: 0;
}
.container {
    max-width: 1200px;
    margin: 40px auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 30px 20px;
    text-align: center;
}


.dhcp-message {
    position: absolute;
    width: auto;
    min-width: 100px;
    height: 35px;
    padding: 0 10px;
    background-color: #ffcc00;
    border: 1px solid #cc9900;
    border-radius: 4px;
    font-size: 0.8em;
    text-align: center;
    line-height: 35px;
    z-index: 10;
    opacity: 0; /* 初始隐藏 */
    transition: top 1s ease-in-out, left 1s ease-in-out, opacity 0.3s ease-in-out;
    white-space: nowrap;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

/* 不同消息类型的样式 */
.discover { background-color: #ff9999; border-color: #cc6666; } /* 广播 */
.offer { background-color: #99ccff; border-color: #6699cc; } /* 单播 */
.request { background-color: #ff9999; border-color: #cc6666; } /* 广播 */
.ack { background-color: #99ccff; border-color: #6699cc; } /* 单播 */


#dhcp-info {
    text-align: left;
    margin: 20px auto;
    padding: 15px;
    border: 1px solid #d6e9c6;
    background-color: #dff0d8;
    color: #3c763d;
    border-radius: 5px;
    min-height: 100px;
    max-height: 200px;
    overflow-y: auto;
    width: 70%; /* 与 diagram 宽度一致 */
    box-sizing: border-box;
}
#dhcp-info p { margin: 5px 0; }

/* 控件区域 */
.controls {
    text-align: center;
    margin-top: 10px; /* 调整与 diagram 的间距 */
    margin-bottom: 20px;
}
.controls button {
    padding: 8px 15px;
    margin: 0 5px;
    cursor: pointer;
}